@finsemble/finsemble-ui 6.3.0-beta.20211021 → 6.3.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 (550) hide show
  1. package/README.md +28 -28
  2. package/package.json +3 -2
  3. package/react/actions/favoriteActions.js.map +1 -1
  4. package/react/actions/linkerActions.js.map +1 -1
  5. package/react/actions/menuActions.js.map +1 -1
  6. package/react/actions/rootActions.js.map +1 -1
  7. package/react/actions/searchActions.js.map +1 -1
  8. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  9. package/react/actions/toolbarActions.js.map +1 -1
  10. package/react/actions/workspaceActions.js.map +1 -1
  11. package/react/assets/css/advancedAppLauncher.css +636 -636
  12. package/react/assets/css/appCatalog.css +1069 -1069
  13. package/react/assets/css/authentication.css +78 -78
  14. package/react/assets/css/button.css +220 -220
  15. package/react/assets/css/core/formElements.css +23 -23
  16. package/react/assets/css/core/icons.css +69 -69
  17. package/react/assets/css/core/notifications.css +75 -75
  18. package/react/assets/css/core/windowFrame.css +36 -36
  19. package/react/assets/css/dashbar.css +78 -78
  20. package/react/assets/css/defaultTheme.css +356 -356
  21. package/react/assets/css/dialogs.css +158 -158
  22. package/react/assets/css/favorites.css +101 -101
  23. package/react/assets/css/finsemble.css +38 -38
  24. package/react/assets/css/focus.css +4 -4
  25. package/react/assets/css/font-finance.css +385 -385
  26. package/react/assets/css/fonts/Open_Sans/LICENSE.txt +202 -202
  27. package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +118 -118
  28. package/react/assets/css/fonts/font-finance.svg +124 -124
  29. package/react/assets/css/fonts/icons-reference.html +1174 -1174
  30. package/react/assets/css/linkerWindow.css +124 -124
  31. package/react/assets/css/menus.css +195 -195
  32. package/react/assets/css/notificationsCenter.css +597 -597
  33. package/react/assets/css/processMonitor.css +213 -213
  34. package/react/assets/css/search.css +128 -128
  35. package/react/assets/css/shared/animations.css +99 -99
  36. package/react/assets/css/tags.css +136 -136
  37. package/react/assets/css/toolbar.css +413 -413
  38. package/react/assets/css/userPreferences.css +568 -568
  39. package/react/assets/css/windowTitleBar.css +652 -652
  40. package/react/assets/icons/check-square.svg +5 -5
  41. package/react/assets/icons/check.svg +3 -3
  42. package/react/assets/icons/chevron-left.svg +3 -3
  43. package/react/assets/icons/chevron-right.svg +3 -3
  44. package/react/assets/icons/copy.svg +10 -10
  45. package/react/assets/icons/exclamation-circle.svg +4 -4
  46. package/react/assets/icons/external-link.svg +12 -12
  47. package/react/assets/icons/flag.svg +10 -10
  48. package/react/assets/icons/folder.svg +3 -3
  49. package/react/assets/icons/font.svg +3 -3
  50. package/react/assets/icons/globe.svg +3 -3
  51. package/react/assets/icons/hdd.svg +9 -9
  52. package/react/assets/icons/key.svg +10 -10
  53. package/react/assets/icons/life-ring.svg +3 -3
  54. package/react/assets/icons/lock.svg +5 -5
  55. package/react/assets/icons/magic.svg +15 -15
  56. package/react/assets/icons/moon.svg +10 -10
  57. package/react/assets/icons/paint-roller.svg +3 -3
  58. package/react/assets/icons/pencil.svg +10 -10
  59. package/react/assets/icons/plus.svg +3 -3
  60. package/react/assets/icons/question-circle.svg +5 -5
  61. package/react/assets/icons/search.svg +3 -3
  62. package/react/assets/icons/sun.svg +9 -9
  63. package/react/assets/icons/times.svg +3 -3
  64. package/react/assets/icons/toggle-off.svg +6 -6
  65. package/react/assets/icons/toggle-on.svg +6 -6
  66. package/react/assets/icons/tools.svg +3 -3
  67. package/react/assets/icons/trash.svg +12 -12
  68. package/react/assets/icons/upload.svg +10 -10
  69. package/react/assets/icons/window.svg +3 -3
  70. package/react/componentTemplateGenerator.js +85 -85
  71. package/react/componentTemplateGenerator.js.map +1 -1
  72. package/react/components/FinsembleProvider.js.map +1 -1
  73. package/react/components/appCatalog/AppCatalog.js.map +1 -1
  74. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  75. package/react/components/appCatalog/components/AppCard.js.map +1 -1
  76. package/react/components/appCatalog/components/AppList.js.map +1 -1
  77. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  78. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  79. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  80. package/react/components/appCatalog/components/Hero.js.map +1 -1
  81. package/react/components/appCatalog/components/Home.js.map +1 -1
  82. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  83. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  84. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  85. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  86. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  87. package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
  88. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  89. package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
  90. package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
  91. package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
  92. package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
  93. package/react/components/appCatalog/components/Tag.js.map +1 -1
  94. package/react/components/appCatalog/components/Toast.js.map +1 -1
  95. package/react/components/appCatalog/components/helpers.js.map +1 -1
  96. package/react/components/appCatalog/index.js.map +1 -1
  97. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  98. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  99. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  100. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  101. package/react/components/common/Button.js.map +1 -1
  102. package/react/components/common/ButtonIcon.js.map +1 -1
  103. package/react/components/common/ButtonRow.js.map +1 -1
  104. package/react/components/common/ButtonTile.js.map +1 -1
  105. package/react/components/common/Checkbox.js.map +1 -1
  106. package/react/components/common/ColorPicker.js.map +1 -1
  107. package/react/components/common/DropZone.js.map +1 -1
  108. package/react/components/common/DropdownButton.js.map +1 -1
  109. package/react/components/common/FileInput.js.map +1 -1
  110. package/react/components/common/FinsembleIcon.js.map +1 -1
  111. package/react/components/common/FinsembleSelect.js.map +1 -1
  112. package/react/components/common/FinsembleToggle.js.map +1 -1
  113. package/react/components/common/FontSizeSelector.js.map +1 -1
  114. package/react/components/common/Header.js.map +1 -1
  115. package/react/components/common/ImagePreview.js.map +1 -1
  116. package/react/components/common/LoadingSpinner.js.map +1 -1
  117. package/react/components/common/Tab.js.map +1 -1
  118. package/react/components/common/Tooltip.js.map +1 -1
  119. package/react/components/common/css/application-edit-page.css +117 -117
  120. package/react/components/common/css/application-list.css +47 -47
  121. package/react/components/common/css/button.css +164 -164
  122. package/react/components/common/css/color-picker.css +52 -52
  123. package/react/components/common/css/drop-zone.css +17 -17
  124. package/react/components/common/css/file-input.css +49 -49
  125. package/react/components/common/css/header.css +43 -43
  126. package/react/components/common/css/icon.css +13 -13
  127. package/react/components/common/css/image-preview.css +57 -57
  128. package/react/components/common/css/loading-spinner.css +39 -39
  129. package/react/components/common/css/selector.css +51 -51
  130. package/react/components/common/css/styles.css +128 -128
  131. package/react/components/common/css/tab.css +56 -56
  132. package/react/components/common/css/toggle.css +32 -32
  133. package/react/components/common/css/tooltip.css +78 -78
  134. package/react/components/common/file_helpers.js.map +1 -1
  135. package/react/components/common/fixtures/FinsembleIcon.css +4 -4
  136. package/react/components/common/helpers.js.map +1 -1
  137. package/react/components/common/stories/Button.stories.js.map +1 -1
  138. package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
  139. package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
  140. package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
  141. package/react/components/common/stories/Checkbox.stories.js.map +1 -1
  142. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  143. package/react/components/common/stories/DropZone.stories.js.map +1 -1
  144. package/react/components/common/stories/DropdownButton.stories.js.map +1 -1
  145. package/react/components/common/stories/FileInput.stories.js.map +1 -1
  146. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  147. package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
  148. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  149. package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
  150. package/react/components/common/stories/Header.stories.js.map +1 -1
  151. package/react/components/common/stories/ImagePreview.stories.js.map +1 -1
  152. package/react/components/common/stories/LoadingSpinner.stories.js.map +1 -1
  153. package/react/components/common/stories/Tab.stories.js.map +1 -1
  154. package/react/components/common/stories/Tooltip.stories.js.map +1 -1
  155. package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
  156. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  157. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  158. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  159. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  160. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  161. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  162. package/react/components/common/tests/Header.spec.js.map +1 -1
  163. package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
  164. package/react/components/common/tests/Tab.spec.js.map +1 -1
  165. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  166. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  167. package/react/components/favorites/FavoritesShell.js.map +1 -1
  168. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  169. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  170. package/react/components/favorites/index.js.map +1 -1
  171. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  172. package/react/components/fdc3Resolver/ResolverDialog.css +126 -126
  173. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  174. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  175. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  176. package/react/components/icon/Icon.js.map +1 -1
  177. package/react/components/icon/index.js.map +1 -1
  178. package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
  179. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  180. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  181. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  182. package/react/components/legacyControls/FinsembleDnDContext.js +1 -1
  183. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  184. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  185. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  186. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  187. package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
  188. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
  189. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
  190. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
  191. package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
  192. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  193. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
  194. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  195. package/react/components/linker/LinkerMenu.js.map +1 -1
  196. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  197. package/react/components/linker/index.js.map +1 -1
  198. package/react/components/linker/remoteRedux.js.map +1 -1
  199. package/react/components/menu/Menu.js.map +1 -1
  200. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  201. package/react/components/menu/MenuContent.js.map +1 -1
  202. package/react/components/menu/MenuHotKey.js.map +1 -1
  203. package/react/components/menu/MenuItem.js.map +1 -1
  204. package/react/components/menu/MenuPortal.js.map +1 -1
  205. package/react/components/menu/MenuShell.js.map +1 -1
  206. package/react/components/menu/MenuToggle.js.map +1 -1
  207. package/react/components/menu/index.js.map +1 -1
  208. package/react/components/menu/keyboardNavigation.js.map +1 -1
  209. package/react/components/menu/menuContext.js.map +1 -1
  210. package/react/components/menu/menuHelpers.js.map +1 -1
  211. package/react/components/notifications/components/NoNotifications.js.map +1 -1
  212. package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
  213. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  214. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  215. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  216. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  217. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  218. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  219. package/react/components/notifications/components/shared/NotificationCardShell.js +1 -1
  220. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  221. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  222. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  223. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyContentLogo.js.map +1 -1
  224. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  225. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  226. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderLogo.js.map +1 -1
  227. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  228. package/react/components/notifications/components/views/CardView.js.map +1 -1
  229. package/react/components/notifications/components/views/ListView.js +1 -1
  230. package/react/components/notifications/components/views/ListView.js.map +1 -1
  231. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  232. package/react/components/notifications/constants.js.map +1 -1
  233. package/react/components/notifications/icons/Card.js.map +1 -1
  234. package/react/components/notifications/icons/Chevron.js.map +1 -1
  235. package/react/components/notifications/icons/CloseIcon.js.map +1 -1
  236. package/react/components/notifications/icons/EnvelopeClose.js.map +1 -1
  237. package/react/components/notifications/icons/EnvelopeOpen.js.map +1 -1
  238. package/react/components/notifications/icons/SnoozeIcon.js.map +1 -1
  239. package/react/components/notifications/index.js.map +1 -1
  240. package/react/components/notifications/notificationsContext.js.map +1 -1
  241. package/react/components/notifications/types.js.map +1 -1
  242. package/react/components/notifications/utils.js.map +1 -1
  243. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  244. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
  245. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  246. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  247. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  248. package/react/components/processMonitor/constants.js.map +1 -1
  249. package/react/components/processMonitor/helpers.js.map +1 -1
  250. package/react/components/processMonitor/helpers.spec.js.map +1 -1
  251. package/react/components/processMonitor/index.js.map +1 -1
  252. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +1 -0
  253. package/react/components/processMonitor/stores/ProcessMonitorStore.js +2 -1
  254. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  255. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  256. package/react/components/quickComponentForm/index.js.map +1 -1
  257. package/react/components/quickComponentForm/quickComponent.css +3 -3
  258. package/react/components/search/Highlight.js.map +1 -1
  259. package/react/components/search/Highlight.spec.js.map +1 -1
  260. package/react/components/search/Highlight.stories.js.map +1 -1
  261. package/react/components/search/Search.js.map +1 -1
  262. package/react/components/search/SearchBestMatch.js.map +1 -1
  263. package/react/components/search/SearchInput.js.map +1 -1
  264. package/react/components/search/SearchProviderResults.js.map +1 -1
  265. package/react/components/search/SearchResult.js.map +1 -1
  266. package/react/components/search/SearchResults.js.map +1 -1
  267. package/react/components/search/index.js.map +1 -1
  268. package/react/components/shared/Animate.js.map +1 -1
  269. package/react/components/shared/BellIcon.js.map +1 -1
  270. package/react/components/shared/BellIconCrossed.js.map +1 -1
  271. package/react/components/shared/Button.js.map +1 -1
  272. package/react/components/shared/ConditionalWrapper.js.map +1 -1
  273. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  274. package/react/components/shared/NavigationButton.js.map +1 -1
  275. package/react/components/shared/Tag.js.map +1 -1
  276. package/react/components/shared/TagsMenu.js.map +1 -1
  277. package/react/components/shared/addProtocolToValidURL.js.map +1 -1
  278. package/react/components/shared/linkerUtil.js.map +1 -1
  279. package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
  280. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  281. package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
  282. package/react/components/shared/validateURL.js.map +1 -1
  283. package/react/components/shared/validateURL.spec.js.map +1 -1
  284. package/react/components/singleInputDialog/SingleInputDialog.css +3 -3
  285. package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
  286. package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
  287. package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
  288. package/react/components/singleInputDialog/index.js.map +1 -1
  289. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  290. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  291. package/react/components/smartDesktopDesigner/Appearance.css +94 -94
  292. package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +1 -1
  293. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  294. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  295. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
  296. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  297. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
  298. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  299. package/react/components/smartDesktopDesigner/AssetsPage.css +26 -26
  300. package/react/components/smartDesktopDesigner/AssetsPage.js.map +1 -1
  301. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  302. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  303. package/react/components/smartDesktopDesigner/Content.js.map +1 -1
  304. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  305. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  306. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  307. package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
  308. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  309. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  310. package/react/components/smartDesktopDesigner/Navigation.js.map +1 -1
  311. package/react/components/smartDesktopDesigner/ProjectErrors.js.map +1 -1
  312. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
  313. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  314. package/react/components/smartDesktopDesigner/PublishProgress.js.map +1 -1
  315. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  316. package/react/components/smartDesktopDesigner/ThemePage.css +110 -110
  317. package/react/components/smartDesktopDesigner/ThemePage.js.map +1 -1
  318. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  319. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  320. package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +1 -1
  321. package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
  322. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  323. package/react/components/smartDesktopDesigner/css/appearance.css +10 -10
  324. package/react/components/smartDesktopDesigner/css/applications.css +127 -127
  325. package/react/components/smartDesktopDesigner/css/authentication.css +125 -125
  326. package/react/components/smartDesktopDesigner/css/buttons.css +12 -12
  327. package/react/components/smartDesktopDesigner/css/export.css +163 -163
  328. package/react/components/smartDesktopDesigner/css/getting-started.css +6 -6
  329. package/react/components/smartDesktopDesigner/css/nav.css +93 -93
  330. package/react/components/smartDesktopDesigner/css/project-errors.css +15 -15
  331. package/react/components/smartDesktopDesigner/css/project-header.css +121 -121
  332. package/react/components/smartDesktopDesigner/css/styles.css +179 -179
  333. package/react/components/smartDesktopDesigner/css/views.css +16 -16
  334. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
  335. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
  336. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  337. package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
  338. package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +1 -1
  339. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  340. package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +1 -1
  341. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  342. package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
  343. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  344. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  345. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  346. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
  347. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
  348. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
  349. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
  350. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  351. package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +1 -1
  352. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
  353. package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
  354. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  355. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  356. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
  357. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
  358. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
  359. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
  360. package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
  361. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
  362. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  363. package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +1 -1
  364. package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
  365. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  366. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
  367. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
  368. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
  369. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  370. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
  371. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  372. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  373. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
  374. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  375. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
  376. package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
  377. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
  378. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  379. package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
  380. package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
  381. package/react/components/smartDesktopDesigner/themeDefinitions.js.map +1 -1
  382. package/react/components/system/System.js.map +1 -1
  383. package/react/components/system/System.spec.js.map +1 -1
  384. package/react/components/system/System.stories.js.map +1 -1
  385. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  386. package/react/components/system/index.js.map +1 -1
  387. package/react/components/toolbar/AutoArrange.js.map +1 -1
  388. package/react/components/toolbar/DragHandle.js.map +1 -1
  389. package/react/components/toolbar/MinimizeAll.js.map +1 -1
  390. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  391. package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
  392. package/react/components/toolbar/NotificationControl.js.map +1 -1
  393. package/react/components/toolbar/RevealAll.js.map +1 -1
  394. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  395. package/react/components/toolbar/RevealAll.stories.js.map +1 -1
  396. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  397. package/react/components/toolbar/ToolbarSection.js.map +1 -1
  398. package/react/components/toolbar/ToolbarShell.js.map +1 -1
  399. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  400. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
  401. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  402. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  403. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  404. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  405. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
  406. package/react/components/toolbar/advancedAppLauncher/components/Content.js +3 -1
  407. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  408. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  409. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  410. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  411. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
  412. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  413. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
  414. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  415. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  416. package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
  417. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  418. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  419. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  420. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  421. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  422. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  423. package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
  424. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  425. package/react/components/toolbar/appLauncher/appLauncher.css +30 -30
  426. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  427. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  428. package/react/components/toolbar/dashbar/Dashbar.js +2 -2
  429. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  430. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  431. package/react/components/toolbar/index.js.map +1 -1
  432. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  433. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  434. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  435. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  436. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  437. package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +90 -90
  438. package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
  439. package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -1
  440. package/react/components/userPreferences/UserPreferences.js.map +1 -1
  441. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  442. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
  443. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  444. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  445. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  446. package/react/components/userPreferences/components/content/DashbarEditorItem.js.map +1 -1
  447. package/react/components/userPreferences/components/content/General.js.map +1 -1
  448. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  449. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  450. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  451. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  452. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  453. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  454. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  455. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  456. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
  457. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  458. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
  459. package/react/components/userPreferences/index.js.map +1 -1
  460. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  461. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  462. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
  463. package/react/components/userPreferences/stories/General.stories.js.map +1 -1
  464. package/react/components/userPreferences/stories/Notifications.stories.js.map +1 -1
  465. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
  466. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
  467. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
  468. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
  469. package/react/components/userPreferences/stories/WorkspaceComponents.stories.js.map +1 -1
  470. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
  471. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
  472. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
  473. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
  474. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
  475. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
  476. package/react/components/userPreferences/tests/General.spec.js.map +1 -1
  477. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
  478. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
  479. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
  480. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  481. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
  482. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  483. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
  484. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
  485. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
  486. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
  487. package/react/components/utils.js.map +1 -1
  488. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  489. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  490. package/react/components/windowTitleBar/components/center/TabList.js +1 -1
  491. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  492. package/react/components/windowTitleBar/components/center/TabRegion.js.map +1 -1
  493. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  494. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
  495. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  496. package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
  497. package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
  498. package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
  499. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  500. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  501. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  502. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  503. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  504. package/react/components/windowTitleBar/index.js.map +1 -1
  505. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  506. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
  507. package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
  508. package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
  509. package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
  510. package/react/components/yesNoDialog/YesNoDialog.css +3 -3
  511. package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
  512. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  513. package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
  514. package/react/components/yesNoDialog/index.js.map +1 -1
  515. package/react/components/yesNoDialog/timer.js.map +1 -1
  516. package/react/enzymeSetup.js.map +1 -1
  517. package/react/hooks/index.js.map +1 -1
  518. package/react/hooks/useAuth.js.map +1 -1
  519. package/react/hooks/useDeepEffect.js.map +1 -1
  520. package/react/hooks/useFavorites.js.map +1 -1
  521. package/react/hooks/useFavoritesShell.js.map +1 -1
  522. package/react/hooks/useHotkey.js.map +1 -1
  523. package/react/hooks/useLinker.js.map +1 -1
  524. package/react/hooks/useMenu.js.map +1 -1
  525. package/react/hooks/useNotifications.js.map +1 -1
  526. package/react/hooks/useOutsideClickDetector.js.map +1 -1
  527. package/react/hooks/usePubSub.js.map +1 -1
  528. package/react/hooks/useSearch.js.map +1 -1
  529. package/react/hooks/useToolbar.js.map +1 -1
  530. package/react/hooks/useWorkspace.js.map +1 -1
  531. package/react/reducers/favoriteReducer.js.map +1 -1
  532. package/react/reducers/linkerReducer.js.map +1 -1
  533. package/react/reducers/menuReducer.js.map +1 -1
  534. package/react/reducers/rootReducer.js.map +1 -1
  535. package/react/reducers/searchReducer.js.map +1 -1
  536. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  537. package/react/reducers/toolbarReducer.js.map +1 -1
  538. package/react/reducers/workspaceReducer.js.map +1 -1
  539. package/react/store.js.map +1 -1
  540. package/react/types/advancedAppLauncherTypes.js.map +1 -1
  541. package/react/types/dashbarTypes.js.map +1 -1
  542. package/react/types/favoriteTypes.js.map +1 -1
  543. package/react/types/fdc3.js.map +1 -1
  544. package/react/types/hotkeyTypes.js.map +1 -1
  545. package/react/types/iconTypes.js.map +1 -1
  546. package/react/types/linkerTypes.js.map +1 -1
  547. package/react/types/searchTypes.js.map +1 -1
  548. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  549. package/react/types/windowTitleBar.js.map +1 -1
  550. package/react/types/workspaceTypes.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MenuPortal.js","sourceRoot":"","sources":["../../../src/components/menu/MenuPortal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAA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AG,CAAC,KAAK,EAAE,CAAC;gBACZ,cAAc,CAAC,IAAI,CAAC,CAAC;aACrB;QACF,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAMxE,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport * as ReactDOM from \"react-dom\";\r\nimport { MenuContext } from \"./menuContext\";\r\nimport { calculateDimensions, injectCSS } from \"./menuHelpers\";\r\nimport { KeyboardNavigation } from \"./keyboardNavigation\";\r\nimport { MenuAutoResizer } from \"./MenuAutoResizer\";\r\nimport { useState, useEffect, useContext, useMemo } from \"react\";\r\nimport { useMenu } from \"../../hooks/useMenu\";\r\nimport { services, FEA } from \"@finsemble/finsemble-core\";\r\n\r\ntype SpawnParams = services.window.types.SpawnParams;\r\n\r\nexport const MenuPortal: React.FunctionComponent<{\r\n\tshow: boolean;\r\n}> = ({ show, children }) => {\r\n\tconst { thisMenuId, menuWidth, menuHeight, className, maxHeight } = useContext(MenuContext);\r\n\r\n\tconst { blurMenu } = useMenu();\r\n\t// Container div for React portal\r\n\tconst [element, setElement] = useState<HTMLElement>();\r\n\tconst [childWindow, setChildWindow] = useState<Window | null>(null);\r\n\tconst isAutoResizable = !menuHeight;\r\n\r\n\t/**\r\n\t * KeyboardNavigation registers global hotkeys for navigating through a menu with cursor keys.\r\n\t * Those hotkeys are registered/unregistered based on visibility of the child window.\r\n\t * The KeyboardNavigation class is a singleton and so is memoized. It is created when the child window is available.\r\n\t */\r\n\tconst keyboardNavigation = useMemo(() => {\r\n\t\tif (childWindow) return new KeyboardNavigation(childWindow, \".menu-item\");\r\n\t\telse return null;\r\n\t}, [childWindow]);\r\n\r\n\t/**\r\n\t * Show and hide window. This effect will run whenever the `show` prop changes,\r\n\t * generally initiated by a click to <MenuToggle>.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\t// If child window isn't yet initialized then no-op\r\n\t\tif (!childWindow) return;\r\n\r\n\t\t/**\r\n\t\t * Sets visibility of the window.\r\n\t\t * When being made visible, the window size and location is recalculated and updated.\r\n\t\t */\r\n\t\tconst runWindowEffects = async () => {\r\n\t\t\tconst finWindow: FEA.FEAWindow = childWindow.fin.desktop.Window.getCurrent();\r\n\t\t\tif (show) {\r\n\t\t\t\tconst { left, top, height } = await calculateDimensions(childWindow, thisMenuId, menuHeight, maxHeight);\r\n\r\n\t\t\t\tconst params: SpawnParams = {\r\n\t\t\t\t\tposition: \"absolute\",\r\n\t\t\t\t\tleft: left,\r\n\t\t\t\t\ttop: top,\r\n\t\t\t\t\theight: height,\r\n\t\t\t\t\tforceOntoMonitor: \"monitorRect\",\r\n\t\t\t\t};\r\n\r\n\t\t\t\tconst { name } = childWindow;\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * Use Finsemble to show the window. We might be tempted simply to use childWindow.moveTo() or childWindow.resizeTo()\r\n\t\t\t\t * but those commands limit the child window to a single monitor. We want to position the window relative to the\r\n\t\t\t\t * monitor on which the toolbar currently resides. showWindow() is monitor aware, so by using monitor=\"mine\" we can\r\n\t\t\t\t * ensure that the menu will always open on the same monitor as the toolbar. Since our toolbar has built in logic\r\n\t\t\t\t * to avoid straddling, we can be sure that the menu will never have to guess whether it exists on the left or right\r\n\t\t\t\t * side of the toolbar. Finally, showWindow() forces windows to open entirely on a monitor, so it will slide the\r\n\t\t\t\t * menu to the left or right as necessary to prevent it from straddling.\r\n\t\t\t\t */\r\n\t\t\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: name }, params);\r\n\r\n\t\t\t\t// Ensures that the menu has keyboard focus for accessibility\r\n\t\t\t\tfinWindow.focus();\r\n\r\n\t\t\t\t// Ensures that the menu is positioned above any other windows that have setAlwaysOnTop flagged\r\n\t\t\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\r\n\t\t\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: true });\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (keyboardNavigation) {\r\n\t\t\t\t\t// Why??\r\n\t\t\t\t\t(childWindow as any).keyboardNavigation = keyboardNavigation;\r\n\t\t\t\t\tkeyboardNavigation.attach();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconst { name } = childWindow;\r\n\t\t\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\r\n\t\t\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: false });\r\n\t\t\t\t});\r\n\r\n\t\t\t\tfinWindow.hide();\r\n\t\t\t\tif (keyboardNavigation) keyboardNavigation.detach();\r\n\t\t\t}\r\n\t\t};\r\n\t\trunWindowEffects();\r\n\t}, [show]);\r\n\r\n\t/**\r\n\t * Initialize the window. This should only run once.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tlet menuAutoResizer: any = null;\r\n\t\t/**\r\n\t\t * This function creates the external window\r\n\t\t * appends portal container to childWindow's body\r\n\t\t * and enables keyboard navigation.\r\n\t\t *\r\n\t\t */\r\n\t\tconst initMenu = async () => {\r\n\t\t\t/**\r\n\t\t\t * Initial size and location of the menu is irrelevant because it is hidden.\r\n\t\t\t * The menu will be resized and positioned correctly when it is shown.\r\n\t\t\t */\r\n\t\t\tconst features = `height=1,width=${menuWidth},left=0,top=0,opacity=1`;\r\n\r\n\t\t\t/**\r\n\t\t\t * Opens the window which will contain the menu contents. This looks like a browser window open\r\n\t\t\t * but actually opens an Electron window which FEA intercepts. FEA uses the `childWindowOptions`\r\n\t\t\t * json configuration to determine how to display the window. `childWindowOptions.show` should\r\n\t\t\t * be set to `false` otherwise a white window will flash prior to the menu being rendered.\r\n\t\t\t *\r\n\t\t\t *\r\n\t\t\t * The \"/component/toolbar/menu.html\" is just an empty page. It's necessary to reference a real page\r\n\t\t\t * rather than about:blank in order that the \"origin\" is correct for the page. Many CSS ui-assets such\r\n\t\t\t * as fonts and images are set with relative paths that require a correct origin.\r\n\t\t\t *\r\n\t\t\t * Note, we append the menu ID for automated testing. This allows Selenium to\r\n\t\t\t * uniquely identify each menu.\r\n\t\t\t */\r\n\t\t\tlet newWindow = window.open(`./menu.html#${thisMenuId}`, undefined, features);\r\n\t\t\tsetChildWindow(newWindow);\r\n\r\n\t\t\tconst insertWindowContent = () => {\r\n\t\t\t\tif (!newWindow) return;\r\n\r\n\t\t\t\t// Set the child window's <html> tag to class \"menu-portal\" for scrollbar styling\r\n\t\t\t\tnewWindow.document.documentElement.className = \"menu-portal\";\r\n\t\t\t\tisAutoResizable && newWindow.document.body.setAttribute(\"resizing\", \"true\");\r\n\r\n\t\t\t\t// Create the element which will hold our react elements and then append it into the child window's body.\r\n\t\t\t\tconst containerDiv: HTMLElement = document.createElement(\"div\");\r\n\t\t\t\tnewWindow.document.body.appendChild(containerDiv);\r\n\r\n\t\t\t\t// The className that was passed to MenuShell is added to the child window's <body>\r\n\t\t\t\tclassName && className.split(\" \").forEach((name: string) => newWindow!.document.body.classList.add(name));\r\n\t\t\t\t// This will update local state which will cause this React Functional Component\r\n\t\t\t\t// to return a react portal. See comments at the end of this file.\r\n\t\t\t\tsetElement(containerDiv);\r\n\t\t\t\t// Inject css into the child window's <head>\r\n\t\t\t\tinjectCSS(newWindow);\r\n\t\t\t\t// Attach MenuAutoResizer only if the menu doesn't have a fixed height\r\n\t\t\t\tisAutoResizable && (menuAutoResizer = new MenuAutoResizer(newWindow, thisMenuId, menuWidth, maxHeight));\r\n\r\n\t\t\t\t// THE FOLLOWING IS LIKELY DEPRECATED BUT KEEPING JUST IN CASE\r\n\t\t\t\t// Place height on the portal.\r\n\t\t\t\t// inside of the portal, window.outerHeight === 39 (toolbar height).\r\n\t\t\t\t// Knowing the height of the window is important because some menus use that\r\n\t\t\t\t// information to force overflow on certain sections of the menu.\r\n\t\t\t\t(newWindow as any).portalHeight = menuHeight;\r\n\r\n\t\t\t\t/* Close window when a user clicks away.\r\n\t\t\t\tAre you wondering why not just close the window without calling\r\n\t\t\t\ttoggle? because we want to update the state in the store first\r\n\t\t\t\twhich will cause openMenuId to no longer match the shell id\r\n\t\t\t\tand eventually destroy this component which will cause the window\r\n\t\t\t\tto close (see cleanup function).\r\n\t\t\t\t*/\r\n\t\t\t\tnewWindow.addEventListener(\"blur\", blurMenu);\r\n\r\n\t\t\t\t// We need to proxy/fake some events for the following reason:\r\n\t\t\t\t// If you do document.addEventListener inside a component\r\n\t\t\t\t// that is rendered inside react portal, `document` will refer\r\n\t\t\t\t// to toolbar's document instead of the childWindow's document\r\n\t\t\t\t// and for that reason, clicking inside portal will not fire\r\n\t\t\t\t// the window's click event. It will do so when you click\r\n\t\t\t\t// anywhere in the toolbar.\r\n\t\t\t\t[\"mouseDown\", \"click\", \"mouseUp\"].forEach((eventName) => {\r\n\t\t\t\t\tnewWindow?.document.addEventListener(eventName, (event) => {\r\n\t\t\t\t\t\tdocument.dispatchEvent(\r\n\t\t\t\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\r\n\t\t\t\t\t\t\t\tdetail: {\r\n\t\t\t\t\t\t\t\t\t// Devs may need access to the x and y of the cursor\r\n\t\t\t\t\t\t\t\t\tmouseEvent: new MouseEvent(eventName, event),\r\n\t\t\t\t\t\t\t\t\t// And possibly the target element\r\n\t\t\t\t\t\t\t\t\ttarget: event.target,\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t\t/**\r\n\t\t\t\t * Proxies keyboard events from the portal up into the parent window.\r\n\t\t\t\t * instead of e.key, you'll need to access e.detail.key.\r\n\t\t\t\t */\r\n\t\t\t\t[\"keyup\", \"keydown\", \"keypress\"].forEach((eventName) => {\r\n\t\t\t\t\tnewWindow?.document.addEventListener(eventName, (event) => {\r\n\t\t\t\t\t\tdocument.dispatchEvent(\r\n\t\t\t\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\r\n\t\t\t\t\t\t\t\tdetail: new KeyboardEvent(event.type, event),\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t};\r\n\r\n\t\t\tif (newWindow) newWindow.addEventListener(\"load\", insertWindowContent, true);\r\n\t\t};\r\n\r\n\t\tinitMenu();\r\n\r\n\t\treturn () => {\r\n\t\t\t// imesner 20210406 childwindow and keyboardNavigation were both null but hadn't closed the window or released global hotkeys\r\n\t\t\t// This file is a mess and needs significant refactoring to ensure the cleanup occurs and to have less event-hell\r\n\t\t\tconst win = childWindow || menuAutoResizer?.childWindow;\r\n\t\t\tconst keyboardNav = keyboardNavigation || (win as any)?.keyboardNavigation;\r\n\r\n\t\t\tif (keyboardNav) keyboardNav.detach();\r\n\r\n\t\t\tif (menuAutoResizer) {\r\n\t\t\t\tmenuAutoResizer.disconnect();\r\n\t\t\t}\r\n\t\t\tif (win) {\r\n\t\t\t\twin.close();\r\n\t\t\t\tsetChildWindow(null);\r\n\t\t\t}\r\n\t\t};\r\n\t}, [blurMenu, className, menuWidth, menuHeight, maxHeight, thisMenuId]);\r\n\r\n\t// We should only return a react portal when window is ready\r\n\t// and container div appended to its body\r\n\t// See Dan abramov comment about this at:\r\n\t// https://github.com/facebook/react/issues/12355#issuecomment-410996235\r\n\treturn element ? ReactDOM.createPortal(children, element) : null;\r\n};\r\n"]}
