@finsemble/finsemble-ui 6.2.0 → 6.3.0-beta.20211008

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 (705) hide show
  1. package/package.json +17 -16
  2. package/react/actions/smartDesktopDesignerActions.d.ts +7 -8
  3. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  4. package/react/actions/toolbarActions.d.ts +2 -3
  5. package/react/actions/toolbarActions.js.map +1 -1
  6. package/react/assets/css/notificationsCenter.css +4 -2
  7. package/react/assets/css/userPreferences.css +1 -0
  8. package/react/assets/css/windowTitleBar.css +33 -1
  9. package/react/components/FinsembleProvider.js +1 -1
  10. package/react/components/FinsembleProvider.js.map +1 -1
  11. package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
  12. package/react/components/appCatalog/components/AppList.d.ts +7 -1
  13. package/react/components/appCatalog/components/AppList.js +1 -1
  14. package/react/components/appCatalog/components/AppList.js.map +1 -1
  15. package/react/components/appCatalog/components/AppResults.d.ts +10 -8
  16. package/react/components/appCatalog/components/AppResults.js +1 -1
  17. package/react/components/appCatalog/components/AppResults.js.map +1 -1
  18. package/react/components/appCatalog/components/Carousel.js +1 -1
  19. package/react/components/appCatalog/components/Carousel.js.map +1 -1
  20. package/react/components/appCatalog/components/EmptyResults.d.ts +2 -1
  21. package/react/components/appCatalog/components/EmptyResults.js +2 -4
  22. package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
  23. package/react/components/appCatalog/components/Hero.d.ts +24 -4
  24. package/react/components/appCatalog/components/Hero.js +2 -1
  25. package/react/components/appCatalog/components/Hero.js.map +1 -1
  26. package/react/components/appCatalog/components/Home.d.ts +18 -4
  27. package/react/components/appCatalog/components/Home.js.map +1 -1
  28. package/react/components/appCatalog/components/SearchBar.d.ts +20 -7
  29. package/react/components/appCatalog/components/SearchBar.js +4 -7
  30. package/react/components/appCatalog/components/SearchBar.js.map +1 -1
  31. package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -3
  32. package/react/components/appCatalog/components/Showcase/AppDescription.js +4 -6
  33. package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
  34. package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +5 -4
  35. package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
  36. package/react/components/appCatalog/components/Showcase/AppShowcase.js +1 -1
  37. package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
  38. package/react/components/appCatalog/components/Showcase/Header.d.ts +13 -5
  39. package/react/components/appCatalog/components/Showcase/Header.js +2 -2
  40. package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
  41. package/react/components/appCatalog/components/Showcase/Modal.d.ts +7 -4
  42. package/react/components/appCatalog/components/Showcase/Modal.js +6 -6
  43. package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
  44. package/react/components/appCatalog/components/Showcase/defaults.d.ts +3 -3
  45. package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
  46. package/react/components/appCatalog/components/Tag.d.ts +6 -4
  47. package/react/components/appCatalog/components/Tag.js.map +1 -1
  48. package/react/components/appCatalog/components/Toast.d.ts +5 -3
  49. package/react/components/appCatalog/components/Toast.js +5 -4
  50. package/react/components/appCatalog/components/Toast.js.map +1 -1
  51. package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -1
  52. package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
  53. package/react/components/appCatalog/modules/FDC3.d.ts +12 -11
  54. package/react/components/appCatalog/modules/FDC3.js +20 -18
  55. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  56. package/react/components/appCatalog/stores/appStore.d.ts +9 -2
  57. package/react/components/appCatalog/stores/appStore.js +10 -4
  58. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  59. package/react/components/appCatalog/stores/storeActions.js.map +1 -1
  60. package/react/components/common/Button.d.ts +4 -4
  61. package/react/components/common/Button.js +1 -1
  62. package/react/components/common/Button.js.map +1 -1
  63. package/react/components/common/ButtonIcon.js +1 -1
  64. package/react/components/common/ButtonIcon.js.map +1 -1
  65. package/react/components/common/ColorPicker.js +1 -1
  66. package/react/components/common/ColorPicker.js.map +1 -1
  67. package/react/components/common/DropZone.d.ts +0 -5
  68. package/react/components/common/DropZone.js.map +1 -1
  69. package/react/components/common/DropdownButton.js +1 -1
  70. package/react/components/common/DropdownButton.js.map +1 -1
  71. package/react/components/common/FileInput.d.ts +0 -5
  72. package/react/components/common/FileInput.js +7 -9
  73. package/react/components/common/FileInput.js.map +1 -1
  74. package/react/components/common/FinsembleIcon.d.ts +2 -2
  75. package/react/components/common/FinsembleIcon.js.map +1 -1
  76. package/react/components/common/FinsembleSelect.js +2 -5
  77. package/react/components/common/FinsembleSelect.js.map +1 -1
  78. package/react/components/common/FinsembleToggle.js +2 -2
  79. package/react/components/common/FinsembleToggle.js.map +1 -1
  80. package/react/components/common/FontSizeSelector.js +2 -2
  81. package/react/components/common/FontSizeSelector.js.map +1 -1
  82. package/react/components/common/ImagePreview.js +2 -2
  83. package/react/components/common/ImagePreview.js.map +1 -1
  84. package/react/components/common/Tab.js +2 -1
  85. package/react/components/common/Tab.js.map +1 -1
  86. package/react/components/common/file_helpers.js +3 -2
  87. package/react/components/common/file_helpers.js.map +1 -1
  88. package/react/components/common/helpers.js +8 -10
  89. package/react/components/common/helpers.js.map +1 -1
  90. package/react/components/common/stories/Button.stories.js +1 -1
  91. package/react/components/common/stories/Button.stories.js.map +1 -1
  92. package/react/components/common/stories/ButtonIcon.stories.js +1 -1
  93. package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
  94. package/react/components/common/stories/ButtonRow.stories.js +2 -2
  95. package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
  96. package/react/components/common/stories/ButtonTile.stories.js +1 -1
  97. package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
  98. package/react/components/common/stories/Checkbox.stories.js +1 -1
  99. package/react/components/common/stories/Checkbox.stories.js.map +1 -1
  100. package/react/components/common/stories/ColorPicker.stories.js +1 -1
  101. package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
  102. package/react/components/common/stories/DropZone.stories.js +1 -1
  103. package/react/components/common/stories/DropZone.stories.js.map +1 -1
  104. package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
  105. package/react/components/common/stories/FinsembleSelect.stories.js +1 -1
  106. package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
  107. package/react/components/common/stories/FinsembleToggle.stories.js +3 -1
  108. package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
  109. package/react/components/common/stories/FontSizeSelector.stories.js +1 -1
  110. package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
  111. package/react/components/common/stories/Header.stories.js +1 -1
  112. package/react/components/common/stories/Header.stories.js.map +1 -1
  113. package/react/components/common/tests/Checkbox.spec.js +4 -4
  114. package/react/components/common/tests/Checkbox.spec.js.map +1 -1
  115. package/react/components/common/tests/ColorPicker.spec.js +6 -6
  116. package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
  117. package/react/components/common/tests/DropZone.spec.js +4 -4
  118. package/react/components/common/tests/DropZone.spec.js.map +1 -1
  119. package/react/components/common/tests/FileInput.spec.js +5 -5
  120. package/react/components/common/tests/FileInput.spec.js.map +1 -1
  121. package/react/components/common/tests/FinsembleSelect.spec.js +12 -11
  122. package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
  123. package/react/components/common/tests/FinsembleToggle.spec.js +8 -2
  124. package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
  125. package/react/components/common/tests/Header.spec.js +3 -3
  126. package/react/components/common/tests/Header.spec.js.map +1 -1
  127. package/react/components/common/tests/ImagePreview.spec.js +8 -8
  128. package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
  129. package/react/components/common/tests/Tab.spec.js +3 -3
  130. package/react/components/common/tests/Tab.spec.js.map +1 -1
  131. package/react/components/common/tests/Tooltip.spec.js +5 -5
  132. package/react/components/common/tests/Tooltip.spec.js.map +1 -1
  133. package/react/components/favorites/FavoriteMaker.d.ts +0 -5
  134. package/react/components/favorites/FavoriteMaker.js +1 -1
  135. package/react/components/favorites/FavoriteMaker.js.map +1 -1
  136. package/react/components/favorites/FavoritesShell.js +1 -1
  137. package/react/components/favorites/FavoritesShell.js.map +1 -1
  138. package/react/components/favorites/FavoritesShell.spec.js +7 -7
  139. package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
  140. package/react/components/favorites/FavoritesShell.stories.js +5 -4
  141. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  142. package/react/components/fdc3Resolver/ResolverContainer.js +2 -1
  143. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  144. package/react/components/fdc3Resolver/ResolverDialog.js +13 -13
  145. package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
  146. package/react/components/fdc3Resolver/ResolverDialog.spec.js +5 -5
  147. package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
  148. package/react/components/fdc3Resolver/ResolverDialog.stories.js +1 -1
  149. package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
  150. package/react/components/icon/Icon.js +5 -4
  151. package/react/components/icon/Icon.js.map +1 -1
  152. package/react/components/legacyControls/FinsembleDialogButton.d.ts +1 -1
  153. package/react/components/legacyControls/FinsembleDialogButton.js +4 -3
  154. package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
  155. package/react/components/legacyControls/FinsembleDialogQuestion.js +2 -1
  156. package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
  157. package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +1 -1
  158. package/react/components/legacyControls/FinsembleDialogTextInput.js +8 -5
  159. package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
  160. package/react/components/legacyControls/FinsembleDnDContext.js +18 -17
  161. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  162. package/react/components/legacyControls/FinsembleDraggable.js +3 -3
  163. package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
  164. package/react/components/legacyControls/FinsembleHoverDetector.js +2 -1
  165. package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
  166. package/react/components/legacyControls/FinsembleMenuSection.js +6 -3
  167. package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
  168. package/react/components/legacyControls/stories/FinsembleDialog.stories.js +1 -1
  169. package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
  170. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js +1 -1
  171. package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
  172. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js +1 -1
  173. package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
  174. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js +1 -1
  175. package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
  176. package/react/components/legacyControls/tests/FinsembleDialog.spec.js +1 -1
  177. package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
  178. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +8 -7
  179. package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
  180. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js +7 -5
  181. package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
  182. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +13 -12
  183. package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
  184. package/react/components/linker/LinkerMenu.js +4 -3
  185. package/react/components/linker/LinkerMenu.js.map +1 -1
  186. package/react/components/linker/LinkerMenuDeprecated.js +1 -1
  187. package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
  188. package/react/components/linker/remoteRedux.d.ts +10 -42
  189. package/react/components/linker/remoteRedux.js.map +1 -1
  190. package/react/components/menu/Menu.d.ts +1 -1
  191. package/react/components/menu/Menu.js +1 -1
  192. package/react/components/menu/Menu.js.map +1 -1
  193. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  194. package/react/components/menu/MenuPortal.js +7 -6
  195. package/react/components/menu/MenuPortal.js.map +1 -1
  196. package/react/components/menu/keyboardNavigation.js +14 -15
  197. package/react/components/menu/keyboardNavigation.js.map +1 -1
  198. package/react/components/notifications/components/NoNotifications.js +2 -4
  199. package/react/components/notifications/components/NoNotifications.js.map +1 -1
  200. package/react/components/notifications/components/drawer/Drawer.js +2 -4
  201. package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
  202. package/react/components/notifications/components/drawer/DrawerControls.js +2 -4
  203. package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
  204. package/react/components/notifications/components/drawer/DrawerHeader.js +1 -4
  205. package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
  206. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +28 -43
  207. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  208. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +10 -9
  209. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  210. package/react/components/notifications/components/shared/CheckButton.d.ts +2 -2
  211. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  212. package/react/components/notifications/components/shared/IconButton.js +3 -5
  213. package/react/components/notifications/components/shared/IconButton.js.map +1 -1
  214. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +3 -2
  215. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  216. package/react/components/notifications/components/shared/OverflowMenu.d.ts +2 -1
  217. package/react/components/notifications/components/shared/OverflowMenu.js +6 -5
  218. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  219. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +3 -2
  220. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js +1 -1
  221. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  222. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +3 -2
  223. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  224. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +3 -2
  225. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js +2 -4
  226. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  227. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +3 -2
  228. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  229. package/react/components/notifications/components/views/CardView.js +15 -24
  230. package/react/components/notifications/components/views/CardView.js.map +1 -1
  231. package/react/components/notifications/components/views/ListView.d.ts +2 -2
  232. package/react/components/notifications/components/views/ListView.js +9 -9
  233. package/react/components/notifications/components/views/ListView.js.map +1 -1
  234. package/react/components/notifications/components/views/NotificationDetailsView.d.ts +2 -2
  235. package/react/components/notifications/components/views/NotificationDetailsView.js +2 -6
  236. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  237. package/react/components/notifications/types.d.ts +7 -6
  238. package/react/components/notifications/types.js.map +1 -1
  239. package/react/components/notifications/utils.d.ts +6 -4
  240. package/react/components/notifications/utils.js +26 -32
  241. package/react/components/notifications/utils.js.map +1 -1
  242. package/react/components/processMonitor/ProcessMonitor.d.ts +3 -1
  243. package/react/components/processMonitor/ProcessMonitor.js +17 -10
  244. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  245. package/react/components/processMonitor/ProcessMonitorTypes.d.ts +33 -0
  246. package/react/components/processMonitor/ProcessMonitorTypes.js +6 -0
  247. package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -0
  248. package/react/components/processMonitor/components/ChildWindow.d.ts +10 -3
  249. package/react/components/processMonitor/components/ChildWindow.js +19 -10
  250. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  251. package/react/components/processMonitor/components/ListHeader.d.ts +17 -4
  252. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  253. package/react/components/processMonitor/components/ProcessStatistics.d.ts +11 -3
  254. package/react/components/processMonitor/components/ProcessStatistics.js +25 -18
  255. package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
  256. package/react/components/processMonitor/constants.d.ts +11 -16
  257. package/react/components/processMonitor/constants.js +3 -1
  258. package/react/components/processMonitor/constants.js.map +1 -1
  259. package/react/components/processMonitor/helpers.d.ts +25 -5
  260. package/react/components/processMonitor/helpers.js +28 -20
  261. package/react/components/processMonitor/helpers.js.map +1 -1
  262. package/react/components/processMonitor/helpers.spec.d.ts +1 -0
  263. package/react/components/processMonitor/helpers.spec.js +44 -0
  264. package/react/components/processMonitor/helpers.spec.js.map +1 -0
  265. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +30 -15
  266. package/react/components/processMonitor/stores/ProcessMonitorStore.js +101 -86
  267. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  268. package/react/components/quickComponentForm/QuickComponentForm.d.ts +4 -1
  269. package/react/components/quickComponentForm/QuickComponentForm.js +13 -14
  270. package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
  271. package/react/components/search/Highlight.js +2 -2
  272. package/react/components/search/Highlight.js.map +1 -1
  273. package/react/components/search/Highlight.spec.js +3 -3
  274. package/react/components/search/Highlight.spec.js.map +1 -1
  275. package/react/components/search/Highlight.stories.js +1 -1
  276. package/react/components/search/Highlight.stories.js.map +1 -1
  277. package/react/components/search/Search.js +17 -8
  278. package/react/components/search/Search.js.map +1 -1
  279. package/react/components/search/SearchBestMatch.js +2 -1
  280. package/react/components/search/SearchBestMatch.js.map +1 -1
  281. package/react/components/search/SearchProviderResults.js +4 -5
  282. package/react/components/search/SearchProviderResults.js.map +1 -1
  283. package/react/components/search/SearchResult.js +3 -2
  284. package/react/components/search/SearchResult.js.map +1 -1
  285. package/react/components/search/SearchResults.js +1 -1
  286. package/react/components/search/SearchResults.js.map +1 -1
  287. package/react/components/shared/Button.js +2 -4
  288. package/react/components/shared/Button.js.map +1 -1
  289. package/react/components/shared/DefaultDropdownButton.js +1 -1
  290. package/react/components/shared/DefaultDropdownButton.js.map +1 -1
  291. package/react/components/shared/NavigationButton.js +9 -11
  292. package/react/components/shared/NavigationButton.js.map +1 -1
  293. package/react/components/shared/Tag.d.ts +11 -1
  294. package/react/components/shared/Tag.js.map +1 -1
  295. package/react/components/shared/TagsMenu.d.ts +26 -6
  296. package/react/components/shared/TagsMenu.js.map +1 -1
  297. package/react/components/shared/linkerUtil.d.ts +3 -1
  298. package/react/components/shared/linkerUtil.js.map +1 -1
  299. package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
  300. package/react/components/singleInputDialog/SingleInputDialog.spec.js +6 -6
  301. package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
  302. package/react/components/singleInputDialog/SingleInputDialog.stories.js +1 -1
  303. package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
  304. package/react/components/smartDesktopDesigner/AppEditAccess.d.ts +1 -1
  305. package/react/components/smartDesktopDesigner/AppEditAccess.js +17 -34
  306. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  307. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +4 -4
  308. package/react/components/smartDesktopDesigner/AppEditPage.js +2 -2
  309. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  310. package/react/components/smartDesktopDesigner/Appearance.js +3 -5
  311. package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
  312. package/react/components/smartDesktopDesigner/Application.d.ts +4 -4
  313. package/react/components/smartDesktopDesigner/Application.js +84 -92
  314. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  315. package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +1 -1
  316. package/react/components/smartDesktopDesigner/ApplicationEdit.js +68 -51
  317. package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
  318. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +4 -2
  319. package/react/components/smartDesktopDesigner/ApplicationList.js +23 -20
  320. package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
  321. package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +4 -3
  322. package/react/components/smartDesktopDesigner/ApplicationSetup.js +8 -20
  323. package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
  324. package/react/components/smartDesktopDesigner/Applications.d.ts +0 -1
  325. package/react/components/smartDesktopDesigner/Applications.js +73 -62
  326. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  327. package/react/components/smartDesktopDesigner/Authentication.js +2 -8
  328. package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
  329. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +1 -8
  330. package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
  331. package/react/components/smartDesktopDesigner/Content.js.map +1 -1
  332. package/react/components/smartDesktopDesigner/CurrentView.js +1 -1
  333. package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
  334. package/react/components/smartDesktopDesigner/Export.js +3 -3
  335. package/react/components/smartDesktopDesigner/Export.js.map +1 -1
  336. package/react/components/smartDesktopDesigner/ExportCloud.js +1 -1
  337. package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
  338. package/react/components/smartDesktopDesigner/ExportDeployInfo.js +1 -1
  339. package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
  340. package/react/components/smartDesktopDesigner/ExportZip.js +0 -1
  341. package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
  342. package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -1
  343. package/react/components/smartDesktopDesigner/GettingStarted.js +1 -1
  344. package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
  345. package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +1 -1
  346. package/react/components/smartDesktopDesigner/ProjectHeader.js +1 -1
  347. package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
  348. package/react/components/smartDesktopDesigner/Publish.js +1 -1
  349. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  350. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +0 -11
  351. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +11 -24
  352. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  353. package/react/components/smartDesktopDesigner/Themes.js +2 -8
  354. package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
  355. package/react/components/smartDesktopDesigner/View.js.map +1 -1
  356. package/react/components/smartDesktopDesigner/common/getCSSVars.d.ts +1 -1
  357. package/react/components/smartDesktopDesigner/common/getCSSVars.js +2 -1
  358. package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
  359. package/react/components/smartDesktopDesigner/common/views.d.ts +1 -1
  360. package/react/components/smartDesktopDesigner/common/views.js +4 -14
  361. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  362. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +4 -4
  363. package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
  364. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +2 -2
  365. package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
  366. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +2 -3
  367. package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +1 -1
  368. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +4 -70
  369. package/react/components/smartDesktopDesigner/fixtures/apps.js +9 -20
  370. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  371. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  372. package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +2 -1
  373. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  374. package/react/components/smartDesktopDesigner/fixtures/views.js +4 -4
  375. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  376. package/react/components/smartDesktopDesigner/sdd_helpers.js +2 -1
  377. package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
  378. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -4
  379. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +8 -8
  380. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  381. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js +7 -7
  382. package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
  383. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +3 -7
  384. package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
  385. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js +9 -2
  386. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
  387. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +3 -10
  388. package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
  389. package/react/components/smartDesktopDesigner/stories/Applications.stories.js +1 -1
  390. package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
  391. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js +7 -14
  392. package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
  393. package/react/components/smartDesktopDesigner/stories/Export.stories.js +2 -2
  394. package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
  395. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +2 -2
  396. package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
  397. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +5 -11
  398. package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
  399. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.d.ts +1 -1
  400. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js +1 -1
  401. package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
  402. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js +1 -1
  403. package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
  404. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js +2 -4
  405. package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
  406. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +1 -1
  407. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +1 -1
  408. package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
  409. package/react/components/smartDesktopDesigner/stories/Publish.stories.js +13 -28
  410. package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
  411. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js +1 -1
  412. package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
  413. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +3 -3
  414. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  415. package/react/components/smartDesktopDesigner/stories/Themes.stories.js +1 -1
  416. package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
  417. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +32 -32
  418. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  419. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +6 -5
  420. package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
  421. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js +11 -11
  422. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
  423. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +9 -7
  424. package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
  425. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +35 -35
  426. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  427. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js +6 -18
  428. package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
  429. package/react/components/smartDesktopDesigner/tests/Export.spec.js +14 -22
  430. package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
  431. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +2 -6
  432. package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
  433. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js +2 -2
  434. package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
  435. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +2 -2
  436. package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
  437. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +2 -2
  438. package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
  439. package/react/components/smartDesktopDesigner/tests/Publish.spec.js +3 -10
  440. package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
  441. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js +2 -6
  442. package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
  443. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +3 -3
  444. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  445. package/react/components/smartDesktopDesigner/tests/Themes.spec.js +7 -7
  446. package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
  447. package/react/components/smartDesktopDesigner/tests/a11y_helper.js +2 -1
  448. package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
  449. package/react/components/system/System.spec.js +1 -1
  450. package/react/components/system/System.spec.js.map +1 -1
  451. package/react/components/system/SystemTrayComponentShell.js +1 -1
  452. package/react/components/system/SystemTrayComponentShell.js.map +1 -1
  453. package/react/components/toolbar/MinimizeAll.spec.js +5 -5
  454. package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
  455. package/react/components/toolbar/NotificationControl.js +3 -2
  456. package/react/components/toolbar/NotificationControl.js.map +1 -1
  457. package/react/components/toolbar/RevealAll.spec.js +5 -5
  458. package/react/components/toolbar/RevealAll.spec.js.map +1 -1
  459. package/react/components/toolbar/ToolbarIcon.js +14 -2
  460. package/react/components/toolbar/ToolbarIcon.js.map +1 -1
  461. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +22 -5
  462. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +11 -6
  463. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  464. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js +21 -9
  465. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
  466. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +33 -10
  467. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +24 -3
  468. package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
  469. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +3 -3
  470. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +0 -3
  471. package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
  472. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +24 -8
  473. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +4 -2
  474. package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
  475. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +18 -4
  476. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +5 -4
  477. package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
  478. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.d.ts +14 -6
  479. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js +2 -2
  480. package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
  481. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +34 -13
  482. package/react/components/toolbar/advancedAppLauncher/components/Content.js +23 -29
  483. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  484. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +15 -5
  485. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -3
  486. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  487. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +38 -21
  488. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +13 -8
  489. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  490. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +18 -3
  491. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +7 -3
  492. package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
  493. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.d.ts +10 -3
  494. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js +1 -3
  495. package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
  496. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.d.ts +15 -6
  497. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +11 -6
  498. package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
  499. package/react/components/toolbar/advancedAppLauncher/components/SortBy.d.ts +11 -4
  500. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js +3 -2
  501. package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
  502. package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +18 -6
  503. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js +2 -2
  504. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  505. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +20 -4
  506. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +2 -4
  507. package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
  508. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.d.ts +5 -1
  509. package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
  510. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +15 -10
  511. package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
  512. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +5 -2
  513. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js +1 -1
  514. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  515. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +5 -4
  516. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  517. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +7 -6
  518. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +11 -13
  519. package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
  520. package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +3 -3
  521. package/react/components/toolbar/appLauncher/AppLauncherMenu.js +1 -1
  522. package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
  523. package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
  524. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +25 -3
  525. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +3 -10
  526. package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
  527. package/react/components/toolbar/appLauncher/components/componentList.d.ts +34 -6
  528. package/react/components/toolbar/appLauncher/components/componentList.js +24 -21
  529. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  530. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +32 -32
  531. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +37 -55
  532. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  533. package/react/components/toolbar/dashbar/Dashbar.js +2 -3
  534. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  535. package/react/components/toolbar/dashbar/DashbarItem.js +1 -1
  536. package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
  537. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +28 -5
  538. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +17 -23
  539. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  540. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +25 -3
  541. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  542. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +13 -8
  543. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +2 -2
  544. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
  545. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +16 -8
  546. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +0 -3
  547. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  548. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +65 -11
  549. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +95 -145
  550. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  551. package/react/components/userPreferences/UserPreferenceTypes.d.ts +5 -0
  552. package/react/components/userPreferences/UserPreferenceTypes.js +2 -0
  553. package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -0
  554. package/react/components/userPreferences/UserPreferencesBase.js +2 -2
  555. package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
  556. package/react/components/userPreferences/UserPreferencesWrapper.js +1 -1
  557. package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
  558. package/react/components/userPreferences/components/ContentSection.js +2 -1
  559. package/react/components/userPreferences/components/ContentSection.js.map +1 -1
  560. package/react/components/userPreferences/components/LeftNav.d.ts +1 -1
  561. package/react/components/userPreferences/components/LeftNav.js +1 -1
  562. package/react/components/userPreferences/components/LeftNav.js.map +1 -1
  563. package/react/components/userPreferences/components/content/DashbarEditor.js +1 -1
  564. package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
  565. package/react/components/userPreferences/components/content/Notifications.js +2 -0
  566. package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
  567. package/react/components/userPreferences/components/content/Workspaces.js +21 -10
  568. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  569. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +48 -51
  570. package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
  571. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +9 -9
  572. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  573. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +4 -6
  574. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
  575. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js +6 -6
  576. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  577. package/react/components/userPreferences/components/general/ScheduledRestart.js +0 -1
  578. package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
  579. package/react/components/userPreferences/components/workspaces/WorkspaceButton.d.ts +3 -4
  580. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +5 -1
  581. package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
  582. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js +8 -5
  583. package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
  584. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +15 -8
  585. package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
  586. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js +16 -2
  587. package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
  588. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +12 -12
  589. package/react/components/userPreferences/stores/UserPreferencesStore.js +9 -16
  590. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  591. package/react/components/userPreferences/stories/DashbarEditor.stories.js +1 -1
  592. package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
  593. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js +1 -1
  594. package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
  595. package/react/components/userPreferences/stories/General.stories.js.map +1 -1
  596. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js +1 -1
  597. package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
  598. package/react/components/userPreferences/stories/NotificationsSources.stories.js +1 -1
  599. package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
  600. package/react/components/userPreferences/stories/UserPreferences.stories.d.ts +1 -1
  601. package/react/components/userPreferences/stories/UserPreferences.stories.js +1 -1
  602. package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
  603. package/react/components/userPreferences/stories/WorkspaceButton.stories.d.ts +5 -9
  604. package/react/components/userPreferences/stories/WorkspaceButton.stories.js +10 -3
  605. package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
  606. package/react/components/userPreferences/stories/WorkspaceItem.stories.js +2 -2
  607. package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
  608. package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
  609. package/react/components/userPreferences/stories/Workspaces.stories.js +1 -1
  610. package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
  611. package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
  612. package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
  613. package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
  614. package/react/components/userPreferences/tests/General.spec.js.map +1 -1
  615. package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
  616. package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
  617. package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
  618. package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
  619. package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
  620. package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
  621. package/react/components/userPreferences/tests/WorkspaceButton.spec.js +17 -3
  622. package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
  623. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js +1 -1
  624. package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
  625. package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
  626. package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
  627. package/react/components/utils.js +1 -1
  628. package/react/components/utils.js.map +1 -1
  629. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +58 -31
  630. package/react/components/windowTitleBar/WindowTitleBarShell.js +47 -50
  631. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  632. package/react/components/windowTitleBar/components/center/Tab.d.ts +27 -7
  633. package/react/components/windowTitleBar/components/center/Tab.js +2 -2
  634. package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
  635. package/react/components/windowTitleBar/components/center/TabList.d.ts +43 -30
  636. package/react/components/windowTitleBar/components/center/TabList.js +111 -37
  637. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  638. package/react/components/windowTitleBar/components/left/LinkerButton.js +5 -4
  639. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  640. package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +1 -21
  641. package/react/components/windowTitleBar/components/left/LinkerGroups.js +6 -8
  642. package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
  643. package/react/components/windowTitleBar/components/left/ShareButton.d.ts +1 -21
  644. package/react/components/windowTitleBar/components/right/CloseButton.d.ts +12 -25
  645. package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
  646. package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +17 -26
  647. package/react/components/windowTitleBar/components/right/GroupingButton.js +2 -2
  648. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  649. package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +1 -21
  650. package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +12 -25
  651. package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
  652. package/react/components/windowTitleBar/components/windowTitle.js +11 -6
  653. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  654. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +51 -44
  655. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +63 -56
  656. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  657. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.d.ts +42 -44
  658. package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
  659. package/react/components/windowTitleBar/windowTitleBarContext.d.ts +9 -9
  660. package/react/components/windowTitleBar/windowTitleBarContext.js +2 -4
  661. package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
  662. package/react/components/yesNoDialog/Timer.spec.js +2 -2
  663. package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
  664. package/react/components/yesNoDialog/Timer.stories.js +1 -1
  665. package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
  666. package/react/components/yesNoDialog/YesNoDialog.spec.js +5 -5
  667. package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
  668. package/react/components/yesNoDialog/YesNoDialog.stories.js +1 -1
  669. package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
  670. package/react/hooks/useFavoritesShell.js.map +1 -1
  671. package/react/hooks/useLinker.js +1 -1
  672. package/react/hooks/useLinker.js.map +1 -1
  673. package/react/hooks/useMenu.js +1 -1
  674. package/react/hooks/useMenu.js.map +1 -1
  675. package/react/hooks/useNotifications.d.ts +6 -6
  676. package/react/hooks/useNotifications.js +16 -17
  677. package/react/hooks/useNotifications.js.map +1 -1
  678. package/react/hooks/useSearch.js +1 -1
  679. package/react/hooks/useSearch.js.map +1 -1
  680. package/react/hooks/useToolbar.js.map +1 -1
  681. package/react/hooks/useWorkspace.js +1 -1
  682. package/react/hooks/useWorkspace.js.map +1 -1
  683. package/react/reducers/favoriteReducer.js +1 -1
  684. package/react/reducers/favoriteReducer.js.map +1 -1
  685. package/react/reducers/rootReducer.d.ts +3 -4
  686. package/react/reducers/toolbarReducer.js +1 -1
  687. package/react/reducers/toolbarReducer.js.map +1 -1
  688. package/react/store.d.ts +6 -7
  689. package/react/types/advancedAppLauncherTypes.d.ts +28 -1
  690. package/react/types/advancedAppLauncherTypes.js.map +1 -1
  691. package/react/types/favoriteTypes.d.ts +1 -1
  692. package/react/types/favoriteTypes.js.map +1 -1
  693. package/react/types/fdc3.d.ts +22 -0
  694. package/react/types/fdc3.js.map +1 -1
  695. package/react/types/smartDesktopDesignerTypes.d.ts +11 -9
  696. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  697. package/react/types/windowTitleBar.d.ts +46 -0
  698. package/react/types/windowTitleBar.js +2 -0
  699. package/react/types/windowTitleBar.js.map +1 -0
  700. package/react/components/processMonitor/components/ChildWindows.d.ts +0 -4
  701. package/react/components/processMonitor/components/ChildWindows.js +0 -11
  702. package/react/components/processMonitor/components/ChildWindows.js.map +0 -1
  703. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.d.ts +0 -4
  704. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js +0 -14
  705. package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js.map +0 -1
