@finsemble/finsemble-ui 6.2.1 → 6.3.1-beta-1
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.
- package/package.json +27 -22
- package/react/actions/smartDesktopDesignerActions.d.ts +7 -8
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/actions/toolbarActions.d.ts +2 -3
- package/react/actions/toolbarActions.js.map +1 -1
- package/react/assets/css/button.css +2 -1
- package/react/assets/css/notificationsCenter.css +4 -2
- package/react/assets/css/userPreferences.css +1 -0
- package/react/assets/css/windowTitleBar.css +33 -1
- package/react/componentTemplateGenerator.js.map +1 -1
- package/react/components/FinsembleProvider.js +1 -1
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/AppCatalogComponent.js +7 -13
- package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
- package/react/components/appCatalog/components/AppList.d.ts +7 -1
- package/react/components/appCatalog/components/AppList.js +1 -1
- package/react/components/appCatalog/components/AppList.js.map +1 -1
- package/react/components/appCatalog/components/AppResults.d.ts +10 -8
- package/react/components/appCatalog/components/AppResults.js +1 -1
- package/react/components/appCatalog/components/AppResults.js.map +1 -1
- package/react/components/appCatalog/components/Carousel.js +1 -1
- package/react/components/appCatalog/components/Carousel.js.map +1 -1
- package/react/components/appCatalog/components/EmptyResults.d.ts +2 -1
- package/react/components/appCatalog/components/EmptyResults.js +2 -4
- package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
- package/react/components/appCatalog/components/Hero.d.ts +24 -4
- package/react/components/appCatalog/components/Hero.js +2 -1
- package/react/components/appCatalog/components/Hero.js.map +1 -1
- package/react/components/appCatalog/components/Home.d.ts +18 -4
- package/react/components/appCatalog/components/Home.js.map +1 -1
- package/react/components/appCatalog/components/SearchBar.d.ts +20 -7
- package/react/components/appCatalog/components/SearchBar.js +4 -7
- package/react/components/appCatalog/components/SearchBar.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -3
- package/react/components/appCatalog/components/Showcase/AppDescription.js +4 -6
- package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +5 -4
- package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppShowcase.js +1 -1
- package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Header.d.ts +13 -5
- package/react/components/appCatalog/components/Showcase/Header.js +2 -2
- package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Modal.d.ts +7 -4
- package/react/components/appCatalog/components/Showcase/Modal.js +6 -6
- package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/defaults.d.ts +3 -3
- package/react/components/appCatalog/components/Showcase/defaults.js.map +1 -1
- package/react/components/appCatalog/components/Tag.d.ts +6 -4
- package/react/components/appCatalog/components/Tag.js.map +1 -1
- package/react/components/appCatalog/components/Toast.d.ts +5 -3
- package/react/components/appCatalog/components/Toast.js +5 -5
- package/react/components/appCatalog/components/Toast.js.map +1 -1
- package/react/components/appCatalog/components/helpers.js +2 -1
- package/react/components/appCatalog/components/helpers.js.map +1 -1
- package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -1
- package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +12 -11
- package/react/components/appCatalog/modules/FDC3.js +39 -48
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.d.ts +9 -2
- package/react/components/appCatalog/stores/appStore.js +10 -4
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/appCatalog/stores/storeActions.js +96 -98
- package/react/components/appCatalog/stores/storeActions.js.map +1 -1
- package/react/components/common/Button.d.ts +4 -4
- package/react/components/common/Button.js +1 -1
- package/react/components/common/Button.js.map +1 -1
- package/react/components/common/ButtonIcon.js +1 -1
- package/react/components/common/ButtonIcon.js.map +1 -1
- package/react/components/common/ColorPicker.js +1 -1
- package/react/components/common/ColorPicker.js.map +1 -1
- package/react/components/common/DropZone.d.ts +0 -5
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/DropdownButton.js +1 -1
- package/react/components/common/DropdownButton.js.map +1 -1
- package/react/components/common/FileInput.d.ts +0 -5
- package/react/components/common/FileInput.js +7 -9
- package/react/components/common/FileInput.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +2 -2
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +2 -5
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/FinsembleToggle.js +2 -2
- package/react/components/common/FinsembleToggle.js.map +1 -1
- package/react/components/common/FontSizeSelector.js +2 -2
- package/react/components/common/FontSizeSelector.js.map +1 -1
- package/react/components/common/ImagePreview.js +2 -2
- package/react/components/common/ImagePreview.js.map +1 -1
- package/react/components/common/Tab.js +2 -1
- package/react/components/common/Tab.js.map +1 -1
- package/react/components/common/file_helpers.js +3 -2
- package/react/components/common/file_helpers.js.map +1 -1
- package/react/components/common/helpers.js +12 -10
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/Button.stories.js +1 -1
- package/react/components/common/stories/Button.stories.js.map +1 -1
- package/react/components/common/stories/ButtonIcon.stories.js +1 -1
- package/react/components/common/stories/ButtonIcon.stories.js.map +1 -1
- package/react/components/common/stories/ButtonRow.stories.js +2 -2
- package/react/components/common/stories/ButtonRow.stories.js.map +1 -1
- package/react/components/common/stories/ButtonTile.stories.js +1 -1
- package/react/components/common/stories/ButtonTile.stories.js.map +1 -1
- package/react/components/common/stories/Checkbox.stories.js +1 -1
- package/react/components/common/stories/Checkbox.stories.js.map +1 -1
- package/react/components/common/stories/ColorPicker.stories.js +1 -1
- package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
- package/react/components/common/stories/DropZone.stories.js +1 -1
- package/react/components/common/stories/DropZone.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleIcon.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleSelect.stories.js +1 -1
- package/react/components/common/stories/FinsembleSelect.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggle.stories.js +3 -1
- package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
- package/react/components/common/stories/FontSizeSelector.stories.js +1 -1
- package/react/components/common/stories/FontSizeSelector.stories.js.map +1 -1
- package/react/components/common/stories/Header.stories.js +1 -1
- package/react/components/common/stories/Header.stories.js.map +1 -1
- package/react/components/common/tests/Checkbox.spec.js +4 -4
- package/react/components/common/tests/Checkbox.spec.js.map +1 -1
- package/react/components/common/tests/ColorPicker.spec.js +6 -6
- package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
- package/react/components/common/tests/DropZone.spec.js +4 -4
- package/react/components/common/tests/DropZone.spec.js.map +1 -1
- package/react/components/common/tests/FileInput.spec.js +5 -5
- package/react/components/common/tests/FileInput.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js +12 -11
- package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js +8 -2
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/common/tests/Header.spec.js +3 -3
- package/react/components/common/tests/Header.spec.js.map +1 -1
- package/react/components/common/tests/ImagePreview.spec.js +8 -8
- package/react/components/common/tests/ImagePreview.spec.js.map +1 -1
- package/react/components/common/tests/Tab.spec.js +3 -3
- package/react/components/common/tests/Tab.spec.js.map +1 -1
- package/react/components/common/tests/Tooltip.spec.js +5 -5
- package/react/components/common/tests/Tooltip.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.d.ts +0 -5
- package/react/components/favorites/FavoriteMaker.js +1 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/favorites/FavoritesShell.js +1 -1
- package/react/components/favorites/FavoritesShell.js.map +1 -1
- package/react/components/favorites/FavoritesShell.spec.js +7 -7
- package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
- package/react/components/favorites/FavoritesShell.stories.js +5 -4
- package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js +2 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.js +13 -13
- package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js +5 -5
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.stories.js +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
- package/react/components/icon/Icon.js +5 -4
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialog.js +0 -1
- package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogButton.d.ts +1 -1
- package/react/components/legacyControls/FinsembleDialogButton.js +4 -3
- package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogQuestion.js +2 -1
- package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +1 -1
- package/react/components/legacyControls/FinsembleDialogTextInput.js +8 -5
- package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +34 -22
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/legacyControls/FinsembleDraggable.js +3 -3
- package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
- package/react/components/legacyControls/FinsembleHoverDetector.js +2 -1
- package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
- package/react/components/legacyControls/FinsembleMenuSection.js +9 -5
- package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialog.stories.js +1 -1
- package/react/components/legacyControls/stories/FinsembleDialog.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogButton.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogQuestion.stories.js.map +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js +1 -1
- package/react/components/legacyControls/stories/FinsembleDialogTextInput.stories.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialog.spec.js +1 -1
- package/react/components/legacyControls/tests/FinsembleDialog.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +8 -7
- package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js +7 -5
- package/react/components/legacyControls/tests/FinsembleDialogQuestion.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +13 -12
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
- package/react/components/linker/LinkerMenu.js +4 -3
- package/react/components/linker/LinkerMenu.js.map +1 -1
- package/react/components/linker/LinkerMenuDeprecated.js +1 -1
- package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
- package/react/components/linker/remoteRedux.d.ts +10 -42
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/Menu.d.ts +1 -1
- package/react/components/menu/Menu.js +1 -1
- package/react/components/menu/Menu.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuContent.js +1 -2
- package/react/components/menu/MenuContent.js.map +1 -1
- package/react/components/menu/MenuHotKey.js +1 -1
- package/react/components/menu/MenuHotKey.js.map +1 -1
- package/react/components/menu/MenuPortal.js +7 -6
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/menu/keyboardNavigation.js +14 -15
- package/react/components/menu/keyboardNavigation.js.map +1 -1
- package/react/components/notifications/components/NoNotifications.js +2 -4
- package/react/components/notifications/components/NoNotifications.js.map +1 -1
- package/react/components/notifications/components/drawer/Drawer.js +2 -4
- package/react/components/notifications/components/drawer/Drawer.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerControls.js +3 -5
- package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerHeader.js +1 -4
- package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +64 -79
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +15 -13
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.d.ts +2 -2
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/IconButton.js +3 -5
- package/react/components/notifications/components/shared/IconButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +3 -2
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +2 -1
- package/react/components/notifications/components/shared/OverflowMenu.js +6 -5
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +3 -2
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js +2 -2
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +3 -2
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +3 -2
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js +2 -4
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +3 -2
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js +15 -24
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.d.ts +2 -2
- package/react/components/notifications/components/views/ListView.js +9 -9
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.d.ts +2 -2
- package/react/components/notifications/components/views/NotificationDetailsView.js +2 -6
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/constants.d.ts +0 -13
- package/react/components/notifications/constants.js.map +1 -1
- package/react/components/notifications/types.d.ts +7 -6
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +6 -4
- package/react/components/notifications/utils.js +26 -32
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.d.ts +3 -1
- package/react/components/processMonitor/ProcessMonitor.js +24 -14
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitorTypes.d.ts +33 -0
- package/react/components/processMonitor/ProcessMonitorTypes.js +6 -0
- package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -0
- package/react/components/processMonitor/components/ChildWindow.d.ts +10 -3
- package/react/components/processMonitor/components/ChildWindow.js +29 -10
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +18 -4
- package/react/components/processMonitor/components/ListHeader.js +11 -3
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.d.ts +11 -3
- package/react/components/processMonitor/components/ProcessStatistics.js +35 -18
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/constants.d.ts +11 -16
- package/react/components/processMonitor/constants.js +6 -1
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.d.ts +14 -6
- package/react/components/processMonitor/helpers.js +31 -23
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/helpers.spec.d.ts +1 -0
- package/react/components/processMonitor/helpers.spec.js +44 -0
- package/react/components/processMonitor/helpers.spec.js.map +1 -0
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +31 -15
- package/react/components/processMonitor/stores/ProcessMonitorStore.js +104 -95
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/quickComponentForm/QuickComponentForm.d.ts +4 -1
- package/react/components/quickComponentForm/QuickComponentForm.js +14 -15
- package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
- package/react/components/search/Highlight.js +2 -2
- package/react/components/search/Highlight.js.map +1 -1
- package/react/components/search/Highlight.spec.js +3 -3
- package/react/components/search/Highlight.spec.js.map +1 -1
- package/react/components/search/Highlight.stories.js +1 -1
- package/react/components/search/Highlight.stories.js.map +1 -1
- package/react/components/search/Search.js +17 -8
- package/react/components/search/Search.js.map +1 -1
- package/react/components/search/SearchBestMatch.js +3 -5
- package/react/components/search/SearchBestMatch.js.map +1 -1
- package/react/components/search/SearchProviderResults.js +4 -5
- package/react/components/search/SearchProviderResults.js.map +1 -1
- package/react/components/search/SearchResult.js +3 -2
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/search/SearchResults.js +1 -1
- package/react/components/search/SearchResults.js.map +1 -1
- package/react/components/shared/Button.js +2 -4
- package/react/components/shared/Button.js.map +1 -1
- package/react/components/shared/DefaultDropdownButton.js +58 -13
- package/react/components/shared/DefaultDropdownButton.js.map +1 -1
- package/react/components/shared/NavigationButton.js +9 -11
- package/react/components/shared/NavigationButton.js.map +1 -1
- package/react/components/shared/Tag.d.ts +11 -1
- package/react/components/shared/Tag.js.map +1 -1
- package/react/components/shared/TagsMenu.d.ts +26 -6
- package/react/components/shared/TagsMenu.js.map +1 -1
- package/react/components/shared/linkerUtil.d.ts +3 -1
- package/react/components/shared/linkerUtil.js.map +1 -1
- package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
- package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.js +0 -2
- package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js +6 -6
- package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.stories.js +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.d.ts +1 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.js +17 -34
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
- package/react/components/smartDesktopDesigner/AppEditPage.d.ts +4 -4
- package/react/components/smartDesktopDesigner/AppEditPage.js +2 -2
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
- package/react/components/smartDesktopDesigner/Appearance.js +3 -5
- package/react/components/smartDesktopDesigner/Appearance.js.map +1 -1
- package/react/components/smartDesktopDesigner/Application.d.ts +7 -5
- package/react/components/smartDesktopDesigner/Application.js +78 -92
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +4 -1
- package/react/components/smartDesktopDesigner/ApplicationEdit.js +68 -51
- package/react/components/smartDesktopDesigner/ApplicationEdit.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationList.d.ts +4 -2
- package/react/components/smartDesktopDesigner/ApplicationList.js +23 -20
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationSetup.d.ts +4 -3
- package/react/components/smartDesktopDesigner/ApplicationSetup.js +8 -20
- package/react/components/smartDesktopDesigner/ApplicationSetup.js.map +1 -1
- package/react/components/smartDesktopDesigner/Applications.d.ts +3 -2
- package/react/components/smartDesktopDesigner/Applications.js +73 -62
- package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
- package/react/components/smartDesktopDesigner/Authentication.js +2 -8
- package/react/components/smartDesktopDesigner/Authentication.js.map +1 -1
- package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js +1 -8
- package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +1 -1
- package/react/components/smartDesktopDesigner/Content.js.map +1 -1
- package/react/components/smartDesktopDesigner/CurrentView.js +1 -1
- package/react/components/smartDesktopDesigner/CurrentView.js.map +1 -1
- package/react/components/smartDesktopDesigner/Export.js +3 -3
- package/react/components/smartDesktopDesigner/Export.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportCloud.js +1 -1
- package/react/components/smartDesktopDesigner/ExportCloud.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportDeployInfo.js +1 -1
- package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +1 -1
- package/react/components/smartDesktopDesigner/ExportZip.js +0 -1
- package/react/components/smartDesktopDesigner/ExportZip.js.map +1 -1
- package/react/components/smartDesktopDesigner/GettingStarted.d.ts +1 -1
- package/react/components/smartDesktopDesigner/GettingStarted.js +1 -1
- package/react/components/smartDesktopDesigner/GettingStarted.js.map +1 -1
- package/react/components/smartDesktopDesigner/ProjectHeader.d.ts +1 -1
- package/react/components/smartDesktopDesigner/ProjectHeader.js +1 -1
- package/react/components/smartDesktopDesigner/ProjectHeader.js.map +1 -1
- package/react/components/smartDesktopDesigner/Publish.js +1 -1
- package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +0 -11
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +18 -31
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/Themes.js +2 -8
- package/react/components/smartDesktopDesigner/Themes.js.map +1 -1
- package/react/components/smartDesktopDesigner/View.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/getCSSVars.d.ts +1 -2
- package/react/components/smartDesktopDesigner/common/getCSSVars.js +2 -2
- package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.d.ts +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +8 -18
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +16 -24
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +8 -9
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +4 -70
- package/react/components/smartDesktopDesigner/fixtures/apps.js +20 -31
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js +6 -9
- package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js +5 -5
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +2 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/themeProps.d.ts +5 -5
- package/react/components/smartDesktopDesigner/fixtures/themeProps.js +6 -7
- package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js +4 -4
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/sdd_helpers.js +2 -1
- package/react/components/smartDesktopDesigner/sdd_helpers.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +3 -4
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +14 -20
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Appearance.stories.js +7 -7
- package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js +3 -7
- package/react/components/smartDesktopDesigner/stories/ApplicationEdit.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js +9 -2
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js +3 -10
- package/react/components/smartDesktopDesigner/stories/ApplicationSetup.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Authentication.stories.js +18 -36
- package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Export.stories.js +2 -2
- package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js +2 -2
- package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js +5 -11
- package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.d.ts +1 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Navigation.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js +2 -4
- package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.d.ts +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/ProjectHeader.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Publish.stories.js +13 -28
- package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js +3 -3
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/stories/Themes.stories.js +1 -1
- package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +32 -32
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js +6 -5
- package/react/components/smartDesktopDesigner/tests/ApplicationEdit.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js +11 -11
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js +9 -7
- package/react/components/smartDesktopDesigner/tests/ApplicationSetup.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js +35 -35
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Authentication.spec.js +6 -18
- package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Export.spec.js +14 -22
- package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js +2 -6
- package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Navigation.spec.js +2 -2
- package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js +2 -2
- package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js +2 -2
- package/react/components/smartDesktopDesigner/tests/ProjectHeader.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Publish.spec.js +3 -10
- package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js +2 -6
- package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +3 -3
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/Themes.spec.js +7 -7
- package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js +4 -5
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +1 -1
- package/react/components/system/System.spec.js +1 -1
- package/react/components/system/System.spec.js.map +1 -1
- package/react/components/system/SystemTrayComponentShell.js +1 -1
- package/react/components/system/SystemTrayComponentShell.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.spec.js +5 -5
- package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
- package/react/components/toolbar/NotificationControl.js +3 -2
- package/react/components/toolbar/NotificationControl.js.map +1 -1
- package/react/components/toolbar/RevealAll.spec.js +5 -5
- package/react/components/toolbar/RevealAll.spec.js.map +1 -1
- package/react/components/toolbar/ToolbarIcon.js +14 -2
- package/react/components/toolbar/ToolbarIcon.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +22 -5
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +11 -6
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js +21 -9
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +33 -10
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +41 -10
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +3 -3
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +0 -3
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +24 -8
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +4 -2
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +18 -4
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +7 -5
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.d.ts +14 -6
- package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js +2 -3
- package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +30 -13
- package/react/components/toolbar/advancedAppLauncher/components/Content.js +35 -37
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +15 -5
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -3
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +38 -21
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +14 -9
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +18 -3
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +8 -4
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.d.ts +10 -3
- package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js +1 -3
- package/react/components/toolbar/advancedAppLauncher/components/NoAppsFound.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.d.ts +15 -6
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +11 -6
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/SortBy.d.ts +11 -4
- package/react/components/toolbar/advancedAppLauncher/components/SortBy.js +3 -2
- package/react/components/toolbar/advancedAppLauncher/components/SortBy.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +18 -6
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js +2 -2
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +20 -4
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +2 -4
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +15 -10
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js +19 -30
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +5 -2
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.d.ts +87 -59
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +51 -54
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +7 -6
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +11 -13
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +3 -3
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +1 -1
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +25 -3
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +4 -11
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +34 -6
- package/react/components/toolbar/appLauncher/components/componentList.js +25 -22
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +32 -32
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +43 -65
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +143 -125
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/dashbar/DashbarItem.js +4 -5
- package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +28 -5
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +17 -23
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +25 -3
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +13 -8
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +2 -2
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +16 -8
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +0 -3
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +66 -11
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +103 -153
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +0 -4
- package/react/components/userPreferences/UserPreferenceTypes.d.ts +5 -0
- package/react/components/userPreferences/UserPreferenceTypes.js +2 -0
- package/react/components/userPreferences/UserPreferenceTypes.js.map +1 -0
- package/react/components/userPreferences/UserPreferencesBase.js +2 -2
- package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
- package/react/components/userPreferences/UserPreferencesWrapper.js +1 -1
- package/react/components/userPreferences/UserPreferencesWrapper.js.map +1 -1
- package/react/components/userPreferences/components/ContentSection.js +1 -1
- package/react/components/userPreferences/components/ContentSection.js.map +1 -1
- package/react/components/userPreferences/components/LeftNav.d.ts +1 -1
- package/react/components/userPreferences/components/LeftNav.js +1 -1
- package/react/components/userPreferences/components/LeftNav.js.map +1 -1
- package/react/components/userPreferences/components/content/DashbarEditor.js +4 -4
- package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
- package/react/components/userPreferences/components/content/Notifications.js +2 -0
- package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +51 -14
- package/react/components/userPreferences/components/content/Workspaces.js +96 -90
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +48 -51
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +9 -9
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +4 -6
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js +6 -6
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.js +0 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.d.ts +3 -4
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +5 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js +8 -5
- package/react/components/userPreferences/components/workspaces/WorkspaceComponents.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +24 -9
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js +16 -2
- package/react/components/userPreferences/components/workspaces/WorkspaceItemList.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +12 -12
- package/react/components/userPreferences/stores/UserPreferencesStore.js +10 -17
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/stories/DashbarEditor.stories.js +1 -1
- package/react/components/userPreferences/stories/DashbarEditor.stories.js.map +1 -1
- package/react/components/userPreferences/stories/DashbarEditorItem.stories.js +1 -1
- package/react/components/userPreferences/stories/DashbarEditorItem.stories.js.map +1 -1
- package/react/components/userPreferences/stories/General.stories.js.map +1 -1
- package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js +1 -1
- package/react/components/userPreferences/stories/NotificationsSourceTypes.stories.js.map +1 -1
- package/react/components/userPreferences/stories/NotificationsSources.stories.js +1 -1
- package/react/components/userPreferences/stories/NotificationsSources.stories.js.map +1 -1
- package/react/components/userPreferences/stories/UserPreferences.stories.d.ts +1 -1
- package/react/components/userPreferences/stories/UserPreferences.stories.js +1 -1
- package/react/components/userPreferences/stories/UserPreferences.stories.js.map +1 -1
- package/react/components/userPreferences/stories/WorkspaceButton.stories.d.ts +5 -9
- package/react/components/userPreferences/stories/WorkspaceButton.stories.js +10 -3
- package/react/components/userPreferences/stories/WorkspaceButton.stories.js.map +1 -1
- package/react/components/userPreferences/stories/WorkspaceItem.stories.js +2 -2
- package/react/components/userPreferences/stories/WorkspaceItem.stories.js.map +1 -1
- package/react/components/userPreferences/stories/WorkspaceItemList.stories.js.map +1 -1
- package/react/components/userPreferences/stories/Workspaces.stories.js +2 -2
- package/react/components/userPreferences/stories/Workspaces.stories.js.map +1 -1
- package/react/components/userPreferences/tests/ContentSection.spec.js.map +1 -1
- package/react/components/userPreferences/tests/DashbarEditor.spec.js.map +1 -1
- package/react/components/userPreferences/tests/DashbarEditorItem.spec.js.map +1 -1
- package/react/components/userPreferences/tests/General.spec.js.map +1 -1
- package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationSourceTypes.spec.js.map +1 -1
- package/react/components/userPreferences/tests/Notifications.spec.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationsSourcesPreferences.spec.js.map +1 -1
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
- package/react/components/userPreferences/tests/WorkspaceButton.spec.js +17 -3
- package/react/components/userPreferences/tests/WorkspaceButton.spec.js.map +1 -1
- package/react/components/userPreferences/tests/WorkspaceComponents.spec.js +1 -1
- package/react/components/userPreferences/tests/WorkspaceComponents.spec.js.map +1 -1
- package/react/components/userPreferences/tests/WorkspaceItem.spec.js.map +1 -1
- package/react/components/userPreferences/tests/WorkspaceItemList.spec.js.map +1 -1
- package/react/components/utils.js +1 -1
- package/react/components/utils.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +58 -31
- package/react/components/windowTitleBar/WindowTitleBarShell.js +47 -50
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/Tab.d.ts +28 -7
- package/react/components/windowTitleBar/components/center/Tab.js +11 -4
- package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +43 -30
- package/react/components/windowTitleBar/components/center/TabList.js +179 -66
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js +5 -4
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +1 -21
- package/react/components/windowTitleBar/components/left/LinkerGroups.js +6 -8
- package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +2 -1
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
- package/react/components/windowTitleBar/components/left/ShareButton.d.ts +1 -21
- package/react/components/windowTitleBar/components/right/CloseButton.d.ts +12 -25
- package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +17 -26
- package/react/components/windowTitleBar/components/right/GroupingButton.js +2 -2
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +16 -26
- package/react/components/windowTitleBar/components/right/MaximizeButton.js +7 -9
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +12 -25
- package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +2 -1
- package/react/components/windowTitleBar/components/windowTitle.js +22 -10
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +56 -44
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +96 -64
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.d.ts +42 -44
- package/react/components/windowTitleBar/stores/windowTitleBarStoreDefaults.js.map +1 -1
- package/react/components/windowTitleBar/windowTitleBarContext.d.ts +9 -9
- package/react/components/windowTitleBar/windowTitleBarContext.js +2 -4
- package/react/components/windowTitleBar/windowTitleBarContext.js.map +1 -1
- package/react/components/yesNoDialog/Timer.spec.js +2 -2
- package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
- package/react/components/yesNoDialog/Timer.stories.js +1 -1
- package/react/components/yesNoDialog/Timer.stories.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js +5 -5
- package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.stories.js +1 -1
- package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
- package/react/hooks/useFavoritesShell.js +1 -3
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useLinker.js +4 -4
- package/react/hooks/useLinker.js.map +1 -1
- package/react/hooks/useMenu.js +2 -2
- package/react/hooks/useMenu.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +8 -8
- package/react/hooks/useNotifications.js +30 -30
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/usePubSub.js +3 -5
- package/react/hooks/usePubSub.js.map +1 -1
- package/react/hooks/useSearch.js +1 -1
- package/react/hooks/useSearch.js.map +1 -1
- package/react/hooks/useToolbar.js +16 -35
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/hooks/useWorkspace.js +1 -1
- package/react/hooks/useWorkspace.js.map +1 -1
- package/react/reducers/favoriteReducer.js +1 -1
- package/react/reducers/favoriteReducer.js.map +1 -1
- package/react/reducers/linkerReducer.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +3 -4
- package/react/reducers/toolbarReducer.js +1 -1
- package/react/reducers/toolbarReducer.js.map +1 -1
- package/react/store.d.ts +6 -7
- package/react/store.js.map +1 -1
- package/react/types/advancedAppLauncherTypes.d.ts +28 -1
- package/react/types/advancedAppLauncherTypes.js.map +1 -1
- package/react/types/favoriteTypes.d.ts +1 -1
- package/react/types/favoriteTypes.js.map +1 -1
- package/react/types/fdc3.d.ts +22 -0
- package/react/types/fdc3.js.map +1 -1
- package/react/types/searchTypes.d.ts +3 -0
- package/react/types/searchTypes.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +11 -9
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +47 -0
- package/react/types/windowTitleBar.js +2 -0
- package/react/types/windowTitleBar.js.map +1 -0
- package/react/types/workspaceTypes.d.ts +19 -0
- package/react/types/workspaceTypes.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindows.d.ts +0 -4
- package/react/components/processMonitor/components/ChildWindows.js +0 -11
- package/react/components/processMonitor/components/ChildWindows.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.d.ts +0 -2
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +0 -88
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +0 -1
- package/react/components/toolbar/advancedAppLauncher/components/LeftNav.d.ts +0 -4
- package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js +0 -14
- package/react/components/toolbar/advancedAppLauncher/components/LeftNav.js.map +0 -1
|
@@ -30,22 +30,20 @@ function reducer(state, action) {
|
|
|
30
30
|
export const useNotificationUI = () => {
|
|
31
31
|
const [state, setState] = usePubSub(NOTIFICATIONS_PUBSUB_TOPIC);
|
|
32
32
|
const setStateAndAddWindowName = (newState) => {
|
|
33
|
-
setState({
|
|
34
|
-
...newState,
|
|
35
|
-
mostRecentWindowName: finsembleWindow.name,
|
|
36
|
-
});
|
|
33
|
+
setState(Object.assign(Object.assign({}, newState), { mostRecentWindowName: finsembleWindow.name }));
|
|
37
34
|
};
|
|
38
35
|
return [state, setStateAndAddWindowName];
|
|
39
36
|
};
|
|
40
37
|
const getActiveDescriptorsByType = (componentType) => new Promise(async (resolve, reject) => {
|
|
41
38
|
FSBL.Clients.LauncherClient.getActiveDescriptors((err, data) => {
|
|
39
|
+
var _a;
|
|
42
40
|
const activeDescriptors = [];
|
|
43
41
|
if (err) {
|
|
44
42
|
reject(err);
|
|
45
43
|
}
|
|
46
44
|
else {
|
|
47
45
|
for (const key in data) {
|
|
48
|
-
if (data.hasOwnProperty(key) && data[key]
|
|
46
|
+
if (data.hasOwnProperty(key) && ((_a = data[key]) === null || _a === void 0 ? void 0 : _a.componentType) === componentType) {
|
|
49
47
|
activeDescriptors.push(data[key]);
|
|
50
48
|
}
|
|
51
49
|
}
|
|
@@ -55,24 +53,26 @@ const getActiveDescriptorsByType = (componentType) => new Promise(async (resolve
|
|
|
55
53
|
});
|
|
56
54
|
let toolbarWindowName;
|
|
57
55
|
export const moveToToolbarMonitor = async () => {
|
|
56
|
+
var _a, _b;
|
|
58
57
|
const getToolbarMonitorData = async () => new Promise(async (resolve, reject) => {
|
|
58
|
+
var _a;
|
|
59
59
|
if (!toolbarWindowName) {
|
|
60
60
|
const activeDescriptors = await getActiveDescriptorsByType("Toolbar");
|
|
61
|
-
toolbarWindowName = activeDescriptors[0]
|
|
61
|
+
toolbarWindowName = (_a = activeDescriptors[0]) === null || _a === void 0 ? void 0 : _a.name;
|
|
62
62
|
}
|
|
63
63
|
const { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({
|
|
64
64
|
windowIdentifier: { windowName: toolbarWindowName },
|
|
65
65
|
}));
|
|
66
66
|
if (err) {
|
|
67
|
-
FSBL.Clients.Logger.error("Could not get Monitor info", err);
|
|
67
|
+
FSBL.Clients.Logger.system.error("Could not get Monitor info", err);
|
|
68
68
|
reject(err);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
resolve(data);
|
|
72
72
|
});
|
|
73
73
|
const data = (await getToolbarMonitorData());
|
|
74
|
-
const bounds =
|
|
75
|
-
const width = bounds.
|
|
74
|
+
const { data: bounds } = await finsembleWindow.getBounds();
|
|
75
|
+
const width = ((_a = bounds === null || bounds === void 0 ? void 0 : bounds.right) !== null && _a !== void 0 ? _a : 0) - ((_b = bounds === null || bounds === void 0 ? void 0 : bounds.left) !== null && _b !== void 0 ? _b : 0);
|
|
76
76
|
finsembleWindow.setBounds({
|
|
77
77
|
bounds: {
|
|
78
78
|
top: data["availableRect"]["top"],
|
|
@@ -82,7 +82,7 @@ export const moveToToolbarMonitor = async () => {
|
|
|
82
82
|
},
|
|
83
83
|
}, (err) => {
|
|
84
84
|
if (err) {
|
|
85
|
-
FSBL.Clients.Logger.error("Could not update position", err);
|
|
85
|
+
FSBL.Clients.Logger.system.error("Could not update position", err);
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
};
|
|
@@ -104,7 +104,7 @@ export const doAction = (notification, action) => {
|
|
|
104
104
|
}
|
|
105
105
|
catch (e) {
|
|
106
106
|
console.error("could not create a notification client", e);
|
|
107
|
-
FSBL.Clients.Logger.error("could not create a notification client", e);
|
|
107
|
+
FSBL.Clients.Logger.system.error("could not create a notification client", e);
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
110
|
export const mute = async (filter) => {
|
|
@@ -113,7 +113,7 @@ export const mute = async (filter) => {
|
|
|
113
113
|
}
|
|
114
114
|
catch (e) {
|
|
115
115
|
console.error("Could not save mute preferences", e);
|
|
116
|
-
FSBL.Clients.Logger.error("Could not save mute preferences", e);
|
|
116
|
+
FSBL.Clients.Logger.system.error("Could not save mute preferences", e);
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
export const unmute = async (filter) => {
|
|
@@ -122,7 +122,7 @@ export const unmute = async (filter) => {
|
|
|
122
122
|
}
|
|
123
123
|
catch (e) {
|
|
124
124
|
console.error("Could not save mute preferences", e);
|
|
125
|
-
FSBL.Clients.Logger.error("Could not save mute preferences", e);
|
|
125
|
+
FSBL.Clients.Logger.system.error("Could not save mute preferences", e);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
export const snoozeNotifications = async (notifications) => {
|
|
@@ -144,7 +144,7 @@ export const markNotificationsUnread = (notifications) => {
|
|
|
144
144
|
}
|
|
145
145
|
catch (e) {
|
|
146
146
|
console.error("Error marking messages as unread", e);
|
|
147
|
-
FSBL.Clients.Logger.error("Could not mark notification as unread", e);
|
|
147
|
+
FSBL.Clients.Logger.system.error("Could not mark notification as unread", e);
|
|
148
148
|
}
|
|
149
149
|
};
|
|
150
150
|
export const markNotificationsRead = (notifications) => {
|
|
@@ -154,7 +154,7 @@ export const markNotificationsRead = (notifications) => {
|
|
|
154
154
|
}
|
|
155
155
|
catch (e) {
|
|
156
156
|
console.error("Error marking messages as read", e);
|
|
157
|
-
FSBL.Clients.Logger.error("Could not mark notification as read", e);
|
|
157
|
+
FSBL.Clients.Logger.system.error("Could not mark notification as read", e);
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
export const dismissNotification = (notifications) => {
|
|
@@ -164,35 +164,34 @@ export const dismissNotification = (notifications) => {
|
|
|
164
164
|
}
|
|
165
165
|
catch (e) {
|
|
166
166
|
console.error("Error marking messages as read", e);
|
|
167
|
-
FSBL.Clients.Logger.error("Could not mark notification as read", e);
|
|
167
|
+
FSBL.Clients.Logger.system.error("Could not mark notification as read", e);
|
|
168
168
|
}
|
|
169
169
|
};
|
|
170
170
|
export const initializeCenterToggle = () => {
|
|
171
171
|
const [uiState, setUIState] = useNotificationUI();
|
|
172
172
|
const toggleCenter = () => {
|
|
173
|
-
setUIState({
|
|
174
|
-
...uiState,
|
|
175
|
-
showCenter: !uiState.showCenter,
|
|
176
|
-
});
|
|
173
|
+
setUIState(Object.assign(Object.assign({}, uiState), { showCenter: !uiState.showCenter }));
|
|
177
174
|
};
|
|
178
175
|
return {
|
|
179
176
|
toggleCenter,
|
|
180
177
|
};
|
|
181
178
|
};
|
|
182
179
|
export const getNotificationConfig = () => {
|
|
180
|
+
var _a, _b, _c, _d;
|
|
183
181
|
const config = WindowClient.options.customData;
|
|
184
|
-
return Object.assign(config
|
|
185
|
-
isTransparent: config
|
|
182
|
+
return Object.assign(((_b = (_a = config === null || config === void 0 ? void 0 : config.window) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.notifications) || {}, {
|
|
183
|
+
isTransparent: ((_d = (_c = config === null || config === void 0 ? void 0 : config.window) === null || _c === void 0 ? void 0 : _c.options) === null || _d === void 0 ? void 0 : _d.transparent) || false,
|
|
186
184
|
});
|
|
187
185
|
};
|
|
188
186
|
export const getFetchHistoryParams = (config, params) => {
|
|
189
|
-
|
|
187
|
+
var _a, _b;
|
|
188
|
+
const notificationsHistory = (config === null || config === void 0 ? void 0 : config.notificationsHistory) || ((_a = params === null || params === void 0 ? void 0 : params.config) === null || _a === void 0 ? void 0 : _a.notificationsHistory);
|
|
190
189
|
let options = notificationsHistory.since ? notificationsHistory.since : null;
|
|
191
190
|
if (!options) {
|
|
192
|
-
options = notificationsHistory
|
|
191
|
+
options = notificationsHistory === null || notificationsHistory === void 0 ? void 0 : notificationsHistory.options;
|
|
193
192
|
}
|
|
194
193
|
if (!options && typeof notificationsHistory === "boolean" && notificationsHistory) {
|
|
195
|
-
options = params
|
|
194
|
+
options = (_b = params === null || params === void 0 ? void 0 : params.config) === null || _b === void 0 ? void 0 : _b.notificationsHistory.options;
|
|
196
195
|
}
|
|
197
196
|
const filter = notificationsHistory.filter ? notificationsHistory.filter : null;
|
|
198
197
|
return [options, filter];
|
|
@@ -209,20 +208,20 @@ export default function useNotifications(params = {}) {
|
|
|
209
208
|
dispatch({ type: CREATE_MULTIPLE, payload: notifications });
|
|
210
209
|
};
|
|
211
210
|
const groupNotificationsByType = (notifications) => {
|
|
212
|
-
const groupBy = (arr
|
|
213
|
-
.map((notification) => notification
|
|
211
|
+
const groupBy = (arr) => arr
|
|
212
|
+
.map((notification) => { var _a; return (_a = notification.type) !== null && _a !== void 0 ? _a : "unknown"; })
|
|
214
213
|
.reduce((acc, notificationType, index) => {
|
|
215
214
|
acc[notificationType] = [...(acc[notificationType] || []), arr[index]];
|
|
216
215
|
return acc;
|
|
217
216
|
}, {});
|
|
218
|
-
return groupBy(notifications
|
|
217
|
+
return groupBy(notifications);
|
|
219
218
|
};
|
|
220
219
|
const getNotificationHistory = (since = { sentAfter: "1969-12-31T23:59:59.999Z" }, filter = null) => NotificationClient.fetchHistory(since, filter);
|
|
221
220
|
const notificationIsActive = (notification, applyMuteFilterOverride) => {
|
|
222
221
|
let applyMuteFilters = applyMuteFilterOverride;
|
|
223
222
|
if (typeof applyMuteFilterOverride === "undefined") {
|
|
224
223
|
const config = getNotificationConfig();
|
|
225
|
-
applyMuteFilters = config
|
|
224
|
+
applyMuteFilters = (config === null || config === void 0 ? void 0 : config.applyMuteFilters) ? config.applyMuteFilters : false;
|
|
226
225
|
}
|
|
227
226
|
return (!notification.isSnoozed &&
|
|
228
227
|
!notification.isRead &&
|
|
@@ -231,6 +230,7 @@ export default function useNotifications(params = {}) {
|
|
|
231
230
|
};
|
|
232
231
|
const activeNotifications = (notifications, applyMuteFilterOverride) => notifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));
|
|
233
232
|
async function init() {
|
|
233
|
+
var _a;
|
|
234
234
|
try {
|
|
235
235
|
const subscription = new NotificationClient.Subscription();
|
|
236
236
|
const notificationConfig = getNotificationConfig();
|
|
@@ -244,7 +244,7 @@ export default function useNotifications(params = {}) {
|
|
|
244
244
|
filter.exclude.push(...notificationConfig.filter.exclude);
|
|
245
245
|
}
|
|
246
246
|
subscription.filter = filter;
|
|
247
|
-
const notificationsHistory = notificationConfig
|
|
247
|
+
const notificationsHistory = (notificationConfig === null || notificationConfig === void 0 ? void 0 : notificationConfig.notificationsHistory) || ((_a = params === null || params === void 0 ? void 0 : params.config) === null || _a === void 0 ? void 0 : _a.notificationsHistory);
|
|
248
248
|
if (notificationsHistory) {
|
|
249
249
|
const [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);
|
|
250
250
|
const pastNotifications = await getNotificationHistory(options, historyFilter);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifications.js","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAK9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAA4B,MAAM,uCAAuC,CAAC;AAG7G,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;AAE1D,MAAM,YAAY,GAAQ,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC;AAKhD,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,MAAM,GAAG,QAAQ,CAAC;AAKxB,SAAS,OAAO,CAAC,KAAyC,EAAE,MAAsC;IACjG,QAAQ,MAAM,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YACnB,OAAO;gBACN,aAAa,EAAE,CAAC,GAAG,KAAK,CAAC,aAAa,EAAE,GAAG,MAAM,CAAC,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,CAAC,CAAC;iBACjC;qBAAM;oBACN,eAAe,CAAC,YAAY,CAAC,CAAC;iBAC9B;YACF,CAAC,CAAC;YAEF,OAAO,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;SAClE;QAAC,OAAO,KAAK,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACrB;IACF,CAAC;IAKD,SAAS,kBAAkB,CAAC,QAAiB;QAC5C,IAAI,QAAQ,EAAE;YACb,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7D,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAC9C,WAAW,CAAC,SAAS,GAAG,GAAG,WAAW,CAAC,SAAS,SAAS,CAAC;aAC1D;SACD;IACF,CAAC;IAGD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE;YAEX,CAAC,KAAK,IAAI,EAAE;gBACX,MAAM,eAAe,GAAG,CAAC,MAAM,SAAS,CAAQ,CAAC;gBACjD,IAAI,eAAe,EAAE;oBACpB,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;iBACzD;YACF,CAAC,CAAC,EAAE,CAAC;QACN,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACN,mBAAmB;QACnB,eAAe;QACf,oBAAoB;QACpB,sBAAsB;QACtB,wBAAwB;QACxB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB;QAClB,kBAAkB;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { useEffect, useReducer } from \"react\";\r\nimport { INotification } from \"common/notifications/definitions/INotification\";\r\nimport IFilter from \"common/notifications/definitions/IFilter\";\r\nimport IMuteFilter from \"common/notifications/definitions/IMuteFilter\";\r\nimport { WindowConfig, NotificationsConfig } from \"../components/notifications/types\";\r\nimport { usePubSub } from \"./usePubSub\";\r\nimport { NOTIFICATIONS_PUBSUB_TOPIC, NotificationServiceState } from \"../components/notifications/constants\";\r\nimport { INotificationHistoryOptions } from \"@finsemble/finsemble-core/src/common/notifications/definitions/INotificationHistoryOptions\";\r\n\r\nconst { WindowClient, NotificationClient } = FSBL.Clients;\r\n\r\nconst initialState: any = { notifications: [] };\r\n\r\n/*\r\nAction Types\r\n*/\r\nconst CREATE_MULTIPLE = \"CREATE_MULTIPLE\";\r\nconst UPDATE = \"UPDATE\";\r\nconst REMOVE = \"REMOVE\";\r\n\r\n/*\r\n\tReducer\r\n\t*/\r\nfunction reducer(state: { notifications: INotification[] }, action: { type: string; payload: any }) {\r\n\tswitch (action.type) {\r\n\t\tcase CREATE_MULTIPLE:\r\n\t\t\treturn {\r\n\t\t\t\tnotifications: [...state.notifications, ...action.payload],\r\n\t\t\t};\r\n\t\tcase UPDATE: {\r\n\t\t\t// check to see if the notification exists if so update the values\r\n\t\t\tconst notificationExistsInArray = state.notifications.find(\r\n\t\t\t\t(notification: INotification) => notification.id === action.payload.id\r\n\t\t\t);\r\n\r\n\t\t\t//if the notification exists then do nothing and return the current state else add the the new notification to the state\r\n\t\t\tconst notifications = notificationExistsInArray\r\n\t\t\t\t? state.notifications.map((notification: INotification) =>\r\n\t\t\t\t\t\tnotification.id === action.payload.id ? action.payload : notification\r\n\t\t\t\t )\r\n\t\t\t\t: [action.payload, ...state.notifications];\r\n\r\n\t\t\treturn { notifications };\r\n\t\t}\r\n\t\tcase REMOVE:\r\n\t\t\treturn {\r\n\t\t\t\tnotifications: state.notifications.filter((notification) => notification.id !== action.payload.id),\r\n\t\t\t};\r\n\t\tdefault:\r\n\t\t\tthrow new Error();\r\n\t}\r\n}\r\n\r\ntype NotificationUIStatePublish = (state: NotificationServiceState) => void;\r\n\r\n/**\r\n * Thin wrapper around usePubSub to give us typesafety for the notification service's UI state.\r\n * Automatically appends this client's windowName which is used by the notification service to\r\n * display the notification center on an appropriate monitor.\r\n */\r\nexport const useNotificationUI = (): [state: NotificationServiceState, setState: NotificationUIStatePublish] => {\r\n\tconst [state, setState] = usePubSub(NOTIFICATIONS_PUBSUB_TOPIC);\r\n\r\n\tconst setStateAndAddWindowName = (newState: NotificationServiceState) => {\r\n\t\tsetState({\r\n\t\t\t...newState,\r\n\t\t\tmostRecentWindowName: finsembleWindow.name,\r\n\t\t});\r\n\t};\r\n\treturn [state as NotificationServiceState, setStateAndAddWindowName];\r\n};\r\n\r\nconst getActiveDescriptorsByType = (componentType: string): Promise<any[]> =>\r\n\tnew Promise(async (resolve, reject) => {\r\n\t\tFSBL.Clients.LauncherClient.getActiveDescriptors((err: any, data: any) => {\r\n\t\t\tconst activeDescriptors: any[] = [];\r\n\t\t\tif (err) {\r\n\t\t\t\treject(err);\r\n\t\t\t} else {\r\n\t\t\t\tfor (const key in data) {\r\n\t\t\t\t\tif (data.hasOwnProperty(key) && data[key]?.componentType === componentType) {\r\n\t\t\t\t\t\tactiveDescriptors.push(data[key]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresolve(activeDescriptors);\r\n\t\t});\r\n\t});\r\n\r\nlet toolbarWindowName: string;\r\n\r\nexport const moveToToolbarMonitor = async () => {\r\n\tconst getToolbarMonitorData = async () =>\r\n\t\tnew Promise(async (resolve, reject) => {\r\n\t\t\tif (!toolbarWindowName) {\r\n\t\t\t\tconst activeDescriptors = await getActiveDescriptorsByType(\"Toolbar\");\r\n\t\t\t\ttoolbarWindowName = activeDescriptors[0]?.name;\r\n\t\t\t}\r\n\t\t\tconst { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({\r\n\t\t\t\twindowIdentifier: { windowName: toolbarWindowName },\r\n\t\t\t})) as any;\r\n\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.error(\"Could not get Monitor info\", err);\r\n\t\t\t\treject(err);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tresolve(data);\r\n\t\t});\r\n\r\n\tconst data = (await getToolbarMonitorData()) as any;\r\n\tconst bounds = (await finsembleWindow.getBounds({})) as any;\r\n\tconst width = bounds.data.right - bounds.data.left;\r\n\r\n\tfinsembleWindow.setBounds(\r\n\t\t{\r\n\t\t\tbounds: {\r\n\t\t\t\ttop: data[\"availableRect\"][\"top\"],\r\n\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\r\n\t\t\t\theight: data[\"availableRect\"][\"height\"],\r\n\t\t\t\twidth: width,\r\n\t\t\t},\r\n\t\t},\r\n\t\t(err: any) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.error(\"Could not update position\", err);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n};\r\n\r\nexport const getOS = () => {\r\n\tif (navigator.platform.indexOf(\"Win\") != -1) {\r\n\t\treturn \"Windows\";\r\n\t} else if (navigator.platform.indexOf(\"Linux\") != -1) {\r\n\t\treturn \"Linux\";\r\n\t} else if (navigator.platform.indexOf(\"Mac\") != -1) {\r\n\t\treturn \"Mac\";\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param notification\r\n * @param action\r\n */\r\nexport const doAction = (notification: INotification, action: any) => {\r\n\ttry {\r\n\t\tNotificationClient.performAction([notification], action).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t\t// 1) alert user notification has been sent (action may not have completed)\r\n\t\t});\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"could not create a notification client\", e);\r\n\t\tFSBL.Clients.Logger.error(\"could not create a notification client\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param filter\r\n */\r\nexport const mute = async (filter: IMuteFilter) => {\r\n\ttry {\r\n\t\tawait NotificationClient.mute(filter);\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"Could not save mute preferences\", e);\r\n\t\tFSBL.Clients.Logger.error(\"Could not save mute preferences\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param filter\r\n */\r\nexport const unmute = async (filter: IMuteFilter) => {\r\n\ttry {\r\n\t\tawait NotificationClient.unmute(filter);\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"Could not save mute preferences\", e);\r\n\t\tFSBL.Clients.Logger.error(\"Could not save mute preferences\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Snooze a notification\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const snoozeNotifications = async (notifications: INotification[]) => {\r\n\tconst preferences: any = await FSBL.Clients.NotificationClient.getPreferences();\r\n\tconst snoozeAction = new FSBL.Clients.NotificationClient.Action();\r\n\tsnoozeAction.type = FSBL.Clients.NotificationClient.ActionTypes.SNOOZE;\r\n\tif (preferences && preferences.defaultSnoozePeriodSeconds) {\r\n\t\tsnoozeAction.milliseconds = preferences.defaultSnoozePeriodSeconds * 1000;\r\n\t}\r\n\tsnoozeAction.buttonText = \"Snooze\";\r\n\r\n\tfor (let i = 0; i < notifications.length; i++) {\r\n\t\tdoAction(notifications[i], snoozeAction);\r\n\t}\r\n};\r\n\r\n/**\r\n * Marks a notification as read\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const markNotificationsUnread = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.markUnread(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as unread\", e);\r\n\t\tFSBL.Clients.Logger.error(\"Could not mark notification as unread\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Marks a notification as read\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const markNotificationsRead = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.markRead(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as read\", e);\r\n\t\tFSBL.Clients.Logger.error(\"Could not mark notification as read\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Dismisses a notification\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const dismissNotification = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.deleteNotifications(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as read\", e);\r\n\t\tFSBL.Clients.Logger.error(\"Could not mark notification as read\", e);\r\n\t}\r\n};\r\n\r\nexport const initializeCenterToggle = () => {\r\n\tconst [uiState, setUIState] = useNotificationUI();\r\n\r\n\tconst toggleCenter = () => {\r\n\t\tsetUIState({\r\n\t\t\t...uiState,\r\n\t\t\tshowCenter: !uiState.showCenter,\r\n\t\t});\r\n\t};\r\n\r\n\treturn {\r\n\t\ttoggleCenter,\r\n\t};\r\n};\r\n\r\n/**\r\n * Get Notification's config from\r\n */\r\nexport const getNotificationConfig = (): NotificationsConfig => {\r\n\tconst config: WindowConfig = WindowClient.options.customData;\r\n\r\n\treturn Object.assign(config?.window?.data?.notifications || {}, {\r\n\t\tisTransparent: config?.window?.options?.transparent || false,\r\n\t});\r\n};\r\n\r\nexport const getFetchHistoryParams = (config: any, params: any) => {\r\n\tconst notificationsHistory = config?.notificationsHistory || params?.config?.notificationsHistory;\r\n\r\n\t// Backwards compatibility - `since` replaced with `options` object\r\n\tlet options = notificationsHistory.since ? notificationsHistory.since : null;\r\n\r\n\t// Use options object if it's been set in the component config\r\n\tif (!options) {\r\n\t\toptions = notificationsHistory?.options;\r\n\t}\r\n\r\n\t// If no options object set and notificationsHistory is true set in config, use the params\r\n\tif (!options && typeof notificationsHistory === \"boolean\" && notificationsHistory) {\r\n\t\toptions = params?.config?.notificationsHistory.options;\r\n\t}\r\n\r\n\tconst filter = notificationsHistory.filter ? notificationsHistory.filter : null;\r\n\r\n\treturn [options, filter];\r\n};\r\n\r\nexport default function useNotifications(params: any = {}) {\r\n\tconst [state, dispatch] = useReducer(reducer, initialState);\r\n\r\n\t/*\r\n\t\tAction Creators\r\n\t*/\r\n\tconst removeNotification = (notification: INotification) => {\r\n\t\tdispatch({ type: REMOVE, payload: notification });\r\n\t};\r\n\r\n\tconst addNotification = (notification: INotification) => {\r\n\t\tdispatch({ type: UPDATE, payload: notification });\r\n\t};\r\n\r\n\tconst addMultipleNotifications = (notifications: INotification[]) => {\r\n\t\tdispatch({ type: CREATE_MULTIPLE, payload: notifications });\r\n\t};\r\n\r\n\t/**\r\n\t * Group Notifications by Type\r\n\t * @param notifications\r\n\t */\r\n\tconst groupNotificationsByType = (notifications: INotification[]) => {\r\n\t\tconst groupBy = (arr: INotification[], type: keyof INotification) =>\r\n\t\t\tarr\r\n\t\t\t\t.map(\r\n\t\t\t\t\t(notification: INotification): string =>\r\n\t\t\t\t\t\t//@ts-ignore\r\n\t\t\t\t\t\tnotification[type]\r\n\t\t\t\t)\r\n\t\t\t\t.reduce((acc: { [x: string]: any }, notificationType: string, index: number) => {\r\n\t\t\t\t\tacc[notificationType] = [...(acc[notificationType] || []), arr[index]];\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}, {});\r\n\r\n\t\treturn groupBy(notifications, \"type\");\r\n\t};\r\n\r\n\t/**\r\n\t * \t * get the past notifications\r\n\t * WARNING - The default will get all notifications all the way back from 1969!!!\r\n\t * @param since\r\n\t * @param filter\r\n\t */\r\n\tconst getNotificationHistory = (\r\n\t\tsince: INotificationHistoryOptions = { sentAfter: \"1969-12-31T23:59:59.999Z\" },\r\n\t\tfilter: null | IFilter = null\r\n\t): Promise<INotification[]> => NotificationClient.fetchHistory(since, filter as IFilter);\r\n\r\n\tconst notificationIsActive = (notification: INotification, applyMuteFilterOverride?: boolean | undefined) => {\r\n\t\tlet applyMuteFilters = applyMuteFilterOverride;\r\n\r\n\t\tif (typeof applyMuteFilterOverride === \"undefined\") {\r\n\t\t\tconst config = getNotificationConfig();\r\n\t\t\tapplyMuteFilters = config?.applyMuteFilters ? config.applyMuteFilters : false;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t!notification.isSnoozed &&\r\n\t\t\t!notification.isRead &&\r\n\t\t\t!notification.isDeleted &&\r\n\t\t\t(applyMuteFilters ? !notification.isMuted : true)\r\n\t\t);\r\n\t};\r\n\r\n\tconst activeNotifications = (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) =>\r\n\t\tnotifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));\r\n\r\n\t/**\r\n\t * Main init function to start the subscription\r\n\t */\r\n\tasync function init() {\r\n\t\ttry {\r\n\t\t\tconst subscription = new NotificationClient.Subscription();\r\n\r\n\t\t\tconst notificationConfig: NotificationsConfig = getNotificationConfig();\r\n\r\n\t\t\tconst filter: IFilter = new NotificationClient.Filter();\r\n\r\n\t\t\t// make filters from the config\r\n\t\t\tif (notificationConfig) {\r\n\t\t\t\tnotificationConfig.filter &&\r\n\t\t\t\t\tnotificationConfig.filter.include &&\r\n\t\t\t\t\tfilter.include.push(...notificationConfig.filter.include);\r\n\r\n\t\t\t\tnotificationConfig.filter &&\r\n\t\t\t\t\tnotificationConfig.filter.exclude &&\r\n\t\t\t\t\tfilter.exclude.push(...notificationConfig.filter.exclude);\r\n\t\t\t}\r\n\r\n\t\t\tsubscription.filter = filter;\r\n\r\n\t\t\tconst notificationsHistory = notificationConfig?.notificationsHistory || params?.config?.notificationsHistory;\r\n\r\n\t\t\tif (notificationsHistory) {\r\n\t\t\t\tconst [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);\r\n\r\n\t\t\t\tconst pastNotifications = await getNotificationHistory(options, historyFilter);\r\n\t\t\t\taddMultipleNotifications(pastNotifications);\r\n\t\t\t}\r\n\t\t\tconst onNotification = function (notification: INotification) {\r\n\t\t\t\t// This function will be called when a notification arrives\r\n\t\t\t\tif (notification.isDeleted) {\r\n\t\t\t\t\tremoveNotification(notification);\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddNotification(notification);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\treturn NotificationClient.subscribe(subscription, onNotification);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set opaque class to html element\r\n\t */\r\n\tfunction setOpaqueClassName(isOpaque: boolean) {\r\n\t\tif (isOpaque) {\r\n\t\t\tconst htmlElement = document.getElementsByTagName(\"html\")[0];\r\n\t\t\tif (!htmlElement.className.includes(\"opaque\")) {\r\n\t\t\t\thtmlElement.className = `${htmlElement.className} opaque`;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// start receiving Notifications and putting them in state\r\n\tuseEffect(() => {\r\n\t\tconst subscribe = init();\r\n\t\treturn () => {\r\n\t\t\t// Unsubscribe using the subscription ID\r\n\t\t\t(async () => {\r\n\t\t\t\tconst subscribeObject = (await subscribe) as any;\r\n\t\t\t\tif (subscribeObject) {\r\n\t\t\t\t\tawait NotificationClient.unsubscribe(subscribeObject.id);\r\n\t\t\t\t}\r\n\t\t\t})();\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn {\r\n\t\tactiveNotifications,\r\n\t\taddNotification,\r\n\t\tnotificationIsActive,\r\n\t\tgetNotificationHistory,\r\n\t\tgroupNotificationsByType,\r\n\t\tnotifications: state.notifications,\r\n\t\tremoveNotification,\r\n\t\tsetOpaqueClassName,\r\n\t};\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"useNotifications.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,CAAC;iBAC9B;YACF,CAAC,CAAC;YAEF,OAAO,kBAAkB,CAAC,SAAS,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;SAClE;QAAC,OAAO,KAAK,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACrB;IACF,CAAC;IAKD,SAAS,kBAAkB,CAAC,QAAiB;QAC5C,IAAI,QAAQ,EAAE;YACb,MAAM,WAAW,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YAC7D,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;gBAC9C,WAAW,CAAC,SAAS,GAAG,GAAG,WAAW,CAAC,SAAS,SAAS,CAAC;aAC1D;SACD;IACF,CAAC;IAGD,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC;QACzB,OAAO,GAAG,EAAE;YAEX,CAAC,KAAK,IAAI,EAAE;gBACX,MAAM,eAAe,GAAG,CAAC,MAAM,SAAS,CAAQ,CAAC;gBACjD,IAAI,eAAe,EAAE;oBACpB,MAAM,kBAAkB,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;iBACzD;YACF,CAAC,CAAC,EAAE,CAAC;QACN,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO;QACN,mBAAmB;QACnB,eAAe;QACf,oBAAoB;QACpB,sBAAsB;QACtB,wBAAwB;QACxB,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,kBAAkB;QAClB,kBAAkB;KAClB,CAAC;AACH,CAAC","sourcesContent":["import { useEffect, useReducer } from \"react\";\r\nimport { WindowConfig, NotificationsConfig } from \"../components/notifications/types\";\r\nimport { usePubSub } from \"./usePubSub\";\r\nimport { NOTIFICATIONS_PUBSUB_TOPIC } from \"../components/notifications/constants\";\r\nimport { services } from \"@finsemble/finsemble-core\";\r\ntype NotificationServiceState = services.notification.types.NotificationServiceState;\r\n\r\ntype IFilter = services.notification.types.IFilter;\r\ntype IMuteFilter = services.notification.types.IMuteFilter;\r\ntype INotification = services.notification.types.INotification;\r\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\r\n\r\nconst { WindowClient, NotificationClient } = FSBL.Clients;\r\n\r\nconst initialState: any = { notifications: [] };\r\n\r\n/*\r\nAction Types\r\n*/\r\nconst CREATE_MULTIPLE = \"CREATE_MULTIPLE\";\r\nconst UPDATE = \"UPDATE\";\r\nconst REMOVE = \"REMOVE\";\r\n\r\n/*\r\n\tReducer\r\n\t*/\r\nfunction reducer(state: { notifications: INotification[] }, action: { type: string; payload: any }) {\r\n\tswitch (action.type) {\r\n\t\tcase CREATE_MULTIPLE:\r\n\t\t\treturn {\r\n\t\t\t\tnotifications: [...state.notifications, ...action.payload],\r\n\t\t\t};\r\n\t\tcase UPDATE: {\r\n\t\t\t// check to see if the notification exists if so update the values\r\n\t\t\tconst notificationExistsInArray = state.notifications.find(\r\n\t\t\t\t(notification: INotification) => notification.id === action.payload.id\r\n\t\t\t);\r\n\r\n\t\t\t//if the notification exists then do nothing and return the current state else add the the new notification to the state\r\n\t\t\tconst notifications = notificationExistsInArray\r\n\t\t\t\t? state.notifications.map((notification: INotification) =>\r\n\t\t\t\t\t\tnotification.id === action.payload.id ? action.payload : notification\r\n\t\t\t\t )\r\n\t\t\t\t: [action.payload, ...state.notifications];\r\n\r\n\t\t\treturn { notifications };\r\n\t\t}\r\n\t\tcase REMOVE:\r\n\t\t\treturn {\r\n\t\t\t\tnotifications: state.notifications.filter((notification) => notification.id !== action.payload.id),\r\n\t\t\t};\r\n\t\tdefault:\r\n\t\t\tthrow new Error();\r\n\t}\r\n}\r\n\r\ntype NotificationUIStatePublish = (state: NotificationServiceState) => void;\r\n\r\n/**\r\n * Thin wrapper around usePubSub to give us typesafety for the notification service's UI state.\r\n * Automatically appends this client's windowName which is used by the notification service to\r\n * display the notification center on an appropriate monitor.\r\n */\r\nexport const useNotificationUI = (): [state: NotificationServiceState, setState: NotificationUIStatePublish] => {\r\n\tconst [state, setState] = usePubSub(NOTIFICATIONS_PUBSUB_TOPIC);\r\n\r\n\tconst setStateAndAddWindowName = (newState: NotificationServiceState) => {\r\n\t\tsetState({\r\n\t\t\t...newState,\r\n\t\t\tmostRecentWindowName: finsembleWindow.name,\r\n\t\t});\r\n\t};\r\n\treturn [state as NotificationServiceState, setStateAndAddWindowName];\r\n};\r\n\r\nconst getActiveDescriptorsByType = (componentType: string): Promise<any[]> =>\r\n\tnew Promise(async (resolve, reject) => {\r\n\t\tFSBL.Clients.LauncherClient.getActiveDescriptors((err: any, data: any) => {\r\n\t\t\tconst activeDescriptors: any[] = [];\r\n\t\t\tif (err) {\r\n\t\t\t\treject(err);\r\n\t\t\t} else {\r\n\t\t\t\tfor (const key in data) {\r\n\t\t\t\t\tif (data.hasOwnProperty(key) && data[key]?.componentType === componentType) {\r\n\t\t\t\t\t\tactiveDescriptors.push(data[key]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tresolve(activeDescriptors);\r\n\t\t});\r\n\t});\r\n\r\nlet toolbarWindowName: string;\r\n\r\nexport const moveToToolbarMonitor = async () => {\r\n\tconst getToolbarMonitorData = async () =>\r\n\t\tnew Promise(async (resolve, reject) => {\r\n\t\t\tif (!toolbarWindowName) {\r\n\t\t\t\tconst activeDescriptors = await getActiveDescriptorsByType(\"Toolbar\");\r\n\t\t\t\ttoolbarWindowName = activeDescriptors[0]?.name;\r\n\t\t\t}\r\n\t\t\tconst { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({\r\n\t\t\t\twindowIdentifier: { windowName: toolbarWindowName },\r\n\t\t\t})) as any;\r\n\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not get Monitor info\", err);\r\n\t\t\t\treject(err);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tresolve(data);\r\n\t\t});\r\n\r\n\tconst data = (await getToolbarMonitorData()) as any;\r\n\tconst { data: bounds } = await finsembleWindow.getBounds();\r\n\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\r\n\r\n\tfinsembleWindow.setBounds(\r\n\t\t{\r\n\t\t\tbounds: {\r\n\t\t\t\ttop: data[\"availableRect\"][\"top\"],\r\n\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\r\n\t\t\t\theight: data[\"availableRect\"][\"height\"],\r\n\t\t\t\twidth: width,\r\n\t\t\t},\r\n\t\t},\r\n\t\t(err: any) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Could not update position\", err);\r\n\t\t\t}\r\n\t\t}\r\n\t);\r\n};\r\n\r\nexport const getOS = () => {\r\n\tif (navigator.platform.indexOf(\"Win\") != -1) {\r\n\t\treturn \"Windows\";\r\n\t} else if (navigator.platform.indexOf(\"Linux\") != -1) {\r\n\t\treturn \"Linux\";\r\n\t} else if (navigator.platform.indexOf(\"Mac\") != -1) {\r\n\t\treturn \"Mac\";\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param notification\r\n * @param action\r\n */\r\nexport const doAction = (notification: INotification, action: any) => {\r\n\ttry {\r\n\t\tNotificationClient.performAction([notification], action).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t\t// 1) alert user notification has been sent (action may not have completed)\r\n\t\t});\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"could not create a notification client\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"could not create a notification client\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param filter\r\n */\r\nexport const mute = async (filter: IMuteFilter) => {\r\n\ttry {\r\n\t\tawait NotificationClient.mute(filter);\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"Could not save mute preferences\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Example for setting up button clicks\r\n *\r\n * @param filter\r\n */\r\nexport const unmute = async (filter: IMuteFilter) => {\r\n\ttry {\r\n\t\tawait NotificationClient.unmute(filter);\r\n\t} catch (e) {\r\n\t\t// NOTE: The request to perform the action has failed\r\n\t\tconsole.error(\"Could not save mute preferences\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"Could not save mute preferences\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Snooze a notification\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const snoozeNotifications = async (notifications: INotification[]) => {\r\n\tconst preferences: any = await FSBL.Clients.NotificationClient.getPreferences();\r\n\tconst snoozeAction = new FSBL.Clients.NotificationClient.Action();\r\n\tsnoozeAction.type = FSBL.Clients.NotificationClient.ActionTypes.SNOOZE;\r\n\tif (preferences && preferences.defaultSnoozePeriodSeconds) {\r\n\t\tsnoozeAction.milliseconds = preferences.defaultSnoozePeriodSeconds * 1000;\r\n\t}\r\n\tsnoozeAction.buttonText = \"Snooze\";\r\n\r\n\tfor (let i = 0; i < notifications.length; i++) {\r\n\t\tdoAction(notifications[i], snoozeAction);\r\n\t}\r\n};\r\n\r\n/**\r\n * Marks a notification as read\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const markNotificationsUnread = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.markUnread(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as unread\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as unread\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Marks a notification as read\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const markNotificationsRead = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.markRead(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as read\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\r\n\t}\r\n};\r\n\r\n/**\r\n * Dismisses a notification\r\n *\r\n * @param {INotification[]} notifications\r\n */\r\nexport const dismissNotification = (notifications: INotification[]) => {\r\n\ttry {\r\n\t\tNotificationClient.deleteNotifications(notifications).then(() => {\r\n\t\t\t// NOTE: The request to perform the action has be sent to the notifications service successfully\r\n\t\t\t// The action itself has not necessarily been perform successfully\r\n\t\t});\r\n\t} catch (e) {\r\n\t\tconsole.error(\"Error marking messages as read\", e);\r\n\t\tFSBL.Clients.Logger.system.error(\"Could not mark notification as read\", e);\r\n\t}\r\n};\r\n\r\nexport const initializeCenterToggle = () => {\r\n\tconst [uiState, setUIState] = useNotificationUI();\r\n\r\n\tconst toggleCenter = () => {\r\n\t\tsetUIState({\r\n\t\t\t...uiState,\r\n\t\t\tshowCenter: !uiState.showCenter,\r\n\t\t});\r\n\t};\r\n\r\n\treturn {\r\n\t\ttoggleCenter,\r\n\t};\r\n};\r\n\r\n/**\r\n * Get Notification's config from\r\n */\r\nexport const getNotificationConfig = (): NotificationsConfig => {\r\n\tconst config: WindowConfig = WindowClient.options.customData;\r\n\r\n\treturn Object.assign(config?.window?.data?.notifications || {}, {\r\n\t\tisTransparent: config?.window?.options?.transparent || false,\r\n\t});\r\n};\r\n\r\nexport const getFetchHistoryParams = (config: any, params: any) => {\r\n\tconst notificationsHistory = config?.notificationsHistory || params?.config?.notificationsHistory;\r\n\r\n\t// Backwards compatibility - `since` replaced with `options` object\r\n\tlet options = notificationsHistory.since ? notificationsHistory.since : null;\r\n\r\n\t// Use options object if it's been set in the component config\r\n\tif (!options) {\r\n\t\toptions = notificationsHistory?.options;\r\n\t}\r\n\r\n\t// If no options object set and notificationsHistory is true set in config, use the params\r\n\tif (!options && typeof notificationsHistory === \"boolean\" && notificationsHistory) {\r\n\t\toptions = params?.config?.notificationsHistory.options;\r\n\t}\r\n\r\n\tconst filter = notificationsHistory.filter ? notificationsHistory.filter : null;\r\n\r\n\treturn [options, filter];\r\n};\r\n\r\nexport default function useNotifications(params: any = {}) {\r\n\tconst [state, dispatch] = useReducer(reducer, initialState);\r\n\r\n\t/*\r\n\t\tAction Creators\r\n\t*/\r\n\tconst removeNotification = (notification: INotification) => {\r\n\t\tdispatch({ type: REMOVE, payload: notification });\r\n\t};\r\n\r\n\tconst addNotification = (notification: INotification) => {\r\n\t\tdispatch({ type: UPDATE, payload: notification });\r\n\t};\r\n\r\n\tconst addMultipleNotifications = (notifications: INotification[]) => {\r\n\t\tdispatch({ type: CREATE_MULTIPLE, payload: notifications });\r\n\t};\r\n\r\n\t/**\r\n\t * Group Notifications by Type\r\n\t * @param notifications\r\n\t */\r\n\tconst groupNotificationsByType = (notifications: INotification[]) => {\r\n\t\tconst groupBy = (arr: INotification[]) =>\r\n\t\t\tarr\r\n\t\t\t\t.map((notification: INotification): string => notification.type ?? \"unknown\")\r\n\t\t\t\t.reduce((acc: { [x: string]: any }, notificationType: string, index: number) => {\r\n\t\t\t\t\tacc[notificationType] = [...(acc[notificationType] || []), arr[index]];\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}, {});\r\n\r\n\t\treturn groupBy(notifications);\r\n\t};\r\n\r\n\t/**\r\n\t * \t * get the past notifications\r\n\t * WARNING - The default will get all notifications all the way back from 1969!!!\r\n\t * @param since\r\n\t * @param filter\r\n\t */\r\n\tconst getNotificationHistory = (\r\n\t\tsince: INotificationHistoryOptions = { sentAfter: \"1969-12-31T23:59:59.999Z\" },\r\n\t\tfilter: null | IFilter = null\r\n\t): Promise<INotification[]> => NotificationClient.fetchHistory(since, filter as IFilter);\r\n\r\n\tconst notificationIsActive = (notification: INotification, applyMuteFilterOverride?: boolean | undefined) => {\r\n\t\tlet applyMuteFilters = applyMuteFilterOverride;\r\n\r\n\t\tif (typeof applyMuteFilterOverride === \"undefined\") {\r\n\t\t\tconst config = getNotificationConfig();\r\n\t\t\tapplyMuteFilters = config?.applyMuteFilters ? config.applyMuteFilters : false;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t!notification.isSnoozed &&\r\n\t\t\t!notification.isRead &&\r\n\t\t\t!notification.isDeleted &&\r\n\t\t\t(applyMuteFilters ? !notification.isMuted : true)\r\n\t\t);\r\n\t};\r\n\r\n\tconst activeNotifications = (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) =>\r\n\t\tnotifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));\r\n\r\n\t/**\r\n\t * Main init function to start the subscription\r\n\t */\r\n\tasync function init() {\r\n\t\ttry {\r\n\t\t\tconst subscription = new NotificationClient.Subscription();\r\n\r\n\t\t\tconst notificationConfig: NotificationsConfig = getNotificationConfig();\r\n\r\n\t\t\tconst filter: IFilter = new NotificationClient.Filter();\r\n\r\n\t\t\t// make filters from the config\r\n\t\t\tif (notificationConfig) {\r\n\t\t\t\tnotificationConfig.filter &&\r\n\t\t\t\t\tnotificationConfig.filter.include &&\r\n\t\t\t\t\tfilter.include.push(...notificationConfig.filter.include);\r\n\r\n\t\t\t\tnotificationConfig.filter &&\r\n\t\t\t\t\tnotificationConfig.filter.exclude &&\r\n\t\t\t\t\tfilter.exclude.push(...notificationConfig.filter.exclude);\r\n\t\t\t}\r\n\r\n\t\t\tsubscription.filter = filter;\r\n\r\n\t\t\tconst notificationsHistory = notificationConfig?.notificationsHistory || params?.config?.notificationsHistory;\r\n\r\n\t\t\tif (notificationsHistory) {\r\n\t\t\t\tconst [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);\r\n\r\n\t\t\t\tconst pastNotifications = await getNotificationHistory(options, historyFilter);\r\n\t\t\t\taddMultipleNotifications(pastNotifications);\r\n\t\t\t}\r\n\t\t\tconst onNotification = function (notification: INotification) {\r\n\t\t\t\t// This function will be called when a notification arrives\r\n\t\t\t\tif (notification.isDeleted) {\r\n\t\t\t\t\tremoveNotification(notification);\r\n\t\t\t\t} else {\r\n\t\t\t\t\taddNotification(notification);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\r\n\t\t\treturn NotificationClient.subscribe(subscription, onNotification);\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Set opaque class to html element\r\n\t */\r\n\tfunction setOpaqueClassName(isOpaque: boolean) {\r\n\t\tif (isOpaque) {\r\n\t\t\tconst htmlElement = document.getElementsByTagName(\"html\")[0];\r\n\t\t\tif (!htmlElement.className.includes(\"opaque\")) {\r\n\t\t\t\thtmlElement.className = `${htmlElement.className} opaque`;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// start receiving Notifications and putting them in state\r\n\tuseEffect(() => {\r\n\t\tconst subscribe = init();\r\n\t\treturn () => {\r\n\t\t\t// Unsubscribe using the subscription ID\r\n\t\t\t(async () => {\r\n\t\t\t\tconst subscribeObject = (await subscribe) as any;\r\n\t\t\t\tif (subscribeObject) {\r\n\t\t\t\t\tawait NotificationClient.unsubscribe(subscribeObject.id);\r\n\t\t\t\t}\r\n\t\t\t})();\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn {\r\n\t\tactiveNotifications,\r\n\t\taddNotification,\r\n\t\tnotificationIsActive,\r\n\t\tgetNotificationHistory,\r\n\t\tgroupNotificationsByType,\r\n\t\tnotifications: state.notifications,\r\n\t\tremoveNotification,\r\n\t\tsetOpaqueClassName,\r\n\t};\r\n}\r\n"]}
|
package/react/hooks/usePubSub.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
const { useState, useEffect } = React;
|
|
3
|
-
const { RouterClient } = FSBL.Clients;
|
|
4
|
-
const { publish, subscribe, unsubscribe } = RouterClient;
|
|
5
3
|
function usePubSub(topic, initialMessage = {}) {
|
|
6
4
|
const [message, setMessage] = useState(initialMessage);
|
|
7
|
-
const pub = (value) => publish(topic, value);
|
|
5
|
+
const pub = (value) => FSBL.Clients.RouterClient.publish(topic, value);
|
|
8
6
|
useEffect(() => {
|
|
9
|
-
const subscribeId = subscribe(topic, (err, res) => {
|
|
7
|
+
const subscribeId = FSBL.Clients.RouterClient.subscribe(topic, (err, res) => {
|
|
10
8
|
if (err) {
|
|
11
9
|
console.error(err);
|
|
12
10
|
}
|
|
13
11
|
setMessage(res.data);
|
|
14
12
|
});
|
|
15
13
|
return () => {
|
|
16
|
-
unsubscribe(subscribeId);
|
|
14
|
+
FSBL.Clients.RouterClient.unsubscribe(subscribeId);
|
|
17
15
|
};
|
|
18
16
|
}, []);
|
|
19
17
|
return [message, pub];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePubSub.js","sourceRoot":"","sources":["../../src/hooks/usePubSub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"usePubSub.js","sourceRoot":"","sources":["../../src/hooks/usePubSub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;AAmBtC,SAAS,SAAS,CAAC,KAAa,EAAE,iBAAyB,EAAE;IAC5D,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEvD,MAAM,GAAG,GAAG,CAAC,KAAU,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE5E,SAAS,CAAC,GAAG,EAAE;QACd,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;YAC3E,IAAI,GAAG,EAAE;gBAER,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YACD,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC,CAAC,CAAC;QACH,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;QACpD,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import * as React from \"react\";\r\n\r\nconst { useState, useEffect } = React;\r\n\r\n/**\r\n * A generic effect for getting and setting state dynamically from a Router pubsub channel.\r\n *\r\n * @param {string} topic The pubsub topic (i.e. channel) to subscribe\r\n * @param {object} initialMessage The initial state (defaults to empty object)\r\n * @returns [object, function] The current state of the pubsub channel (or initialMessage if no state exists).\r\n * The second returned array parameter is a publish function which can be used to update state.\r\n *\r\n * @example\r\n * // Inside a React functional component\r\n * const [currentState, publish] = usePubSub(\"topic\", {});\r\n * console.log(currentState);\r\n *\r\n * onClick = () => {\r\n * publish(someNewState);\r\n * }\r\n */\r\nfunction usePubSub(topic: string, initialMessage: object = {}): [{ [key: string]: any }, Function] {\r\n\tconst [message, setMessage] = useState(initialMessage);\r\n\r\n\tconst pub = (value: any) => FSBL.Clients.RouterClient.publish(topic, value);\r\n\r\n\tuseEffect(() => {\r\n\t\tconst subscribeId = FSBL.Clients.RouterClient.subscribe(topic, (err, res) => {\r\n\t\t\tif (err) {\r\n\t\t\t\t// Use Finsemble Logger?\r\n\t\t\t\tconsole.error(err);\r\n\t\t\t}\r\n\t\t\tsetMessage(res.data);\r\n\t\t});\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(subscribeId);\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn [message, pub];\r\n}\r\n\r\nexport { usePubSub };\r\n"]}
|
package/react/hooks/useSearch.js
CHANGED
|
@@ -16,7 +16,7 @@ const useSearch = () => {
|
|
|
16
16
|
const clonedProviderResponses = JSON.parse(JSON.stringify(responses));
|
|
17
17
|
if (!clonedProviderResponses)
|
|
18
18
|
return updateResults([]);
|
|
19
|
-
let providersWithData = clonedProviderResponses.filter((provider) => provider
|
|
19
|
+
let providersWithData = clonedProviderResponses.filter((provider) => { var _a; return (_a = provider === null || provider === void 0 ? void 0 : provider.data) === null || _a === void 0 ? void 0 : _a.length; });
|
|
20
20
|
if (providersWithData.length === 0)
|
|
21
21
|
providersWithData = [];
|
|
22
22
|
updateResults(providersWithData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSearch.js","sourceRoot":"","sources":["../../src/hooks/useSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;AActC,MAAM,SAAS,GAAG,GAAe,EAAE;IAClC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IAEhC,MAAM,aAAa,GA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AAW,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,QAAQ,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC,CAAC;IACxC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,OAAO;QACN,aAAa;QACb,WAAW;QACX,WAAW;QACX,WAAW;KACX,CAAC;AACH,CAAC,CAAC;AACF,OAAO,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import { useRef, useCallback } from \"react\";\r\nimport { useDispatch, useSelector } from \"../store\";\r\nimport { SearchActions } from \"../actions/searchActions\";\r\nimport { SearchProviderResponse } from \"../types/searchTypes\";\r\nimport { debounce } from \"lodash\";\r\n\r\nconst { SearchClient } = FSBL.Clients;\r\n\r\ntype SearchHook = {\r\n\tsearchResults: Array<SearchProviderResponse>;\r\n\tsearchQuery: string;\r\n\tupdateQuery: (query: string) => void;\r\n\tresetSearch: () => void;\r\n};\r\n\r\n/**\r\n * A hook for working with search. Search results stream back, and this hook will relay those through\r\n * a reducer. Note that the reducer implementation is a singleton (if you have multiple search) inputs\r\n * across a component then they will all be synchronized to query and results.\r\n */\r\nconst useSearch = (): SearchHook => {\r\n\tconst dispatch = useDispatch();\r\n\tconst { searchQuery, searchResults } = useSelector((state) => state.search);\r\n\tconst currentQuery = useRef({});\r\n\r\n\tconst updateResults = useCallback(\r\n\t\t(results: Array<any>) => {\r\n\t\t\tdispatch(SearchActions.UPDATE_RESULTS(results));\r\n\t\t},\r\n\t\t[dispatch]\r\n\t);\r\n\tconst onSearchClientResponse = (searchError: any, responses: SearchProviderResponse[], query: string) => {\r\n\t\t// If we get a response back from an older query then drop the results\r\n\t\tif (query !== currentQuery.current) return;\r\n\t\t/**\r\n\t\t * The callback from `SearchClient.search` can return *multiple times*, and it uses a single global array\r\n\t\t * that it is constantly mutating. React isn't doing a deep comparison, so it never updates the results, we\r\n\t\t * therefore force an update by cloning the array into a new reference.\r\n\t\t */\r\n\t\tconst clonedProviderResponses = JSON.parse(JSON.stringify(responses));\r\n\r\n\t\tif (!clonedProviderResponses) return updateResults([]);\r\n\r\n\t\tlet providersWithData = clonedProviderResponses.filter(\r\n\t\t\t(provider: SearchProviderResponse) => provider?.data?.length\r\n\t\t);\r\n\t\tif (providersWithData.length === 0) providersWithData = [];\r\n\r\n\t\tupdateResults(providersWithData);\r\n\t};\r\n\r\n\t/**\r\n\t * The seach client callback procedure is a little strange. In order to prevent a hangup for slow search\r\n\t * providers, your callback to searchClient.search is invoked multiple times -- one time per search provider.\r\n\t *\r\n\t * Your search goes out for \"De\", you get a response from the WindowService saying \"No components match\".\r\n\t * Then you get a response from the WorkspaceService saying \"Hey DefaultWorkspace matches!\". Your callback\r\n\t * has been hit twice. On the 2nd time, you get all of the data you would've gotten the first time.\r\n\t *\r\n\t * Without debouncing the search client response, we end up setting intermediary state, which forces the DOM to\r\n\t * render, which forces the window size to change to fit the DOM. Imagine the situation above.\r\n\t *\r\n\t * We send out a search for \"DE\", and the WindowService comes back at us first saying 'no components'. There's no data,\r\n\t * so there's no results. So there's no DOM spit out for the search results. This causes the window to size down\r\n\t * to its minimum. Miliseconds later, the workspace service comes at us saying \"Hey I have workspaces!\", which\r\n\t * causes the search menu to expand to fit the results in the DOM. By setting the intermediary\r\n\t * state, we cause unnecessary renders and we end up resizing resizing the window in a very jarring manner.\r\n\t * By waiting until they've had a chance to come at us in a burst, we make the menu resizing smoother and less prone to jitter.\r\n\t */\r\n\tconst debouncedSearchResponse = debounce(onSearchClientResponse, 100);\r\n\r\n\tconst updateQuery = useCallback(\r\n\t\t(query: string) => {\r\n\t\t\tdispatch(SearchActions.UPDATE_QUERY(query));\r\n\t\t\tcurrentQuery.current = query;\r\n\t\t\t// Run the search() effect. One day, move this to effects middleware.\r\n\t\t\tSearchClient.search({ text: query }, (e: any, responses: SearchProviderResponse[]) => {\r\n\t\t\t\tdebouncedSearchResponse(e, responses, query);\r\n\t\t\t});\r\n\t\t},\r\n\t\t[dispatch, updateResults]\r\n\t);\r\n\r\n\tconst resetSearch = useCallback(() => {\r\n\t\tdispatch(SearchActions.RESET_SEARCH());\r\n\t}, [dispatch]);\r\n\r\n\treturn {\r\n\t\tsearchResults,\r\n\t\tupdateQuery,\r\n\t\tsearchQuery,\r\n\t\tresetSearch,\r\n\t};\r\n};\r\nexport { useSearch };\r\n"]}
|
|
@@ -9,7 +9,7 @@ let DashbarStore;
|
|
|
9
9
|
const bringToolbarToFront = ({ focus }) => {
|
|
10
10
|
finsembleWindow.bringToFront(null, (err) => {
|
|
11
11
|
if (err) {
|
|
12
|
-
FSBL.Clients.Logger.error("bringToolbarToFront failed, error:", err);
|
|
12
|
+
FSBL.Clients.Logger.system.error("bringToolbarToFront failed, error:", err);
|
|
13
13
|
}
|
|
14
14
|
if (focus) {
|
|
15
15
|
finsembleWindow.focus();
|
|
@@ -21,7 +21,10 @@ const hideToolbar = () => {
|
|
|
21
21
|
finsembleWindow.hide();
|
|
22
22
|
};
|
|
23
23
|
const showToolbar = () => {
|
|
24
|
-
FSBL.Clients.
|
|
24
|
+
FSBL.Clients.RouterClient.transmit("DockingService.showAtMousePosition", {
|
|
25
|
+
windowName: finsembleWindow.name,
|
|
26
|
+
uuid: finsembleWindow.uuid,
|
|
27
|
+
});
|
|
25
28
|
bringToolbarToFront({ focus: true });
|
|
26
29
|
};
|
|
27
30
|
const minimizeAllWindows = () => {
|
|
@@ -83,35 +86,19 @@ export const useToolbar = () => {
|
|
|
83
86
|
preventSystemClose();
|
|
84
87
|
}
|
|
85
88
|
}, []);
|
|
86
|
-
|
|
87
|
-
if (
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
fsblWindow.getBounds(async (bounds) => {
|
|
92
|
-
const response = await FSBL.Clients.ConfigClient.getValue({
|
|
93
|
-
field: "finsemble.components.Toolbar.window.height",
|
|
94
|
-
});
|
|
95
|
-
const expectedToolbarHeight = response.data + dashbar.height;
|
|
96
|
-
if (bounds.height !== expectedToolbarHeight) {
|
|
97
|
-
fsblWindow.setBounds(bounds.left, bounds.top, bounds.width, expectedToolbarHeight);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}
|
|
89
|
+
const setDashbarItem = (itemName, availableDashbarItems, newDashbarItems) => {
|
|
90
|
+
if (availableDashbarItems.hasOwnProperty(itemName)) {
|
|
91
|
+
const newItem = availableDashbarItems[itemName];
|
|
92
|
+
newItem.id = itemName;
|
|
93
|
+
newDashbarItems.push(newItem);
|
|
101
94
|
}
|
|
102
|
-
}
|
|
103
|
-
async function setDashbarItems(
|
|
95
|
+
};
|
|
96
|
+
async function setDashbarItems(_, data) {
|
|
104
97
|
const { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({
|
|
105
98
|
field: "finsemble.availableDashbarItems",
|
|
106
99
|
});
|
|
107
100
|
const newDashbarItems = [];
|
|
108
|
-
data.value.forEach((
|
|
109
|
-
if (availableDashbarItems.hasOwnProperty(itemName)) {
|
|
110
|
-
const newItem = availableDashbarItems[itemName];
|
|
111
|
-
newItem.id = itemName;
|
|
112
|
-
newDashbarItems.push(newItem);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
101
|
+
data.value.forEach((item) => setDashbarItem(item, availableDashbarItems, newDashbarItems));
|
|
115
102
|
dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));
|
|
116
103
|
}
|
|
117
104
|
useDeepEffect(() => {
|
|
@@ -128,7 +115,7 @@ export const useToolbar = () => {
|
|
|
128
115
|
persist: true,
|
|
129
116
|
}, async (getDashbarStoreErr, store) => {
|
|
130
117
|
if (getDashbarStoreErr) {
|
|
131
|
-
FSBL.Clients.Logger.error("Error initializing dashbar: unable to retrieve stored items, falling back to config", getDashbarStoreErr);
|
|
118
|
+
FSBL.Clients.Logger.system.error("Error initializing dashbar: unable to retrieve stored items, falling back to config", getDashbarStoreErr);
|
|
132
119
|
}
|
|
133
120
|
DashbarStore = store;
|
|
134
121
|
const { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({
|
|
@@ -150,13 +137,7 @@ export const useToolbar = () => {
|
|
|
150
137
|
dashbarItemList = [];
|
|
151
138
|
const newDashbarItems = [];
|
|
152
139
|
if (dashbarItemList.length > 0) {
|
|
153
|
-
dashbarItemList.forEach((itemName) =>
|
|
154
|
-
if (availableDashbarItems.hasOwnProperty(itemName)) {
|
|
155
|
-
const newItem = availableDashbarItems[itemName];
|
|
156
|
-
newItem.id = itemName;
|
|
157
|
-
newDashbarItems.push(newItem);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
140
|
+
dashbarItemList.forEach((itemName) => setDashbarItem(itemName, availableDashbarItems, newDashbarItems));
|
|
160
141
|
}
|
|
161
142
|
if (!DashbarStore.values.dashbaritems) {
|
|
162
143
|
DashbarStore.setValue({
|
|
@@ -173,7 +154,7 @@ export const useToolbar = () => {
|
|
|
173
154
|
});
|
|
174
155
|
}
|
|
175
156
|
catch (majorErr) {
|
|
176
|
-
return FSBL.Clients.Logger.error(`Fatal error retrieving dashbar items`, majorErr);
|
|
157
|
+
return FSBL.Clients.Logger.system.error(`Fatal error retrieving dashbar items`, majorErr);
|
|
177
158
|
}
|
|
178
159
|
}
|
|
179
160
|
if (!storageIsInitialized) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToolbar.js","sourceRoot":"","sources":["../../src/hooks/useToolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,IAAI,oBAAoB,GAAY,KAAK,CAAC;AAe1C,IAAI,YAA8B,CAAC;AAMnC,MAAM,mBAAmB,GAAG,CAAC,EAAE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Ac,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC,CACD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;QACZ,2BAA2B;QAC3B,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;QAChB,iBAAiB;QACjB,WAAW;QACX,WAAW;QACX,mBAAmB;QACnB,iBAAiB;KACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useEffect } from \"react\";\r\nimport { useDeepEffect } from \"./useDeepEffect\";\r\nimport { useSelector } from \"../store\";\r\nimport { ToolbarActions } from \"../actions/toolbarActions\";\r\nimport { openQuitConfirmationDialog } from \"../components/shared/openQuitConfirmationDialog\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { DashbarItem } from \"../types/dashbarTypes\";\r\n\r\nlet storageIsInitialized: boolean = false;\r\n\r\ntype DashbarStoreValueType = {\r\n\tdashbaritems: DashbarItem[];\r\n};\r\n\r\ntype DashbarStoreType = {\r\n\tname: string;\r\n\tsetValue: Function;\r\n\tsetValues: Function;\r\n\taddListener: Function;\r\n\tremoveListener: Function;\r\n\tvalues: DashbarStoreValueType;\r\n};\r\n\r\nlet DashbarStore: DashbarStoreType;\r\n\r\n/**\r\n * Function to bring toolbar to front (since dockable toolbar can be hidden)\r\n * @param {boolean} focus If true, will also focus the toolbar\r\n */\r\nconst bringToolbarToFront = ({ focus }: { focus: boolean }) => {\r\n\tfinsembleWindow.bringToFront(null, (err: any) => {\r\n\t\tif (err) {\r\n\t\t\tFSBL.Clients.Logger.error(\"bringToolbarToFront failed, error:\", err);\r\n\t\t}\r\n\r\n\t\tif (focus) {\r\n\t\t\tfinsembleWindow.focus();\r\n\t\t}\r\n\t});\r\n};\r\n\r\n/**\r\n * Hides the toolbar\r\n */\r\nconst hideToolbar = () => {\r\n\tfinsembleWindow.blur();\r\n\tfinsembleWindow.hide();\r\n};\r\n\r\n/**\r\n * Shows the toolbar left-aligned to the user's mouse.\r\n */\r\nconst showToolbar = () => {\r\n\tFSBL.Clients.WindowClient.showAtMousePosition();\r\n\tbringToolbarToFront({ focus: true });\r\n};\r\n\r\n/**\r\n * Mimimizes all windows.\r\n */\r\nconst minimizeAllWindows = () => {\r\n\tFSBL.Clients.WorkspaceClient.minimizeAll();\r\n};\r\n\r\n/**\r\n * Brings all windows to front.\r\n */\r\nconst revealAllWindows = () => {\r\n\tFSBL.Clients.WorkspaceClient.bringWindowsToFront();\r\n};\r\n\r\n/**\r\n * Toggles Auto Arrange for all windows on the same monitor as the toolbar\r\n */\r\nconst toggleAutoArrange = () => {\r\n\tFSBL.Clients.WorkspaceClient.autoArrange({}, () => {\r\n\t\t// This is legacy and we're not sure if it's still required or not.\r\n\t\t// We can try eliminating this once core auto arrange is refactored.\r\n\t\tbringToolbarToFront({ focus: false });\r\n\t\trevealAllWindows();\r\n\t});\r\n};\r\n\r\n/**\r\n * It's a requirement that the toolbar not be minimized.\r\n * the minimizable option does not work.\r\n * Instead, we just listen for this event and restore the window.\r\n * Hacky. Best I can think of right now.\r\n * //TODO allowMinimize should be a component config option\r\n */\r\nconst preventMinimize = () => {\r\n\tfinsembleWindow.addEventListener(\"minimized\", () => {\r\n\t\tfinsembleWindow.restore();\r\n\t});\r\n};\r\n\r\n/**\r\n * Required to let the system know that the toolbar is up and ready.\r\n * Other pieces of the UI key off of this.\r\n * @TODO Determine whether this kind of baked-in dependency\r\n * makes sense in finsemble.\r\n */\r\nconst publishSystemCheckpoint = () => {\r\n\tFSBL.SystemManagerClient.publishCheckpointState(\"Toolbar\", \"initialize\", \"completed\");\r\n};\r\n\r\n/**\r\n * Prevents closing of the window.\r\n */\r\nconst onBeforeToolbarUnload = () => {\r\n\topenQuitConfirmationDialog();\r\n\t// Return of a non-void value (in this `onbeforeunload` handler) is what tells Electron not to close the window.\r\n\t// Don't delete this!\r\n\treturn false;\r\n};\r\n\r\nconst removeSystemClosePrevention = () => {\r\n\tif (window.onbeforeunload === onBeforeToolbarUnload) {\r\n\t\twindow.onbeforeunload = null;\r\n\t}\r\n};\r\n\r\nconst launchPreferences = (tabName: string) => {\r\n\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\r\n\t\tpreferencesTab: tabName,\r\n\t});\r\n\tFSBL.Clients.LauncherClient.showWindow(\r\n\t\t{\r\n\t\t\tcomponentType: \"UserPreferences\",\r\n\t\t},\r\n\t\t{\r\n\t\t\tmonitor: \"mine\",\r\n\t\t\tleft: \"center\",\r\n\t\t\ttop: \"center\",\r\n\t\t}\r\n\t);\r\n};\r\n\r\n/**\r\n * Prevents the window from going down on alt+f4 or closing from taskbar.\r\n * Pops up a dialog asking if the user meant to shut down the system.\r\n */\r\nconst preventSystemClose = () => {\r\n\t// This function was already called, so no need to run it again.\r\n\tif (window.onbeforeunload === onBeforeToolbarUnload) return;\r\n\r\n\t// Bypass system close prevention if for some reason the toolbar has been customized with an alternative onbeforeunload handler\r\n\tif (window.onbeforeunload) {\r\n\t\tconsole.error(\r\n\t\t\t`Finsemble toolbar was configured to prevent system closes, however, there is already a function assigned to window.onbeforeunload. In order to prevent the OS from closing your window, we need to overwrite this handler. Users will be able to close your toolbar from the windows taskbar. Please remove your onbeforeunload handler or set the toolbar property 'allowSystemToCloseWindow' to true to get rid of this error message.`\r\n\t\t);\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * From the electron docs:\r\n\t * Note: There is a subtle difference between the behaviors of window.onbeforeunload = handler and window.addEventListener('beforeunload', handler). It is recommended to always set the event.returnValue explicitly, instead of only returning a value, as the former works more consistently within Electron.\r\n\t *\r\n\t * Tried addEventListener, and it wouldn't work.\r\n\t */\r\n\twindow.onbeforeunload = onBeforeToolbarUnload;\r\n\t// Terry, onShutdown() hasn't worked for many versions, so this code was never running\r\n\t// remove the listener when we're shutting down. Don't want to get into an infinite loop.\r\n\t//FSBL.onShutdown(removeSystemClosePrevention);\r\n};\r\n\r\nexport const useToolbar = () => {\r\n\tconst dispatch = useDispatch();\r\n\r\n\tuseEffect(() => {\r\n\t\tpreventMinimize();\r\n\t\tpublishSystemCheckpoint();\r\n\r\n\t\tif (FSBL.debug !== true) {\r\n\t\t\tpreventSystemClose();\r\n\t\t}\r\n\t}, []);\r\n\r\n\t/**\r\n\t * Sometimes toolbar window has a less height then it needed to show dashabar section (ticket #37118).\r\n\t * The fix with a check for correct toolbar window height.\r\n\t */\r\n\tuseEffect(() => {\r\n\t\tif (typeof FSBL.Clients.WindowClient[\"getSpawnData\"] === \"function\") {\r\n\t\t\tconst { dashbar } = FSBL.Clients.WindowClient.getSpawnData();\r\n\t\t\t// dashbar enabled\r\n\t\t\tif (dashbar && dashbar.height) {\r\n\t\t\t\tconst fsblWindow = FSBL.Clients.WindowClient.getCurrentWindow();\r\n\t\t\t\t// @ts-ignore\r\n\t\t\t\tfsblWindow.getBounds(async (bounds: any) => {\r\n\t\t\t\t\tconst response = await FSBL.Clients.ConfigClient.getValue({\r\n\t\t\t\t\t\tfield: \"finsemble.components.Toolbar.window.height\",\r\n\t\t\t\t\t});\r\n\t\t\t\t\tconst expectedToolbarHeight = response.data + dashbar.height;\r\n\t\t\t\t\t// the change of window height if it is incorrect\r\n\t\t\t\t\tif (bounds.height !== expectedToolbarHeight) {\r\n\t\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\t\tfsblWindow.setBounds(bounds.left, bounds.top, bounds.width, expectedToolbarHeight);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}, []);\r\n\r\n\tasync function setDashbarItems(error: Error, data: any) {\r\n\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\r\n\t\t\tfield: \"finsemble.availableDashbarItems\",\r\n\t\t});\r\n\t\tconst newDashbarItems: DashbarItem[] = [];\r\n\t\t// Add the widget name as an id to help identify\r\n\t\t// keys -> widgets when reordering items\r\n\t\tdata.value.forEach((itemName: string) => {\r\n\t\t\tif (availableDashbarItems.hasOwnProperty(itemName)) {\r\n\t\t\t\tconst newItem = availableDashbarItems[itemName];\r\n\t\t\t\tnewItem.id = itemName;\r\n\t\t\t\tnewDashbarItems.push(newItem);\r\n\t\t\t}\r\n\t\t});\r\n\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\r\n\t}\r\n\r\n\t/**\r\n\t * This effect initializes the dashbar items in the redux store. The store must only be initialized once. We use the module level variable\r\n\t * `storageIsInitialized` as a simple flag to prevent initialization from occuring more than once.\r\n\t */\r\n\tuseDeepEffect(() => {\r\n\t\tasync function createStoreAndFetchDashbarItems() {\r\n\t\t\ttry {\r\n\t\t\t\tFSBL.Clients.RouterClient.subscribe(\"distributedStoresLoading\", (subscribeErr, notify) => {\r\n\t\t\t\t\tif (!subscribeErr && notify.data.State === \"done\") {\r\n\t\t\t\t\t\t// if we already initialized the store we bail out\r\n\t\t\t\t\t\tif (storageIsInitialized) return;\r\n\r\n\t\t\t\t\t\tstorageIsInitialized = true;\r\n\t\t\t\t\t\tFSBL.Clients.DistributedStoreClient.createStore(\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstore: \"Finsemble-Dashbar-Store\",\r\n\t\t\t\t\t\t\t\tglobal: true,\r\n\t\t\t\t\t\t\t\tpersist: true,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tasync (getDashbarStoreErr: Error, store: any) => {\r\n\t\t\t\t\t\t\t\tif (getDashbarStoreErr) {\r\n\t\t\t\t\t\t\t\t\tFSBL.Clients.Logger.error(\r\n\t\t\t\t\t\t\t\t\t\t\"Error initializing dashbar: unable to retrieve stored items, falling back to config\",\r\n\t\t\t\t\t\t\t\t\t\tgetDashbarStoreErr\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tDashbarStore = store;\r\n\r\n\t\t\t\t\t\t\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\r\n\t\t\t\t\t\t\t\t\tfield: \"finsemble.availableDashbarItems\",\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t// Fetch active dashbar items from store, if not found, fall back to spawn data\r\n\t\t\t\t\t\t\t\tlet dashbarItemList;\r\n\t\t\t\t\t\t\t\tif (DashbarStore && Object.keys(DashbarStore.values).length > 0) {\r\n\t\t\t\t\t\t\t\t\t({ dashbaritems: dashbarItemList } = DashbarStore.values);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!dashbarItemList) {\r\n\t\t\t\t\t\t\t\t\tconst spawnData = FSBL.Clients.WindowClient.getSpawnData();\r\n\t\t\t\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\t\t\t\tspawnData.hasOwnProperty(\"dashbar\") &&\r\n\t\t\t\t\t\t\t\t\t\tspawnData.dashbar.hasOwnProperty(\"items\") &&\r\n\t\t\t\t\t\t\t\t\t\tArray.isArray(spawnData.dashbar.items)\r\n\t\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\t\tdashbarItemList = spawnData.dashbar.items;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!dashbarItemList) dashbarItemList = [];\r\n\r\n\t\t\t\t\t\t\t\tconst newDashbarItems: DashbarItem[] = [];\r\n\t\t\t\t\t\t\t\tif (dashbarItemList.length > 0) {\r\n\t\t\t\t\t\t\t\t\tdashbarItemList.forEach((itemName: string) => {\r\n\t\t\t\t\t\t\t\t\t\tif (availableDashbarItems.hasOwnProperty(itemName)) {\r\n\t\t\t\t\t\t\t\t\t\t\tconst newItem = availableDashbarItems[itemName];\r\n\t\t\t\t\t\t\t\t\t\t\t// Add the widget name as an id to help identify\r\n\t\t\t\t\t\t\t\t\t\t\t// keys -> widgets when reordering items\r\n\t\t\t\t\t\t\t\t\t\t\tnewItem.id = itemName;\r\n\t\t\t\t\t\t\t\t\t\t\tnewDashbarItems.push(newItem);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!DashbarStore.values.dashbaritems) {\r\n\t\t\t\t\t\t\t\t\tDashbarStore.setValue({\r\n\t\t\t\t\t\t\t\t\t\tfield: \"dashbaritems\",\r\n\t\t\t\t\t\t\t\t\t\tvalue: dashbarItemList,\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tDashbarStore.addListener({ field: \"dashbaritems\" }, setDashbarItems);\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} catch (majorErr) {\r\n\t\t\t\treturn FSBL.Clients.Logger.error(`Fatal error retrieving dashbar items`, majorErr);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!storageIsInitialized) {\r\n\t\t\tcreateStoreAndFetchDashbarItems();\r\n\t\t}\r\n\t\treturn function cleanup() {\r\n\t\t\tDashbarStore.removeListener({ field: \"dashbaritems\" }, setDashbarItems);\r\n\t\t};\r\n\t}, [dispatch]);\r\n\r\n\tconst { dashbarItems } = useSelector((state) => state.toolbar);\r\n\r\n\tconst reorderDashbarItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\r\n\t\tconst dashbarItemsNewOrder = [...dashbarItems];\r\n\t\tconst dashbarItemToMove = dashbarItemsNewOrder[oldIndex];\r\n\t\tdashbarItemsNewOrder.splice(oldIndex, 1);\r\n\t\tdashbarItemsNewOrder.splice(newIndex, 0, dashbarItemToMove);\r\n\r\n\t\tconst newOrderList = dashbarItemsNewOrder.map((dashbarItem) => dashbarItem.id);\r\n\r\n\t\tDashbarStore.setValue(\r\n\t\t\t{\r\n\t\t\t\tfield: \"dashbaritems\",\r\n\t\t\t\tvalue: newOrderList,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tdispatch(ToolbarActions.REORDER_DASHBAR_ITEMS({ oldIndex, newIndex }));\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\treturn {\r\n\t\tdashbarItems,\r\n\t\tremoveSystemClosePrevention,\r\n\t\tpreventSystemClose,\r\n\t\tminimizeAllWindows,\r\n\t\trevealAllWindows,\r\n\t\ttoggleAutoArrange,\r\n\t\tshowToolbar,\r\n\t\thideToolbar,\r\n\t\treorderDashbarItems,\r\n\t\tlaunchPreferences,\r\n\t};\r\n};\r\n"]}
|
|
1
|
+
{"version":3,"file":"useToolbar.js","sourceRoot":"","sources":["../../src/hooks/useToolbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAM1C,IAAI,oBAAoB,GAAY,KAAK,CAAC;AAe1C,IAAI,YAA8B,CAAC;AAMnC,MAAM,mBAAmB,GAAG,CAAC,EAAE,KAAK,EAAsB,EAAE,EAAE;IAC7D,eAAe,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,GAAQ,EAAE,EAAE;QAC/C,IAAI,GAAG,EAAE;YACR,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;SAC5E;QAED,IAAI,KAAK,EAAE;YACV,eAAe,CAAC,KAAK,EAAE,CAAC;SACxB;IACF,CAAC,C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,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAE/E,YAAY,CAAC,QAAQ,CACpB;YACC,KAAK,EAAE,cAAc;YACrB,KAAK,EAAE,YAAY;SACnB,EACD,GAAG,EAAE;YACJ,QAAQ,CAAC,cAAc,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;QACxE,CAAC,CACD,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACN,YAAY;QACZ,2BAA2B;QAC3B,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;QAChB,iBAAiB;QACjB,WAAW;QACX,WAAW;QACX,mBAAmB;QACnB,iBAAiB;KACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useEffect } from \"react\";\r\nimport { useDeepEffect } from \"./useDeepEffect\";\r\nimport { useSelector } from \"../store\";\r\nimport { ToolbarActions } from \"../actions/toolbarActions\";\r\nimport { openQuitConfirmationDialog } from \"../components/shared/openQuitConfirmationDialog\";\r\nimport { useDispatch } from \"react-redux\";\r\nimport { DashbarItem } from \"../types/dashbarTypes\";\r\nimport { types } from \"@finsemble/finsemble-core\";\r\n\r\ntype StandardError = types.StandardError;\r\n\r\nlet storageIsInitialized: boolean = false;\r\n\r\ntype DashbarStoreValueType = {\r\n\tdashbaritems: DashbarItem[];\r\n};\r\n\r\ntype DashbarStoreType = {\r\n\tname: string;\r\n\tsetValue: Function;\r\n\tsetValues: Function;\r\n\taddListener: Function;\r\n\tremoveListener: Function;\r\n\tvalues: DashbarStoreValueType;\r\n};\r\n\r\nlet DashbarStore: DashbarStoreType;\r\n\r\n/**\r\n * Function to bring toolbar to front (since dockable toolbar can be hidden)\r\n * @param {boolean} focus If true, will also focus the toolbar\r\n */\r\nconst bringToolbarToFront = ({ focus }: { focus: boolean }) => {\r\n\tfinsembleWindow.bringToFront(null, (err: any) => {\r\n\t\tif (err) {\r\n\t\t\tFSBL.Clients.Logger.system.error(\"bringToolbarToFront failed, error:\", err);\r\n\t\t}\r\n\r\n\t\tif (focus) {\r\n\t\t\tfinsembleWindow.focus();\r\n\t\t}\r\n\t});\r\n};\r\n\r\n/**\r\n * Hides the toolbar\r\n */\r\nconst hideToolbar = () => {\r\n\tfinsembleWindow.blur();\r\n\tfinsembleWindow.hide();\r\n};\r\n\r\n/**\r\n * Shows the toolbar left-aligned to the user's mouse.\r\n */\r\nconst showToolbar = () => {\r\n\tFSBL.Clients.RouterClient.transmit(\"DockingService.showAtMousePosition\", {\r\n\t\twindowName: finsembleWindow.name,\r\n\t\tuuid: finsembleWindow.uuid,\r\n\t});\r\n\tbringToolbarToFront({ focus: true });\r\n};\r\n\r\n/**\r\n * Mimimizes all windows.\r\n */\r\nconst minimizeAllWindows = () => {\r\n\tFSBL.Clients.WorkspaceClient.minimizeAll();\r\n};\r\n\r\n/**\r\n * Brings all windows to front.\r\n */\r\nconst revealAllWindows = () => {\r\n\tFSBL.Clients.WorkspaceClient.bringWindowsToFront();\r\n};\r\n\r\n/**\r\n * Toggles Auto Arrange for all windows on the same monitor as the toolbar\r\n */\r\nconst toggleAutoArrange = () => {\r\n\tFSBL.Clients.WorkspaceClient.autoArrange({}, () => {\r\n\t\t// This is legacy and we're not sure if it's still required or not.\r\n\t\t// We can try eliminating this once core auto arrange is refactored.\r\n\t\tbringToolbarToFront({ focus: false });\r\n\t\trevealAllWindows();\r\n\t});\r\n};\r\n\r\n/**\r\n * It's a requirement that the toolbar not be minimized.\r\n * the minimizable option does not work.\r\n * Instead, we just listen for this event and restore the window.\r\n */\r\nconst preventMinimize = () => {\r\n\tfinsembleWindow.addEventListener(\"minimized\", () => {\r\n\t\tfinsembleWindow.restore();\r\n\t});\r\n};\r\n\r\n/**\r\n * Required to let the system know that the toolbar is up and ready.\r\n * Other pieces of the UI key off of this.\r\n */\r\nconst publishSystemCheckpoint = () => {\r\n\tFSBL.SystemManagerClient.publishCheckpointState(\"Toolbar\", \"initialize\", \"completed\");\r\n};\r\n\r\n/**\r\n * Prevents closing of the window.\r\n */\r\nconst onBeforeToolbarUnload = () => {\r\n\topenQuitConfirmationDialog();\r\n\t// Return of a non-void value (in this `onbeforeunload` handler) is what tells Electron not to close the window.\r\n\t// Don't delete this!\r\n\treturn false;\r\n};\r\n\r\nconst removeSystemClosePrevention = () => {\r\n\tif (window.onbeforeunload === onBeforeToolbarUnload) {\r\n\t\twindow.onbeforeunload = null;\r\n\t}\r\n};\r\n\r\nconst launchPreferences = (tabName: string) => {\r\n\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\r\n\t\tpreferencesTab: tabName,\r\n\t});\r\n\tFSBL.Clients.LauncherClient.showWindow(\r\n\t\t{\r\n\t\t\tcomponentType: \"UserPreferences\",\r\n\t\t},\r\n\t\t{\r\n\t\t\tmonitor: \"mine\",\r\n\t\t\tleft: \"center\",\r\n\t\t\ttop: \"center\",\r\n\t\t}\r\n\t);\r\n};\r\n\r\n/**\r\n * Prevents the window from going down on alt+f4 or closing from taskbar.\r\n * Pops up a dialog asking if the user meant to shut down the system.\r\n */\r\nconst preventSystemClose = () => {\r\n\t// This function was already called, so no need to run it again.\r\n\tif (window.onbeforeunload === onBeforeToolbarUnload) return;\r\n\r\n\t// Bypass system close prevention if for some reason the toolbar has been customized with an alternative onbeforeunload handler\r\n\tif (window.onbeforeunload) {\r\n\t\tconsole.error(\r\n\t\t\t`Finsemble toolbar was configured to prevent system closes, however, there is already a function assigned to window.onbeforeunload. In order to prevent the OS from closing your window, we need to overwrite this handler. Users will be able to close your toolbar from the windows taskbar. Please remove your onbeforeunload handler or set the toolbar property 'allowSystemToCloseWindow' to true to get rid of this error message.`\r\n\t\t);\r\n\t\treturn;\r\n\t}\r\n\r\n\t/**\r\n\t * From the electron docs:\r\n\t * Note: There is a subtle difference between the behaviors of window.onbeforeunload = handler and window.addEventListener('beforeunload', handler). It is recommended to always set the event.returnValue explicitly, instead of only returning a value, as the former works more consistently within Electron.\r\n\t *\r\n\t * Tried addEventListener, and it wouldn't work.\r\n\t */\r\n\twindow.onbeforeunload = onBeforeToolbarUnload;\r\n\t// Terry, onShutdown() hasn't worked for many versions, so this code was never running\r\n\t// remove the listener when we're shutting down. Don't want to get into an infinite loop.\r\n\t//FSBL.onShutdown(removeSystemClosePrevention);\r\n};\r\n\r\nexport const useToolbar = () => {\r\n\tconst dispatch = useDispatch();\r\n\r\n\tuseEffect(() => {\r\n\t\tpreventMinimize();\r\n\t\tpublishSystemCheckpoint();\r\n\r\n\t\tif (FSBL.debug !== true) {\r\n\t\t\tpreventSystemClose();\r\n\t\t}\r\n\t}, []);\r\n\r\n\tconst setDashbarItem = (\r\n\t\titemName: string,\r\n\t\tavailableDashbarItems: Record<string, DashbarItem>,\r\n\t\tnewDashbarItems: DashbarItem[]\r\n\t) => {\r\n\t\tif (availableDashbarItems.hasOwnProperty(itemName)) {\r\n\t\t\tconst newItem = availableDashbarItems[itemName];\r\n\t\t\tnewItem.id = itemName;\r\n\t\t\tnewDashbarItems.push(newItem);\r\n\t\t}\r\n\t};\r\n\r\n\tasync function setDashbarItems(_: Error, data: any) {\r\n\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\r\n\t\t\tfield: \"finsemble.availableDashbarItems\",\r\n\t\t});\r\n\t\tconst newDashbarItems: DashbarItem[] = [];\r\n\t\t// Add the widget name as an id to help identify\r\n\t\t// keys -> widgets when reordering items\r\n\t\tdata.value.forEach((item: string) => setDashbarItem(item, availableDashbarItems, newDashbarItems));\r\n\r\n\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\r\n\t}\r\n\r\n\t/**\r\n\t * This effect initializes the dashbar items in the redux store. The store must only be initialized once. We use the module level variable\r\n\t * `storageIsInitialized` as a simple flag to prevent initialization from occuring more than once.\r\n\t */\r\n\tuseDeepEffect(() => {\r\n\t\tasync function createStoreAndFetchDashbarItems() {\r\n\t\t\ttry {\r\n\t\t\t\tFSBL.Clients.RouterClient.subscribe(\"distributedStoresLoading\", (subscribeErr, notify) => {\r\n\t\t\t\t\tif (!subscribeErr && notify.data.State === \"done\") {\r\n\t\t\t\t\t\t// if we already initialized the store we bail out\r\n\t\t\t\t\t\tif (storageIsInitialized) return;\r\n\r\n\t\t\t\t\t\tstorageIsInitialized = true;\r\n\t\t\t\t\t\tFSBL.Clients.DistributedStoreClient.createStore(\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tstore: \"Finsemble-Dashbar-Store\",\r\n\t\t\t\t\t\t\t\tglobal: true,\r\n\t\t\t\t\t\t\t\tpersist: true,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tasync (getDashbarStoreErr: StandardError, store?: any) => {\r\n\t\t\t\t\t\t\t\tif (getDashbarStoreErr) {\r\n\t\t\t\t\t\t\t\t\tFSBL.Clients.Logger.system.error(\r\n\t\t\t\t\t\t\t\t\t\t\"Error initializing dashbar: unable to retrieve stored items, falling back to config\",\r\n\t\t\t\t\t\t\t\t\t\tgetDashbarStoreErr\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tDashbarStore = store;\r\n\r\n\t\t\t\t\t\t\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\r\n\t\t\t\t\t\t\t\t\tfield: \"finsemble.availableDashbarItems\",\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t// Fetch active dashbar items from store, if not found, fall back to spawn data\r\n\t\t\t\t\t\t\t\tlet dashbarItemList;\r\n\t\t\t\t\t\t\t\tif (DashbarStore && Object.keys(DashbarStore.values).length > 0) {\r\n\t\t\t\t\t\t\t\t\t({ dashbaritems: dashbarItemList } = DashbarStore.values);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!dashbarItemList) {\r\n\t\t\t\t\t\t\t\t\tconst spawnData = FSBL.Clients.WindowClient.getSpawnData();\r\n\t\t\t\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\t\t\t\tspawnData.hasOwnProperty(\"dashbar\") &&\r\n\t\t\t\t\t\t\t\t\t\tspawnData.dashbar.hasOwnProperty(\"items\") &&\r\n\t\t\t\t\t\t\t\t\t\tArray.isArray(spawnData.dashbar.items)\r\n\t\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\t\tdashbarItemList = spawnData.dashbar.items;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!dashbarItemList) dashbarItemList = [];\r\n\r\n\t\t\t\t\t\t\t\tconst newDashbarItems: DashbarItem[] = [];\r\n\t\t\t\t\t\t\t\tif (dashbarItemList.length > 0) {\r\n\t\t\t\t\t\t\t\t\tdashbarItemList.forEach((itemName: string) =>\r\n\t\t\t\t\t\t\t\t\t\tsetDashbarItem(itemName, availableDashbarItems, newDashbarItems)\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (!DashbarStore.values.dashbaritems) {\r\n\t\t\t\t\t\t\t\t\tDashbarStore.setValue({\r\n\t\t\t\t\t\t\t\t\t\tfield: \"dashbaritems\",\r\n\t\t\t\t\t\t\t\t\t\tvalue: dashbarItemList,\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tDashbarStore.addListener({ field: \"dashbaritems\" }, setDashbarItems);\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} catch (majorErr) {\r\n\t\t\t\treturn FSBL.Clients.Logger.system.error(`Fatal error retrieving dashbar items`, majorErr);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!storageIsInitialized) {\r\n\t\t\tcreateStoreAndFetchDashbarItems();\r\n\t\t}\r\n\t\treturn function cleanup() {\r\n\t\t\tDashbarStore.removeListener({ field: \"dashbaritems\" }, setDashbarItems);\r\n\t\t};\r\n\t}, [dispatch]);\r\n\r\n\tconst { dashbarItems } = useSelector((state) => state.toolbar);\r\n\r\n\tconst reorderDashbarItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\r\n\t\tconst dashbarItemsNewOrder = [...dashbarItems];\r\n\t\tconst dashbarItemToMove = dashbarItemsNewOrder[oldIndex];\r\n\t\tdashbarItemsNewOrder.splice(oldIndex, 1);\r\n\t\tdashbarItemsNewOrder.splice(newIndex, 0, dashbarItemToMove);\r\n\r\n\t\tconst newOrderList = dashbarItemsNewOrder.map((dashbarItem) => dashbarItem.id);\r\n\r\n\t\tDashbarStore.setValue(\r\n\t\t\t{\r\n\t\t\t\tfield: \"dashbaritems\",\r\n\t\t\t\tvalue: newOrderList,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tdispatch(ToolbarActions.REORDER_DASHBAR_ITEMS({ oldIndex, newIndex }));\r\n\t\t\t}\r\n\t\t);\r\n\t};\r\n\r\n\treturn {\r\n\t\tdashbarItems,\r\n\t\tremoveSystemClosePrevention,\r\n\t\tpreventSystemClose,\r\n\t\tminimizeAllWindows,\r\n\t\trevealAllWindows,\r\n\t\ttoggleAutoArrange,\r\n\t\tshowToolbar,\r\n\t\thideToolbar,\r\n\t\treorderDashbarItems,\r\n\t\tlaunchPreferences,\r\n\t};\r\n};\r\n"]}
|
|
@@ -14,7 +14,7 @@ export const useWorkspaces = () => {
|
|
|
14
14
|
const WorkspaceUpdateSubscribeID = FSBL.Clients.RouterClient.subscribe("Finsemble.WorkspaceService.update", onWorkspaceUpdate);
|
|
15
15
|
FSBL.Clients.ConfigClient.getValue({
|
|
16
16
|
field: "finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace",
|
|
17
|
-
}, (
|
|
17
|
+
}, (err, data) => {
|
|
18
18
|
data && dispatch(WorkspaceActions.UPDATE_PROMPT_ON_SAVE_WORKSPACE_PREFERENCE(data));
|
|
19
19
|
});
|
|
20
20
|
return function cleanup() {
|