1
+ {"version":3,"file":"MenuPortal.js","sourceRoot":"","sources":["../../../src/components/menu/MenuPortal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE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,eAAe,EAAE;gBACpB,eAAe,CAAC,UAAU,EAAE,CAAC;aAC7B;YACD,IAAI,GAAG,EAAE;gBACR,GAAG,CAAC,KAAK,EAAE,CAAC;gBACZ,cAAc,CAAC,IAAI,CAAC,CAAC;aACrB;QACF,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IAMxE,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { MenuContext } from \"./menuContext\";\nimport { calculateDimensions, injectCSS } from \"./menuHelpers\";\nimport { KeyboardNavigation } from \"./keyboardNavigation\";\nimport { MenuAutoResizer } from \"./MenuAutoResizer\";\nimport { useState, useEffect, useContext, useMemo } from \"react\";\nimport { useMenu } from \"../../hooks/useMenu\";\nimport { services, FEA } from \"@finsemble/finsemble-core\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\nexport const MenuPortal: React.FunctionComponent<{\n\tshow: boolean;\n}> = ({ show, children }) => {\n\tconst { thisMenuId, menuWidth, menuHeight, className, maxHeight } = useContext(MenuContext);\n\n\tconst { blurMenu } = useMenu();\n\t// Container div for React portal\n\tconst [element, setElement] = useState<HTMLElement>();\n\tconst [childWindow, setChildWindow] = useState<Window | null>(null);\n\tconst isAutoResizable = !menuHeight;\n\n\t/**\n\t * KeyboardNavigation registers global hotkeys for navigating through a menu with cursor keys.\n\t * Those hotkeys are registered/unregistered based on visibility of the child window.\n\t * The KeyboardNavigation class is a singleton and so is memoized. It is created when the child window is available.\n\t */\n\tconst keyboardNavigation = useMemo(() => {\n\t\tif (childWindow) return new KeyboardNavigation(childWindow, \".menu-item\");\n\t\telse return null;\n\t}, [childWindow]);\n\n\t/**\n\t * Show and hide window. This effect will run whenever the `show` prop changes,\n\t * generally initiated by a click to <MenuToggle>.\n\t */\n\tuseEffect(() => {\n\t\t// If child window isn't yet initialized then no-op\n\t\tif (!childWindow) return;\n\n\t\t/**\n\t\t * Sets visibility of the window.\n\t\t * When being made visible, the window size and location is recalculated and updated.\n\t\t */\n\t\tconst runWindowEffects = async () => {\n\t\t\tconst finWindow: FEA.FEAWindow = childWindow.fin.desktop.Window.getCurrent();\n\t\t\tif (show) {\n\t\t\t\tconst { left, top, height } = await calculateDimensions(childWindow, thisMenuId, menuHeight, maxHeight);\n\n\t\t\t\tconst params: SpawnParams = {\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\tleft: left,\n\t\t\t\t\ttop: top,\n\t\t\t\t\theight: height,\n\t\t\t\t\tforceOntoMonitor: \"monitorRect\",\n\t\t\t\t};\n\n\t\t\t\tconst { name } = childWindow;\n\n\t\t\t\t/**\n\t\t\t\t * Use Finsemble to show the window. We might be tempted simply to use childWindow.moveTo() or childWindow.resizeTo()\n\t\t\t\t * but those commands limit the child window to a single monitor. We want to position the window relative to the\n\t\t\t\t * monitor on which the toolbar currently resides. showWindow() is monitor aware, so by using monitor=\"mine\" we can\n\t\t\t\t * ensure that the menu will always open on the same monitor as the toolbar. Since our toolbar has built in logic\n\t\t\t\t * to avoid straddling, we can be sure that the menu will never have to guess whether it exists on the left or right\n\t\t\t\t * side of the toolbar. Finally, showWindow() forces windows to open entirely on a monitor, so it will slide the\n\t\t\t\t * menu to the left or right as necessary to prevent it from straddling.\n\t\t\t\t */\n\t\t\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: name }, params);\n\n\t\t\t\t// Ensures that the menu has keyboard focus for accessibility\n\t\t\t\tfinWindow.focus();\n\n\t\t\t\t// Ensures that the menu is positioned above any other windows that have setAlwaysOnTop flagged\n\t\t\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: true });\n\t\t\t\t});\n\n\t\t\t\tif (keyboardNavigation) {\n\t\t\t\t\t// Why??\n\t\t\t\t\t(childWindow as any).keyboardNavigation = keyboardNavigation;\n\t\t\t\t\tkeyboardNavigation.attach();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst { name } = childWindow;\n\t\t\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: false });\n\t\t\t\t});\n\n\t\t\t\tfinWindow.hide();\n\t\t\t\tif (keyboardNavigation) keyboardNavigation.detach();\n\t\t\t}\n\t\t};\n\t\trunWindowEffects();\n\t}, [show]);\n\n\t/**\n\t * Initialize the window. This should only run once.\n\t */\n\tuseEffect(() => {\n\t\tlet menuAutoResizer: any = null;\n\t\t/**\n\t\t * This function creates the external window\n\t\t * appends portal container to childWindow's body\n\t\t * and enables keyboard navigation.\n\t\t *\n\t\t */\n\t\tconst initMenu = async () => {\n\t\t\t/**\n\t\t\t * Initial size and location of the menu is irrelevant because it is hidden.\n\t\t\t * The menu will be resized and positioned correctly when it is shown.\n\t\t\t */\n\t\t\tconst features = `height=1,width=${menuWidth},left=0,top=0,opacity=1`;\n\n\t\t\t/**\n\t\t\t * Opens the window which will contain the menu contents. This looks like a browser window open\n\t\t\t * but actually opens an Electron window which FEA intercepts. FEA uses the `childWindowOptions`\n\t\t\t * json configuration to determine how to display the window. `childWindowOptions.show` should\n\t\t\t * be set to `false` otherwise a white window will flash prior to the menu being rendered.\n\t\t\t *\n\t\t\t *\n\t\t\t * The \"/component/toolbar/menu.html\" is just an empty page. It's necessary to reference a real page\n\t\t\t * rather than about:blank in order that the \"origin\" is correct for the page. Many CSS ui-assets such\n\t\t\t * as fonts and images are set with relative paths that require a correct origin.\n\t\t\t *\n\t\t\t * Note, we append the menu ID for automated testing. This allows Selenium to\n\t\t\t * uniquely identify each menu.\n\t\t\t */\n\t\t\tlet newWindow = window.open(`./menu.html#${thisMenuId}`, undefined, features);\n\t\t\tsetChildWindow(newWindow);\n\n\t\t\tconst insertWindowContent = () => {\n\t\t\t\tif (!newWindow) return;\n\n\t\t\t\t// Set the child window's <html> tag to class \"menu-portal\" for scrollbar styling\n\t\t\t\tnewWindow.document.documentElement.className = \"menu-portal\";\n\t\t\t\tisAutoResizable && newWindow.document.body.setAttribute(\"resizing\", \"true\");\n\n\t\t\t\t// Create the element which will hold our react elements and then append it into the child window's body.\n\t\t\t\tconst containerDiv: HTMLElement = document.createElement(\"div\");\n\t\t\t\tnewWindow.document.body.appendChild(containerDiv);\n\n\t\t\t\t// The className that was passed to MenuShell is added to the child window's <body>\n\t\t\t\tclassName && className.split(\" \").forEach((name: string) => newWindow!.document.body.classList.add(name));\n\t\t\t\t// This will update local state which will cause this React Functional Component\n\t\t\t\t// to return a react portal. See comments at the end of this file.\n\t\t\t\tsetElement(containerDiv);\n\t\t\t\t// Inject css into the child window's <head>\n\t\t\t\tinjectCSS(newWindow);\n\t\t\t\t// Attach MenuAutoResizer only if the menu doesn't have a fixed height\n\t\t\t\tisAutoResizable && (menuAutoResizer = new MenuAutoResizer(newWindow, thisMenuId, menuWidth, maxHeight));\n\n\t\t\t\t// THE FOLLOWING IS LIKELY DEPRECATED BUT KEEPING JUST IN CASE\n\t\t\t\t// Place height on the portal.\n\t\t\t\t// inside of the portal, window.outerHeight === 39 (toolbar height).\n\t\t\t\t// Knowing the height of the window is important because some menus use that\n\t\t\t\t// information to force overflow on certain sections of the menu.\n\t\t\t\t(newWindow as any).portalHeight = menuHeight;\n\n\t\t\t\t/* Close window when a user clicks away.\n\t\t\t\tAre you wondering why not just close the window without calling\n\t\t\t\ttoggle? because we want to update the state in the store first\n\t\t\t\twhich will cause openMenuId to no longer match the shell id\n\t\t\t\tand eventually destroy this component which will cause the window\n\t\t\t\tto close (see cleanup function).\n\t\t\t\t*/\n\t\t\t\tnewWindow.addEventListener(\"blur\", blurMenu);\n\n\t\t\t\t// We need to proxy/fake some events for the following reason:\n\t\t\t\t// If you do document.addEventListener inside a component\n\t\t\t\t// that is rendered inside react portal, `document` will refer\n\t\t\t\t// to toolbar's document instead of the childWindow's document\n\t\t\t\t// and for that reason, clicking inside portal will not fire\n\t\t\t\t// the window's click event. It will do so when you click\n\t\t\t\t// anywhere in the toolbar.\n\t\t\t\t[\"mouseDown\", \"click\", \"mouseUp\"].forEach((eventName) => {\n\t\t\t\t\tnewWindow?.document.addEventListener(eventName, (event) => {\n\t\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t\t\t// Devs may need access to the x and y of the cursor\n\t\t\t\t\t\t\t\t\tmouseEvent: new MouseEvent(eventName, event),\n\t\t\t\t\t\t\t\t\t// And possibly the target element\n\t\t\t\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\t/**\n\t\t\t\t * Proxies keyboard events from the portal up into the parent window.\n\t\t\t\t * instead of e.key, you'll need to access e.detail.key.\n\t\t\t\t */\n\t\t\t\t[\"keyup\", \"keydown\", \"keypress\"].forEach((eventName) => {\n\t\t\t\t\tnewWindow?.document.addEventListener(eventName, (event) => {\n\t\t\t\t\t\tdocument.dispatchEvent(\n\t\t\t\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\t\t\t\tdetail: new KeyboardEvent(event.type, event),\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tif (newWindow) newWindow.addEventListener(\"load\", insertWindowContent, true);\n\t\t};\n\n\t\tinitMenu();\n\n\t\treturn () => {\n\t\t\t// imesner 20210406 childwindow and keyboardNavigation were both null but hadn't closed the window or released global hotkeys\n\t\t\t// This file is a mess and needs significant refactoring to ensure the cleanup occurs and to have less event-hell\n\t\t\tconst win = childWindow || menuAutoResizer?.childWindow;\n\t\t\tconst keyboardNav = keyboardNavigation || (win as any)?.keyboardNavigation;\n\n\t\t\tif (keyboardNav) keyboardNav.detach();\n\n\t\t\tif (menuAutoResizer) {\n\t\t\t\tmenuAutoResizer.disconnect();\n\t\t\t}\n\t\t\tif (win) {\n\t\t\t\twin.close();\n\t\t\t\tsetChildWindow(null);\n\t\t\t}\n\t\t};\n\t}, [blurMenu, className, menuWidth, menuHeight, maxHeight, thisMenuId]);\n\n\t// We should only return a react portal when window is ready\n\t// and container div appended to its body\n\t// See Dan abramov comment about this at:\n\t// https://github.com/facebook/react/issues/12355#issuecomment-410996235\n\treturn element ? ReactDOM.createPortal(children, element) : null;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuShell.js","sourceRoot":"","sources":["../../../src/components/menu/MenuShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,GAAW,GAAG,CAAC;AA4B/B,MAAM,CAAC,MAAM,SAAS,GAAwC,CAAC,EAC9D,QAAQ,EACR,EAAE,EACF,KAAK,GAAG,UAAU,EAClB,MAAM,EACN,SAAS,EACT,SAAS,GAAG,QAAQ,EACpB,UAAU,EACV,WAAW,GAAG,CAAC,QAAQ,CAAC,GACxB,EAAE,EAAE;IAWJ,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO;YACN,UAAU,EAAE,EAAE,IAAI,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;YAC1E,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,MAAM;SAClB,CAAC;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9C,OAAO,CACN,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACxC,oBAAC,UAAU,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAI;QACnD,QAAQ,CACa,CACvB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { MenuContext } from \"./menuContext\";\r\nimport \"../../assets/css/menus.css\";\r\nimport { useMemo } from \"react\";\r\nimport { MenuHotKey } from \"./MenuHotKey\";\r\n\r\nconst MENU_WIDTH: number = 180;\r\n\r\ntype ShellProps = {\r\n\tclassName?: string;\r\n\tcloseHotkey?: Array<string>;\r\n\theight?: number;\r\n\tid?: string;\r\n\tmaxHeight?: number;\r\n\topenHotkey?: Array<string>;\r\n\twidth?: number;\r\n};\r\n\r\n/**\r\n * The higher level menu component that manages the menu state, renders different parts of the menu, and facilitates\r\n * communication between them.\r\n *\r\n * If window.FSBL.debug==true then windows won't automatically close on blur. This is useful for debugging events that occur in the windows.\r\n *\r\n * @param {string} [className] - Custom body class for the menu contents. These classes will be set on the <body> tag for the Menu's drop down window.\r\n * @param {array} [closeHotkey=[\"escape\"] ] - A hotkey combination to close the menu. Defaults to [\"escape\"].\r\n * @param {number} [height] - Custom height for the menu. If not set then the height will be automatically calculated based on the content height and available monitor space.\r\n * @param {string} [id] - Unique ID for the menu. Defaults to a random string.\r\n * @param {number} [maxHeight=Infinity] - Maximum height of the menu.\r\n * @param {array} [openHotkey] - A hotkey combination to open the menu.\r\n * @param {number} [width=180] - Custom width for the menu.\r\n *\r\n */\r\n\r\nexport const MenuShell: React.FunctionComponent<ShellProps> = ({\r\n\tchildren,\r\n\tid,\r\n\twidth = MENU_WIDTH,\r\n\theight,\r\n\tclassName,\r\n\tmaxHeight = Infinity,\r\n\topenHotkey,\r\n\tcloseHotkey = [\"escape\"],\r\n}) => {\r\n\t/**\r\n\t * Every menu has its own context which contains information that child components need to use.\r\n\t * Here, we initialize that context. We do this with useMemo() for efficiency. Without useMemo,\r\n\t * our context value *object* would be recreated with every render cycle, and would thus trigger\r\n\t * every object that depended on context to re-render. Instead, useMenu creates a stable object\r\n\t * that only updates when one of *its* dependencies updates. So in essence, so long as MenuShell's\r\n\t * props are stable, context and all child props will also be stable.\r\n\t *\r\n\t * If id is passed in as a prop then we'll use that to initialize thisMenuId. Otherwise we'll set it to a random string.\r\n\t */\r\n\tconst contextValue = useMemo(() => {\r\n\t\treturn {\r\n\t\t\tthisMenuId: id || `MENU_${((Math.random() * 0xffffff) << 0).toString(16)}`,\r\n\t\t\tclassName: className,\r\n\t\t\tmaxHeight: maxHeight,\r\n\t\t\tmenuWidth: width,\r\n\t\t\tmenuHeight: height,\r\n\t\t};\r\n\t}, [id, className, maxHeight, width, height]);\r\n\r\n\treturn (\r\n\t\t<MenuContext.Provider value={contextValue}>\r\n\t\t\t<MenuHotKey open={openHotkey} close={closeHotkey} />\r\n\t\t\t{children}\r\n\t\t</MenuContext.Provider>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"MenuShell.js","sourceRoot":"","sources":["../../../src/components/menu/MenuShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,UAAU,GAAW,GAAG,CAAC;AA4B/B,MAAM,CAAC,MAAM,SAAS,GAAwC,CAAC,EAC9D,QAAQ,EACR,EAAE,EACF,KAAK,GAAG,UAAU,EAClB,MAAM,EACN,SAAS,EACT,SAAS,GAAG,QAAQ,EACpB,UAAU,EACV,WAAW,GAAG,CAAC,QAAQ,CAAC,GACxB,EAAE,EAAE;IAWJ,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,OAAO;YACN,UAAU,EAAE,EAAE,IAAI,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE;YAC1E,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,MAAM;SAClB,CAAC;IACH,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAE9C,OAAO,CACN,oBAAC,WAAW,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY;QACxC,oBAAC,UAAU,IAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAI;QACnD,QAAQ,CACa,CACvB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { MenuContext } from \"./menuContext\";\nimport \"../../assets/css/menus.css\";\nimport { useMemo } from \"react\";\nimport { MenuHotKey } from \"./MenuHotKey\";\n\nconst MENU_WIDTH: number = 180;\n\ntype ShellProps = {\n\tclassName?: string;\n\tcloseHotkey?: Array<string>;\n\theight?: number;\n\tid?: string;\n\tmaxHeight?: number;\n\topenHotkey?: Array<string>;\n\twidth?: number;\n};\n\n/**\n * The higher level menu component that manages the menu state, renders different parts of the menu, and facilitates\n * communication between them.\n *\n * If window.FSBL.debug==true then windows won't automatically close on blur. This is useful for debugging events that occur in the windows.\n *\n * @param {string} [className] - Custom body class for the menu contents. These classes will be set on the <body> tag for the Menu's drop down window.\n * @param {array} [closeHotkey=[\"escape\"] ] - A hotkey combination to close the menu. Defaults to [\"escape\"].\n * @param {number} [height] - Custom height for the menu. If not set then the height will be automatically calculated based on the content height and available monitor space.\n * @param {string} [id] - Unique ID for the menu. Defaults to a random string.\n * @param {number} [maxHeight=Infinity] - Maximum height of the menu.\n * @param {array} [openHotkey] - A hotkey combination to open the menu.\n * @param {number} [width=180] - Custom width for the menu.\n *\n */\n\nexport const MenuShell: React.FunctionComponent<ShellProps> = ({\n\tchildren,\n\tid,\n\twidth = MENU_WIDTH,\n\theight,\n\tclassName,\n\tmaxHeight = Infinity,\n\topenHotkey,\n\tcloseHotkey = [\"escape\"],\n}) => {\n\t/**\n\t * Every menu has its own context which contains information that child components need to use.\n\t * Here, we initialize that context. We do this with useMemo() for efficiency. Without useMemo,\n\t * our context value *object* would be recreated with every render cycle, and would thus trigger\n\t * every object that depended on context to re-render. Instead, useMenu creates a stable object\n\t * that only updates when one of *its* dependencies updates. So in essence, so long as MenuShell's\n\t * props are stable, context and all child props will also be stable.\n\t *\n\t * If id is passed in as a prop then we'll use that to initialize thisMenuId. Otherwise we'll set it to a random string.\n\t */\n\tconst contextValue = useMemo(() => {\n\t\treturn {\n\t\t\tthisMenuId: id || `MENU_${((Math.random() * 0xffffff) << 0).toString(16)}`,\n\t\t\tclassName: className,\n\t\t\tmaxHeight: maxHeight,\n\t\t\tmenuWidth: width,\n\t\t\tmenuHeight: height,\n\t\t};\n\t}, [id, className, maxHeight, width, height]);\n\n\treturn (\n\t\t<MenuContext.Provider value={contextValue}>\n\t\t\t<MenuHotKey open={openHotkey} close={closeHotkey} />\n\t\t\t{children}\n\t\t</MenuContext.Provider>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuToggle.js","sourceRoot":"","sources":["../../../src/components/menu/MenuToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,MAAM,CAAC,MAAM,UAAU,GAA4B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAErD,MAAM,eAAe,GAAW,YAAY,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,OAAO,CACN,6BACC,EAAE,EAAE,GAAG,UAAU,cAAc,EAC/B,SAAS,EAAE,4BAA4B,eAAe,EAAE,EACxD,WAAW,EAAE,UAAU,EACvB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,CAAsC,EAAE,EAAE;YACrD,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;gBACvC,UAAU,EAAE,CAAC;aACb;QACF,CAAC;QAEA,QAAQ;QACT,2BAAG,SAAS,EAAC,+CAA+C,GAAK,CAC5D,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { MenuContext } from \"./menuContext\";\r\nimport { useMenu } from \"../../hooks/useMenu\";\r\n\r\n/**\r\n * A menu button that opens and closes the menu.\r\n */\r\nexport const MenuToggle: React.FunctionComponent = ({ children }) => {\r\n\tconst { toggleMenu, isMenuActive } = useMenu();\r\n\tconst { thisMenuId } = React.useContext(MenuContext);\r\n\r\n\tconst menuActiveClass: string = isMenuActive() ? \"menu-active\" : \"\";\r\n\r\n\treturn (\r\n\t\t<div\r\n\t\t\tid={`${thisMenuId}-menu-toggle`}\r\n\t\t\tclassName={`finsemble-toolbar-button ${menuActiveClass}`}\r\n\t\t\tonMouseDown={toggleMenu}\r\n\t\t\trole=\"button\"\r\n\t\t\ttabIndex={0}\r\n\t\t\tonKeyDown={(e: React.KeyboardEvent<HTMLDivElement>) => {\r\n\t\t\t\tif ([\"Enter\", \"Space\"].includes(e.key)) {\r\n\t\t\t\t\ttoggleMenu();\r\n\t\t\t\t}\r\n\t\t\t}}\r\n\t\t>\r\n\t\t\t{children}\r\n\t\t\t<i className=\"finsemble-toolbar-button-icon ff-chevron-down\"></i>\r\n\t\t</div>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"MenuToggle.js","sourceRoot":"","sources":["../../../src/components/menu/MenuToggle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAK9C,MAAM,CAAC,MAAM,UAAU,GAA4B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,GAAG,OAAO,EAAE,CAAC;IAC/C,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAErD,MAAM,eAAe,GAAW,YAAY,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,OAAO,CACN,6BACC,EAAE,EAAE,GAAG,UAAU,cAAc,EAC/B,SAAS,EAAE,4BAA4B,eAAe,EAAE,EACxD,WAAW,EAAE,UAAU,EACvB,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,CAAC,CAAsC,EAAE,EAAE;YACrD,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;gBACvC,UAAU,EAAE,CAAC;aACb;QACF,CAAC;QAEA,QAAQ;QACT,2BAAG,SAAS,EAAC,+CAA+C,GAAK,CAC5D,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { MenuContext } from \"./menuContext\";\nimport { useMenu } from \"../../hooks/useMenu\";\n\n/**\n * A menu button that opens and closes the menu.\n */\nexport const MenuToggle: React.FunctionComponent = ({ children }) => {\n\tconst { toggleMenu, isMenuActive } = useMenu();\n\tconst { thisMenuId } = React.useContext(MenuContext);\n\n\tconst menuActiveClass: string = isMenuActive() ? \"menu-active\" : \"\";\n\n\treturn (\n\t\t<div\n\t\t\tid={`${thisMenuId}-menu-toggle`}\n\t\t\tclassName={`finsemble-toolbar-button ${menuActiveClass}`}\n\t\t\tonMouseDown={toggleMenu}\n\t\t\trole=\"button\"\n\t\t\ttabIndex={0}\n\t\t\tonKeyDown={(e: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t\tif ([\"Enter\", \"Space\"].includes(e.key)) {\n\t\t\t\t\ttoggleMenu();\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t\t<i className=\"finsemble-toolbar-button-icon ff-chevron-down\"></i>\n\t\t</div>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Menu } from \"./Menu\";\r\nexport { MenuContent } from \"./MenuContent\";\r\nexport { MenuItem } from \"./MenuItem\";\r\nexport { MenuShell } from \"./MenuShell\";\r\nexport { MenuToggle } from \"./MenuToggle\";\r\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/menu/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { Menu } from \"./Menu\";\nexport { MenuContent } from \"./MenuContent\";\nexport { MenuItem } from \"./MenuItem\";\nexport { MenuShell } from \"./MenuShell\";\nexport { MenuToggle } from \"./MenuToggle\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"keyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/menu/keyboardNavigation.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,kBAAkB;IAc9B,YAAY,QAAgB,EAAE,SAAiB;QATvC,iBAAY,GAAuB,SAAS,CAAC;QAE7C,iBAAY,GAAW,CAAC,CAAC,CAAC;QAQjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,IAAI,CAAC,WAA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us using\r\n * cursor keys and to select items using the enter key.\r\n *\r\n * This is stateful. As implemented in MenuPortal, the currently selected\r\n * menu item will remain selected between menu opens and closes.\r\n *\r\n * When an element is selected then the keyboard navigation state is reset\r\n * so that the user will begin again with the first item.\r\n *\r\n * @param childWin Main window or child window reference.\r\n * @param className Selector of elements to apply navigation on.\r\n * @example\r\n * const keyboardNav = KeyboardNavigation(window, \".menu-item\");\r\n * keyboardNav.attach() // enable navigation\r\n * keyboardNav.detach() // disable navigation\r\n */\r\nexport class KeyboardNavigation {\r\n\tprivate childWin: Window;\r\n\r\n\tprivate className: string;\r\n\r\n\tprivate selectedItem: number | undefined = undefined;\r\n\r\n\tprivate selectedIcon: number = -1;\r\n\r\n\t/**\r\n\t *\r\n\t * @param childWin Main window or child window reference\r\n\t * @param className The selector string e.g .menu-item\r\n\t */\r\n\tconstructor(childWin: Window, className: string) {\r\n\t\tthis.childWin = childWin;\r\n\t\tthis.className = className;\r\n\t\tthis.onArrowDown = this.onArrowDown.bind(this);\r\n\t\tthis.onArrowUp = this.onArrowUp.bind(this);\r\n\t\tthis.onArrowRight = this.onArrowRight.bind(this);\r\n\t\tthis.onArrowLeft = this.onArrowLeft.bind(this);\r\n\t\tthis.clickOnItem = this.clickOnItem.bind(this);\r\n\t\tthis.focusOnFirst = this.focusOnFirst.bind(this);\r\n\t\tthis.focusOnLast = this.focusOnLast.bind(this);\r\n\t\tthis.resetFocusOnDOMChanges();\r\n\t}\r\n\r\n\t/**\r\n\t * A mutation observer to watch changes in the DOM\r\n\t * and set the selectedIndex to undefined when changes\r\n\t * observed. We want to start focusing from element with index 0\r\n\t * when the elements order changes.\r\n\t */\r\n\tprivate resetFocusOnDOMChanges() {\r\n\t\tnew MutationObserver(() => {\r\n\t\t\t// Reset selectedIndex when elements added or removed\r\n\t\t\t// from the DOM. The motivation behind this was an issue\r\n\t\t\t// with Brad's search menu where the order of focus is\r\n\t\t\t// messed up when his list of result changes.\r\n\t\t\tthis.selectedItem = undefined;\r\n\t\t}).observe(this.childWin.document.body, {\r\n\t\t\tchildList: true,\r\n\t\t\tcharacterData: false,\r\n\t\t\tsubtree: true,\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Returns list of elements\r\n\t */\r\n\tprivate getElements() {\r\n\t\treturn this.childWin.document.querySelectorAll(this.className);\r\n\t}\r\n\r\n\tprivate getMenuItemIcons(index: number) {\r\n\t\tconst menuItems = this.getElements();\r\n\t\treturn menuItems[index].querySelectorAll(\".menu-item-icon\");\r\n\t}\r\n\r\n\t/**\r\n\t * Remove all focus classes.\r\n\t */\r\n\tprivate removeAllFocus() {\r\n\t\tconst menuItems = this.getElements();\r\n\t\tmenuItems.forEach((item: Element, key: number) => {\r\n\t\t\titem.removeAttribute(\"focused\");\r\n\t\t\tconst icons = this.getMenuItemIcons(key);\r\n\t\t\ticons.forEach((icon: Element) => {\r\n\t\t\t\ticon.removeAttribute(\"focused\");\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the focus on a menu item\r\n\t * @param index The index of the menu item in the list\r\n\t */\r\n\tprivate focusOn(index: number) {\r\n\t\tthis.removeAllFocus();\r\n\r\n\t\tconst menuItems = this.getElements();\r\n\t\t// Menu could have no items\r\n\t\tif (!menuItems.length) return;\r\n\t\t// Focus on element and scroll if needed\r\n\t\tmenuItems[index].setAttribute(\"focused\", \"true\");\r\n\t\t(menuItems[index] as any).scrollIntoViewIfNeeded({\r\n\t\t\tbehavior: \"smooth\",\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t * Sets the focus on a menu item's icon\r\n\t * @param index The index of the menu item in the list\r\n\t * @param iconIndex The index of the menu item's icon (-1 = menu text, not icon)\r\n\t */\r\n\tprivate focusOnIcon(index: number, iconIndex: number) {\r\n\t\tthis.removeAllFocus();\r\n\r\n\t\tconst menuItems = this.getElements();\r\n\t\t// Menu could have no items\r\n\t\tif (!menuItems.length) return;\r\n\r\n\t\tconst icons = this.getMenuItemIcons(index);\r\n\t\t// Defend against possible js runtime error\r\n\t\tif (icons.length < iconIndex) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// scroll if needed\r\n\t\t(menuItems[index] as any).scrollIntoViewIfNeeded({\r\n\t\t\tbehavior: \"smooth\",\r\n\t\t});\r\n\t\t// Focus on menu item text, if relevant\r\n\t\tif (iconIndex === -1) {\r\n\t\t\tmenuItems[index].setAttribute(\"focused\", \"true\");\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\ticons[iconIndex].setAttribute(\"focused\", \"true\");\r\n\t}\r\n\r\n\t/**\r\n\t * Simulates mouse events\r\n\t */\r\n\tprivate clickOnItem() {\r\n\t\tthis.removeAllFocus();\r\n\t\tif (this.selectedItem !== undefined) {\r\n\t\t\tconst elements = this.getElements();\r\n\t\t\tconst selectedItem = elements[this.selectedItem as any];\r\n\t\t\t[\"mousedown\", \"click\", \"mouseup\"].forEach((event) => {\r\n\t\t\t\tif (this.selectedIcon > -1) {\r\n\t\t\t\t\tconst icons = this.getMenuItemIcons(this.selectedItem as any);\r\n\t\t\t\t\tconst selectedIcon = icons[this.selectedIcon as any];\r\n\t\t\t\t\tif (selectedIcon) {\r\n\t\t\t\t\t\tselectedIcon.dispatchEvent(\r\n\t\t\t\t\t\t\tnew MouseEvent(event, {\r\n\t\t\t\t\t\t\t\tview: this.childWin,\r\n\t\t\t\t\t\t\t\tbubbles: true,\r\n\t\t\t\t\t\t\t\tcancelable: true,\r\n\t\t\t\t\t\t\t\tbuttons: 1,\r\n\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (selectedItem && selectedItem.dispatchEvent) {\r\n\t\t\t\t\tselectedItem.dispatchEvent(\r\n\t\t\t\t\t\tnew MouseEvent(event, {\r\n\t\t\t\t\t\t\tview: this.childWin,\r\n\t\t\t\t\t\t\tbubbles: true,\r\n\t\t\t\t\t\t\tcancelable: true,\r\n\t\t\t\t\t\t\tbuttons: 1,\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t/**\r\n\t\t\t * When an element is selected we reset the menu to focus on the first item.\r\n\t\t\t * Per Dan Nicolai UX specialist.\r\n\t\t\t */\r\n\t\t\tthis.selectedItem = undefined;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when a user presses on the arrow up key\r\n\t */\r\n\tprivate onArrowUp() {\r\n\t\t// On first key up/down press, we want\r\n\t\t// the focus to be on first item\r\n\t\tif (this.selectedItem === undefined) {\r\n\t\t\tthis.selectedItem = 0;\r\n\t\t\treturn this.focusOn(0);\r\n\t\t}\r\n\t\t// Set the focus on the previous item\r\n\t\tthis.selectedItem--;\r\n\t\tif (this.selectedItem < 0) {\r\n\t\t\t// If we are back to the begining\r\n\t\t\t// set the focus on last item\r\n\t\t\tthis.selectedItem = this.getElements().length - 1;\r\n\t\t}\r\n\t\tthis.focusOn(this.selectedItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when user press the arrow down key\r\n\t */\r\n\tprivate onArrowDown() {\r\n\t\tif (this.selectedItem === undefined) {\r\n\t\t\tthis.selectedItem = 0;\r\n\t\t\treturn this.focusOn(0);\r\n\t\t}\r\n\t\t// The the focus on the next item\r\n\t\tthis.selectedItem++;\r\n\t\t// If we reached the end, then go back to first item\r\n\t\tif (this.selectedItem === this.getElements().length) {\r\n\t\t\tthis.selectedItem = 0;\r\n\t\t}\r\n\t\tthis.focusOn(this.selectedItem);\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when user press the arrow right key\r\n\t */\r\n\tprivate onArrowRight() {\r\n\t\tif (this.selectedItem === undefined) {\r\n\t\t\tthis.selectedItem = 0;\r\n\t\t\treturn this.focusOn(0);\r\n\t\t}\r\n\r\n\t\tconst menuItems = this.getElements();\r\n\t\t// Menu could have no items\r\n\t\tif (!menuItems.length) return;\r\n\r\n\t\tconst icons = this.getMenuItemIcons(this.selectedItem);\r\n\t\tif (icons.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.selectedIcon++;\r\n\t\tif (this.selectedIcon === icons.length) {\r\n\t\t\tthis.selectedIcon = -1;\r\n\t\t}\r\n\t\tthis.focusOnIcon(this.selectedItem, this.selectedIcon);\r\n\t}\r\n\r\n\t/**\r\n\t * Invoked when user press the arrow left key\r\n\t */\r\n\tprivate onArrowLeft() {\r\n\t\tif (this.selectedItem === undefined) {\r\n\t\t\tthis.selectedItem = 0;\r\n\t\t\treturn this.focusOn(0);\r\n\t\t}\r\n\r\n\t\tconst menuItems = this.getElements();\r\n\t\t// Menu could have no items\r\n\t\tif (!menuItems.length) return;\r\n\r\n\t\tconst icons = this.getMenuItemIcons(this.selectedItem);\r\n\t\tif (icons.length === 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.selectedIcon--;\r\n\t\tif (this.selectedIcon === icons.length) {\r\n\t\t\tthis.selectedIcon = -1;\r\n\t\t}\r\n\t\tthis.focusOnIcon(this.selectedItem, this.selectedIcon);\r\n\t}\r\n\r\n\tprivate focusOnFirst() {\r\n\t\tthis.selectedItem = 0;\r\n\t\tthis.selectedIcon = -1;\r\n\t\tthis.focusOn(0);\r\n\t}\r\n\r\n\tprivate focusOnLast() {\r\n\t\tthis.selectedIcon = -1;\r\n\t\tconst { length } = this.getElements();\r\n\t\tif (length) {\r\n\t\t\tthis.selectedItem = length - 1;\r\n\t\t\tthis.focusOn(length - 1);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Adds global hot keys for up/down arrow\r\n\t */\r\n\tpublic attach() {\r\n\t\t// Register hotkeys\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"up arrow\"], this.onArrowUp);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"right arrow\"], this.onArrowRight);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"left arrow\"], this.onArrowLeft);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"down arrow\"], this.onArrowDown);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"return\"], this.clickOnItem);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"home\"], this.focusOnFirst);\r\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"end\"], this.focusOnLast);\r\n\t}\r\n\r\n\t/**\r\n\t * Remove global got keys for up/down arrow\r\n\t */\r\n\tpublic detach() {\r\n\t\t// Remove registered hotkeys\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"up arrow\"], this.onArrowUp);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"right arrow\"], this.onArrowRight);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"left arrow\"], this.onArrowLeft);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"down arrow\"], this.onArrowDown);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"return\"], this.clickOnItem);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"home\"], this.focusOnFirst);\r\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"end\"], this.focusOnLast);\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"file":"keyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/menu/keyboardNavigation.ts"],"names":[],"mappings":"AAiBA,MAAM,OAAO,kBAAkB;IAc9B,YAAY,QAAgB,EAAE,SAAiB;QATvC,iBAAY,GAAuB,SAAS,CAAC;QAE7C,iBAAY,GAAW,CAAC,CAAC,CAAC;QAQjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,IAAI,CAA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EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3E,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACzE,CAAC;CACD","sourcesContent":["/**\n * Keyboard navigation allows the end user to navigate through menus using\n * cursor keys and to select items using the enter key.\n *\n * This is stateful. As implemented in MenuPortal, the currently selected\n * menu item will remain selected between menu opens and closes.\n *\n * When an element is selected then the keyboard navigation state is reset\n * so that the user will begin again with the first item.\n *\n * @param childWin Main window or child window reference.\n * @param className Selector of elements to apply navigation on.\n * @example\n * const keyboardNav = KeyboardNavigation(window, \".menu-item\");\n * keyboardNav.attach() // enable navigation\n * keyboardNav.detach() // disable navigation\n */\nexport class KeyboardNavigation {\n\tprivate childWin: Window;\n\n\tprivate className: string;\n\n\tprivate selectedItem: number | undefined = undefined;\n\n\tprivate selectedIcon: number = -1;\n\n\t/**\n\t *\n\t * @param childWin Main window or child window reference\n\t * @param className The selector string e.g .menu-item\n\t */\n\tconstructor(childWin: Window, className: string) {\n\t\tthis.childWin = childWin;\n\t\tthis.className = className;\n\t\tthis.onArrowDown = this.onArrowDown.bind(this);\n\t\tthis.onArrowUp = this.onArrowUp.bind(this);\n\t\tthis.onArrowRight = this.onArrowRight.bind(this);\n\t\tthis.onArrowLeft = this.onArrowLeft.bind(this);\n\t\tthis.clickOnItem = this.clickOnItem.bind(this);\n\t\tthis.focusOnFirst = this.focusOnFirst.bind(this);\n\t\tthis.focusOnLast = this.focusOnLast.bind(this);\n\t\tthis.resetFocusOnDOMChanges();\n\t}\n\n\t/**\n\t * A mutation observer to watch changes in the DOM\n\t * and set the selectedIndex to undefined when changes\n\t * observed. We want to start focusing from element with index 0\n\t * when the elements order changes.\n\t */\n\tprivate resetFocusOnDOMChanges() {\n\t\tnew MutationObserver(() => {\n\t\t\t// Reset selectedIndex when elements added or removed\n\t\t\t// from the DOM. The motivation behind this was an issue\n\t\t\t// with Brad's search menu where the order of focus is\n\t\t\t// messed up when his list of result changes.\n\t\t\tthis.selectedItem = undefined;\n\t\t}).observe(this.childWin.document.body, {\n\t\t\tchildList: true,\n\t\t\tcharacterData: false,\n\t\t\tsubtree: true,\n\t\t});\n\t}\n\n\t/**\n\t * Returns list of elements\n\t */\n\tprivate getElements() {\n\t\treturn this.childWin.document.querySelectorAll(this.className);\n\t}\n\n\tprivate getMenuItemIcons(index: number) {\n\t\tconst menuItems = this.getElements();\n\t\treturn menuItems[index].querySelectorAll(\".menu-item-icon\");\n\t}\n\n\t/**\n\t * Remove all focus classes.\n\t */\n\tprivate removeAllFocus() {\n\t\tconst menuItems = this.getElements();\n\t\tmenuItems.forEach((item: Element, key: number) => {\n\t\t\titem.removeAttribute(\"focused\");\n\t\t\tconst icons = this.getMenuItemIcons(key);\n\t\t\ticons.forEach((icon: Element) => {\n\t\t\t\ticon.removeAttribute(\"focused\");\n\t\t\t});\n\t\t});\n\t}\n\n\t/**\n\t * Sets the focus on a menu item\n\t * @param index The index of the menu item in the list\n\t */\n\tprivate focusOn(index: number) {\n\t\tthis.removeAllFocus();\n\n\t\tconst menuItems = this.getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\t\t// Focus on element and scroll if needed\n\t\tmenuItems[index].setAttribute(\"focused\", \"true\");\n\t\t(menuItems[index] as any).scrollIntoViewIfNeeded({\n\t\t\tbehavior: \"smooth\",\n\t\t});\n\t}\n\n\t/**\n\t * Sets the focus on a menu item's icon\n\t * @param index The index of the menu item in the list\n\t * @param iconIndex The index of the menu item's icon (-1 = menu text, not icon)\n\t */\n\tprivate focusOnIcon(index: number, iconIndex: number) {\n\t\tthis.removeAllFocus();\n\n\t\tconst menuItems = this.getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = this.getMenuItemIcons(index);\n\t\t// Defend against possible js runtime error\n\t\tif (icons.length < iconIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\t// scroll if needed\n\t\t(menuItems[index] as any).scrollIntoViewIfNeeded({\n\t\t\tbehavior: \"smooth\",\n\t\t});\n\t\t// Focus on menu item text, if relevant\n\t\tif (iconIndex === -1) {\n\t\t\tmenuItems[index].setAttribute(\"focused\", \"true\");\n\t\t\treturn;\n\t\t}\n\n\t\ticons[iconIndex].setAttribute(\"focused\", \"true\");\n\t}\n\n\t/**\n\t * Simulates mouse events\n\t */\n\tprivate clickOnItem() {\n\t\tthis.removeAllFocus();\n\t\tif (this.selectedItem !== undefined) {\n\t\t\tconst elements = this.getElements();\n\t\t\tconst selectedItem = elements[this.selectedItem as any];\n\t\t\t[\"mousedown\", \"click\", \"mouseup\"].forEach((event) => {\n\t\t\t\tif (this.selectedIcon > -1) {\n\t\t\t\t\tconst icons = this.getMenuItemIcons(this.selectedItem as any);\n\t\t\t\t\tconst selectedIcon = icons[this.selectedIcon as any];\n\t\t\t\t\tif (selectedIcon) {\n\t\t\t\t\t\tselectedIcon.dispatchEvent(\n\t\t\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\t\t\tview: this.childWin,\n\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\t\t\tbuttons: 1,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (selectedItem && selectedItem.dispatchEvent) {\n\t\t\t\t\tselectedItem.dispatchEvent(\n\t\t\t\t\t\tnew MouseEvent(event, {\n\t\t\t\t\t\t\tview: this.childWin,\n\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\tcancelable: true,\n\t\t\t\t\t\t\tbuttons: 1,\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\t/**\n\t\t\t * When an element is selected we reset the menu to focus on the first item.\n\t\t\t * Per Dan Nicolai UX specialist.\n\t\t\t */\n\t\t\tthis.selectedItem = undefined;\n\t\t}\n\t}\n\n\t/**\n\t * Invoked when a user presses on the arrow up key\n\t */\n\tprivate onArrowUp() {\n\t\t// On first key up/down press, we want\n\t\t// the focus to be on first item\n\t\tif (this.selectedItem === undefined) {\n\t\t\tthis.selectedItem = 0;\n\t\t\treturn this.focusOn(0);\n\t\t}\n\t\t// Set the focus on the previous item\n\t\tthis.selectedItem--;\n\t\tif (this.selectedItem < 0) {\n\t\t\t// If we are back to the begining\n\t\t\t// set the focus on last item\n\t\t\tthis.selectedItem = this.getElements().length - 1;\n\t\t}\n\t\tthis.focusOn(this.selectedItem);\n\t}\n\n\t/**\n\t * Invoked when user press the arrow down key\n\t */\n\tprivate onArrowDown() {\n\t\tif (this.selectedItem === undefined) {\n\t\t\tthis.selectedItem = 0;\n\t\t\treturn this.focusOn(0);\n\t\t}\n\t\t// The the focus on the next item\n\t\tthis.selectedItem++;\n\t\t// If we reached the end, then go back to first item\n\t\tif (this.selectedItem === this.getElements().length) {\n\t\t\tthis.selectedItem = 0;\n\t\t}\n\t\tthis.focusOn(this.selectedItem);\n\t}\n\n\t/**\n\t * Invoked when user press the arrow right key\n\t */\n\tprivate onArrowRight() {\n\t\tif (this.selectedItem === undefined) {\n\t\t\tthis.selectedItem = 0;\n\t\t\treturn this.focusOn(0);\n\t\t}\n\n\t\tconst menuItems = this.getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = this.getMenuItemIcons(this.selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.selectedIcon++;\n\t\tif (this.selectedIcon === icons.length) {\n\t\t\tthis.selectedIcon = -1;\n\t\t}\n\t\tthis.focusOnIcon(this.selectedItem, this.selectedIcon);\n\t}\n\n\t/**\n\t * Invoked when user press the arrow left key\n\t */\n\tprivate onArrowLeft() {\n\t\tif (this.selectedItem === undefined) {\n\t\t\tthis.selectedItem = 0;\n\t\t\treturn this.focusOn(0);\n\t\t}\n\n\t\tconst menuItems = this.getElements();\n\t\t// Menu could have no items\n\t\tif (!menuItems.length) return;\n\n\t\tconst icons = this.getMenuItemIcons(this.selectedItem);\n\t\tif (icons.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.selectedIcon--;\n\t\tif (this.selectedIcon === icons.length) {\n\t\t\tthis.selectedIcon = -1;\n\t\t}\n\t\tthis.focusOnIcon(this.selectedItem, this.selectedIcon);\n\t}\n\n\tprivate focusOnFirst() {\n\t\tthis.selectedItem = 0;\n\t\tthis.selectedIcon = -1;\n\t\tthis.focusOn(0);\n\t}\n\n\tprivate focusOnLast() {\n\t\tthis.selectedIcon = -1;\n\t\tconst { length } = this.getElements();\n\t\tif (length) {\n\t\t\tthis.selectedItem = length - 1;\n\t\t\tthis.focusOn(length - 1);\n\t\t}\n\t}\n\n\t/**\n\t * Adds global hot keys for up/down arrow\n\t */\n\tpublic attach() {\n\t\t// Register hotkeys\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"up arrow\"], this.onArrowUp);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"right arrow\"], this.onArrowRight);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"left arrow\"], this.onArrowLeft);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"down arrow\"], this.onArrowDown);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"return\"], this.clickOnItem);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"home\"], this.focusOnFirst);\n\t\tFSBL.Clients.HotkeyClient.addGlobalHotkey([\"end\"], this.focusOnLast);\n\t}\n\n\t/**\n\t * Remove global got keys for up/down arrow\n\t */\n\tpublic detach() {\n\t\t// Remove registered hotkeys\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"up arrow\"], this.onArrowUp);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"right arrow\"], this.onArrowRight);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"left arrow\"], this.onArrowLeft);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"down arrow\"], this.onArrowDown);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"return\"], this.clickOnItem);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"home\"], this.focusOnFirst);\n\t\tFSBL.Clients.HotkeyClient.removeGlobalHotkey([\"end\"], this.focusOnLast);\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menuContext.js","sourceRoot":"","sources":["../../../src/components/menu/menuContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAkB,EAAqB,CAAC,CAAC","sourcesContent":["import { createContext } from \"react\";\r\n\r\ntype MenuContextType = {\r\n\tthisMenuId: string;\r\n\tclassName: string | undefined;\r\n\tmaxHeight: number;\r\n\tmenuWidth: number;\r\n\tmenuHeight: number | undefined;\r\n};\r\n\r\n/**\r\n * We initialize our context with an empty object because we know that MenuShell will\r\n * properly initialize our context at runtime (during the first render). We cast () to MenuContextType\r\n * to avoid typescript errors for any consumers of the context object. Beware that if you get a runtime error\r\n * then someone has probably missed an initialization in MenuShell.\r\n */\r\nexport const MenuContext = createContext<MenuContextType>({} as MenuContextType);\r\n"]}
1
+ {"version":3,"file":"menuContext.js","sourceRoot":"","sources":["../../../src/components/menu/menuContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAgBtC,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAkB,EAAqB,CAAC,CAAC","sourcesContent":["import { createContext } from \"react\";\n\ntype MenuContextType = {\n\tthisMenuId: string;\n\tclassName: string | undefined;\n\tmaxHeight: number;\n\tmenuWidth: number;\n\tmenuHeight: number | undefined;\n};\n\n/**\n * We initialize our context with an empty object because we know that MenuShell will\n * properly initialize our context at runtime (during the first render). We cast () to MenuContextType\n * to avoid typescript errors for any consumers of the context object. Beware that if you get a runtime error\n * then someone has probably missed an initialization in MenuShell.\n */\nexport const MenuContext = createContext<MenuContextType>({} as MenuContextType);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"menuHelpers.js","sourceRoot":"","sources":["../../../src/components/menu/menuHelpers.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,GAAG,GAAG,CAAC;AASvB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EACrC,MAAc,EACd,iBAA0B,EAIxB,EAAE;IAIJ,MAAM,aAAa,GAAiB,QAAQ,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAE,CAAC,YAAY,CAAC;IAI1G,MAAM,EAAE,WAAW,EAAE,GAAW,MAAM,CAAC,MAAM,CAAC;IAE9C,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC;IACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;IAClC,MAAM,iBAAiB,GAAG,WAAW,GAAG,QAAQ,GAAG,aAAa,CAAC;IAMjE,MAAM,QAAQ,GAAG,IAAI,MAAM,cAAc,CAAC;IAC1C,MAAM,UAAU,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACpD,IAAI,CAAC,UAAU,EAAE;QAChB,OAAO,CAAC,KAAK,CAAC,4CAA4C,QAAQ,GAAG,CAAC,CAAC;KACvE;IAID,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC,CA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Q,EAAE;IACtD,MAAM,EAAE,QAAQ,EAAE,GAAQ,QAAQ,CAAC,IAAI,CAAC;IACxC,MAAM,aAAa,GAAkB,EAAE,CAAC;IACxC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE;QAK5B,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM,EAAE;YAC5E,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAClD,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAC/B;KACD;IACD,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Minimum portal height (chromium limitation)\r\nconst MIN_HEIGHT = 100;\r\n\r\n/**\r\n * Returns a drop down menu's position relative to the toolbar's current location and the\r\n * MenuToggle that was pressed. The dimensions returned are relative to the toolbar's\r\n * current monitor.\r\n * @param menuId The shell ID (e.g. filemenu)\r\n * @param menuContentHeight The height of menu contents.\r\n */\r\nexport const calculatePosition = async (\r\n\tmenuId: string,\r\n\tmenuContentHeight?: number\r\n): Promise<{\r\n\ttop: number;\r\n\tleft: number;\r\n}> => {\r\n\t// Rather than use window.innerHeight, we use the height of the document because Electron at times fails\r\n\t// to resize windows across monitors with different DPI scaling. We've worked around this by calling setShape()\r\n\t// to avoid a white bar at the bottom of the window, but the window DOM height is still the old height.\r\n\tconst toolbarHeight = (<HTMLElement>document.getElementsByClassName(\"finsemble-toolbar\")[0]).offsetHeight;\r\n\r\n\t// The monitor's available height and width is found in the window.screen object (just like Electron, less the space\r\n\t// taken up by the operating system toolbar)\r\n\tconst { availHeight }: Screen = window.screen;\r\n\r\n\tconst toolbarX = window.screenLeft;\r\n\tconst toolbarY = window.screenTop;\r\n\tconst spaceBelowToolbar = availHeight - toolbarY - toolbarHeight;\r\n\r\n\t/*\r\n\tGet a reference to the MenuToggle's element using querySelector to avoid having to pass\r\n\tReact ref all the way down here.\r\n\t*/\r\n\tconst selector = `#${menuId}-menu-toggle`;\r\n\tconst menuToggle = document.querySelector(selector);\r\n\tif (!menuToggle) {\r\n\t\tconsole.error(`calculatePosition() can't find selector \"${selector}\"`);\r\n\t}\r\n\r\n\t// Get the \"x\" coordinate of our toggle button *within* the toolbar\r\n\t// If for whatever reason the menuToggle can't be found, then default to an x coordinate of zero\r\n\tconst { x: menuToggleX } = menuToggle ? menuToggle.getBoundingClientRect() : { x: 0 };\r\n\r\n\tlet left = toolbarX + menuToggleX;\r\n\tlet top = toolbarY + toolbarHeight;\r\n\t/*\r\n\tCheck if we have enough space for the menu between\r\n\tthe toolbar and bottom edge of the screen. If not,\r\n\tthen reposition the menu to appear above toolbar.\r\n\t*/\r\n\tif (menuContentHeight) {\r\n\t\tconst menuHeight = Math.max(menuContentHeight, MIN_HEIGHT);\r\n\t\tif (menuHeight > spaceBelowToolbar) {\r\n\t\t\ttop = toolbarY - menuHeight;\r\n\t\t}\r\n\t}\r\n\r\n\treturn {\r\n\t\ttop,\r\n\t\tleft,\r\n\t};\r\n};\r\n\r\n/**\r\n * Calculates the height and position that a window should take based on the height necessary to display\r\n * the window's DOM contents without scrollbars, but not beyond the scope of the monitor itself.\r\n *\r\n * @param childWindow Window The window to calculate\r\n * @param menuId string The id of the menu, used for a CSS selector\r\n * @param [maxHeight] Maximum height for the window\r\n * @param [fixedHeight] Optional fixed height\r\n */\r\nexport const calculateDimensions = async (\r\n\tchildWindow: Window,\r\n\tmenuId: string,\r\n\tfixedHeight: number = 0,\r\n\tmaxHeight: number = Infinity\r\n): Promise<{\r\n\ttop: number;\r\n\tleft: number;\r\n\theight: number;\r\n}> => {\r\n\t/* Content height is essentially the offsetHeight of the window's <html> element.\r\n\tThis seems more reliable than summing the heights of all body children.\r\n\t*/\r\n\tconst contentHeight = childWindow.document.documentElement.offsetHeight;\r\n\r\n\t/**\r\n\t * Calculate the actual menu height, constrained by maximum and minimum sizes.\r\n\t * Zero, null or undefined are invalid maximum heights.\r\n\t *\r\n\t * Chromium imposes a 100 pixel minimum on window height.\r\n\t */\r\n\tconst CHROMIUM_MIN_HEIGHT = 100;\r\n\tconst minimumContentHeight = Math.max(contentHeight, CHROMIUM_MIN_HEIGHT);\r\n\tconst height = fixedHeight ? fixedHeight : Math.min(minimumContentHeight, maxHeight);\r\n\r\n\tconst { left, top } = await calculatePosition(menuId, height);\r\n\r\n\t// Final step, make sure the menu isn't larger than the screen itself\r\n\tconst { availHeight }: Screen = window.screen;\r\n\tconst finalHeight = Math.min(height, availHeight);\r\n\r\n\treturn {\r\n\t\ttop,\r\n\t\tleft,\r\n\t\theight: finalHeight,\r\n\t};\r\n};\r\n\r\n/**\r\n * Copy CSS elements from parent to child window. Portals operate in a new window which doesn't automatically\r\n * have access to the CSS from the main window, so we need to clone those elements into the menu's window\r\n * when it is created.\r\n * @param childWindow Child window reference\r\n */\r\nexport const injectCSS = (childWindow: Window): void => {\r\n\tconst { children }: any = document.head;\r\n\tconst styleElements: HTMLElement[] = [];\r\n\tfor (const item in children) {\r\n\t\t/** \r\n\t\t\twebpack's style-loader creates <style> tags but some versions will create <link> tags if CSS source maps are \r\n\t\t\tenabled (sourceMap), or if `injectType: linkTag` is configured.\r\n \t*/\r\n\t\tif (children[item].tagName === \"STYLE\" || children[item].tagName === \"LINK\") {\r\n\t\t\tconst newElement = children[item].cloneNode(true);\r\n\t\t\tstyleElements.push(newElement);\r\n\t\t}\r\n\t}\r\n\tstyleElements.forEach((item) => {\r\n\t\tchildWindow.document.head.append(item);\r\n\t});\r\n};\r\n"]}
1
+ {"version":3,"file":"menuHelpers.js","sourceRoot":"","sources":["../../../src/components/menu/menuHelpers.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,GAAG,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E;QAC9B,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Minimum portal height (chromium limitation)\nconst MIN_HEIGHT = 100;\n\n/**\n * Returns a drop down menu's position relative to the toolbar's current location and the\n * MenuToggle that was pressed. The dimensions returned are relative to the toolbar's\n * current monitor.\n * @param menuId The shell ID (e.g. filemenu)\n * @param menuContentHeight The height of menu contents.\n */\nexport const calculatePosition = async (\n\tmenuId: string,\n\tmenuContentHeight?: number\n): Promise<{\n\ttop: number;\n\tleft: number;\n}> => {\n\t// Rather than use window.innerHeight, we use the height of the document because Electron at times fails\n\t// to resize windows across monitors with different DPI scaling. We've worked around this by calling setShape()\n\t// to avoid a white bar at the bottom of the window, but the window DOM height is still the old height.\n\tconst toolbarHeight = (<HTMLElement>document.getElementsByClassName(\"finsemble-toolbar\")[0]).offsetHeight;\n\n\t// The monitor's available height and width is found in the window.screen object (just like Electron, less the space\n\t// taken up by the operating system toolbar)\n\tconst { availHeight }: Screen = window.screen;\n\n\tconst toolbarX = window.screenLeft;\n\tconst toolbarY = window.screenTop;\n\tconst spaceBelowToolbar = availHeight - toolbarY - toolbarHeight;\n\n\t/*\n\tGet a reference to the MenuToggle's element using querySelector to avoid having to pass\n\tReact ref all the way down here.\n\t*/\n\tconst selector = `#${menuId}-menu-toggle`;\n\tconst menuToggle = document.querySelector(selector);\n\tif (!menuToggle) {\n\t\tconsole.error(`calculatePosition() can't find selector \"${selector}\"`);\n\t}\n\n\t// Get the \"x\" coordinate of our toggle button *within* the toolbar\n\t// If for whatever reason the menuToggle can't be found, then default to an x coordinate of zero\n\tconst { x: menuToggleX } = menuToggle ? menuToggle.getBoundingClientRect() : { x: 0 };\n\n\tlet left = toolbarX + menuToggleX;\n\tlet top = toolbarY + toolbarHeight;\n\t/*\n\tCheck if we have enough space for the menu between\n\tthe toolbar and bottom edge of the screen. If not,\n\tthen reposition the menu to appear above toolbar.\n\t*/\n\tif (menuContentHeight) {\n\t\tconst menuHeight = Math.max(menuContentHeight, MIN_HEIGHT);\n\t\tif (menuHeight > spaceBelowToolbar) {\n\t\t\ttop = toolbarY - menuHeight;\n\t\t}\n\t}\n\n\treturn {\n\t\ttop,\n\t\tleft,\n\t};\n};\n\n/**\n * Calculates the height and position that a window should take based on the height necessary to display\n * the window's DOM contents without scrollbars, but not beyond the scope of the monitor itself.\n *\n * @param childWindow Window The window to calculate\n * @param menuId string The id of the menu, used for a CSS selector\n * @param [maxHeight] Maximum height for the window\n * @param [fixedHeight] Optional fixed height\n */\nexport const calculateDimensions = async (\n\tchildWindow: Window,\n\tmenuId: string,\n\tfixedHeight: number = 0,\n\tmaxHeight: number = Infinity\n): Promise<{\n\ttop: number;\n\tleft: number;\n\theight: number;\n}> => {\n\t/* Content height is essentially the offsetHeight of the window's <html> element.\n\tThis seems more reliable than summing the heights of all body children.\n\t*/\n\tconst contentHeight = childWindow.document.documentElement.offsetHeight;\n\n\t/**\n\t * Calculate the actual menu height, constrained by maximum and minimum sizes.\n\t * Zero, null or undefined are invalid maximum heights.\n\t *\n\t * Chromium imposes a 100 pixel minimum on window height.\n\t */\n\tconst CHROMIUM_MIN_HEIGHT = 100;\n\tconst minimumContentHeight = Math.max(contentHeight, CHROMIUM_MIN_HEIGHT);\n\tconst height = fixedHeight ? fixedHeight : Math.min(minimumContentHeight, maxHeight);\n\n\tconst { left, top } = await calculatePosition(menuId, height);\n\n\t// Final step, make sure the menu isn't larger than the screen itself\n\tconst { availHeight }: Screen = window.screen;\n\tconst finalHeight = Math.min(height, availHeight);\n\n\treturn {\n\t\ttop,\n\t\tleft,\n\t\theight: finalHeight,\n\t};\n};\n\n/**\n * Copy CSS elements from parent to child window. Portals operate in a new window which doesn't automatically\n * have access to the CSS from the main window, so we need to clone those elements into the menu's window\n * when it is created.\n * @param childWindow Child window reference\n */\nexport const injectCSS = (childWindow: Window): void => {\n\tconst { children }: any = document.head;\n\tconst styleElements: HTMLElement[] = [];\n\tfor (const item in children) {\n\t\t/** \n\t\t\twebpack's style-loader creates <style> tags but some versions will create <link> tags if CSS source maps are \n\t\t\tenabled (sourceMap), or if `injectType: linkTag` is configured.\n \t*/\n\t\tif (children[item].tagName === \"STYLE\" || children[item].tagName === \"LINK\") {\n\t\t\tconst newElement = children[item].cloneNode(true);\n\t\t\tstyleElements.push(newElement);\n\t\t}\n\t}\n\tstyleElements.forEach((item) => {\n\t\tchildWindow.document.head.append(item);\n\t});\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NoNotifications.js","sourceRoot":"","sources":["../../../../src/components/notifications/components/NoNotifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAe,GAA4B,GAAG,EAAE,CAAC,CACtD,6BAAK,SAAS,EAAC,kBAAkB;IAChC,6DAAkC,CAC7B,CACN,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import React from \"react\";\r\n\r\nconst NoNotifications: React.FunctionComponent = () => (\r\n\t<div className=\"no-notifications\">\r\n\t\t<p>No notifications to display</p>\r\n\t</div>\r\n);\r\n\r\nexport default NoNotifications;\r\n"]}
1
+ {"version":3,"file":"NoNotifications.js","sourceRoot":"","sources":["../../../../src/components/notifications/components/NoNotifications.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAe,GAA4B,GAAG,EAAE,CAAC,CACtD,6BAAK,SAAS,EAAC,kBAAkB;IAChC,6DAAkC,CAC7B,CACN,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import React from \"react\";\n\nconst NoNotifications: React.FunctionComponent = () => (\n\t<div className=\"no-notifications\">\n\t\t<p>No notifications to display</p>\n\t</div>\n);\n\nexport default NoNotifications;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,MAAM,GAAmC,CAAC,KAAY,EAAE,EAAE,CAAC,CAChE,6BAAK,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAE,KAAK,CAAC,UAAU;IAC3C,6BAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,QAAQ,CAAO,CACnD,CACN,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import React from \"react\";\r\n\r\ninterface Props {\r\n\tclassNames?: string;\r\n\tchildren?: React.ReactNode;\r\n}\r\n\r\nconst Drawer: React.FunctionComponent<Props> = (props: Props) => (\r\n\t<div id=\"drawer\" className={props.classNames}>\r\n\t\t<div className=\"drawer-container\">{props.children}</div>\r\n\t</div>\r\n);\r\n\r\nexport default Drawer;\r\n"]}
1
+ {"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,MAAM,GAAmC,CAAC,KAAY,EAAE,EAAE,CAAC,CAChE,6BAAK,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAE,KAAK,CAAC,UAAU;IAC3C,6BAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,QAAQ,CAAO,CACnD,CACN,CAAC;AAEF,eAAe,MAAM,CAAC","sourcesContent":["import React from \"react\";\n\ninterface Props {\n\tclassNames?: string;\n\tchildren?: React.ReactNode;\n}\n\nconst Drawer: React.FunctionComponent<Props> = (props: Props) => (\n\t<div id=\"drawer\" className={props.classNames}>\n\t\t<div className=\"drawer-container\">{props.children}</div>\n\t</div>\n);\n\nexport default Drawer;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerControls.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/DrawerControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM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AE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aAGlG;YAEN,6BAAK,SAAS,EAAC,0CAA0C;gBACxD,oBAAC,UAAU,IACV,QAAQ,EAAC,gBAAgB,EACzB,UAAU,EAAE,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACtD,YAAY,EAAE,GAAG,EAAE;wBAClB,gBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;wBAC7C,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC,GACA;gBACF,oBAAC,UAAU,IACV,QAAQ,EAAC,kBAAkB,EAC3B,UAAU,EAAE,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACtD,YAAY,EAAE,GAAG,EAAE;wBAClB,gBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;wBAC7C,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC,GACA,CACG,CACD,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useContext } from \"react\";\r\n\r\n// Context\r\nimport { NotificationsContext } from \"../../notificationsContext\";\r\n\r\n// Types & Constants\r\nimport { Control } from \"../../types\";\r\nimport { ViewMode, SelectionMode } from \"../../constants\";\r\n\r\n// Hooks\r\nimport {\r\n\tmarkNotificationsRead,\r\n\tmarkNotificationsUnread,\r\n\tdismissNotification,\r\n\tsnoozeNotifications,\r\n} from \"../../../../hooks/useNotifications\";\r\n\r\n// Components\r\nimport IconButton from \"../shared/IconButton\";\r\n\r\nconst DrawerControls: React.FunctionComponent = () => {\r\n\tconst notificationsContext = useContext(NotificationsContext);\r\n\tconst {\r\n\t\tviewMode,\r\n\t\tsetViewMode,\r\n\t\tdrawerControlProps,\r\n\t\tsetDrawerControlProps,\r\n\t\tselectionMode,\r\n\t\tsetSelectionMode,\r\n\t\tcheckedNotifications,\r\n\t} = notificationsContext;\r\n\r\n\tconst toggleControl = (clickedControl: Control) => {\r\n\t\t// If we click on the control aready active, then there's nothing to toggle and we bail out.\r\n\t\tif (clickedControl.action === drawerControlProps.active) return;\r\n\t\tdrawerControlProps.controls.forEach((control: Control) => {\r\n\t\t\tif (control.action === clickedControl.action) {\r\n\t\t\t\tif (drawerControlProps.active === control.action) {\r\n\t\t\t\t\tdelete drawerControlProps.active;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tdrawerControlProps.active = control.action;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t\tsetDrawerControlProps({ ...drawerControlProps });\r\n\t};\r\n\r\n\tconst renderControls = () => {\r\n\t\tlet className = \"notifications-center-controls__filter-btn\";\r\n\t\treturn drawerControlProps.controls.map((control: Control) => (\r\n\t\t\t<div\r\n\t\t\t\tkey={control.action}\r\n\t\t\t\tclassName={`${className} ${drawerControlProps.active === control.action ? \"active\" : \"\"}`}\r\n\t\t\t\tonClick={() => toggleControl(control)}\r\n\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { pointerEvents: \"none\", opacity: \"0.4\" } : {}}\r\n\t\t\t>\r\n\t\t\t\t{control.label}\r\n\t\t\t</div>\r\n\t\t));\r\n\t};\r\n\r\n\tconst toggleSelect = () => {\r\n\t\tsetSelectionMode(\r\n\t\t\tselectionMode === SelectionMode.NO_SELECTION ? SelectionMode.SELECTION : SelectionMode.NO_SELECTION\r\n\t\t);\r\n\t};\r\n\r\n\tconst readChecked = () => {\r\n\t\tmarkNotificationsRead(checkedNotifications);\r\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t};\r\n\r\n\tconst unreadChecked = () => {\r\n\t\tmarkNotificationsUnread(checkedNotifications);\r\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t};\r\n\r\n\tconst hideChecked = () => {\r\n\t\tdismissNotification(checkedNotifications);\r\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t};\r\n\r\n\tconst snoozeChecked = () => {\r\n\t\tsnoozeNotifications(checkedNotifications);\r\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div id=\"notifications-center-controls\">\r\n\t\t\t<div className=\"notifications-center-controls__row\">{renderControls()}</div>\r\n\t\t\t<div className=\"notifications-center-controls__row\">\r\n\t\t\t\t<div className=\"notifications-center-controls__filter-btn\" onClick={() => toggleSelect()}>\r\n\t\t\t\t\t<i\r\n\t\t\t\t\t\tclassName={selectionMode === SelectionMode.NO_SELECTION ? \"ff-check-mark\" : \"ff-close\"}\r\n\t\t\t\t\t\tstyle={{\r\n\t\t\t\t\t\t\tpaddingRight: \"5px\",\r\n\t\t\t\t\t\t\tcolor: selectionMode === SelectionMode.NO_SELECTION ? \"var(--accent-positive)\" : \"\",\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\tSelect\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\r\n\t\t\t\t\tonClick={() => readChecked()}\r\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\r\n\t\t\t\t>\r\n\t\t\t\t\tMark Read\r\n\t\t\t\t</div>\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\r\n\t\t\t\t\tonClick={() => unreadChecked()}\r\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\r\n\t\t\t\t>\r\n\t\t\t\t\tMark Unread\r\n\t\t\t\t</div>\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\r\n\t\t\t\t\tonClick={() => hideChecked()}\r\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\r\n\t\t\t\t>\r\n\t\t\t\t\tHide\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\r\n\t\t\t\t\tonClick={() => snoozeChecked()}\r\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\r\n\t\t\t\t>\r\n\t\t\t\t\tSnooze\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<div className=\"notifications-center-controls__view_mode\">\r\n\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\ticonName=\"ff-chart-alt-2\"\r\n\t\t\t\t\t\tclassNames={viewMode === ViewMode.CARD ? \"active\" : \"\"}\r\n\t\t\t\t\t\tclickHandler={() => {\r\n\t\t\t\t\t\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t\t\t\t\t\t\tsetViewMode(ViewMode.CARD);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t<IconButton\r\n\t\t\t\t\t\ticonName=\"ff-adp-hamburger\"\r\n\t\t\t\t\t\tclassNames={viewMode === ViewMode.LIST ? \"active\" : \"\"}\r\n\t\t\t\t\t\tclickHandler={() => {\r\n\t\t\t\t\t\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\r\n\t\t\t\t\t\t\tsetViewMode(ViewMode.LIST);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DrawerControls;\r\n"]}
1
+ {"version":3,"file":"DrawerControls.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/DrawerControls.tsx"],"names":[],"mappings":"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,GAAG,EAAE,CAAC,aAAa,EAAE,EAC9B,KAAK,EAAE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,aAGlG;YAEN,6BAAK,SAAS,EAAC,0CAA0C;gBACxD,oBAAC,UAAU,IACV,QAAQ,EAAC,gBAAgB,EACzB,UAAU,EAAE,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACtD,YAAY,EAAE,GAAG,EAAE;wBAClB,gBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;wBAC7C,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC,GACA;gBACF,oBAAC,UAAU,IACV,QAAQ,EAAC,kBAAkB,EAC3B,UAAU,EAAE,QAAQ,KAAK,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EACtD,YAAY,EAAE,GAAG,EAAE;wBAClB,gBAAgB,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;wBAC7C,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;oBAC5B,CAAC,GACA,CACG,CACD,CACD,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useContext } from \"react\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Types & Constants\nimport { Control } from \"../../types\";\nimport { ViewMode, SelectionMode } from \"../../constants\";\n\n// Hooks\nimport {\n\tmarkNotificationsRead,\n\tmarkNotificationsUnread,\n\tdismissNotification,\n\tsnoozeNotifications,\n} from \"../../../../hooks/useNotifications\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\n\nconst DrawerControls: React.FunctionComponent = () => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst {\n\t\tviewMode,\n\t\tsetViewMode,\n\t\tdrawerControlProps,\n\t\tsetDrawerControlProps,\n\t\tselectionMode,\n\t\tsetSelectionMode,\n\t\tcheckedNotifications,\n\t} = notificationsContext;\n\n\tconst toggleControl = (clickedControl: Control) => {\n\t\t// If we click on the control aready active, then there's nothing to toggle and we bail out.\n\t\tif (clickedControl.action === drawerControlProps.active) return;\n\t\tdrawerControlProps.controls.forEach((control: Control) => {\n\t\t\tif (control.action === clickedControl.action) {\n\t\t\t\tif (drawerControlProps.active === control.action) {\n\t\t\t\t\tdelete drawerControlProps.active;\n\t\t\t\t} else {\n\t\t\t\t\tdrawerControlProps.active = control.action;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tsetDrawerControlProps({ ...drawerControlProps });\n\t};\n\n\tconst renderControls = () => {\n\t\tlet className = \"notifications-center-controls__filter-btn\";\n\t\treturn drawerControlProps.controls.map((control: Control) => (\n\t\t\t<div\n\t\t\t\tkey={control.action}\n\t\t\t\tclassName={`${className} ${drawerControlProps.active === control.action ? \"active\" : \"\"}`}\n\t\t\t\tonClick={() => toggleControl(control)}\n\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { pointerEvents: \"none\", opacity: \"0.4\" } : {}}\n\t\t\t>\n\t\t\t\t{control.label}\n\t\t\t</div>\n\t\t));\n\t};\n\n\tconst toggleSelect = () => {\n\t\tsetSelectionMode(\n\t\t\tselectionMode === SelectionMode.NO_SELECTION ? SelectionMode.SELECTION : SelectionMode.NO_SELECTION\n\t\t);\n\t};\n\n\tconst readChecked = () => {\n\t\tmarkNotificationsRead(checkedNotifications);\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t};\n\n\tconst unreadChecked = () => {\n\t\tmarkNotificationsUnread(checkedNotifications);\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t};\n\n\tconst hideChecked = () => {\n\t\tdismissNotification(checkedNotifications);\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t};\n\n\tconst snoozeChecked = () => {\n\t\tsnoozeNotifications(checkedNotifications);\n\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t};\n\n\treturn (\n\t\t<div id=\"notifications-center-controls\">\n\t\t\t<div className=\"notifications-center-controls__row\">{renderControls()}</div>\n\t\t\t<div className=\"notifications-center-controls__row\">\n\t\t\t\t<div className=\"notifications-center-controls__filter-btn\" onClick={() => toggleSelect()}>\n\t\t\t\t\t<i\n\t\t\t\t\t\tclassName={selectionMode === SelectionMode.NO_SELECTION ? \"ff-check-mark\" : \"ff-close\"}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tpaddingRight: \"5px\",\n\t\t\t\t\t\t\tcolor: selectionMode === SelectionMode.NO_SELECTION ? \"var(--accent-positive)\" : \"\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\tSelect\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\n\t\t\t\t\tonClick={() => readChecked()}\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\n\t\t\t\t>\n\t\t\t\t\tMark Read\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\n\t\t\t\t\tonClick={() => unreadChecked()}\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\n\t\t\t\t>\n\t\t\t\t\tMark Unread\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\n\t\t\t\t\tonClick={() => hideChecked()}\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\n\t\t\t\t>\n\t\t\t\t\tHide\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"notifications-center-controls__filter-btn active\"\n\t\t\t\t\tonClick={() => snoozeChecked()}\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { visibility: \"visible\" } : { visibility: \"hidden\" }}\n\t\t\t\t>\n\t\t\t\t\tSnooze\n\t\t\t\t</div>\n\n\t\t\t\t<div className=\"notifications-center-controls__view_mode\">\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\ticonName=\"ff-chart-alt-2\"\n\t\t\t\t\t\tclassNames={viewMode === ViewMode.CARD ? \"active\" : \"\"}\n\t\t\t\t\t\tclickHandler={() => {\n\t\t\t\t\t\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t\t\t\t\t\t\tsetViewMode(ViewMode.CARD);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\ticonName=\"ff-adp-hamburger\"\n\t\t\t\t\t\tclassNames={viewMode === ViewMode.LIST ? \"active\" : \"\"}\n\t\t\t\t\t\tclickHandler={() => {\n\t\t\t\t\t\t\tsetSelectionMode(SelectionMode.NO_SELECTION);\n\t\t\t\t\t\t\tsetViewMode(ViewMode.LIST);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DrawerControls;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerHeader.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAGvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAM,uBAAuB,GAAG,CAAC,EAAE,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S,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,EAAE,EAAC,8BAA8B;QACrC,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,UAAU,EAAC,UAAU,GAAG;QACzD,+BACC,SAAS,EAAC,6BAA6B,EACvC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,sBAAsB,EACnC,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,YAAY,GACrB;QACF,oBAAC,UAAU,IAAC,QAAQ,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,aAAa,EAAC,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,IAC7G,QAAQ,CAAC,CAAC,CAAC,oBAAC,uBAAuB,IAAC,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,IAAI,CAChG;QACb,oBAAC,UAAU,IAAC,QAAQ,EAAC,sBAAsB,EAAC,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,GAAI,CACjF,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { useState, useRef, useContext } from \"react\";\r\nimport debounce from \"lodash/debounce\";\r\n\r\n// Hooks\r\nimport { useNotificationUI } from \"../../../../hooks/useNotifications\";\r\n\r\n// Components\r\nimport IconButton from \"../shared/IconButton\";\r\nimport { NotificationsContext } from \"../../notificationsContext\";\r\n\r\nconst NotificationsCenterMenu = ({ poppedOutStatus, popOutToggle }: any) => {\r\n\tconst goToSettings = () => {\r\n\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\r\n\t\t\tpreferencesTab: \"Notifications\",\r\n\t\t});\r\n\t\tFSBL.Clients.LauncherClient.showWindow(\r\n\t\t\t{\r\n\t\t\t\tcomponentType: \"UserPreferences\",\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tmonitor: \"mine\",\r\n\t\t\t\tleft: \"center\",\r\n\t\t\t\ttop: \"center\",\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div className=\"overflow-menu__container\">\r\n\t\t\t<div className=\"overflow-menu__action\" onClick={popOutToggle}>\r\n\t\t\t\t<div className=\"finsemble-icon\">\r\n\t\t\t\t\t<i className={`ff-${poppedOutStatus ? \"share\" : \"chat-popout\"}`} />\r\n\t\t\t\t</div>\r\n\t\t\t\t<span className=\"btn-label\">{poppedOutStatus ? \"Pop-in\" : \"Pop-out\"}</span>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"overflow-menu__action\" onClick={goToSettings}>\r\n\t\t\t\t<div className=\"finsemble-icon\">\r\n\t\t\t\t\t<i className=\"ff-settings\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<span className=\"btn-label\">Settings</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nconst DrawerHeader: React.FunctionComponent<{\r\n\tpoppedOutStatus: boolean;\r\n\tpopOutToggle: Function;\r\n}> = ({ poppedOutStatus, popOutToggle }) => {\r\n\tconst [uiState, setUIState] = useNotificationUI();\r\n\tconst notificationsContext = useContext(NotificationsContext);\r\n\tconst { searchString, setSearchString } = notificationsContext;\r\n\r\n\tconst [searchInputValue, setSearchInputValue] = useState(searchString);\r\n\r\n\tconst [showMenu, setShowMenu] = useState(false);\r\n\r\n\tconst closeDrawerClick = () => {\r\n\t\tsetUIState({\r\n\t\t\t...uiState,\r\n\t\t\tshowCenter: false,\r\n\t\t});\r\n\t};\r\n\r\n\tconst toggleMenu = () => {\r\n\t\tsetShowMenu(!showMenu);\r\n\t};\r\n\r\n\t// This is unchanged across renders\r\n\tconst handleSearchTerm = useRef(\r\n\t\tdebounce((nextValue: string) => {\r\n\t\t\tconst regex = /^(title|details|source):/gi;\r\n\t\t\tnextValue = nextValue.trim();\r\n\r\n\t\t\tconst isFilter = regex.test(nextValue);\r\n\t\t\tlet parsedSearchTerm = \"\";\r\n\r\n\t\t\tif (isFilter) {\r\n\t\t\t\tparsedSearchTerm = nextValue.split(\":\")[1].trim();\r\n\t\t\t} else {\r\n\t\t\t\tparsedSearchTerm = nextValue;\r\n\t\t\t}\r\n\r\n\t\t\tif (parsedSearchTerm.length > 2) {\r\n\t\t\t\tsetSearchString(nextValue);\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"search string is too short\");\r\n\t\t\t\tsetSearchString(\"\");\r\n\t\t\t}\r\n\t\t}, 400)\r\n\t).current;\r\n\r\n\tconst handleChange = (ev: any) => {\r\n\t\tconst { value: nextValue } = ev.target;\r\n\t\tsetSearchInputValue(nextValue);\r\n\t\t// Even though handleChange is created on each render and executed\r\n\t\t// it references the same handleSearchTerm that was created initially\r\n\t\thandleSearchTerm(nextValue);\r\n\t};\r\n\r\n\treturn (\r\n\t\t<div id=\"notifications-center__header\">\r\n\t\t\t<IconButton iconName=\"ff-search\" classNames=\"no-hover\" />\r\n\t\t\t<input\r\n\t\t\t\tclassName=\"search-notifications__input\"\r\n\t\t\t\ttype=\"text\"\r\n\t\t\t\tplaceholder={\"Search Notifications\"}\r\n\t\t\t\tvalue={searchInputValue}\r\n\t\t\t\tonChange={handleChange}\r\n\t\t\t/>\r\n\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" classNames=\"center-menu\" clickHandler={() => toggleMenu()}>\r\n\t\t\t\t{showMenu ? <NotificationsCenterMenu poppedOutStatus={poppedOutStatus} popOutToggle={popOutToggle} /> : null}\r\n\t\t\t</IconButton>\r\n\t\t\t<IconButton iconName=\"ff-adp-chevron-right\" clickHandler={() => closeDrawerClick()} />\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default DrawerHeader;\r\n"]}
1
+ {"version":3,"file":"DrawerHeader.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/drawer/DrawerHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,UA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,CAAC,CAAC;SACpB;IACF,CAAC,EAAE,GAAG,CAAC,CACP,CAAC,OAAO,CAAC;IAEV,MAAM,YAAY,GAAG,CAAC,EAAO,EAAE,EAAE;QAChC,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC;QACvC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAG/B,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,EAAE,EAAC,8BAA8B;QACrC,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,UAAU,EAAC,UAAU,GAAG;QACzD,+BACC,SAAS,EAAC,6BAA6B,EACvC,IAAI,EAAC,MAAM,EACX,WAAW,EAAE,sBAAsB,EACnC,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,YAAY,GACrB;QACF,oBAAC,UAAU,IAAC,QAAQ,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,UAAU,EAAC,aAAa,EAAC,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE,IAC7G,QAAQ,CAAC,CAAC,CAAC,oBAAC,uBAAuB,IAAC,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,IAAI,CAChG;QACb,oBAAC,UAAU,IAAC,QAAQ,EAAC,sBAAsB,EAAC,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,EAAE,GAAI,CACjF,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { useState, useRef, useContext } from \"react\";\nimport debounce from \"lodash/debounce\";\n\n// Hooks\nimport { useNotificationUI } from \"../../../../hooks/useNotifications\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\nimport { NotificationsContext } from \"../../notificationsContext\";\n\nconst NotificationsCenterMenu = ({ poppedOutStatus, popOutToggle }: any) => {\n\tconst goToSettings = () => {\n\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\n\t\t\tpreferencesTab: \"Notifications\",\n\t\t});\n\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t{\n\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tmonitor: \"mine\",\n\t\t\t\tleft: \"center\",\n\t\t\t\ttop: \"center\",\n\t\t\t}\n\t\t);\n\t};\n\n\treturn (\n\t\t<div className=\"overflow-menu__container\">\n\t\t\t<div className=\"overflow-menu__action\" onClick={popOutToggle}>\n\t\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t\t<i className={`ff-${poppedOutStatus ? \"share\" : \"chat-popout\"}`} />\n\t\t\t\t</div>\n\t\t\t\t<span className=\"btn-label\">{poppedOutStatus ? \"Pop-in\" : \"Pop-out\"}</span>\n\t\t\t</div>\n\t\t\t<div className=\"overflow-menu__action\" onClick={goToSettings}>\n\t\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t\t<i className=\"ff-settings\" />\n\t\t\t\t</div>\n\t\t\t\t<span className=\"btn-label\">Settings</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst DrawerHeader: React.FunctionComponent<{\n\tpoppedOutStatus: boolean;\n\tpopOutToggle: Function;\n}> = ({ poppedOutStatus, popOutToggle }) => {\n\tconst [uiState, setUIState] = useNotificationUI();\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { searchString, setSearchString } = notificationsContext;\n\n\tconst [searchInputValue, setSearchInputValue] = useState(searchString);\n\n\tconst [showMenu, setShowMenu] = useState(false);\n\n\tconst closeDrawerClick = () => {\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tshowCenter: false,\n\t\t});\n\t};\n\n\tconst toggleMenu = () => {\n\t\tsetShowMenu(!showMenu);\n\t};\n\n\t// This is unchanged across renders\n\tconst handleSearchTerm = useRef(\n\t\tdebounce((nextValue: string) => {\n\t\t\tconst regex = /^(title|details|source):/gi;\n\t\t\tnextValue = nextValue.trim();\n\n\t\t\tconst isFilter = regex.test(nextValue);\n\t\t\tlet parsedSearchTerm = \"\";\n\n\t\t\tif (isFilter) {\n\t\t\t\tparsedSearchTerm = nextValue.split(\":\")[1].trim();\n\t\t\t} else {\n\t\t\t\tparsedSearchTerm = nextValue;\n\t\t\t}\n\n\t\t\tif (parsedSearchTerm.length > 2) {\n\t\t\t\tsetSearchString(nextValue);\n\t\t\t} else {\n\t\t\t\tconsole.log(\"search string is too short\");\n\t\t\t\tsetSearchString(\"\");\n\t\t\t}\n\t\t}, 400)\n\t).current;\n\n\tconst handleChange = (ev: any) => {\n\t\tconst { value: nextValue } = ev.target;\n\t\tsetSearchInputValue(nextValue);\n\t\t// Even though handleChange is created on each render and executed\n\t\t// it references the same handleSearchTerm that was created initially\n\t\thandleSearchTerm(nextValue);\n\t};\n\n\treturn (\n\t\t<div id=\"notifications-center__header\">\n\t\t\t<IconButton iconName=\"ff-search\" classNames=\"no-hover\" />\n\t\t\t<input\n\t\t\t\tclassName=\"search-notifications__input\"\n\t\t\t\ttype=\"text\"\n\t\t\t\tplaceholder={\"Search Notifications\"}\n\t\t\t\tvalue={searchInputValue}\n\t\t\t\tonChange={handleChange}\n\t\t\t/>\n\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" classNames=\"center-menu\" clickHandler={() => toggleMenu()}>\n\t\t\t\t{showMenu ? <NotificationsCenterMenu poppedOutStatus={poppedOutStatus} popOutToggle={popOutToggle} /> : null}\n\t\t\t</IconButton>\n\t\t\t<IconButton iconName=\"ff-adp-chevron-right\" clickHandler={() => closeDrawerClick()} />\n\t\t</div>\n\t);\n};\n\nexport default DrawerHeader;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsCenter.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsCenter/NotificationsCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,M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r\nimport ConditionalWrapper from \"../../../shared/ConditionalWrapper\";\r\n\r\nimport { ViewMode, SelectionMode } from \"../../constants\";\r\n\r\nimport \"../../../../assets/css/notificationsCenter.css\";\r\n\r\n// Hooks\r\nimport useNotifications, {\r\n\tuseNotificationUI,\r\n\tgetNotificationConfig,\r\n\tmoveToToolbarMonitor,\r\n\tgetOS,\r\n\tgetFetchHistoryParams,\r\n} from \"../../../../hooks/useNotifications\";\r\n\r\n// Context\r\nimport { NotificationsContext } from \"../../notificationsContext\";\r\n\r\n// Types\r\nimport { INotificationCenterProps, NotificationCenterControlsProps, NotificationsContextType } from \"../../types\";\r\n\r\n// Components\r\nimport CardView from \"../views/CardView\";\r\nimport Drawer from \"../drawer/Drawer\";\r\nimport DrawerControls from \"../drawer/DrawerControls\";\r\nimport DrawerHeader from \"../drawer/DrawerHeader\";\r\nimport ListView from \"../views/ListView\";\r\nimport NotificationDetailsView from \"../views/NotificationDetailsView\";\r\nimport { services } from \"@finsemble/finsemble-core\";\r\n\r\ntype INotification = services.notification.types.INotification;\r\ntype IMuteFilter = services.notification.types.IMuteFilter;\r\n\r\nconst defaultControls: NotificationCenterControlsProps = {\r\n\tcontrols: [\r\n\t\t{\r\n\t\t\taction: \"all\",\r\n\t\t\tlabel: \"All\",\r\n\t\t\trun: (notifications: INotification[]) => notifications,\r\n\t\t},\r\n\t\t{\r\n\t\t\taction: \"unread\",\r\n\t\t\tlabel: \"Unread\",\r\n\t\t\trun: (notifications: INotification[]) =>\r\n\t\t\t\tnotifications.filter((notification: INotification) => !notification.isRead),\r\n\t\t},\r\n\t\t{\r\n\t\t\taction: \"read\",\r\n\t\t\tlabel: \"Read\",\r\n\t\t\trun: (notifications: INotification[]) =>\r\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isRead),\r\n\t\t},\r\n\t\t{\r\n\t\t\taction: \"snoozed\",\r\n\t\t\tlabel: \"Snoozed\",\r\n\t\t\trun: (notifications: INotification[]) =>\r\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isSnoozed),\r\n\t\t},\r\n\t],\r\n\tactive: \"all\",\r\n};\r\n\r\nconst addPoppedInClasses = () => {\r\n\tdocument.getElementById(\"notifications-center-container\")?.classList.add(\"notifications-popped-in\");\r\n\tdocument.getElementById(\"FSBLHeader\")?.classList.add(\"notifications-popped-in\");\r\n};\r\n\r\nconst removePoppedInClasses = () => {\r\n\tdocument.getElementById(\"notifications-center-container\")?.classList.remove(\"notifications-popped-in\");\r\n\tdocument.getElementById(\"FSBLHeader\")?.classList.remove(\"notifications-popped-in\");\r\n};\r\n\r\nconst storeNotificationsCenterWindowPosition = ({ showCenter, poppedOut, position }: any) => {\r\n\tFSBL.Clients.StorageClient.save({\r\n\t\ttopic: \"finsemble.notifications\",\r\n\t\tkey: \"last.position\",\r\n\t\tvalue: {\r\n\t\t\tshowCenter,\r\n\t\t\tpoppedOut,\r\n\t\t\tposition,\r\n\t\t},\r\n\t});\r\n};\r\n\r\nconst setShowWindowForState = (centerState: any) => {\r\n\tif (centerState.showCenter) {\r\n\t\tfinsembleWindow.show({}, () => {\r\n\t\t\tfinsembleWindow.bringToFront();\r\n\t\t});\r\n\t}\r\n\r\n\tif (centerState.position) {\r\n\t\tfinsembleWindow.setBounds(centerState.position);\r\n\t}\r\n\r\n\t// Always on top when popped in\r\n\tFSBL.Clients.WindowClient.setAlwaysOnTop(!centerState.poppedOut);\r\n\tstoreNotificationsCenterWindowPosition(centerState);\r\n};\r\n\r\nconst isValidPosition = (bounds: any): boolean =>\r\n\tbounds &&\r\n\ttypeof bounds.left !== \"undefined\" &&\r\n\ttypeof bounds.top !== \"undefined\" &&\r\n\ttypeof bounds.height !== \"undefined\" &&\r\n\ttypeof bounds.width !== \"undefined\";\r\n\r\nconst LAZY_LOAD_NO_MORE_PAGES = -1;\r\n\r\nexport const NotificationsCenter: React.FunctionComponent<INotificationCenterProps> = (props) => {\r\n\tconst params = { config: { notificationsHistory: { options: { pageSize: 10 } } } };\r\n\tconst { notifications, setOpaqueClassName, addNotification } = useNotifications(params);\r\n\tconst [uiState, setUIState] = useNotificationUI();\r\n\r\n\tconst config = getNotificationConfig();\r\n\tconst [isInitialized, setInitialized] = useState(false);\r\n\tconst [isMac] = useState(getOS() === \"Mac\");\r\n\tconst nextPageToFetch = useRef(1);\r\n\r\n\t// Set up references for use in callbacks to FSBL functions\r\n\tconst showCenterRef = useRef(false);\r\n\tconst poppedOutRef = useRef(false);\r\n\tconst subscriptionMessageRef = useRef<any>({});\r\n\tconst applicationState = useRef(null);\r\n\r\n\tconst checkedNotifications: INotification[] = [];\r\n\r\n\tconst [searchString, setSearchString] = useState(\"\");\r\n\tconst [filteredNotifications, setFilteredNotifications] = useState([...notifications]);\r\n\tconst [viewMode, setViewMode] = useState<ViewMode>(ViewMode.CARD);\r\n\tconst [selectionMode, setSelectionMode] = useState<SelectionMode>(SelectionMode.NO_SELECTION);\r\n\tconst [selectedNotification, setSelectedNotification] = useState<INotification | null>(null);\r\n\tconst [muteFilters, setMuteFilters] = useState<IMuteFilter[]>([]);\r\n\tconst [reloadMuteFilters, setReloadMuteFilters] = useState(true);\r\n\r\n\tconst dcp: NotificationCenterControlsProps = props.controls ? props.controls : defaultControls;\r\n\r\n\tconst [drawerControlProps, setDrawerControlProps] = useState(dcp);\r\n\tconst notificationsContextValues: NotificationsContextType = {\r\n\t\tviewMode,\r\n\t\tsetViewMode,\r\n\t\tselectionMode,\r\n\t\tsetSelectionMode,\r\n\t\tdrawerControlProps,\r\n\t\tsetDrawerControlProps,\r\n\t\tselectedNotification,\r\n\t\tsetSelectedNotification,\r\n\t\tsearchString,\r\n\t\tsetSearchString,\r\n\t\tfilteredNotifications,\r\n\t\tcheckedNotifications,\r\n\t\tsetFilteredNotifications,\r\n\t\tmuteFilters,\r\n\t\tsetMuteFilters,\r\n\t};\r\n\r\n\tconst togglePoppedStatus = () => {\r\n\t\tconst poppedOut = !uiState.poppedOut;\r\n\t\tpoppedOutRef.current = poppedOut;\r\n\t\tsetUIState({\r\n\t\t\t...uiState,\r\n\t\t\tpoppedOut,\r\n\t\t});\r\n\t};\r\n\r\n\tconst setFullHeight = async (monitorInfo?: any) => {\r\n\t\tif (!monitorInfo) {\r\n\t\t\tawait new Promise<void>((resolve) => {\r\n\t\t\t\tfinsembleWindow.getMonitor((monitor: any) => {\r\n\t\t\t\t\tmonitorInfo = monitor;\r\n\t\t\t\t\tresolve();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tconst { data } = await finsembleWindow.getBounds();\r\n\t\tif (data) {\r\n\t\t\tconst centerWindowPosition = {\r\n\t\t\t\tleft: monitorInfo.availableRect.right - data.width,\r\n\t\t\t\ttop: monitorInfo.availableRect.top,\r\n\t\t\t\theight: monitorInfo.availableRect.height,\r\n\t\t\t\twidth: data.width,\r\n\t\t\t};\r\n\r\n\t\t\tsetShowWindowForState({\r\n\t\t\t\tshowCenter: uiState.showCenter,\r\n\t\t\t\tpoppedOut: poppedOutRef.current,\r\n\t\t\t\tposition: centerWindowPosition,\r\n\t\t\t});\r\n\r\n\t\t\tfinsembleWindow.setShape([]);\r\n\t\t}\r\n\t};\r\n\r\n\tconst boundsChangeListener = (event: any) => {\r\n\t\tif (showCenterRef?.current && !poppedOutRef.current) {\r\n\t\t\t// Bounds Changed fires when Windows Taskbar + Finsemble Toolbar docking changes\r\n\t\t\tsetFullHeight();\r\n\t\t}\r\n\t\tconst position = {\r\n\t\t\ttop: event.data.top,\r\n\t\t\tleft: event.data.left,\r\n\t\t\theight: event.data.height,\r\n\t\t\twidth: event.data.width,\r\n\t\t};\r\n\r\n\t\tstoreNotificationsCenterWindowPosition({\r\n\t\t\tshowCenter: showCenterRef?.current ? showCenterRef.current : false,\r\n\t\t\tpoppedOut: poppedOutRef.current,\r\n\t\t\tposition,\r\n\t\t});\r\n\t};\r\n\r\n\tconst getScrollPercentage = () => {\r\n\t\tconst maxScroll = document.body.scrollHeight;\r\n\t\tconst currentScroll = window.innerHeight + window.scrollY;\r\n\t\treturn currentScroll / maxScroll;\r\n\t};\r\n\r\n\tconst lazyLoadNextPage = async () =>\r\n\t\tnew Promise<void>(async (resolve) => {\r\n\t\t\tif (nextPageToFetch.current > 0) {\r\n\t\t\t\tconst [options, filter] = getFetchHistoryParams(config, params);\r\n\t\t\t\toptions.pageNumber = nextPageToFetch.current;\r\n\t\t\t\tconst notificationList = await FSBL.Clients.NotificationClient.fetchHistory(options, filter);\r\n\t\t\t\tif (notificationList.length) {\r\n\t\t\t\t\tnextPageToFetch.current = nextPageToFetch.current + 1;\r\n\t\t\t\t\tfor (const notification of notificationList) {\r\n\t\t\t\t\t\taddNotification(notification);\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Stop fetching after this one\r\n\t\t\t\t\tnextPageToFetch.current = LAZY_LOAD_NO_MORE_PAGES;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresolve();\r\n\t\t});\r\n\r\n\tconst toggleCenter = async (show: boolean, isTransparent: boolean, poppedOut: boolean) => {\r\n\t\tif (isTransparent && !isMac) {\r\n\t\t\tif (poppedOut) {\r\n\t\t\t\tif (show) {\r\n\t\t\t\t\tfinsembleWindow.show({}, () => {\r\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\r\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tfinsembleWindow.hide();\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (show) {\r\n\t\t\t\t\tawait moveToToolbarMonitor();\r\n\t\t\t\t\tawait setFullHeight();\r\n\t\t\t\t\tfinsembleWindow.show({}, () => {\r\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\r\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tfinsembleWindow.setShape([\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tx: 0,\r\n\t\t\t\t\t\t\t\ty: 0,\r\n\t\t\t\t\t\t\t\twidth: 1,\r\n\t\t\t\t\t\t\t\theight: 1,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t]);\r\n\t\t\t\t\t\tfinsembleWindow.hide();\r\n\t\t\t\t\t}, 500);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (show) {\r\n\t\t\t\tif (!poppedOut) {\r\n\t\t\t\t\tawait moveToToolbarMonitor();\r\n\t\t\t\t\tawait setFullHeight();\r\n\t\t\t\t}\r\n\t\t\t\tfinsembleWindow.show({}, () => {\r\n\t\t\t\t\tfinsembleWindow.bringToFront();\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tfinsembleWindow.hide();\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t// When popped out we want to prevent the center to be closed when the close button is clicked (or alt +)\r\n\tuseEffect(() => {\r\n\t\tsetOpaqueClassName(!config.isTransparent);\r\n\r\n\t\tconst subscriptionId = FSBL.Clients.RouterClient.subscribe(\"Finsemble.Application.State\", (err, response) => {\r\n\t\t\tapplicationState.current = response.data.state;\r\n\t\t});\r\n\r\n\t\tconst hide = (event: any) => {\r\n\t\t\tconst publishValue = { ...subscriptionMessageRef.current };\r\n\t\t\tpublishValue[\"showCenter\"] = false;\r\n\t\t\tsetUIState(publishValue);\r\n\t\t\tif (applicationState?.current !== \"closing\") {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tevent.cancel();\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\"Error cancelling the window close event\", error);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst scrollHandler = () => {\r\n\t\t\tif (getScrollPercentage() > 0.9) {\r\n\t\t\t\tlazyLoadNextPage();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tfinsembleWindow.addEventListener(\"close-requested\", hide);\r\n\t\tfinsembleWindow.addEventListener(\"bounds-change-end\", boundsChangeListener);\r\n\t\twindow.addEventListener(\"scroll\", scrollHandler);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(subscriptionId);\r\n\t\t\tfinsembleWindow.removeEventListener(\"close-requested\", hide);\r\n\t\t\tfinsembleWindow.removeEventListener(\"bounds-change-end\", boundsChangeListener);\r\n\t\t\twindow.removeEventListener(\"scroll\", scrollHandler);\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst recursiveLoad = async () => {\r\n\t\t\t// Cater for the case where there is no scroll bar to trigger lazy load - keep loading until scrollbar or no pages\r\n\t\t\tawait lazyLoadNextPage();\r\n\t\t\tif (getScrollPercentage() === 1 && nextPageToFetch.current != LAZY_LOAD_NO_MORE_PAGES) {\r\n\t\t\t\trecursiveLoad();\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\trecursiveLoad();\r\n\t}, [viewMode, drawerControlProps.active]);\r\n\r\n\t// Hook to set up the center state from service data on component start\r\n\tuseEffect(() => {\r\n\t\tsubscriptionMessageRef.current = uiState;\r\n\t\t// Hook can execute before initial pubsub response - waiting for actual values\r\n\t\tif (!isInitialized && typeof uiState.showCenter !== \"undefined\") {\r\n\t\t\tif (uiState.poppedOut) {\r\n\t\t\t\tremovePoppedInClasses();\r\n\t\t\t} else {\r\n\t\t\t\taddPoppedInClasses();\r\n\t\t\t}\r\n\r\n\t\t\tif (isValidPosition(uiState.position)) {\r\n\t\t\t\tsetShowWindowForState({\r\n\t\t\t\t\tshowCenter: uiState.showCenter,\r\n\t\t\t\t\tpoppedOut: uiState.poppedOut,\r\n\t\t\t\t\tposition: uiState.position,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// Setup references\r\n\t\t\tshowCenterRef.current = uiState.showCenter;\r\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\r\n\r\n\t\t\tsetInitialized(true);\r\n\t\t}\r\n\t}, [uiState]);\r\n\r\n\t// Effect to run when we pop-in or pop-out the notification center\r\n\tuseEffect(() => {\r\n\t\tif (isInitialized) {\r\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\r\n\t\t\tfinsembleWindow.getMonitor(async (monitorInfo: any) => {\r\n\t\t\t\tif (uiState.poppedOut) {\r\n\t\t\t\t\tconst { data } = await finsembleWindow.getBounds();\r\n\t\t\t\t\tremovePoppedInClasses();\r\n\r\n\t\t\t\t\tif (data) {\r\n\t\t\t\t\t\tconst centerWindowPosition = {\r\n\t\t\t\t\t\t\tleft: data.left - 25,\r\n\t\t\t\t\t\t\ttop: data.top + 25,\r\n\t\t\t\t\t\t\theight: Math.round(monitorInfo.availableRect.height * 0.8),\r\n\t\t\t\t\t\t\twidth: data.width,\r\n\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\tsetShowWindowForState({\r\n\t\t\t\t\t\t\tshowCenter: uiState.showCenter,\r\n\t\t\t\t\t\t\tpoppedOut: uiState.poppedOut,\r\n\t\t\t\t\t\t\tposition: centerWindowPosition,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddPoppedInClasses();\r\n\t\t\t\t\tsetFullHeight(monitorInfo);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}, [uiState.poppedOut]);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (isInitialized) {\r\n\t\t\tshowCenterRef.current = uiState.showCenter;\r\n\t\t\ttoggleCenter(uiState.showCenter, config.isTransparent as boolean, poppedOutRef.current);\r\n\t\t}\r\n\t}, [uiState.showCenter]);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetFilteredNotifications([...notifications]);\r\n\t}, [notifications]);\r\n\r\n\tuseEffect(() => {\r\n\t\tfunction listenMuteStateChanged(error: any) {\r\n\t\t\tif (error) {\r\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\r\n\t\t\t} else {\r\n\t\t\t\tsetReloadMuteFilters(true);\r\n\t\t\t}\r\n\t\t}\r\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\r\n\t\t};\r\n\t}, []);\r\n\r\n\t// Sets the current active mute filters\r\n\tuseEffect(() => {\r\n\t\tasync function loadMuteFilter() {\r\n\t\t\treturn await FSBL.Clients.NotificationClient.getMuteFilters();\r\n\t\t}\r\n\r\n\t\tloadMuteFilter().then((loadedMuteFilters: IMuteFilter[]) => {\r\n\t\t\tsetMuteFilters(loadedMuteFilters);\r\n\t\t\tsetReloadMuteFilters(false);\r\n\t\t});\r\n\t}, [reloadMuteFilters]);\r\n\r\n\tconst notificationsMainView = () => (\r\n\t\t<>\r\n\t\t\t<DrawerHeader poppedOutStatus={uiState.poppedOut} popOutToggle={togglePoppedStatus} />\r\n\t\t\t<DrawerControls />\r\n\t\t\t<div className=\"cards-container\">\r\n\t\t\t\t{viewMode === ViewMode.CARD ? (\r\n\t\t\t\t\t<CardView notifications={notifications} notificationCard={props.notificationCard} />\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<ListView\r\n\t\t\t\t\t\tnotifications={notifications}\r\n\t\t\t\t\t\tnotificationHeaderRow={props.notificationHeaderRow}\r\n\t\t\t\t\t\tnotificationListRow={props.notificationListRow}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n\r\n\tconst notificationDetailsViewComponent = () => <NotificationDetailsView notification={selectedNotification} />;\r\n\r\n\treturn (\r\n\t\t<ConditionalWrapper\r\n\t\t\tcondition={(config.isTransparent as boolean) && !uiState.poppedOut && !isMac}\r\n\t\t\twrapper={(children) => (\r\n\t\t\t\t<CSSTransition in={uiState.showCenter} timeout={500} classNames=\"drawer\" unmountOnExit>\r\n\t\t\t\t\t{children}\r\n\t\t\t\t</CSSTransition>\r\n\t\t\t)}\r\n\t\t>\r\n\t\t\t<NotificationsContext.Provider value={notificationsContextValues}>\r\n\t\t\t\t<Drawer classNames={uiState.poppedOut ? \"popped-out\" : \"\"}>\r\n\t\t\t\t\t{selectedNotification ? notificationDetailsViewComponent() : notificationsMainView()}\r\n\t\t\t\t</Drawer>\r\n\t\t\t</NotificationsContext.Provider>\r\n\t\t</ConditionalWrapper>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"NotificationsCenter.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsCenter/NotificationsCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,gDAAgD,CAAC;AAGxD,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,EACL,qBAAqB,GACrB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,uBAAuB,MAAM,kCAAkC,CAAC;AAMvE,MAAM,eAAe,GAAoC;IACxD,QAAQ,EAAE;QACT;YACC,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,KAAK;YACZ,GAAG,EAAE,CAAC,aAA8B,EAAE,EAAE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C,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAC,QAAQ,EAAC,aAAa,UACpF,QAAQ,CACM,CAChB;QAED,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,0BAA0B;YAC/D,oBAAC,MAAM,IAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IACvD,oBAAoB,CAAC,CAAC,CAAC,gCAAgC,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAC5E,CACsB,CACZ,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { CSSTransition } from \"react-transition-group\";\nimport ConditionalWrapper from \"../../../shared/ConditionalWrapper\";\n\nimport { ViewMode, SelectionMode } from \"../../constants\";\n\nimport \"../../../../assets/css/notificationsCenter.css\";\n\n// Hooks\nimport useNotifications, {\n\tuseNotificationUI,\n\tgetNotificationConfig,\n\tmoveToToolbarMonitor,\n\tgetOS,\n\tgetFetchHistoryParams,\n} from \"../../../../hooks/useNotifications\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Types\nimport { INotificationCenterProps, NotificationCenterControlsProps, NotificationsContextType } from \"../../types\";\n\n// Components\nimport CardView from \"../views/CardView\";\nimport Drawer from \"../drawer/Drawer\";\nimport DrawerControls from \"../drawer/DrawerControls\";\nimport DrawerHeader from \"../drawer/DrawerHeader\";\nimport ListView from \"../views/ListView\";\nimport NotificationDetailsView from \"../views/NotificationDetailsView\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype IMuteFilter = services.notification.types.IMuteFilter;\n\nconst defaultControls: NotificationCenterControlsProps = {\n\tcontrols: [\n\t\t{\n\t\t\taction: \"all\",\n\t\t\tlabel: \"All\",\n\t\t\trun: (notifications: INotification[]) => notifications,\n\t\t},\n\t\t{\n\t\t\taction: \"unread\",\n\t\t\tlabel: \"Unread\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => !notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"read\",\n\t\t\tlabel: \"Read\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"snoozed\",\n\t\t\tlabel: \"Snoozed\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isSnoozed),\n\t\t},\n\t],\n\tactive: \"all\",\n};\n\nconst addPoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.add(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.add(\"notifications-popped-in\");\n};\n\nconst removePoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.remove(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.remove(\"notifications-popped-in\");\n};\n\nconst storeNotificationsCenterWindowPosition = ({ showCenter, poppedOut, position }: any) => {\n\tFSBL.Clients.StorageClient.save({\n\t\ttopic: \"finsemble.notifications\",\n\t\tkey: \"last.position\",\n\t\tvalue: {\n\t\t\tshowCenter,\n\t\t\tpoppedOut,\n\t\t\tposition,\n\t\t},\n\t});\n};\n\nconst setShowWindowForState = (centerState: any) => {\n\tif (centerState.showCenter) {\n\t\tfinsembleWindow.show({}, () => {\n\t\t\tfinsembleWindow.bringToFront();\n\t\t});\n\t}\n\n\tif (centerState.position) {\n\t\tfinsembleWindow.setBounds(centerState.position);\n\t}\n\n\t// Always on top when popped in\n\tFSBL.Clients.WindowClient.setAlwaysOnTop(!centerState.poppedOut);\n\tstoreNotificationsCenterWindowPosition(centerState);\n};\n\nconst isValidPosition = (bounds: any): boolean =>\n\tbounds &&\n\ttypeof bounds.left !== \"undefined\" &&\n\ttypeof bounds.top !== \"undefined\" &&\n\ttypeof bounds.height !== \"undefined\" &&\n\ttypeof bounds.width !== \"undefined\";\n\nconst LAZY_LOAD_NO_MORE_PAGES = -1;\n\nexport const NotificationsCenter: React.FunctionComponent<INotificationCenterProps> = (props) => {\n\tconst params = { config: { notificationsHistory: { options: { pageSize: 10 } } } };\n\tconst { notifications, setOpaqueClassName, addNotification } = useNotifications(params);\n\tconst [uiState, setUIState] = useNotificationUI();\n\n\tconst config = getNotificationConfig();\n\tconst [isInitialized, setInitialized] = useState(false);\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\tconst nextPageToFetch = useRef(1);\n\n\t// Set up references for use in callbacks to FSBL functions\n\tconst showCenterRef = useRef(false);\n\tconst poppedOutRef = useRef(false);\n\tconst subscriptionMessageRef = useRef<any>({});\n\tconst applicationState = useRef(null);\n\n\tconst checkedNotifications: INotification[] = [];\n\n\tconst [searchString, setSearchString] = useState(\"\");\n\tconst [filteredNotifications, setFilteredNotifications] = useState([...notifications]);\n\tconst [viewMode, setViewMode] = useState<ViewMode>(ViewMode.CARD);\n\tconst [selectionMode, setSelectionMode] = useState<SelectionMode>(SelectionMode.NO_SELECTION);\n\tconst [selectedNotification, setSelectedNotification] = useState<INotification | null>(null);\n\tconst [muteFilters, setMuteFilters] = useState<IMuteFilter[]>([]);\n\tconst [reloadMuteFilters, setReloadMuteFilters] = useState(true);\n\n\tconst dcp: NotificationCenterControlsProps = props.controls ? props.controls : defaultControls;\n\n\tconst [drawerControlProps, setDrawerControlProps] = useState(dcp);\n\tconst notificationsContextValues: NotificationsContextType = {\n\t\tviewMode,\n\t\tsetViewMode,\n\t\tselectionMode,\n\t\tsetSelectionMode,\n\t\tdrawerControlProps,\n\t\tsetDrawerControlProps,\n\t\tselectedNotification,\n\t\tsetSelectedNotification,\n\t\tsearchString,\n\t\tsetSearchString,\n\t\tfilteredNotifications,\n\t\tcheckedNotifications,\n\t\tsetFilteredNotifications,\n\t\tmuteFilters,\n\t\tsetMuteFilters,\n\t};\n\n\tconst togglePoppedStatus = () => {\n\t\tconst poppedOut = !uiState.poppedOut;\n\t\tpoppedOutRef.current = poppedOut;\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tpoppedOut,\n\t\t});\n\t};\n\n\tconst setFullHeight = async (monitorInfo?: any) => {\n\t\tif (!monitorInfo) {\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\tfinsembleWindow.getMonitor((monitor: any) => {\n\t\t\t\t\tmonitorInfo = monitor;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tconst { data } = await finsembleWindow.getBounds();\n\t\tif (data) {\n\t\t\tconst centerWindowPosition = {\n\t\t\t\tleft: monitorInfo.availableRect.right - data.width,\n\t\t\t\ttop: monitorInfo.availableRect.top,\n\t\t\t\theight: monitorInfo.availableRect.height,\n\t\t\t\twidth: data.width,\n\t\t\t};\n\n\t\t\tsetShowWindowForState({\n\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\t\tposition: centerWindowPosition,\n\t\t\t});\n\n\t\t\tfinsembleWindow.setShape([]);\n\t\t}\n\t};\n\n\tconst boundsChangeListener = (event: any) => {\n\t\tif (showCenterRef?.current && !poppedOutRef.current) {\n\t\t\t// Bounds Changed fires when Windows Taskbar + Finsemble Toolbar docking changes\n\t\t\tsetFullHeight();\n\t\t}\n\t\tconst position = {\n\t\t\ttop: event.data.top,\n\t\t\tleft: event.data.left,\n\t\t\theight: event.data.height,\n\t\t\twidth: event.data.width,\n\t\t};\n\n\t\tstoreNotificationsCenterWindowPosition({\n\t\t\tshowCenter: showCenterRef?.current ? showCenterRef.current : false,\n\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\tposition,\n\t\t});\n\t};\n\n\tconst getScrollPercentage = () => {\n\t\tconst maxScroll = document.body.scrollHeight;\n\t\tconst currentScroll = window.innerHeight + window.scrollY;\n\t\treturn currentScroll / maxScroll;\n\t};\n\n\tconst lazyLoadNextPage = async () =>\n\t\tnew Promise<void>(async (resolve) => {\n\t\t\tif (nextPageToFetch.current > 0) {\n\t\t\t\tconst [options, filter] = getFetchHistoryParams(config, params);\n\t\t\t\toptions.pageNumber = nextPageToFetch.current;\n\t\t\t\tconst notificationList = await FSBL.Clients.NotificationClient.fetchHistory(options, filter);\n\t\t\t\tif (notificationList.length) {\n\t\t\t\t\tnextPageToFetch.current = nextPageToFetch.current + 1;\n\t\t\t\t\tfor (const notification of notificationList) {\n\t\t\t\t\t\taddNotification(notification);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop fetching after this one\n\t\t\t\t\tnextPageToFetch.current = LAZY_LOAD_NO_MORE_PAGES;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve();\n\t\t});\n\n\tconst toggleCenter = async (show: boolean, isTransparent: boolean, poppedOut: boolean) => {\n\t\tif (isTransparent && !isMac) {\n\t\t\tif (poppedOut) {\n\t\t\t\tif (show) {\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (show) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tfinsembleWindow.setShape([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (show) {\n\t\t\t\tif (!poppedOut) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t}\n\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t}\n\t\t}\n\t};\n\n\t// When popped out we want to prevent the center to be closed when the close button is clicked (or alt +)\n\tuseEffect(() => {\n\t\tsetOpaqueClassName(!config.isTransparent);\n\n\t\tconst subscriptionId = FSBL.Clients.RouterClient.subscribe(\"Finsemble.Application.State\", (err, response) => {\n\t\t\tapplicationState.current = response.data.state;\n\t\t});\n\n\t\tconst hide = (event: any) => {\n\t\t\tconst publishValue = { ...subscriptionMessageRef.current };\n\t\t\tpublishValue[\"showCenter\"] = false;\n\t\t\tsetUIState(publishValue);\n\t\t\tif (applicationState?.current !== \"closing\") {\n\t\t\t\ttry {\n\t\t\t\t\tevent.cancel();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\"Error cancelling the window close event\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst scrollHandler = () => {\n\t\t\tif (getScrollPercentage() > 0.9) {\n\t\t\t\tlazyLoadNextPage();\n\t\t\t}\n\t\t};\n\n\t\tfinsembleWindow.addEventListener(\"close-requested\", hide);\n\t\tfinsembleWindow.addEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\twindow.addEventListener(\"scroll\", scrollHandler);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(subscriptionId);\n\t\t\tfinsembleWindow.removeEventListener(\"close-requested\", hide);\n\t\t\tfinsembleWindow.removeEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\t\twindow.removeEventListener(\"scroll\", scrollHandler);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst recursiveLoad = async () => {\n\t\t\t// Cater for the case where there is no scroll bar to trigger lazy load - keep loading until scrollbar or no pages\n\t\t\tawait lazyLoadNextPage();\n\t\t\tif (getScrollPercentage() === 1 && nextPageToFetch.current != LAZY_LOAD_NO_MORE_PAGES) {\n\t\t\t\trecursiveLoad();\n\t\t\t}\n\t\t};\n\n\t\trecursiveLoad();\n\t}, [viewMode, drawerControlProps.active]);\n\n\t// Hook to set up the center state from service data on component start\n\tuseEffect(() => {\n\t\tsubscriptionMessageRef.current = uiState;\n\t\t// Hook can execute before initial pubsub response - waiting for actual values\n\t\tif (!isInitialized && typeof uiState.showCenter !== \"undefined\") {\n\t\t\tif (uiState.poppedOut) {\n\t\t\t\tremovePoppedInClasses();\n\t\t\t} else {\n\t\t\t\taddPoppedInClasses();\n\t\t\t}\n\n\t\t\tif (isValidPosition(uiState.position)) {\n\t\t\t\tsetShowWindowForState({\n\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\tposition: uiState.position,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Setup references\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\n\t\t\tsetInitialized(true);\n\t\t}\n\t}, [uiState]);\n\n\t// Effect to run when we pop-in or pop-out the notification center\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\t\t\tfinsembleWindow.getMonitor(async (monitorInfo: any) => {\n\t\t\t\tif (uiState.poppedOut) {\n\t\t\t\t\tconst { data } = await finsembleWindow.getBounds();\n\t\t\t\t\tremovePoppedInClasses();\n\n\t\t\t\t\tif (data) {\n\t\t\t\t\t\tconst centerWindowPosition = {\n\t\t\t\t\t\t\tleft: data.left - 25,\n\t\t\t\t\t\t\ttop: data.top + 25,\n\t\t\t\t\t\t\theight: Math.round(monitorInfo.availableRect.height * 0.8),\n\t\t\t\t\t\t\twidth: data.width,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tsetShowWindowForState({\n\t\t\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\t\t\tposition: centerWindowPosition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\taddPoppedInClasses();\n\t\t\t\t\tsetFullHeight(monitorInfo);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [uiState.poppedOut]);\n\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\ttoggleCenter(uiState.showCenter, config.isTransparent as boolean, poppedOutRef.current);\n\t\t}\n\t}, [uiState.showCenter]);\n\n\tuseEffect(() => {\n\t\tsetFilteredNotifications([...notifications]);\n\t}, [notifications]);\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tsetReloadMuteFilters(true);\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\t// Sets the current active mute filters\n\tuseEffect(() => {\n\t\tasync function loadMuteFilter() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getMuteFilters();\n\t\t}\n\n\t\tloadMuteFilter().then((loadedMuteFilters: IMuteFilter[]) => {\n\t\t\tsetMuteFilters(loadedMuteFilters);\n\t\t\tsetReloadMuteFilters(false);\n\t\t});\n\t}, [reloadMuteFilters]);\n\n\tconst notificationsMainView = () => (\n\t\t<>\n\t\t\t<DrawerHeader poppedOutStatus={uiState.poppedOut} popOutToggle={togglePoppedStatus} />\n\t\t\t<DrawerControls />\n\t\t\t<div className=\"cards-container\">\n\t\t\t\t{viewMode === ViewMode.CARD ? (\n\t\t\t\t\t<CardView notifications={notifications} notificationCard={props.notificationCard} />\n\t\t\t\t) : (\n\t\t\t\t\t<ListView\n\t\t\t\t\t\tnotifications={notifications}\n\t\t\t\t\t\tnotificationHeaderRow={props.notificationHeaderRow}\n\t\t\t\t\t\tnotificationListRow={props.notificationListRow}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n\n\tconst notificationDetailsViewComponent = () => <NotificationDetailsView notification={selectedNotification} />;\n\n\treturn (\n\t\t<ConditionalWrapper\n\t\t\tcondition={(config.isTransparent as boolean) && !uiState.poppedOut && !isMac}\n\t\t\twrapper={(children) => (\n\t\t\t\t<CSSTransition in={uiState.showCenter} timeout={500} classNames=\"drawer\" unmountOnExit>\n\t\t\t\t\t{children}\n\t\t\t\t</CSSTransition>\n\t\t\t)}\n\t\t>\n\t\t\t<NotificationsContext.Provider value={notificationsContextValues}>\n\t\t\t\t<Drawer classNames={uiState.poppedOut ? \"popped-out\" : \"\"}>\n\t\t\t\t\t{selectedNotification ? notificationDetailsViewComponent() : notificationsMainView()}\n\t\t\t\t</Drawer>\n\t\t\t</NotificationsContext.Provider>\n\t\t</ConditionalWrapper>\n\t);\n};\n"]}