@@ -1,44 +1,12 @@
1
- export declare type LinkerStore = {
2
- clients: {
3
- [windowName: string]: {
4
- joinedChannels: string[];
5
- };
6
- };
7
- allChannels: {
8
- name: string;
9
- color: string;
10
- cssClassName: string;
11
- label: string;
12
- }[];
13
- activeWindowName?: string;
14
- };
15
- export declare const store: import("@reduxjs/toolkit").EnhancedStore<any, import("redux").AnyAction, [import("redux-thunk").ThunkMiddleware<any, import("redux").AnyAction, null> | import("redux-thunk").ThunkMiddleware<any, import("redux").AnyAction, undefined>]>;
16
- export declare type InteropLinkChannels = {
17
- type: "linker/linkChannels";
18
- payload: {
19
- channels: string[];
20
- };
21
- meta: {
22
- windowName: string;
23
- };
24
- };
25
- export declare type InteropUnlinkChannels = {
26
- type: "linker/unlinkChannels";
27
- payload: {
28
- channels?: string[];
29
- };
30
- meta: {
31
- windowName: string;
32
- };
33
- };
34
- export declare type InteropLinkerSetActiveWindow = {
35
- type: "linker/setActiveWindow";
36
- payload: {
37
- windowName: string | undefined;
38
- };
39
- };
1
+ import { EnhancedStore } from "@reduxjs/toolkit";
2
+ import { services } from "@finsemble/finsemble-core";
3
+ export declare type LinkerStore = services.Interop.types.LinkerStore;
4
+ export declare type InteropLinkChannels = services.Interop.modules.linker.InteropLinkChannels;
5
+ export declare type InteropUnlinkChannels = services.Interop.modules.linker.InteropUnlinkChannels;
6
+ export declare type InteropLinkerSetActiveWindow = services.Interop.modules.linker.InteropLinkerSetActiveWindow;
7
+ export declare const store: EnhancedStore<LinkerStore, any, any>;
40
8
  export declare const actions: {
41
- setActiveWindow: import("@reduxjs/toolkit").ActionCreatorWithPayload<InteropLinkerSetActiveWindow, string>;
42
- linkChannels: import("@reduxjs/toolkit").ActionCreatorWithPayload<InteropLinkChannels, string>;
43
- unlinkChannels: import("@reduxjs/toolkit").ActionCreatorWithPayload<InteropUnlinkChannels, string>;
9
+ setActiveWindow: import("@reduxjs/toolkit").ActionCreatorWithPayload<services.Interop.modules.linker.InteropLinkerSetActiveWindow, string>;
10
+ linkChannels: import("@reduxjs/toolkit").ActionCreatorWithPayload<services.Interop.modules.linker.InteropLinkChannels, string>;
11
+ unlinkChannels: import("@reduxjs/toolkit").ActionCreatorWithPayload<services.Interop.modules.linker.InteropUnlinkChannels, string>;
44
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"remoteRedux.js","sourceRoot":"","sources":["../../../src/components/linker/remoteRedux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhE,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;AAE7B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC;AAkB3C,MAAM,UAAU,GAAgB;IAC/B,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,cAAc,CAAC;IACnC,cAAc,EAAE,UAAU;IAC1B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACV,WAAW,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAC1G;CACD,CAAC,CAAC;AA6BH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,eAAe,EAAE,YAAY,CAA+B,wBAAwB,CAAC;IACrF,YAAY,EAAE,YAAY,CAAsB,qBAAqB,CAAC;IACtE,cAAc,EAAE,YAAY,CAAwB,uBAAuB,CAAC;CAC5E,CAAC","sourcesContent":["import { configureStore, createAction } from \"@reduxjs/toolkit\";\r\n\r\n// @todo, import this so that we get enumerated types!\r\nconst { remoteRedux } = FSBL;\r\n\r\nconst dummyReducer = (state: any) => state;\r\n\r\n//, @todo import all this from finsemble-core\r\nexport type LinkerStore = {\r\n\tclients: {\r\n\t\t[windowName: string]: {\r\n\t\t\tjoinedChannels: string[];\r\n\t\t};\r\n\t};\r\n\tallChannels: {\r\n\t\tname: string;\r\n\t\tcolor: string;\r\n\t\tcssClassName: string;\r\n\t\tlabel: string;\r\n\t}[];\r\n\tactiveWindowName?: string;\r\n};\r\n\r\nconst emptyStore: LinkerStore = {\r\n\tclients: {},\r\n\tallChannels: [],\r\n};\r\n\r\nexport const store = configureStore({\r\n\tpreloadedState: emptyStore,\r\n\treducer: dummyReducer,\r\n\tenhancers: [\r\n\t\tremoteRedux.remoteReduxClientEnhancer({ server: \"@@finsemble/remoteRedux/InteropStore\", slice: \"linker\" }),\r\n\t],\r\n});\r\n\r\nexport type InteropLinkChannels = {\r\n\ttype: \"linker/linkChannels\";\r\n\tpayload: {\r\n\t\tchannels: string[];\r\n\t};\r\n\tmeta: {\r\n\t\twindowName: string;\r\n\t};\r\n};\r\n\r\nexport type InteropUnlinkChannels = {\r\n\ttype: \"linker/unlinkChannels\";\r\n\tpayload: {\r\n\t\tchannels?: string[];\r\n\t};\r\n\tmeta: {\r\n\t\twindowName: string;\r\n\t};\r\n};\r\n\r\nexport type InteropLinkerSetActiveWindow = {\r\n\ttype: \"linker/setActiveWindow\";\r\n\tpayload: {\r\n\t\twindowName: string | undefined;\r\n\t};\r\n};\r\n\r\nexport const actions = {\r\n\tsetActiveWindow: createAction<InteropLinkerSetActiveWindow>(\"linker/setActiveWindow\"),\r\n\tlinkChannels: createAction<InteropLinkChannels>(\"linker/linkChannels\"),\r\n\tunlinkChannels: createAction<InteropUnlinkChannels>(\"linker/unlinkChannels\"),\r\n};\r\n// end, @todo\r\n"]}
1
+ {"version":3,"file":"remoteRedux.js","sourceRoot":"","sources":["../../../src/components/linker/remoteRedux.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAiB,MAAM,kBAAkB,CAAC;AAS/E,MAAM,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;AAE7B,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC;AAE3C,MAAM,UAAU,GAAgB;IAC/B,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,EAAE;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAyC,cAAc,CAAC;IACzE,cAAc,EAAE,UAAU;IAC1B,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE;QACV,WAAW,CAAC,yBAAyB,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KAC1G;CACD,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG;IACtB,eAAe,EAAE,YAAY,CAA+B,wBAAwB,CAAC;IACrF,YAAY,EAAE,YAAY,CAAsB,qBAAqB,CAAC;IACtE,cAAc,EAAE,YAAY,CAAwB,uBAAuB,CAAC;CAC5E,CAAC","sourcesContent":["import { configureStore, createAction, EnhancedStore } from \"@reduxjs/toolkit\";\r\nimport { services } from \"@finsemble/finsemble-core\";\r\n\r\nexport type LinkerStore = services.Interop.types.LinkerStore;\r\nexport type InteropLinkChannels = services.Interop.modules.linker.InteropLinkChannels;\r\nexport type InteropUnlinkChannels = services.Interop.modules.linker.InteropUnlinkChannels;\r\nexport type InteropLinkerSetActiveWindow = services.Interop.modules.linker.InteropLinkerSetActiveWindow;\r\n\r\n// @todo, import this so that we get enumerated types!\r\nconst { remoteRedux } = FSBL;\r\n\r\nconst dummyReducer = (state: any) => state;\r\n\r\nconst emptyStore: LinkerStore = {\r\n\tclients: {},\r\n\tallChannels: [],\r\n};\r\n\r\nexport const store: EnhancedStore<LinkerStore, any, any> = configureStore({\r\n\tpreloadedState: emptyStore,\r\n\treducer: dummyReducer,\r\n\tenhancers: [\r\n\t\tremoteRedux.remoteReduxClientEnhancer({ server: \"@@finsemble/remoteRedux/InteropStore\", slice: \"linker\" }),\r\n\t],\r\n});\r\n\r\nexport const actions = {\r\n\tsetActiveWindow: createAction<InteropLinkerSetActiveWindow>(\"linker/setActiveWindow\"),\r\n\tlinkChannels: createAction<InteropLinkChannels>(\"linker/linkChannels\"),\r\n\tunlinkChannels: createAction<InteropUnlinkChannels>(\"linker/unlinkChannels\"),\r\n};\r\n// end, @todo\r\n"]}
@@ -7,6 +7,6 @@ export declare type MenuProps = {
7
7
  maxHeight?: number;
8
8
  openHotkey?: Array<string>;
9
9
  width?: number;
10
- title?: React.ReactNode;
10
+ title?: React.ReactNode | string;
11
11
  };
12
12
  export declare const Menu: React.FunctionComponent<MenuProps>;
@@ -4,7 +4,7 @@ import { MenuToggle } from "./MenuToggle";
4
4
  import { MenuContent } from "./MenuContent";
5
5
  export const Menu = (props) => {
6
6
  const { children, title } = props;
7
- return (React.createElement(MenuShell, { ...props },
7
+ return (React.createElement(MenuShell, Object.assign({}, props),
8
8
  React.createElement(MenuToggle, null, title),
9
9
  React.createElement(MenuContent, null, children)));
10
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C,MAAM,CAAC,MAAM,IAAI,GAAuC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACN,oBAAC,SAAS,OAAK,KAAK;QACnB,oBAAC,UAAU,QAAE,KAAK,CAAc;QAChC,oBAAC,WAAW,QAAE,QAAQ,CAAe,CAC1B,CACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { MenuShell } from \"./MenuShell\";\r\nimport { MenuToggle } from \"./MenuToggle\";\r\nimport { MenuContent } from \"./MenuContent\";\r\n\r\nexport type MenuProps = {\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\ttitle?: React.ReactNode;\r\n};\r\n\r\n/**\r\n * A convenience component that fully encapsulates a menu by constructing a <MenuShell> and its contents.\r\n * All of the props are passed to MenuShell.\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 * @param {title} [string] - Name that appears in the menu's <MenuToggle> button.\r\n *\r\n */\r\n\r\nexport const Menu: React.FunctionComponent<MenuProps> = (props) => {\r\n\tconst { children, title } = props;\r\n\r\n\treturn (\r\n\t\t<MenuShell {...props}>\r\n\t\t\t<MenuToggle>{title}</MenuToggle>\r\n\t\t\t<MenuContent>{children}</MenuContent>\r\n\t\t</MenuShell>\r\n\t);\r\n};\r\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/menu/Menu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AA4B5C,MAAM,CAAC,MAAM,IAAI,GAAuC,CAAC,KAAK,EAAE,EAAE;IACjE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAElC,OAAO,CACN,oBAAC,SAAS,oBAAK,KAAK;QACnB,oBAAC,UAAU,QAAE,KAAK,CAAc;QAChC,oBAAC,WAAW,QAAE,QAAQ,CAAe,CAC1B,CACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\r\nimport { MenuShell } from \"./MenuShell\";\r\nimport { MenuToggle } from \"./MenuToggle\";\r\nimport { MenuContent } from \"./MenuContent\";\r\n\r\nexport type MenuProps = {\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\ttitle?: React.ReactNode | string;\r\n};\r\n\r\n/**\r\n * A convenience component that fully encapsulates a menu by constructing a <MenuShell> and its contents.\r\n * All of the props are passed to MenuShell.\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 * @param {title} [string] - Name that appears in the menu's <MenuToggle> button.\r\n *\r\n */\r\n\r\nexport const Menu: React.FunctionComponent<MenuProps> = (props) => {\r\n\tconst { children, title } = props;\r\n\r\n\treturn (\r\n\t\t<MenuShell {...props}>\r\n\t\t\t<MenuToggle>{title}</MenuToggle>\r\n\t\t\t<MenuContent>{children}</MenuContent>\r\n\t\t</MenuShell>\r\n\t);\r\n};\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"MenuAutoResizer.js","sourceRoot":"","sources":["../../../src/components/menu/MenuAutoResizer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAQpD,MAAM,OAAO,eAAe;IAW3B,YAAY,WAAmB,EAAE,MAAc,EAAE,KAAa,EAAE,YAAoB,QAAQ;QAC3F,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAQrE,IAAI,CAAC,QAAQ,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAKlE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;YAChD,SAAS,EAAE,IAAI;YACf,aAAa,EAAE,KAAK;YACpB,OAAO,EAAE,IAAI;SACb,CAAC,CAAC;QAGH,UAAU,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;IAC5C,CAAC;IAED,UAAU;QACT,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IAC5B,CAAC;IAKO,KAAK,CAAC,sBAAsB;QAInC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,IAAI,CAAC,MAAM,cAAc,CAAC,EAAE;YAC3D,OAAO;SACP;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,mBAAmB,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1G,MAAM,MAAM,GAAgB;YAC3B,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,IAAI;YACnB,gBAAgB,EAAE,aAAa;SAC/B,CAAC;QAOF,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACD","sourcesContent":["import { calculateDimensions } from \"./menuHelpers\";\r\n// Typescript ambient module loaded automagically from typeroots from core/types/index.d.ts\r\nimport { SpawnParams } from \"services/window/Launcher/launcher\";\r\n\r\n/**\r\n * To make sure that MenuPortal.tsx remain small\r\n * I have isolated the auto resize logic in this class.\r\n */\r\nexport class MenuAutoResizer {\r\n\tprivate width: number;\r\n\r\n\tprivate maxHeight: number;\r\n\r\n\tprivate childWindow: Window;\r\n\r\n\tprivate menuId: string;\r\n\r\n\tprivate observer: MutationObserver;\r\n\r\n\tconstructor(childWindow: Window, menuId: string, width: number, maxHeight: number = Infinity) {\r\n\t\tthis.width = width;\r\n\t\tthis.maxHeight = maxHeight;\r\n\t\tthis.childWindow = childWindow;\r\n\t\tthis.menuId = menuId;\r\n\t\tthis.updateWindowDimensions = this.updateWindowDimensions.bind(this);\r\n\t\t/* The external window does not have a URL and so its origin\r\n\t\twill not match the toolbar's origin, in that case\r\n\t\twe won't have onload, DOMContentLoaded or any other events.\r\n\t\tThat makes it hard to know when the content are loaded, we cant\r\n\t\teven inject custom JS as it will be already late.\r\n\t\tThe only way to know about a DOM change was MutationObserver!\r\n\t\t*/\r\n\t\tthis.observer = new MutationObserver(this.updateWindowDimensions);\r\n\t\t/* Now we watch for any DOM changes in the childWindow\r\n\t\tKnowing the height of the window contents is crucial for\r\n\t\tmaking decision about its position (below/above the toolbar).\r\n\t\t*/\r\n\t\tthis.observer.observe(this.childWindow.document, {\r\n\t\t\tchildList: true,\r\n\t\t\tcharacterData: false,\r\n\t\t\tsubtree: true,\r\n\t\t});\r\n\r\n\t\t// Initialize the window to the correct height\r\n\t\tsetTimeout(this.updateWindowDimensions, 0);\r\n\t}\r\n\r\n\tdisconnect() {\r\n\t\tthis.observer.disconnect();\r\n\t}\r\n\r\n\t/**\r\n\t * Callback for MutationObserver\r\n\t */\r\n\tprivate async updateWindowDimensions() {\r\n\t\t// If the original menu button has been removed then bypass updating the window dimensions.\r\n\t\t// Probably the menu itself is in the process of being removed but the mutation observer has\r\n\t\t// not yet disconnected\r\n\t\tif (!document.querySelector(`#${this.menuId}-menu-toggle`)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst { left, top, height } = await calculateDimensions(this.childWindow, this.menuId, 0, this.maxHeight);\r\n\r\n\t\tconst params: SpawnParams = {\r\n\t\t\tmonitor: \"mine\",\r\n\t\t\tposition: \"monitor\",\r\n\t\t\tleft: left,\r\n\t\t\ttop: top,\r\n\t\t\twidth: this.width,\r\n\t\t\theight: height,\r\n\t\t\tsetBoundsOnly: true,\r\n\t\t\tforceOntoMonitor: \"monitorRect\",\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * See comment in MenuPortal.tsx on why we use showWindow() here instead of childWindow.moveTo()\r\n\t\t */\r\n\t\t//this.childWindow.moveTo(left, top);\r\n\t\t//this.childWindow.resizeTo(this.width, height);\r\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: this.childWindow.window.name }, params);\r\n\t\tthis.childWindow.document.body.setAttribute(\"resizing\", \"false\");\r\n\t}\r\n}\r\n"]}
1
+ {"version":3,"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ACf,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,IAAI;YACV,GAAG,EAAE,GAAG;YACR,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,MAAM,EAAE,MAAM;YACd,aAAa,EAAE,IAAI;YACnB,gBAAgB,EAAE,aAAa;SAC/B,CAAC;QAOF,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7F,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACD","sourcesContent":["import { calculateDimensions } from \"./menuHelpers\";\r\nimport { services } from \"@finsemble/finsemble-core\";\r\n\r\ntype SpawnParams = services.window.types.SpawnParams;\r\n\r\n/**\r\n * To make sure that MenuPortal.tsx remain small\r\n * I have isolated the auto resize logic in this class.\r\n */\r\nexport class MenuAutoResizer {\r\n\tprivate width: number;\r\n\r\n\tprivate maxHeight: number;\r\n\r\n\tprivate childWindow: Window;\r\n\r\n\tprivate menuId: string;\r\n\r\n\tprivate observer: MutationObserver;\r\n\r\n\tconstructor(childWindow: Window, menuId: string, width: number, maxHeight: number = Infinity) {\r\n\t\tthis.width = width;\r\n\t\tthis.maxHeight = maxHeight;\r\n\t\tthis.childWindow = childWindow;\r\n\t\tthis.menuId = menuId;\r\n\t\tthis.updateWindowDimensions = this.updateWindowDimensions.bind(this);\r\n\t\t/* The external window does not have a URL and so its origin\r\n\t\twill not match the toolbar's origin, in that case\r\n\t\twe won't have onload, DOMContentLoaded or any other events.\r\n\t\tThat makes it hard to know when the content are loaded, we cant\r\n\t\teven inject custom JS as it will be already late.\r\n\t\tThe only way to know about a DOM change was MutationObserver!\r\n\t\t*/\r\n\t\tthis.observer = new MutationObserver(this.updateWindowDimensions);\r\n\t\t/* Now we watch for any DOM changes in the childWindow\r\n\t\tKnowing the height of the window contents is crucial for\r\n\t\tmaking decision about its position (below/above the toolbar).\r\n\t\t*/\r\n\t\tthis.observer.observe(this.childWindow.document, {\r\n\t\t\tchildList: true,\r\n\t\t\tcharacterData: false,\r\n\t\t\tsubtree: true,\r\n\t\t});\r\n\r\n\t\t// Initialize the window to the correct height\r\n\t\tsetTimeout(this.updateWindowDimensions, 0);\r\n\t}\r\n\r\n\tdisconnect() {\r\n\t\tthis.observer.disconnect();\r\n\t}\r\n\r\n\t/**\r\n\t * Callback for MutationObserver\r\n\t */\r\n\tprivate async updateWindowDimensions() {\r\n\t\t// If the original menu button has been removed then bypass updating the window dimensions.\r\n\t\t// Probably the menu itself is in the process of being removed but the mutation observer has\r\n\t\t// not yet disconnected\r\n\t\tif (!document.querySelector(`#${this.menuId}-menu-toggle`)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst { left, top, height } = await calculateDimensions(this.childWindow, this.menuId, 0, this.maxHeight);\r\n\r\n\t\tconst params: SpawnParams = {\r\n\t\t\tmonitor: \"mine\",\r\n\t\t\tposition: \"monitor\",\r\n\t\t\tleft: left,\r\n\t\t\ttop: top,\r\n\t\t\twidth: this.width,\r\n\t\t\theight: height,\r\n\t\t\tsetBoundsOnly: true,\r\n\t\t\tforceOntoMonitor: \"monitorRect\",\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * See comment in MenuPortal.tsx on why we use showWindow() here instead of childWindow.moveTo()\r\n\t\t */\r\n\t\t//this.childWindow.moveTo(left, top);\r\n\t\t//this.childWindow.resizeTo(this.width, height);\r\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: this.childWindow.window.name }, params);\r\n\t\tthis.childWindow.document.body.setAttribute(\"resizing\", \"false\");\r\n\t}\r\n}\r\n"]}
@@ -31,7 +31,7 @@ export const MenuPortal = ({ show, children }) => {
31
31
  height: height,
32
32
  forceOntoMonitor: "monitorRect",
33
33
  };
34
- const { name } = childWindow.window;
34
+ const { name } = childWindow;
35
35
  FSBL.Clients.LauncherClient.showWindow({ windowName: name }, params);
36
36
  finWindow.focus();
37
37
  FSBL.FinsembleWindow.getInstance({ name: name }, (e, fsblWindow) => {
@@ -43,7 +43,7 @@ export const MenuPortal = ({ show, children }) => {
43
43
  }
44
44
  }
45
45
  else {
46
- const { name } = childWindow.window;
46
+ const { name } = childWindow;
47
47
  FSBL.FinsembleWindow.getInstance({ name: name }, (e, fsblWindow) => {
48
48
  fsblWindow.setAlwaysOnTop({ alwaysOnTop: false });
49
49
  });
@@ -74,7 +74,7 @@ export const MenuPortal = ({ show, children }) => {
74
74
  newWindow.portalHeight = menuHeight;
75
75
  newWindow.addEventListener("blur", blurMenu);
76
76
  ["mouseDown", "click", "mouseUp"].forEach((eventName) => {
77
- newWindow?.document.addEventListener(eventName, (event) => {
77
+ newWindow === null || newWindow === void 0 ? void 0 : newWindow.document.addEventListener(eventName, (event) => {
78
78
  document.dispatchEvent(new CustomEvent(`portal:${eventName}`, {
79
79
  detail: {
80
80
  mouseEvent: new MouseEvent(eventName, event),
@@ -84,7 +84,7 @@ export const MenuPortal = ({ show, children }) => {
84
84
  });
85
85
  });
86
86
  ["keyup", "keydown", "keypress"].forEach((eventName) => {
87
- newWindow?.document.addEventListener(eventName, (event) => {
87
+ newWindow === null || newWindow === void 0 ? void 0 : newWindow.document.addEventListener(eventName, (event) => {
88
88
  document.dispatchEvent(new CustomEvent(`portal:${eventName}`, {
89
89
  detail: new KeyboardEvent(event.type, event),
90
90
  }));
@@ -96,8 +96,9 @@ export const MenuPortal = ({ show, children }) => {
96
96
  };
97
97
  initMenu();
98
98
  return () => {
99
- const win = childWindow || menuAutoResizer?.childWindow;
100
- const keyboardNav = keyboardNavigation || win?.keyboardNavigation;
99
+ var _a;
100
+ const win = childWindow || (menuAutoResizer === null || menuAutoResizer === void 0 ? void 0 : menuAutoResizer.childWindow);
101
+ const keyboardNav = keyboardNavigation || ((_a = win) === null || _a === void 0 ? void 0 : _a.keyboardNavigation);
101
102
  if (keyboardNav)
102
103
  keyboardNav.detach();
103
104
  if (menuAutoResizer) {
@@ -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,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAI9C,MAAM,CAAC,MAAM,UAAU,GAElB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC3B,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;IAE5F,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;IAE/B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,EAAe,CAAC;IACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACpE,MAAM,eAAe,GAAG,CAAC,UAAU,CAAC;IAOpC,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,IAAI,WAAW;YAAE,OAAO,IAAI,kBAAkB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;;YACrE,OAAO,IAAI,CAAC;IAClB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAMlB,SAAS,CAAC,GAAG,EAAE;QAEd,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C,CAAC;QAEF,QAAQ,EAAE,CAAC;QAEX,OAAO,GAAG,EAAE;YAGX,MAAM,GAAG,GAAG,WAAW,IAAI,eAAe,EAAE,WAAW,CAAC;YACxD,MAAM,WAAW,GAAG,kBAAkB,IAAK,GAAW,EAAE,kBAAkB,CAAC;YAE3E,IAAI,WAAW;gBAAE,WAAW,CAAC,MAAM,EAAE,CAAC;YAEtC,IAAI,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\";\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\n// Typescript ambient module loaded auto-magically from typeroots from core/types/index.d.ts\r\nimport { SpawnParams } from \"services/window/Launcher/launcher\";\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 = (childWindow as any).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.window;\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\t\t\t\tfinWindow.focus();\r\n\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(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.window;\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// @todo 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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M,GAAG,GAAG,WAAW,KAAI,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,CAAA,CAAC;YACxD,MAAM,WAAW,GAAG,kBAAkB,KAAI,MAAC,GAAW,0CAAE,kBAAkB,CAAA,CAAC;YAE3E,IAAI,WAAW;gBAAE,WAAW,CAAC,MAAM,EAAE,CAAC;YAEtC,IAAI,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\";\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// @todo 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,4 +1,3 @@
1
- const { HotkeyClient } = FSBL.Clients;
2
1
  export class KeyboardNavigation {
3
2
  constructor(childWin, className) {
4
3
  this.selectedItem = undefined;
@@ -171,22 +170,22 @@ export class KeyboardNavigation {
171
170
  }
172
171
  }
173
172
  attach() {
174
- HotkeyClient.addGlobalHotkey(["up arrow"], this.onArrowUp);
175
- HotkeyClient.addGlobalHotkey(["right arrow"], this.onArrowRight);
176
- HotkeyClient.addGlobalHotkey(["left arrow"], this.onArrowLeft);
177
- HotkeyClient.addGlobalHotkey(["down arrow"], this.onArrowDown);
178
- HotkeyClient.addGlobalHotkey(["return"], this.clickOnItem);
179
- HotkeyClient.addGlobalHotkey(["home"], this.focusOnFirst);
180
- HotkeyClient.addGlobalHotkey(["end"], this.focusOnLast);
173
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["up arrow"], this.onArrowUp);
174
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["right arrow"], this.onArrowRight);
175
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["left arrow"], this.onArrowLeft);
176
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["down arrow"], this.onArrowDown);
177
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["return"], this.clickOnItem);
178
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["home"], this.focusOnFirst);
179
+ FSBL.Clients.HotkeyClient.addGlobalHotkey(["end"], this.focusOnLast);
181
180
  }
182
181
  detach() {
183
- HotkeyClient.removeGlobalHotkey(["up arrow"], this.onArrowUp);
184
- HotkeyClient.removeGlobalHotkey(["right arrow"], this.onArrowRight);
185
- HotkeyClient.removeGlobalHotkey(["left arrow"], this.onArrowLeft);
186
- HotkeyClient.removeGlobalHotkey(["down arrow"], this.onArrowDown);
187
- HotkeyClient.removeGlobalHotkey(["return"], this.clickOnItem);
188
- HotkeyClient.removeGlobalHotkey(["home"], this.focusOnFirst);
189
- HotkeyClient.removeGlobalHotkey(["end"], this.focusOnLast);
182
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["up arrow"], this.onArrowUp);
183
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["right arrow"], this.onArrowRight);
184
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["left arrow"], this.onArrowLeft);
185
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["down arrow"], this.onArrowDown);
186
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["return"], this.clickOnItem);
187
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["home"], this.focusOnFirst);
188
+ FSBL.Clients.HotkeyClient.removeGlobalHotkey(["end"], this.focusOnLast);
190
189
  }
191
190
  }
192
191
  //# sourceMappingURL=keyboardNavigation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyboardNavigation.js","sourceRoot":"","sources":["../../../src/components/menu/keyboardNavigation.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,YAAY,EAAE,GAAQ,IAAI,CAAC,OAAO,CAAC;AAmB3C,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,IA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AAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/D,YAAY,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC/D,YAAY,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3D,YAAY,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC1D,YAAY,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;IAKM,MAAM;QAEZ,YAAY,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC9D,YAAY,CAAC,kBAAkB,CAAC,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACpE,YAAY,CAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClE,YAAY,CAAC,kBAAkB,CAAC,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAClE,YAAY,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9D,YAAY,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAC7D,YAAY,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC;CACD","sourcesContent":["const { HotkeyClient }: any = FSBL.Clients;\r\n\r\n/**\r\n * Keyboard navigation allows the end user to navigate through menus 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\tHotkeyClient.addGlobalHotkey([\"up arrow\"], this.onArrowUp);\r\n\t\tHotkeyClient.addGlobalHotkey([\"right arrow\"], this.onArrowRight);\r\n\t\tHotkeyClient.addGlobalHotkey([\"left arrow\"], this.onArrowLeft);\r\n\t\tHotkeyClient.addGlobalHotkey([\"down arrow\"], this.onArrowDown);\r\n\t\tHotkeyClient.addGlobalHotkey([\"return\"], this.clickOnItem);\r\n\t\tHotkeyClient.addGlobalHotkey([\"home\"], this.focusOnFirst);\r\n\t\tHotkeyClient.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\tHotkeyClient.removeGlobalHotkey([\"up arrow\"], this.onArrowUp);\r\n\t\tHotkeyClient.removeGlobalHotkey([\"right arrow\"], this.onArrowRight);\r\n\t\tHotkeyClient.removeGlobalHotkey([\"left arrow\"], this.onArrowLeft);\r\n\t\tHotkeyClient.removeGlobalHotkey([\"down arrow\"], this.onArrowDown);\r\n\t\tHotkeyClient.removeGlobalHotkey([\"return\"], this.clickOnItem);\r\n\t\tHotkeyClient.removeGlobalHotkey([\"home\"], this.focusOnFirst);\r\n\t\tHotkeyClient.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,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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IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACzE,CAAC;CACD","sourcesContent":["/**\r\n * Keyboard navigation allows the end user to navigate through menus 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,7 +1,5 @@
1
1
  import React from "react";
2
- const NoNotifications = () => {
3
- return (React.createElement("div", { className: "no-notifications" },
4
- React.createElement("p", null, "No notifications to display")));
5
- };
2
+ const NoNotifications = () => (React.createElement("div", { className: "no-notifications" },
3
+ React.createElement("p", null, "No notifications to display")));
6
4
  export default NoNotifications;
7
5
  //# sourceMappingURL=NoNotifications.js.map
@@ -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;IACrD,OAAO,CACN,6BAAK,SAAS,EAAC,kBAAkB;QAChC,6DAAkC,CAC7B,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import React from \"react\";\r\n\r\nconst NoNotifications: React.FunctionComponent = () => {\r\n\treturn (\r\n\t\t<div className=\"no-notifications\">\r\n\t\t\t<p>No notifications to display</p>\r\n\t\t</div>\r\n\t);\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\";\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,7 +1,5 @@
1
1
  import React from "react";
2
- const Drawer = (props) => {
3
- return (React.createElement("div", { id: "drawer", className: props.classNames },
4
- React.createElement("div", { className: "drawer-container" }, props.children)));
5
- };
2
+ const Drawer = (props) => (React.createElement("div", { id: "drawer", className: props.classNames },
3
+ React.createElement("div", { className: "drawer-container" }, props.children)));
6
4
  export default Drawer;
7
5
  //# sourceMappingURL=Drawer.js.map
@@ -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;IAC/D,OAAO,CACN,6BAAK,EAAE,EAAC,QAAQ,EAAC,SAAS,EAAE,KAAK,CAAC,UAAU;QAC3C,6BAAK,SAAS,EAAC,kBAAkB,IAAE,KAAK,CAAC,QAAQ,CAAO,CACnD,CACN,CAAC;AACH,CAAC,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\treturn (\r\n\t\t<div id=\"drawer\" className={props.classNames}>\r\n\t\t\t<div className=\"drawer-container\">{props.children}</div>\r\n\t\t</div>\r\n\t);\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\";\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"]}
@@ -19,13 +19,11 @@ const DrawerControls = () => {
19
19
  }
20
20
  }
21
21
  });
22
- setDrawerControlProps({ ...drawerControlProps });
22
+ setDrawerControlProps(Object.assign({}, drawerControlProps));
23
23
  };
24
24
  const renderControls = () => {
25
25
  let className = "notifications-center-controls__filter-btn";
26
- return drawerControlProps.controls.map((control) => {
27
- return (React.createElement("div", { key: control.action, className: `${className} ${drawerControlProps.active === control.action ? "active" : ""}`, onClick: () => toggleControl(control), style: selectionMode === SelectionMode.SELECTION ? { pointerEvents: "none", opacity: "0.4" } : {} }, control.label));
28
- });
26
+ return drawerControlProps.controls.map((control) => (React.createElement("div", { key: control.action, className: `${className} ${drawerControlProps.active === control.action ? "active" : ""}`, onClick: () => toggleControl(control), style: selectionMode === SelectionMode.SELECTION ? { pointerEvents: "none", opacity: "0.4" } : {} }, control.label)));
29
27
  };
30
28
  const toggleSelect = () => {
31
29
  setSelectionMode(selectionMode === SelectionMode.NO_SELECTION ? SelectionMode.SELECTION : SelectionMode.NO_SELECTION);
@@ -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,OAAO,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAE9C,MAAM,cAAc,GAA4B,GAAG,EAAE;IACpD,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EACL,QAAQ,EACR,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,gBAAgB,EAChB,oBAAoB,GACpB,GAAG,oBAAoB,CAAC;IAEzB,MAAM,aAAa,GAAG,CAAC,c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,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.map((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\treturn (\r\n\t\t\t\t<div\r\n\t\t\t\t\tkey={control.action}\r\n\t\t\t\t\tclassName={`${className} ${drawerControlProps.active === control.action ? \"active\" : \"\"}`}\r\n\t\t\t\t\tonClick={() => toggleControl(control)}\r\n\t\t\t\t\tstyle={selectionMode === SelectionMode.SELECTION ? { pointerEvents: \"none\", opacity: \"0.4\" } : {}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{control.label}\r\n\t\t\t\t</div>\r\n\t\t\t);\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":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1D,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAE9C,MAAM,cAAc,GAA4B,GAAG,EAAE;IACpD,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EACL,QAAQ,EACR,W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AC;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.map((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"]}
@@ -33,10 +33,7 @@ const DrawerHeader = ({ poppedOutStatus, popOutToggle }) => {
33
33
  const [searchInputValue, setSearchInputValue] = useState(searchString);
34
34
  const [showMenu, setShowMenu] = useState(false);
35
35
  const closeDrawerClick = () => {
36
- setUIState({
37
- ...uiState,
38
- showCenter: false,
39
- });
36
+ setUIState(Object.assign(Object.assign({}, uiState), { showCenter: false }));
40
37
  };
41
38
  const toggleMenu = () => {
42
39
  setShowMenu(!showMenu);
@@ -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,OA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ACF,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\";\r\nimport debounce from \"lodash/debounce\";\r\n\r\n// Types\r\nimport { NOTIFICATIONS_PUBSUB_TOPIC } from \"../../constants\";\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,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,eAAe,EAAE,YAAY,EAAO,EAAE,EAAE;IAC1E,MAAM,YAAY,GAAG,GAAG,EAAE;QACzB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,iCAAiC,EAAE;YACrE,cAAc,EAAE,eAAe;SAC/B,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CACrC;YACC,aAAa,EAAE,iBAAiB;SAChC,EACD;YACC,OAAO,EAAE,MAAM;YACf,IAAI,EAAE,QAAQ;YACd,GAAG,EAAE,QAAQ;SACb,CACD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,0BAA0B;QACxC,6BAAK,SAAS,EAAC,uBAAuB,EAAC,OAAO,EAAE,YAAY;YAC3D,6BAAK,SAAS,EAAC,gBAAgB;gBAC9B,2BAAG,SAAS,EAAE,MAAM,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,EAAE,GAAI,CAC9D;YACN,8BAAM,SAAS,EAAC,WAAW,IAAE,eAAe,CAAC,CAAC,CAA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C;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"]}