@finsemble/finsemble-ui 6.2.0 → 6.3.0-beta.20211008
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -16
- 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/notificationsCenter.css +4 -2
- package/react/assets/css/userPreferences.css +1 -0
- package/react/assets/css/windowTitleBar.css +33 -1
- package/react/components/FinsembleProvider.js +1 -1
- package/react/components/FinsembleProvider.js.map +1 -1
- 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 -4
- package/react/components/appCatalog/components/Toast.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 +20 -18
- 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.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 +8 -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/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 +18 -17
- 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 +6 -3
- 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/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 +2 -4
- 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 +28 -43
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +10 -9
- 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 +1 -1
- 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/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 +17 -10
- 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 +19 -10
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +17 -4
- 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 +25 -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 +3 -1
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.d.ts +25 -5
- package/react/components/processMonitor/helpers.js +28 -20
- 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 +30 -15
- package/react/components/processMonitor/stores/ProcessMonitorStore.js +101 -86
- 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 +13 -14
- 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 +2 -1
- 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 +1 -1
- 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/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 +4 -4
- package/react/components/smartDesktopDesigner/Application.js +84 -92
- package/react/components/smartDesktopDesigner/Application.js.map +1 -1
- package/react/components/smartDesktopDesigner/ApplicationEdit.d.ts +1 -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 +0 -1
- 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 +11 -24
- 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 -1
- package/react/components/smartDesktopDesigner/common/getCSSVars.js +2 -1
- 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 +4 -14
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js +4 -4
- package/react/components/smartDesktopDesigner/fixtures/applicationEditProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js +2 -2
- package/react/components/smartDesktopDesigner/fixtures/applicationSetupProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js +2 -3
- package/react/components/smartDesktopDesigner/fixtures/applicationsProps.js.map +1 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +4 -70
- package/react/components/smartDesktopDesigner/fixtures/apps.js +9 -20
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
- 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/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 +8 -8
- 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 +7 -14
- 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 +2 -1
- 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 +24 -3
- 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 +5 -4
- 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 -2
- package/react/components/toolbar/advancedAppLauncher/components/AppTagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +34 -13
- package/react/components/toolbar/advancedAppLauncher/components/Content.js +23 -29
- 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 +13 -8
- 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 +7 -3
- 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.d.ts +5 -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.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.js +5 -4
- 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 +3 -10
- 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 +24 -21
- 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 +37 -55
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +2 -3
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/dashbar/DashbarItem.js +1 -1
- 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 +65 -11
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +95 -145
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- 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 +2 -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 +1 -1
- 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.js +21 -10
- 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.js +15 -8
- 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 +9 -16
- 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 +1 -1
- 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 +27 -7
- package/react/components/windowTitleBar/components/center/Tab.js +2 -2
- 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 +111 -37
- 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/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 +1 -21
- 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.js +11 -6
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +51 -44
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +63 -56
- 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.map +1 -1
- package/react/hooks/useLinker.js +1 -1
- package/react/hooks/useLinker.js.map +1 -1
- package/react/hooks/useMenu.js +1 -1
- package/react/hooks/useMenu.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +6 -6
- package/react/hooks/useNotifications.js +16 -17
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/useSearch.js +1 -1
- package/react/hooks/useSearch.js.map +1 -1
- 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/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/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/smartDesktopDesignerTypes.d.ts +11 -9
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +46 -0
- package/react/types/windowTitleBar.js +2 -0
- package/react/types/windowTitleBar.js.map +1 -0
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinker.js","sourceRoot":"","sources":["../../src/hooks/useLinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC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AAG,+BAA+B,CAAC;QAIjG,IAAI,YAAY,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;SACtG;aAAM,IAAI,UAAU,IAAI,+BAA+B,EAAE;YACzD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjG;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CACxB,iCAAiC,+BAA+B,8HAA8H,+BAA+B,2CAA2C,CACxQ,CAAC;SACF;QACD,UAAU,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { useEffect } from \"react\";\r\nimport { LinkerActions } from \"../actions/linkerActions\";\r\nimport { Channel, MAXIMUM_ALLOWED_ACTIVE_CHANNELS } from \"../types/linkerTypes\";\r\n\r\ndeclare const finsembleWindow: any;\r\n\r\n// Encapsulate the linker initialization and Redux dispatch functions inside the hook\r\nexport const useLinker = () => {\r\n\tconst dispatch = useDispatch();\r\n\tconst linkerState = useSelector((state) => state.linker);\r\n\r\n\tconst hideWindow = () => {\r\n\t\t// Must blur or you end up having to click twice to show the window.\r\n\t\t// If you just hide, the first time the user clicks\r\n\t\t// on the linker button, the blur will trigger, which will hide the window.\r\n\t\tfinsembleWindow.blur();\r\n\t\tfinsembleWindow.hide();\r\n\t};\r\n\r\n\tuseEffect(() => {\r\n\t\tconst setInitialChannels = () => {\r\n\t\t\tconst channels: Channel[] = FSBL.Clients.LinkerClient.getAllChannels();\r\n\t\t\tdispatch(LinkerActions.SET_CHANNELS({ channels }));\r\n\t\t};\r\n\r\n\t\tconst focusWindow = () => {\r\n\t\t\tfinsembleWindow.focus();\r\n\t\t};\r\n\r\n\t\tconst initAccessibleLinkerMode = () => {\r\n\t\t\tconst accessibilityCallback = (err: any, value: any) => {\r\n\t\t\t\tif (err) {\r\n\t\t\t\t\tFSBL.Clients.Logger.system.error(`Failed to get accessibleLinker value: ${err}`);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tdispatch(\r\n\t\t\t\t\tLinkerActions.SET_ACCESSIBILITY({\r\n\t\t\t\t\t\tisAccessibleLinker: Boolean(value),\r\n\t\t\t\t\t})\r\n\t\t\t\t);\r\n\t\t\t};\r\n\t\t\tFSBL.Clients.ConfigClient.getValue(\"finsemble.accessibleLinker\", accessibilityCallback);\r\n\t\t};\r\n\r\n\t\t/** If user switches the linker channel for different components, this function would be invoked. It will dispatch another\r\n\t\t * action to update the linker's state according to the linker setup on the switched component.\r\n\t\t *\r\n\t\t * @param err error from FSBL\r\n\t\t * @param msg msg from FSBL\r\n\t\t */\r\n\t\tconst onActiveChannelsChanged = (err: any, msg: any) => {\r\n\t\t\tconst componentLinkerState = FSBL.Clients.LinkerClient.getState(msg.data.windowIdentifier);\r\n\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Failed to update the linker state.\");\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tLinkerActions.UPDATE_ACTIVE_CHANNELS({\r\n\t\t\t\t\tchannelNames: componentLinkerState.channels,\r\n\t\t\t\t\twindowIdentifier: msg.data.windowIdentifier,\r\n\t\t\t\t})\r\n\t\t\t);\r\n\r\n\t\t\tmsg.sendQueryResponse(null, null);\r\n\t\t};\r\n\r\n\t\tFSBL.Clients.Logger.system.log(\"Linker component is mounted. Initializing.\");\r\n\t\tfinsembleWindow.addEventListener(\"blurred\", hideWindow);\r\n\t\tfinsembleWindow.addEventListener(\"shown\", focusWindow);\r\n\t\tsetInitialChannels();\r\n\t\tinitAccessibleLinkerMode();\r\n\t\tFSBL.Clients.RouterClient.addResponder(\"Finsemble.LinkerWindow.SetActiveChannels\", onActiveChannelsChanged);\r\n\r\n\t\treturn () => {\r\n\t\t\tFSBL.Clients.Logger.system.log(\"Linker component is unmounted. Cleaning up the event listeners.\");\r\n\t\t\tfinsembleWindow.removeEventListener(\"blurred\", hideWindow);\r\n\t\t\tfinsembleWindow.removeEventListener(\"shown\", focusWindow);\r\n\t\t\tFSBL.Clients.RouterClient.removeResponder(\"Finsemble.LinkerWindow.SetActiveChannels\");\r\n\t\t};\r\n\t}, []);\r\n\r\n\tuseEffect(() => {\r\n\t\tFSBL.Clients.WindowClient.fitToDOM();\r\n\t}, [linkerState]);\r\n\r\n\tconst toggleChannel = (channelId: number) => {\r\n\t\tconst channel = linkerState.channels[channelId];\r\n\t\tif (!channel) {\r\n\t\t\tFSBL.Clients.Logger.error(\"Targeted channel to toggle is not found.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tconst channelName = channel.name;\r\n\t\tconst channelActive = channel.active;\r\n\t\tconst { windowIdentifier } = linkerState;\r\n\r\n\t\tconst updateActivationTo = (isActive: boolean) => (err: any) => {\r\n\t\t\tif (err) {\r\n\t\t\t\tFSBL.Clients.Logger.error(\"Error in linkerHook, linkCallback\", err);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tdispatch(\r\n\t\t\t\tLinkerActions.UPDATE_CHANNEL_STATUS({\r\n\t\t\t\t\tchannelId,\r\n\t\t\t\t\tactive: isActive,\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t};\r\n\r\n\t\tconst numberOfActiveChannels = Object.values(linkerState.channels).filter((c) => c?.active).length;\r\n\r\n\t\t// We're activating if the channel is currently inactive\r\n\t\tconst activating = !channelActive;\r\n\t\tconst deactivating = channelActive;\r\n\t\tconst allowedToActivateAnotherChannel = numberOfActiveChannels < MAXIMUM_ALLOWED_ACTIVE_CHANNELS;\r\n\t\t// if we're toggling a channel to be inactive OR\r\n\t\t// we're trying to toggle one to be active AND we have not hit our maximum,\r\n\t\t// let the call go through. Otherwise log an error.\r\n\t\tif (deactivating) {\r\n\t\t\tFSBL.Clients.LinkerClient.unlinkFromChannel(channelName, windowIdentifier, updateActivationTo(false));\r\n\t\t} else if (activating && allowedToActivateAnotherChannel) {\r\n\t\t\tFSBL.Clients.LinkerClient.linkToChannel(channelName, windowIdentifier, updateActivationTo(true));\r\n\t\t} else {\r\n\t\t\tFSBL.Clients.Logger.error(\r\n\t\t\t\t`Attempted to toggle more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} channels. This could result in an unacceptable UX. Please contact finsemble support if you would like to render more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} linker channels in the window title bar.`\r\n\t\t\t);\r\n\t\t}\r\n\t\thideWindow();\r\n\t};\r\n\r\n\treturn { state: linkerState, toggleChannel };\r\n};\r\n"]}
|
package/react/hooks/useMenu.js
CHANGED
|
@@ -18,7 +18,7 @@ export const useMenu = () => {
|
|
|
18
18
|
dispatch(MenuActions.CLOSE_MENU(thisMenuId));
|
|
19
19
|
}, [dispatch, thisMenuId]);
|
|
20
20
|
const blurMenu = useCallback(() => {
|
|
21
|
-
if (FSBL
|
|
21
|
+
if (FSBL === null || FSBL === void 0 ? void 0 : FSBL.debug)
|
|
22
22
|
return;
|
|
23
23
|
const closeIfPending = () => {
|
|
24
24
|
dispatch(MenuActions.CLOSE_MENU_IF_PENDING(thisMenuId));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenu.js","sourceRoot":"","sources":["../../src/hooks/useMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAwC7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,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAG5C,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE3B,MAAM,YAAY,GAAG,GAAY,EAAE,CAAC,UAAU,KAAK,UAAU,CAAC;IAE9D,OAAO;QACN,UAAU;QACV,UAAU;QACV,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,YAAY;KACZ,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { MenuActions } from \"../actions/menuActions\";\r\nimport { useCallback, useContext } from \"react\";\r\nimport { MenuContext } from \"../components/menu/menuContext\"; // TODO move this to a place that makes sense\r\n\r\ntype MenuHook = {\r\n\t/**\r\n\t * The Id of the menu that is currently open\r\n\t *\r\n\t * @type {string | null}\r\n\t */\r\n\topenMenuId: string | null;\r\n\t/**\r\n\t * Dispatches a TOGGLE_MENU action, which should cause the menu to close if it is open, or to open if it is closed.\r\n\t */\r\n\ttoggleMenu: () => void;\r\n\t/**\r\n\t * Dispatches a CLOSE_MENU action, which should cause the menu to close if it is open.\r\n\t */\r\n\tcloseMenu: () => void;\r\n\t/**\r\n\t * Dispatches a CLOSE_MENU action after a timeout (DURATION in ms). See description in useMenu comments.\r\n\t */\r\n\tblurMenu: () => void;\r\n\t/**\r\n\t * Dispatches a OPEN_MENU action, which should cause the menu to open if it is closed.\r\n\t */\r\n\topenMenu: () => void;\r\n\t/**\r\n\t * Returns true if the id of the menu matches the currently active menu\r\n\t * @return boolean - Returns true if the menu is active\r\n\t */\r\n\tisMenuActive: () => boolean;\r\n};\r\n\r\n/**\r\n * A hook for working with menus. It gets its implicit menu \"id\" from React context.\r\n * It dispatches actions to the reducer to modify menu state across MenuShell instances.\r\n *\r\n * See menuReducer.ts for \"toggle/blur\" race condition algorithm\r\n *\r\n * Setting window.FSBL.debug=true will override menu close on blur, to make it easier to debug windows\r\n */\r\nexport const useMenu = (): MenuHook => {\r\n\tconst DURATION: number = 120;\r\n\tconst dispatch = useDispatch();\r\n\tconst { openMenuId } = useSelector((state) => state.menu);\r\n\tconst { thisMenuId } = useContext(MenuContext);\r\n\r\n\tconst toggleMenu = useCallback(() => {\r\n\t\tdispatch(MenuActions.TOGGLE_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst openMenu = useCallback(() => {\r\n\t\t// without this call, the toolbar will stay hidden behind other content, and the menus will not be visible\r\n\t\tFSBL.Clients.WindowClient.bringWindowToFront();\r\n\t\tdispatch(MenuActions.OPEN_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst closeMenu = useCallback(() => {\r\n\t\tdispatch(MenuActions.CLOSE_MENU(thisMenuId));\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst blurMenu = useCallback(() => {\r\n\t\tif (FSBL?.debug) return; // If we're debugging then don't blur menus\r\n\r\n\t\t// This is a purposeful closure. There is no need to update it with new state.\r\n\t\tconst closeIfPending = () => {\r\n\t\t\tdispatch(MenuActions.CLOSE_MENU_IF_PENDING(thisMenuId));\r\n\t\t};\r\n\r\n\t\tdispatch(MenuActions.BLUR_MENU(thisMenuId));\r\n\r\n\t\t// See menuReducer.ts for how this timeout is used. Removing the timeout will cause a race condition.\r\n\t\tsetTimeout(closeIfPending, DURATION);\r\n\t}, [dispatch, thisMenuId]);\r\n\r\n\tconst isMenuActive = (): boolean => openMenuId === thisMenuId;\r\n\r\n\treturn {\r\n\t\topenMenuId,\r\n\t\ttoggleMenu,\r\n\t\tcloseMenu,\r\n\t\topenMenu,\r\n\t\tblurMenu,\r\n\t\tisMenuActive,\r\n\t};\r\n};\r\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="finsemble-core" />
|
|
2
|
-
import { INotification } from "common/notifications/definitions/INotification";
|
|
3
|
-
import IFilter from "common/notifications/definitions/IFilter";
|
|
4
|
-
import IMuteFilter from "common/notifications/definitions/IMuteFilter";
|
|
5
1
|
import { NotificationsConfig } from "../components/notifications/types";
|
|
6
2
|
import { NotificationServiceState } from "../components/notifications/constants";
|
|
7
|
-
import {
|
|
3
|
+
import { services } from "@finsemble/finsemble-core";
|
|
4
|
+
declare type IFilter = services.notification.types.IFilter;
|
|
5
|
+
declare type IMuteFilter = services.notification.types.IMuteFilter;
|
|
6
|
+
declare type INotification = services.notification.types.INotification;
|
|
7
|
+
declare type INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;
|
|
8
8
|
declare type NotificationUIStatePublish = (state: NotificationServiceState) => void;
|
|
9
9
|
export declare const useNotificationUI: () => [state: NotificationServiceState, setState: NotificationUIStatePublish];
|
|
10
10
|
export declare const moveToToolbarMonitor: () => Promise<void>;
|
|
@@ -22,7 +22,7 @@ export declare const initializeCenterToggle: () => {
|
|
|
22
22
|
export declare const getNotificationConfig: () => NotificationsConfig;
|
|
23
23
|
export declare const getFetchHistoryParams: (config: any, params: any) => any[];
|
|
24
24
|
export default function useNotifications(params?: any): {
|
|
25
|
-
activeNotifications: (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) => INotification[];
|
|
25
|
+
activeNotifications: (notifications: INotification[], applyMuteFilterOverride?: boolean | undefined) => services.notification.types.INotification[];
|
|
26
26
|
addNotification: (notification: INotification) => void;
|
|
27
27
|
notificationIsActive: (notification: INotification, applyMuteFilterOverride?: boolean | undefined) => boolean;
|
|
28
28
|
getNotificationHistory: (since?: INotificationHistoryOptions, filter?: null | IFilter) => Promise<INotification[]>;
|
|
@@ -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
|
}
|
|
@@ -56,9 +54,10 @@ const getActiveDescriptorsByType = (componentType) => new Promise(async (resolve
|
|
|
56
54
|
let toolbarWindowName;
|
|
57
55
|
export const moveToToolbarMonitor = async () => {
|
|
58
56
|
const getToolbarMonitorData = async () => new Promise(async (resolve, reject) => {
|
|
57
|
+
var _a;
|
|
59
58
|
if (!toolbarWindowName) {
|
|
60
59
|
const activeDescriptors = await getActiveDescriptorsByType("Toolbar");
|
|
61
|
-
toolbarWindowName = activeDescriptors[0]
|
|
60
|
+
toolbarWindowName = (_a = activeDescriptors[0]) === null || _a === void 0 ? void 0 : _a.name;
|
|
62
61
|
}
|
|
63
62
|
const { err, data } = (await FSBL.Clients.LauncherClient.getMonitorInfo({
|
|
64
63
|
windowIdentifier: { windowName: toolbarWindowName },
|
|
@@ -170,29 +169,28 @@ export const dismissNotification = (notifications) => {
|
|
|
170
169
|
export const initializeCenterToggle = () => {
|
|
171
170
|
const [uiState, setUIState] = useNotificationUI();
|
|
172
171
|
const toggleCenter = () => {
|
|
173
|
-
setUIState({
|
|
174
|
-
...uiState,
|
|
175
|
-
showCenter: !uiState.showCenter,
|
|
176
|
-
});
|
|
172
|
+
setUIState(Object.assign(Object.assign({}, uiState), { showCenter: !uiState.showCenter }));
|
|
177
173
|
};
|
|
178
174
|
return {
|
|
179
175
|
toggleCenter,
|
|
180
176
|
};
|
|
181
177
|
};
|
|
182
178
|
export const getNotificationConfig = () => {
|
|
179
|
+
var _a, _b, _c, _d;
|
|
183
180
|
const config = WindowClient.options.customData;
|
|
184
|
-
return Object.assign(config
|
|
185
|
-
isTransparent: config
|
|
181
|
+
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) || {}, {
|
|
182
|
+
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
183
|
});
|
|
187
184
|
};
|
|
188
185
|
export const getFetchHistoryParams = (config, params) => {
|
|
189
|
-
|
|
186
|
+
var _a, _b;
|
|
187
|
+
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
188
|
let options = notificationsHistory.since ? notificationsHistory.since : null;
|
|
191
189
|
if (!options) {
|
|
192
|
-
options = notificationsHistory
|
|
190
|
+
options = notificationsHistory === null || notificationsHistory === void 0 ? void 0 : notificationsHistory.options;
|
|
193
191
|
}
|
|
194
192
|
if (!options && typeof notificationsHistory === "boolean" && notificationsHistory) {
|
|
195
|
-
options = params
|
|
193
|
+
options = (_b = params === null || params === void 0 ? void 0 : params.config) === null || _b === void 0 ? void 0 : _b.notificationsHistory.options;
|
|
196
194
|
}
|
|
197
195
|
const filter = notificationsHistory.filter ? notificationsHistory.filter : null;
|
|
198
196
|
return [options, filter];
|
|
@@ -222,7 +220,7 @@ export default function useNotifications(params = {}) {
|
|
|
222
220
|
let applyMuteFilters = applyMuteFilterOverride;
|
|
223
221
|
if (typeof applyMuteFilterOverride === "undefined") {
|
|
224
222
|
const config = getNotificationConfig();
|
|
225
|
-
applyMuteFilters = config
|
|
223
|
+
applyMuteFilters = (config === null || config === void 0 ? void 0 : config.applyMuteFilters) ? config.applyMuteFilters : false;
|
|
226
224
|
}
|
|
227
225
|
return (!notification.isSnoozed &&
|
|
228
226
|
!notification.isRead &&
|
|
@@ -231,6 +229,7 @@ export default function useNotifications(params = {}) {
|
|
|
231
229
|
};
|
|
232
230
|
const activeNotifications = (notifications, applyMuteFilterOverride) => notifications.filter((notification) => notificationIsActive(notification, applyMuteFilterOverride));
|
|
233
231
|
async function init() {
|
|
232
|
+
var _a;
|
|
234
233
|
try {
|
|
235
234
|
const subscription = new NotificationClient.Subscription();
|
|
236
235
|
const notificationConfig = getNotificationConfig();
|
|
@@ -244,7 +243,7 @@ export default function useNotifications(params = {}) {
|
|
|
244
243
|
filter.exclude.push(...notificationConfig.filter.exclude);
|
|
245
244
|
}
|
|
246
245
|
subscription.filter = filter;
|
|
247
|
-
const notificationsHistory = notificationConfig
|
|
246
|
+
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
247
|
if (notificationsHistory) {
|
|
249
248
|
const [options, historyFilter] = getFetchHistoryParams(notificationConfig, params);
|
|
250
249
|
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,kBA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,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.js","sourceRoot":"","sources":["../../src/hooks/useNotifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,0BAA0B,EAA4B,MAAM,uCAAuC,CAAC;AAQ7G,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,OAAO,CAAC;aAC1D,CAAC;QACH,KAAK,MAAM,CAAC,CAAC;YAEZ,MAAM,yBAAyB,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CACzD,CAAC,YAA2B,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,KAA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,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, NotificationServiceState } from \"../components/notifications/constants\";\r\nimport { services } from \"@finsemble/finsemble-core\";\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.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"]}
|
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,GAAG,WAAW,CAChC,CAAC,OAAmB,EAAE,EAAE;QACvB,QAAQ,CAAC,aAA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C,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"]}
|
|
@@ -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,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,KAAK,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;SACrE;QAED,IAAI,KAAK,EAAE;YACV,eAAe,CAAC,KAAK,EAAE,CAAC;SACxB;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC;AAKF,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,eAAe,CAAC,IAAI,EAAE,CAAC;IACvB,eAAe,CAAC,IAAI,EAAE,CAAC;AACxB,CAAC,CAAC;AAKF,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,CAAC;IAChD,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,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AC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAE/D,MAAM,mBAAmB,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAA0C,EAAE,EAAE;QAC9F,MAAM,oBAAoB,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC;QAC/C,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;QACzD,oBAAoB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACzC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAE5D,MAAM,YAAY,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,WAAW,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\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,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CAAC,CAAC,CAAC;QACzC,oBAAoB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,iBAAiB,CAAC,CAAC;QAE5D,MAAM,YAAY,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC,WAAW,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.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: 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.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"]}
|
|
@@ -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() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWorkspace.js","sourceRoot":"","sources":["../../src/hooks/useWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,iBAAiB,GAAG,CAAC,CAAM,EAAE,EAAE,IAAI,EAA4B,EAAE,EAAE;QACxE,IAAI,IAAI,EAAE;YACT,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;SACvD;IACF,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;IAErE,SAAS,CAAC,GAAG,EAAE;QAGd,MAAM,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CACrE,mCAAmC,EACnC,iBAAiB,CACjB,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CACjC;YACC,KAAK,EAAE,mEAAmE;SAC1E,EACD,CAAC,
|
|
1
|
+
{"version":3,"file":"useWorkspace.js","sourceRoot":"","sources":["../../src/hooks/useWorkspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IACjC,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,MAAM,iBAAiB,GAAG,CAAC,CAAM,EAAE,EAAE,IAAI,EAA4B,EAAE,EAAE;QACxE,IAAI,IAAI,EAAE;YACT,QAAQ,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC;SACvD;IACF,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAC/D,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,cAAc,CAAC;IAErE,SAAS,CAAC,GAAG,EAAE;QAGd,MAAM,0BAA0B,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,SAAS,CACrE,mCAAmC,EACnC,iBAAiB,CACjB,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CACjC;YACC,KAAK,EAAE,mEAAmE;SAC1E,EACD,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAEb,IAAI,IAAI,QAAQ,CAAC,gBAAgB,CAAC,0CAA0C,CAAC,IAAI,CAAC,CAAC,CAAC;QACrF,CAAC,CACD,CAAC;QAEF,OAAO,SAAS,OAAO;YACtB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;QACnE,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AACtD,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\r\nimport { WorkspaceActions } from \"../actions/workspaceActions\";\r\nimport { WorkspaceState } from \"../reducers/workspaceReducer\";\r\nimport { useEffect } from \"react\";\r\n\r\n/**\r\n * A hook for getting the current workspaces including the ActiveWorkspace,\r\n * and listening on any workspace updates.\r\n */\r\nexport const useWorkspaces = () => {\r\n\tconst dispatch = useDispatch();\r\n\r\n\tconst onWorkspaceUpdate = (_: any, { data }: { data: WorkspaceState }) => {\r\n\t\tif (data) {\r\n\t\t\tdispatch(WorkspaceActions.UPDATE_ALL_WORKSPACES(data));\r\n\t\t}\r\n\t};\r\n\r\n\tconst workspaceState = useSelector((state) => state.workspace);\r\n\tconst { workspaces, activeWorkspace, promptOnSave } = workspaceState;\r\n\r\n\tuseEffect(() => {\r\n\t\t// When the workspace updates, update the active workspace name.\r\n\t\t// We will also get the active workspace as soon as we subscribe.\r\n\t\tconst WorkspaceUpdateSubscribeID = FSBL.Clients.RouterClient.subscribe(\r\n\t\t\t\"Finsemble.WorkspaceService.update\",\r\n\t\t\tonWorkspaceUpdate\r\n\t\t);\r\n\t\tFSBL.Clients.ConfigClient.getValue<boolean>(\r\n\t\t\t{\r\n\t\t\t\tfield: \"finsemble.preferences.workspaceService.promptUserOnDirtyWorkspace\",\r\n\t\t\t},\r\n\t\t\t(err, data) => {\r\n\t\t\t\t// default to false.\r\n\t\t\t\tdata && dispatch(WorkspaceActions.UPDATE_PROMPT_ON_SAVE_WORKSPACE_PREFERENCE(data));\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\treturn function cleanup() {\r\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(WorkspaceUpdateSubscribeID);\r\n\t\t};\r\n\t}, []);\r\n\r\n\treturn { workspaces, activeWorkspace, promptOnSave };\r\n};\r\n"]}
|
|
@@ -6,7 +6,7 @@ export const initialState = {
|
|
|
6
6
|
export const favoriteReducer = produce((state, action) => {
|
|
7
7
|
FavoriteActions.match(action, {
|
|
8
8
|
INITIALIZE_FAVORITES: (favorites) => {
|
|
9
|
-
state.favorites = favorites
|
|
9
|
+
state.favorites = (favorites === null || favorites === void 0 ? void 0 : favorites.length) ? favorites : [];
|
|
10
10
|
},
|
|
11
11
|
ADD_FAVORITE: (favorite) => {
|
|
12
12
|
state.favorites.push(favorite);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"favoriteReducer.js","sourceRoot":"","sources":["../../src/reducers/favoriteReducer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAuB,MAAM,4BAA4B,CAAC;AAWlF,MAAM,CAAC,MAAM,YAAY,GAAkB;IAC1C,SAAS,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAgD,OAAO,CAClF,CAAC,KAAoB,EAAE,MAA2B,EAAE,EAAE;IACrD,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE;QAC7B,oBAAoB,EAAE,CAAC,SAA0B,EAAE,EAAE;YACpD,KAAK,CAAC,SAAS,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"favoriteReducer.js","sourceRoot":"","sources":["../../src/reducers/favoriteReducer.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,OAAO,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAuB,MAAM,4BAA4B,CAAC;AAWlF,MAAM,CAAC,MAAM,YAAY,GAAkB;IAC1C,SAAS,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAgD,OAAO,CAClF,CAAC,KAAoB,EAAE,MAA2B,EAAE,EAAE;IACrD,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE;QAC7B,oBAAoB,EAAE,CAAC,SAA0B,EAAE,EAAE;YACpD,KAAK,CAAC,SAAS,GAAG,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,MAAM,EAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,CAAC;QACD,YAAY,EAAE,CAAC,QAAkB,EAAE,EAAE;YACpC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,CAAC;QACD,eAAe,EAAE,CAAC,QAAwB,EAAE,EAAE;YAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;YACzE,KAAK,CAAC,SAAS,GAAG,YAAY,CAAC;QAChC,CAAC;QACD,iBAAiB,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;YAC7C,MAAM,mBAAmB,GAAG,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YACjD,MAAM,cAAc,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;YACrD,mBAAmB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;YACxC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,cAAc,CAAC,CAAC;YACxD,KAAK,CAAC,SAAS,GAAG,mBAAmB,CAAC;QACvC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;KACpB,CAAC,CAAC;AACJ,CAAC,EACD,YAAY,CACZ,CAAC","sourcesContent":["import produce from \"immer\";\r\nimport { FavoriteActions, FavoriteActionTypes } from \"../actions/favoriteActions\";\r\nimport { Favorite } from \"../types/favoriteTypes\";\r\nimport { Reducer } from \"react\";\r\n\r\n/**\r\n * Favorite state definition.\r\n */\r\nexport type FavoriteState = {\r\n\tfavorites: Favorite[];\r\n};\r\n\r\nexport const initialState: FavoriteState = {\r\n\tfavorites: [],\r\n};\r\n\r\nexport const favoriteReducer: Reducer<FavoriteState, FavoriteActionTypes> = produce(\r\n\t(state: FavoriteState, action: FavoriteActionTypes) => {\r\n\t\tFavoriteActions.match(action, {\r\n\t\t\tINITIALIZE_FAVORITES: (favorites: Array<Favorite>) => {\r\n\t\t\t\tstate.favorites = favorites?.length ? favorites : [];\r\n\t\t\t},\r\n\t\t\tADD_FAVORITE: (favorite: Favorite) => {\r\n\t\t\t\tstate.favorites.push(favorite);\r\n\t\t\t},\r\n\t\t\tREMOVE_FAVORITE: (targetId: Favorite[\"id\"]) => {\r\n\t\t\t\tconst newFavorites = state.favorites.filter(({ id }) => id !== targetId);\r\n\t\t\t\tstate.favorites = newFavorites;\r\n\t\t\t},\r\n\t\t\tREORDER_FAVORITES: ({ oldIndex, newIndex }) => {\r\n\t\t\t\tconst favoritesInNewOrder = [...state.favorites];\r\n\t\t\t\tconst favoriteToMove = favoritesInNewOrder[oldIndex];\r\n\t\t\t\tfavoritesInNewOrder.splice(oldIndex, 1);\r\n\t\t\t\tfavoritesInNewOrder.splice(newIndex, 0, favoriteToMove);\r\n\t\t\t\tstate.favorites = favoritesInNewOrder;\r\n\t\t\t},\r\n\t\t\tdefault: () => state,\r\n\t\t});\r\n\t},\r\n\tinitialState\r\n);\r\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="finsemble-core" />
|
|
2
1
|
import { ToolbarState } from "./toolbarReducer";
|
|
3
2
|
import { LinkerState } from "./linkerReducer";
|
|
4
3
|
import { WorkspaceState } from "./workspaceReducer";
|
|
@@ -148,7 +147,7 @@ export declare const rootReducer: import("redux").Reducer<import("redux").Combin
|
|
|
148
147
|
}) | ({
|
|
149
148
|
type: "update_apps";
|
|
150
149
|
} & {
|
|
151
|
-
payload: import("services/Interop/types").AppDefinition[];
|
|
150
|
+
payload: import("@finsemble/finsemble-core/types/services/Interop/types").AppDefinition[];
|
|
152
151
|
}) | ({
|
|
153
152
|
type: "new_app";
|
|
154
153
|
} & {
|
|
@@ -164,7 +163,7 @@ export declare const rootReducer: import("redux").Reducer<import("redux").Combin
|
|
|
164
163
|
}) | ({
|
|
165
164
|
type: "update_app";
|
|
166
165
|
} & {
|
|
167
|
-
payload: import("services/Interop/types").AppDefinition;
|
|
166
|
+
payload: import("@finsemble/finsemble-core/types/services/Interop/types").AppDefinition;
|
|
168
167
|
}) | ({
|
|
169
168
|
type: "delete_app";
|
|
170
169
|
} & {
|
|
@@ -176,7 +175,7 @@ export declare const rootReducer: import("redux").Reducer<import("redux").Combin
|
|
|
176
175
|
}) | ({
|
|
177
176
|
type: "set_deploy_info";
|
|
178
177
|
} & {
|
|
179
|
-
payload: DeployInfo | null;
|
|
178
|
+
payload: import("@finsemble/finsemble-core/types/FEA").DeployInfo | null;
|
|
180
179
|
}) | ({
|
|
181
180
|
type: "set_publish_error";
|
|
182
181
|
} & {
|
|
@@ -16,7 +16,7 @@ export const toolbarReducer = produce((state, action) => {
|
|
|
16
16
|
state.dashbarItems = dashbarItemsInNewOrder;
|
|
17
17
|
},
|
|
18
18
|
SET_DASHBAR_ITEMS: (items) => {
|
|
19
|
-
state.dashbarItems = items
|
|
19
|
+
state.dashbarItems = (items === null || items === void 0 ? void 0 : items.length) ? items : [];
|
|
20
20
|
},
|
|
21
21
|
TOOLBAR_ACTION1: ({ foo }) => {
|
|
22
22
|
state.myFoo = foo;
|