@finsemble/finsemble-ui 6.4.0 → 6.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +31 -28
- package/react/actions/smartDesktopDesignerActions.d.ts +6 -2
- package/react/actions/smartDesktopDesignerActions.js +2 -0
- package/react/actions/smartDesktopDesignerActions.js.map +1 -1
- package/react/assets/css/finsemble.css +0 -1
- package/react/assets/css/userPreferences.css +6 -0
- package/react/assets/icons/code-block.svg +15 -0
- package/react/componentTemplateGenerator.js +1 -1
- package/react/componentTemplateGenerator.js.map +1 -1
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/AppCatalogComponent.d.ts +1 -1
- package/react/components/appCatalog/components/Showcase/ImageCarousel.d.ts +3 -3
- package/react/components/appCatalog/components/Showcase/SupportNotes.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.d.ts +2 -2
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/appCatalog/stores/storeActions.d.ts +1 -1
- package/react/components/common/Checkbox.js +1 -1
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/DropZone.js +3 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/FileInput.d.ts +2 -1
- package/react/components/common/FileInput.js +2 -2
- package/react/components/common/FileInput.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +1 -1
- package/react/components/common/FinsembleIcon.js +2 -0
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +1 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/ImagePreview.js +1 -1
- package/react/components/common/ImagePreview.js.map +1 -1
- package/react/components/common/Tooltip.js +3 -1
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/application-edit-page.css +4 -1
- package/react/components/common/css/application-list.css +4 -0
- package/react/components/common/css/preload-edit-page.css +37 -0
- package/react/components/common/helpers.js +1 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/FileInput.stories.d.ts +2 -1
- package/react/components/common/stories/FileInput.stories.js +6 -0
- package/react/components/common/stories/FileInput.stories.js.map +1 -1
- package/react/components/common/tests/Accordion.spec.js +1 -1
- package/react/components/common/tests/Accordion.spec.js.map +1 -1
- package/react/components/common/tests/FileInput.spec.js +8 -1
- package/react/components/common/tests/FileInput.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js +2 -2
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/favorites/FavoritesShell.spec.js +1 -1
- package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
- package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/icon/Icon.d.ts +4 -3
- package/react/components/icon/Icon.js +22 -12
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
- package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
- package/react/components/linker/LinkerMenu.js.map +1 -1
- package/react/components/linker/remoteRedux.d.ts +1 -1
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuPortal.js +20 -1
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.d.ts +1 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
- package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
- package/react/components/notifications/types.d.ts +1 -1
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +1 -1
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitorTypes.d.ts +4 -11
- package/react/components/processMonitor/ProcessMonitorTypes.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.js +5 -10
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.js +8 -10
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/constants.d.ts +0 -2
- package/react/components/processMonitor/constants.js +0 -2
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.d.ts +0 -11
- package/react/components/processMonitor/helpers.js +1 -9
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +6 -14
- package/react/components/processMonitor/stores/ProcessMonitorStore.js +22 -62
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/AddApp.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AddApp.js +0 -0
- package/react/components/sdd/AddApp.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditAccess.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditAccess.js +0 -0
- package/react/components/sdd/AppEditAccess.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AppEditPage.d.ts +2 -1
- package/react/components/{smartDesktopDesigner → sdd}/AppEditPage.js +77 -73
- package/react/components/sdd/AppEditPage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.css +8 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.helpers.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.helpers.js +0 -0
- package/react/components/sdd/Appearance.helpers.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Appearance.js +0 -0
- package/react/components/sdd/Appearance.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Application.d.ts +10 -3
- package/react/components/sdd/Application.js +220 -0
- package/react/components/sdd/Application.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Applications.d.ts +2 -0
- package/react/components/{smartDesktopDesigner → sdd}/Applications.js +17 -7
- package/react/components/sdd/Applications.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AssetsPage.js +0 -0
- package/react/components/sdd/AssetsPage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Authentication.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Authentication.js +1 -1
- package/react/components/sdd/Authentication.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/AuthenticationProviderConfig.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/AuthenticationProviderConfig.js +0 -0
- package/react/components/sdd/AuthenticationProviderConfig.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Content.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Content.js +0 -0
- package/react/components/sdd/Content.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ContentHeader.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ContentHeader.js +0 -0
- package/react/components/sdd/ContentHeader.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/CurrentView.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/CurrentView.js +0 -0
- package/react/components/sdd/CurrentView.js.map +1 -0
- package/react/components/sdd/EditPreload.d.ts +14 -0
- package/react/components/sdd/EditPreload.js +169 -0
- package/react/components/sdd/EditPreload.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Export.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Export.js +0 -0
- package/react/components/sdd/Export.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportCloud.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportCloud.js +0 -0
- package/react/components/sdd/ExportCloud.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportDeployInfo.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportDeployInfo.js +0 -0
- package/react/components/sdd/ExportDeployInfo.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportZip.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ExportZip.js +0 -0
- package/react/components/sdd/ExportZip.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/GettingStarted.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/GettingStarted.js +0 -0
- package/react/components/sdd/GettingStarted.js.map +1 -0
- package/react/components/sdd/ItemList.d.ts +17 -0
- package/react/components/sdd/ItemList.js +58 -0
- package/react/components/sdd/ItemList.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Navigation.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Navigation.js +0 -0
- package/react/components/sdd/Navigation.js.map +1 -0
- package/react/components/sdd/OptionalSettingsView.d.ts +11 -0
- package/react/components/sdd/OptionalSettingsView.js +71 -0
- package/react/components/sdd/OptionalSettingsView.js.map +1 -0
- package/react/components/sdd/Preloads.d.ts +8 -0
- package/react/components/sdd/Preloads.js +26 -0
- package/react/components/sdd/Preloads.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ProjectErrors.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ProjectErrors.js +0 -0
- package/react/components/sdd/ProjectErrors.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Publish.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Publish.js +0 -0
- package/react/components/sdd/Publish.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/PublishProgress.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/PublishProgress.js +0 -0
- package/react/components/sdd/PublishProgress.js.map +1 -0
- package/react/components/sdd/SmartDesktopDesigner.d.ts +28 -0
- package/react/components/sdd/SmartDesktopDesigner.js +121 -0
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/ThemePage.js +0 -0
- package/react/components/sdd/ThemePage.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Themes.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Themes.js +0 -0
- package/react/components/sdd/Themes.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/Toolbar.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/Toolbar.js +13 -11
- package/react/components/sdd/Toolbar.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/View.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/View.js +0 -0
- package/react/components/sdd/View.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/fsbl_functions.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/fsbl_functions.js +0 -0
- package/react/components/sdd/common/fsbl_functions.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/getCSSVars.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/common/getCSSVars.js +0 -0
- package/react/components/sdd/common/getCSSVars.js.map +1 -0
- package/react/components/{smartDesktopDesigner/fixtures → sdd/common}/views.d.ts +0 -0
- package/react/components/sdd/common/views.js +204 -0
- package/react/components/sdd/common/views.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/appearance.css +3 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/applications.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/authentication.css +5 -1
- package/react/components/{smartDesktopDesigner → sdd}/css/buttons.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/export.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/getting-started.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/nav.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/project-errors.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/project-header.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/styles.css +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/css/views.css +0 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/apps.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/apps.js +27 -5
- package/react/components/sdd/fixtures/apps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/authenticationProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/authenticationProps.js +0 -0
- package/react/components/sdd/fixtures/authenticationProps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/configTemplate.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/configTemplate.js +1 -1
- package/react/components/sdd/fixtures/configTemplate.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/exportProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/exportProps.js +0 -0
- package/react/components/sdd/fixtures/exportProps.js.map +1 -0
- package/react/components/sdd/fixtures/preloads.d.ts +22 -0
- package/react/components/sdd/fixtures/preloads.js +40 -0
- package/react/components/sdd/fixtures/preloads.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/projectErrorsProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/projectErrorsProps.js +0 -0
- package/react/components/sdd/fixtures/projectErrorsProps.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/publishProgress.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/publishProgress.js +0 -0
- package/react/components/sdd/fixtures/publishProgress.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/themeProps.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/themeProps.js +0 -0
- package/react/components/sdd/fixtures/themeProps.js.map +1 -0
- package/react/components/sdd/fixtures/views.d.ts +3 -0
- package/react/components/{smartDesktopDesigner → sdd}/fixtures/views.js +9 -0
- package/react/components/sdd/fixtures/views.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/sdd_helpers.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/sdd_helpers.js +0 -0
- package/react/components/sdd/sdd_helpers.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AppEditPage.stories.d.ts +1 -1
- package/react/components/{smartDesktopDesigner → sdd}/stories/AppEditPage.stories.js +1 -0
- package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Appearance.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Appearance.stories.js +0 -0
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Applications.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Applications.stories.js +0 -0
- package/react/components/sdd/stories/Applications.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AssetsPage.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/AssetsPage.stories.js +0 -0
- package/react/components/sdd/stories/AssetsPage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Authentication.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Authentication.stories.js +0 -0
- package/react/components/sdd/stories/Authentication.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ContentHeader.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ContentHeader.stories.js +0 -0
- package/react/components/sdd/stories/ContentHeader.stories.js.map +1 -0
- package/react/components/sdd/stories/EditPreload.stories.d.ts +11 -0
- package/react/components/sdd/stories/EditPreload.stories.js +35 -0
- package/react/components/sdd/stories/EditPreload.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Export.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Export.stories.js +0 -0
- package/react/components/sdd/stories/Export.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportCloud.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportCloud.stories.js +0 -0
- package/react/components/sdd/stories/ExportCloud.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportZip.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ExportZip.stories.js +0 -0
- package/react/components/sdd/stories/ExportZip.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/GettingStarted.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/GettingStarted.stories.js +0 -0
- package/react/components/sdd/stories/GettingStarted.stories.js.map +1 -0
- package/react/components/sdd/stories/ItemList.stories.d.ts +16 -0
- package/react/components/{smartDesktopDesigner/stories/ApplicationList.stories.js → sdd/stories/ItemList.stories.js} +26 -26
- package/react/components/sdd/stories/ItemList.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Navigation.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Navigation.stories.js +0 -0
- package/react/components/sdd/stories/Navigation.stories.js.map +1 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.d.ts +11 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.js +28 -0
- package/react/components/sdd/stories/OptionalSettingsView.stories.js.map +1 -0
- package/react/components/sdd/stories/Preloads.stories.d.ts +11 -0
- package/react/components/sdd/stories/Preloads.stories.js +31 -0
- package/react/components/sdd/stories/Preloads.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ProjectErrors.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ProjectErrors.stories.js +0 -0
- package/react/components/sdd/stories/ProjectErrors.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Publish.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Publish.stories.js +0 -0
- package/react/components/sdd/stories/Publish.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/PublishProgress.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/PublishProgress.stories.js +0 -0
- package/react/components/sdd/stories/PublishProgress.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/SmartDesktopDesigner.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/SmartDesktopDesigner.stories.js +0 -0
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ThemePage.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/ThemePage.stories.js +0 -0
- package/react/components/sdd/stories/ThemePage.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Themes.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Themes.stories.js +0 -0
- package/react/components/sdd/stories/Themes.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Toolbar.stories.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/stories/Toolbar.stories.js +0 -0
- package/react/components/sdd/stories/Toolbar.stories.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/AppEditPage.spec.d.ts +0 -0
- package/react/components/sdd/tests/AppEditPage.spec.js +1151 -0
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.d.ts → sdd/tests/Application.spec.d.ts} +0 -0
- package/react/components/sdd/tests/Application.spec.js +1478 -0
- package/react/components/sdd/tests/Application.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Applications.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Applications.spec.js +3 -3
- package/react/components/sdd/tests/Applications.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Authentication.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Authentication.spec.js +0 -0
- package/react/components/sdd/tests/Authentication.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ContentHeader.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ContentHeader.spec.js +0 -0
- package/react/components/sdd/tests/ContentHeader.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Export.spec.d.ts → sdd/tests/EditPreload.spec.d.ts} +0 -0
- package/react/components/sdd/tests/EditPreload.spec.js +61 -0
- package/react/components/sdd/tests/EditPreload.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ExportZip.spec.d.ts → sdd/tests/Export.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Export.spec.js +0 -0
- package/react/components/sdd/tests/Export.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Navigation.spec.d.ts → sdd/tests/ExportZip.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ExportZip.spec.js +0 -0
- package/react/components/sdd/tests/ExportZip.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/ProjectErrors.spec.d.ts → sdd/tests/ItemList.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner/tests/ApplicationList.spec.js → sdd/tests/ItemList.spec.js} +8 -8
- package/react/components/sdd/tests/ItemList.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Publish.spec.d.ts → sdd/tests/Navigation.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Navigation.spec.js +0 -0
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/PublishProgess.spec.d.ts → sdd/tests/Preloads.spec.d.ts} +0 -0
- package/react/components/sdd/tests/Preloads.spec.js +47 -0
- package/react/components/sdd/tests/Preloads.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/SmartDesktopDesigner.spec.d.ts → sdd/tests/ProjectErrors.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/ProjectErrors.spec.js +0 -0
- package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/Themes.spec.d.ts → sdd/tests/Publish.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Publish.spec.js +0 -0
- package/react/components/sdd/tests/Publish.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner/tests/sdd_helpers.spec.d.ts → sdd/tests/PublishProgess.spec.d.ts} +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/PublishProgess.spec.js +0 -0
- package/react/components/sdd/tests/PublishProgess.spec.js.map +1 -0
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/SmartDesktopDesigner.spec.js +6 -0
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -0
- package/react/components/sdd/tests/Themes.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Themes.spec.js +0 -0
- package/react/components/sdd/tests/Themes.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Toolbar.spec.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/Toolbar.spec.js +0 -0
- package/react/components/sdd/tests/Toolbar.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/a11y_helper.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/a11y_helper.js +0 -0
- package/react/components/sdd/tests/a11y_helper.js.map +1 -0
- package/react/components/sdd/tests/sdd_helpers.spec.d.ts +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/tests/sdd_helpers.spec.js +0 -0
- package/react/components/sdd/tests/sdd_helpers.spec.js.map +1 -0
- package/react/components/{smartDesktopDesigner → sdd}/themeDefinitions.d.ts +0 -0
- package/react/components/{smartDesktopDesigner → sdd}/themeDefinitions.js +0 -0
- package/react/components/sdd/themeDefinitions.js.map +1 -0
- package/react/components/search/SearchBestMatch.js.map +1 -1
- package/react/components/search/SearchProviderResults.d.ts +3 -1
- package/react/components/search/SearchProviderResults.js.map +1 -1
- package/react/components/search/SearchResult.d.ts +3 -1
- package/react/components/search/SearchResult.js +11 -8
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.spec.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +0 -11
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +2 -116
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/smartDesktopDesigner/common/views.js +1 -185
- package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
- package/react/components/toolbar/AutoArrange.js +1 -1
- package/react/components/toolbar/AutoArrange.js.map +1 -1
- package/react/components/toolbar/AutoArrange.spec.d.ts +1 -0
- package/react/components/toolbar/AutoArrange.spec.js +48 -0
- package/react/components/toolbar/AutoArrange.spec.js.map +1 -0
- package/react/components/toolbar/AutoArrange.stories.d.ts +11 -0
- package/react/components/toolbar/AutoArrange.stories.js +21 -0
- package/react/components/toolbar/AutoArrange.stories.js.map +1 -0
- package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
- package/react/components/toolbar/DragHandle.spec.js +31 -0
- package/react/components/toolbar/DragHandle.spec.js.map +1 -0
- package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
- package/react/components/toolbar/DragHandle.stories.js +39 -0
- package/react/components/toolbar/DragHandle.stories.js.map +1 -0
- package/react/components/toolbar/SddButton.d.ts +2 -0
- package/react/components/toolbar/SddButton.js +23 -0
- package/react/components/toolbar/SddButton.js.map +1 -0
- package/react/components/toolbar/ToolbarShell.js +4 -1
- package/react/components/toolbar/ToolbarShell.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +3 -2
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
- package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js +15 -4
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
- package/react/components/toolbar/appLauncher/components/componentList.js +3 -4
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +11 -12
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +72 -13
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +6 -1
- package/react/components/userPreferences/components/content/Workspaces.js +59 -18
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledRestart.d.ts +2 -0
- package/react/components/userPreferences/components/general/ScheduledRestart.js +10 -2
- package/react/components/userPreferences/components/general/ScheduledRestart.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +2 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js +10 -0
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js +6 -6
- package/react/components/userPreferences/tests/ScheduledRestart.spec.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +5 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +70 -59
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -2
- package/react/components/windowTitleBar/components/center/TabList.js +5 -2
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -2
- package/react/components/windowTitleBar/components/windowTitle.js +99 -94
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +218 -219
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/components/yesNoDialog/Timer.spec.js +1 -1
- package/react/components/yesNoDialog/Timer.spec.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
- package/react/hooks/useDashbar.js.map +1 -1
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +1 -1
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/useSearch.d.ts +2 -1
- package/react/hooks/useSearch.js.map +1 -1
- package/react/hooks/useToolbar.js +6 -0
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +11 -3
- package/react/reducers/smartDesktopDesignerReducer.js +8 -0
- package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
- package/react/store.d.ts +22 -6
- package/react/types/advancedAppLauncherTypes.d.ts +5 -3
- package/react/types/advancedAppLauncherTypes.js.map +1 -1
- package/react/types/favoriteTypes.d.ts +4 -2
- package/react/types/favoriteTypes.js.map +1 -1
- package/react/types/fdc3.d.ts +2 -2
- package/react/types/fdc3.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +8 -2
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/windowTitleBar.d.ts +1 -1
- package/react/types/windowTitleBar.js.map +1 -1
- package/react/components/smartDesktopDesigner/AddApp.js.map +0 -1
- package/react/components/smartDesktopDesigner/AppEditAccess.js.map +0 -1
- package/react/components/smartDesktopDesigner/AppEditPage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Appearance.helpers.js.map +0 -1
- package/react/components/smartDesktopDesigner/Appearance.js.map +0 -1
- package/react/components/smartDesktopDesigner/Application.js +0 -228
- package/react/components/smartDesktopDesigner/Application.js.map +0 -1
- package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -16
- package/react/components/smartDesktopDesigner/ApplicationList.js +0 -60
- package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
- package/react/components/smartDesktopDesigner/Applications.js.map +0 -1
- package/react/components/smartDesktopDesigner/AssetsPage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Authentication.js.map +0 -1
- package/react/components/smartDesktopDesigner/AuthenticationProviderConfig.js.map +0 -1
- package/react/components/smartDesktopDesigner/Content.js.map +0 -1
- package/react/components/smartDesktopDesigner/ContentHeader.js.map +0 -1
- package/react/components/smartDesktopDesigner/CurrentView.js.map +0 -1
- package/react/components/smartDesktopDesigner/Export.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportCloud.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportDeployInfo.js.map +0 -1
- package/react/components/smartDesktopDesigner/ExportZip.js.map +0 -1
- package/react/components/smartDesktopDesigner/GettingStarted.js.map +0 -1
- package/react/components/smartDesktopDesigner/Navigation.js.map +0 -1
- package/react/components/smartDesktopDesigner/ProjectErrors.js.map +0 -1
- package/react/components/smartDesktopDesigner/Publish.js.map +0 -1
- package/react/components/smartDesktopDesigner/PublishProgress.js.map +0 -1
- package/react/components/smartDesktopDesigner/ThemePage.js.map +0 -1
- package/react/components/smartDesktopDesigner/Themes.js.map +0 -1
- package/react/components/smartDesktopDesigner/Toolbar.js.map +0 -1
- package/react/components/smartDesktopDesigner/View.js.map +0 -1
- package/react/components/smartDesktopDesigner/common/fsbl_functions.js.map +0 -1
- package/react/components/smartDesktopDesigner/common/getCSSVars.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/apps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/authenticationProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/configTemplate.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/projectErrorsProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/themeProps.js.map +0 -1
- package/react/components/smartDesktopDesigner/fixtures/views.js.map +0 -1
- package/react/components/smartDesktopDesigner/sdd_helpers.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Appearance.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -16
- package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Applications.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/AssetsPage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Authentication.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ContentHeader.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Export.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ExportCloud.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ExportZip.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/GettingStarted.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Navigation.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ProjectErrors.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Publish.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/PublishProgress.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/ThemePage.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Themes.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/stories/Toolbar.stories.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +0 -310
- package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Authentication.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ContentHeader.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Export.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ExportZip.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Navigation.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/ProjectErrors.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Publish.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/PublishProgess.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Themes.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/Toolbar.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/a11y_helper.js.map +0 -1
- package/react/components/smartDesktopDesigner/tests/sdd_helpers.spec.js.map +0 -1
- package/react/components/smartDesktopDesigner/themeDefinitions.js.map +0 -1
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.d.ts +0 -6
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js +0 -23
- package/react/components/toolbar/appLauncher/DynamicAppLauncher.js.map +0 -1
- package/react/hooks/useWorkspace.d.ts +0 -5
- package/react/hooks/useWorkspace.js +0 -26
- package/react/hooks/useWorkspace.js.map +0 -1
- package/react/types/iconTypes.d.ts +0 -11
- package/react/types/iconTypes.js +0 -2
- package/react/types/iconTypes.js.map +0 -1
- package/react/types/searchTypes.d.ts +0 -29
- package/react/types/searchTypes.js +0 -2
- package/react/types/searchTypes.js.map +0 -1
|
@@ -42,7 +42,7 @@ const useCreateDropdown = ({ keyboardNavigation, setElement, childWindow, setChi
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
let menuAutoResizer = null;
|
|
44
44
|
const features = `height=1,width=${menuWidth},left=0,top=0,opacity=1`;
|
|
45
|
-
const newWindow = window.open(`./menu.html#${thisMenuId}`,
|
|
45
|
+
const newWindow = window.open(`./menu.html#${thisMenuId}`, `(Menu) ${thisMenuId}`, features);
|
|
46
46
|
setChildWindow(newWindow);
|
|
47
47
|
if (newWindow) {
|
|
48
48
|
const onLoad = () => {
|
|
@@ -100,6 +100,22 @@ const showHideResizeWindow = async ({ childWindow, keyboardNavigation, show, thi
|
|
|
100
100
|
keyboardNavigation.detach();
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
+
const closePortal = (element) => {
|
|
104
|
+
const { closeMenu } = useMenu();
|
|
105
|
+
const options = {
|
|
106
|
+
childList: true,
|
|
107
|
+
subtree: true,
|
|
108
|
+
};
|
|
109
|
+
const mutationObserver = new MutationObserver((mutations) => {
|
|
110
|
+
mutations.forEach((mutation) => {
|
|
111
|
+
var _a;
|
|
112
|
+
if ((_a = mutation.removedNodes) === null || _a === void 0 ? void 0 : _a.length)
|
|
113
|
+
closeMenu();
|
|
114
|
+
mutationObserver.disconnect();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
mutationObserver.observe(element, options);
|
|
118
|
+
};
|
|
103
119
|
export const MenuPortal = ({ show, children }) => {
|
|
104
120
|
const { thisMenuId, menuHeight, maxHeight, minHeight } = useContext(MenuContext);
|
|
105
121
|
const [element, setElement] = useState();
|
|
@@ -117,6 +133,9 @@ export const MenuPortal = ({ show, children }) => {
|
|
|
117
133
|
return () => { };
|
|
118
134
|
}, [show]);
|
|
119
135
|
useCreateDropdown({ keyboardNavigation, childWindow, setElement, setChildWindow });
|
|
136
|
+
const toolbar = document.getElementById("Toolbar-tsx");
|
|
137
|
+
if (toolbar)
|
|
138
|
+
closePortal(toolbar);
|
|
120
139
|
return element ? ReactDOM.createPortal(children, element) : null;
|
|
121
140
|
};
|
|
122
141
|
//# sourceMappingURL=MenuPortal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuPortal.js","sourceRoot":"","sources":["../../../src/components/menu/MenuPortal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAY9C,MAAM,oBAAoB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAClD,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;QACvD,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;YACxD,QAAQ,CAAC,aAAa,CACrB,IAAI,WAAW,CAAC,UAAU,SAAS,EAAE,EAAE;gBACtC,MAAM,EAAE;oBAEP,UAAU,EAAE,IAAI,UAAU,CAAC,SAAS,EAAE,KAAK,CAAC;oBAE5C,MAAM,EAAE,KAAK,CAAC,MAAM;iBACpB;aAC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W,EAAE,YAAY,CAAC,CAAC;;YACrE,OAAO,IAAI,CAAC;IAClB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAMlB,SAAS,CAAC,GAAG,EAAE;QAEd,IAAI,CAAC,WAAW;YAAE,OAAO;QAEzB,oBAAoB,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9G,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IACjB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAGX,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;IAMnF,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { MenuContext } from \"./menuContext\";\nimport { calculateDimensions, injectCSS } from \"./menuHelpers\";\nimport { KeyboardNavigation } from \"./keyboardNavigation\";\nimport { MenuAutoResizer } from \"./MenuAutoResizer\";\nimport { useState, useEffect, useContext, useMemo } from \"react\";\nimport { useMenu } from \"../../hooks/useMenu\";\nimport { services, FEA } from \"@finsemble/finsemble-core\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\n/**\n * Proxy/fake events are needed because when `document.addEventListener` is used inside a component\n * that is rendered inside react portal, `document` will refer to the toolbar's document instead\n * of the childWindow's document. Clicking inside a portal will not therefore capture those events.\n *\n * This code intercepts these events inside the portal and then forwards them to the parent (toolbar).\n */\nconst setupEventForwarding = (newWindow: Window) => {\n\t[\"mouseDown\", \"click\", \"mouseUp\"].forEach((eventName) => {\n\t\tnewWindow.document.addEventListener(eventName, (event) => {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\tdetail: {\n\t\t\t\t\t\t// Devs may need access to the x and y of the cursor\n\t\t\t\t\t\tmouseEvent: new MouseEvent(eventName, event),\n\t\t\t\t\t\t// And possibly the target element\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t});\n\n\t/**\n\t * Proxies keyboard events from the portal up into the parent window.\n\t * instead of e.key, you'll need to access e.detail.key.\n\t */\n\t[\"keyup\", \"keydown\", \"keypress\"].forEach((eventName) => {\n\t\tnewWindow?.document.addEventListener(eventName, (event) => {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\tdetail: new KeyboardEvent(event.type, event),\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t});\n};\n\n/**\n * The window (opened by window.open) is an empty html document.\n * This function creates a containerDiv for the parent to insert its\n * React DOM. That containerDiv is set through the `setElement()` method\n * which must be passed in.\n *\n * This function also does portal housekeeping such as transferring CSS and window\n * events.\n */\nconst insertWindowContent = ({\n\tnewWindow,\n\tisAutoResizable,\n\tclassName,\n\tsetElement,\n\tmenuHeight,\n}: {\n\tnewWindow: Window;\n\tisAutoResizable: boolean;\n\tclassName?: string;\n\tmenuHeight?: number;\n\tsetElement: React.Dispatch<React.SetStateAction<HTMLElement | undefined>>;\n}) => {\n\t// Set the child window's <html> tag to class \"menu-portal\" for scrollbar styling\n\tnewWindow.document.documentElement.className = \"menu-portal\";\n\tif (isAutoResizable) newWindow.document.body.setAttribute(\"resizing\", \"true\");\n\n\t// Create the element which will hold our react elements and then append it into the child window's body.\n\tconst containerDiv: HTMLElement = document.createElement(\"div\");\n\tnewWindow.document.body.appendChild(containerDiv);\n\n\t// The className that was passed to MenuShell is added to the child window's <body>\n\tclassName?.split(\" \").forEach((name: string) => newWindow!.document.body.classList.add(name));\n\n\t// This will update local state which will cause the parent React Functional Component\n\t// to return a react portal. See comments at the end of this file.\n\tsetElement(containerDiv);\n\n\t// Inject css into the child window's <head>\n\tinjectCSS(newWindow);\n\n\t// THE FOLLOWING IS LIKELY DEPRECATED BUT KEEPING JUST IN CASE\n\t// Place height on the portal.\n\t// inside of the portal, window.outerHeight === 39 (toolbar height).\n\t// Knowing the height of the window is important because some menus use that\n\t// information to force overflow on certain sections of the menu.\n\t(newWindow as any).portalHeight = menuHeight;\n};\n\n/**\n * React hook to create a drop down menu. This hook creates a new window using window.open\n * and assigns it as the childWindow to the MenuPortal. It then uses insertWindowContent()\n * to establish the React/DOM connection with the parent (e.g. Toolbar).\n */\nconst useCreateDropdown = ({\n\tkeyboardNavigation,\n\tsetElement,\n\tchildWindow,\n\tsetChildWindow,\n}: {\n\tkeyboardNavigation: KeyboardNavigation | null;\n\tsetElement: React.Dispatch<React.SetStateAction<HTMLElement | undefined>>;\n\tchildWindow: Window | null;\n\tsetChildWindow: React.Dispatch<React.SetStateAction<Window | null>>;\n}) => {\n\tconst { thisMenuId, menuWidth, menuHeight, className, maxHeight, minHeight } = useContext(MenuContext);\n\tconst { blurMenu } = useMenu();\n\tconst isAutoResizable = !menuHeight;\n\n\t/**\n\t * Initialize the window. This should only run once though it is possible\n\t * to run multiple times if MenuContext changes.\n\t */\n\tuseEffect(() => {\n\t\tlet menuAutoResizer: any = null;\n\n\t\t/**\n\t\t * Initial size and location of the menu is irrelevant because it is hidden.\n\t\t * The menu will be resized and positioned correctly when it is shown.\n\t\t */\n\t\tconst features = `height=1,width=${menuWidth},left=0,top=0,opacity=1`;\n\n\t\t/**\n\t\t * Opens the window which will contain the menu contents. This looks like a browser window open\n\t\t * but actually opens an Electron window which FEA intercepts. FEA uses the `childWindowOptions`\n\t\t * json configuration to determine how to display the window. `childWindowOptions.show` should\n\t\t * be set to `false` otherwise a white window will flash prior to the menu being rendered.\n\t\t *\n\t\t *\n\t\t * The \"/component/toolbar/menu.html\" is just an empty page. It's necessary to reference a real page\n\t\t * rather than about:blank in order that the \"origin\" is correct for the page. Many CSS ui-assets such\n\t\t * as fonts and images are set with relative paths that require a correct origin.\n\t\t *\n\t\t * Note, we append the menu ID for automated testing. This allows Selenium to\n\t\t * uniquely identify each menu.\n\t\t */\n\t\tconst newWindow = window.open(`./menu.html#${thisMenuId}`, undefined, features);\n\t\tsetChildWindow(newWindow);\n\n\t\tif (newWindow) {\n\t\t\tconst onLoad = () => {\n\t\t\t\tinsertWindowContent({ newWindow, isAutoResizable, className, setElement, menuHeight });\n\t\t\t\tsetupEventForwarding(newWindow);\n\t\t\t\t/* Close window when a user clicks away.\n\t\t\t\t\tAre you wondering why not just close the window without calling\n\t\t\t\t\ttoggle? because we want to update the state in the store first\n\t\t\t\t\twhich will cause openMenuId to no longer match the shell id\n\t\t\t\t\tand eventually destroy this component which will cause the window\n\t\t\t\t\tto close (see cleanup function).\n\t\t\t\t*/\n\t\t\t\tnewWindow.addEventListener(\"blur\", blurMenu);\n\n\t\t\t\t// Attach MenuAutoResizer only if the menu doesn't have a fixed height\n\t\t\t\tif (isAutoResizable)\n\t\t\t\t\tmenuAutoResizer = new MenuAutoResizer(newWindow, thisMenuId, menuWidth, maxHeight, minHeight);\n\t\t\t};\n\t\t\tnewWindow.addEventListener(\"load\", onLoad, true);\n\t\t} else {\n\t\t\tFSBL.Clients.Logger.system.error(`MenuPortal error: window.open returned null for \"./menu.html#${thisMenuId}\"`);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// imesner 20210406 childwindow and keyboardNavigation were both null but hadn't closed the window or released global hotkeys\n\t\t\tconst win = childWindow || menuAutoResizer?.childWindow;\n\t\t\tconst keyboardNav = keyboardNavigation || (win as any)?.keyboardNavigation;\n\n\t\t\tkeyboardNav?.detach();\n\n\t\t\tmenuAutoResizer?.disconnect();\n\t\t\twin?.close();\n\t\t\tsetChildWindow(null);\n\t\t};\n\t}, [blurMenu, className, menuWidth, menuHeight, maxHeight, thisMenuId]);\n};\n\n/**\n * Sets visibility, size and location of the window. This can be called numerous times\n * during the lifetime of the MenuPortal.\n */\nconst showHideResizeWindow = async ({\n\tchildWindow,\n\tkeyboardNavigation,\n\tshow,\n\tthisMenuId,\n\tmenuHeight,\n\tmaxHeight,\n\tminHeight,\n}: {\n\tchildWindow: Window;\n\tkeyboardNavigation: KeyboardNavigation | null;\n\tshow: boolean;\n\tthisMenuId: string;\n\tmenuHeight?: number;\n\tmaxHeight: number;\n\tminHeight: number;\n}) => {\n\tconst finWindow: FEA.FEAWindow = childWindow.fin.desktop.Window.getCurrent();\n\tif (show) {\n\t\tconst { left, top, height } = await calculateDimensions(childWindow, thisMenuId, menuHeight, maxHeight, minHeight);\n\n\t\tconst params: SpawnParams = {\n\t\t\tposition: \"absolute\",\n\t\t\tleft: left,\n\t\t\ttop: top,\n\t\t\theight: height,\n\t\t\tforceOntoMonitor: \"monitorRect\",\n\t\t};\n\n\t\tconst { name } = childWindow;\n\n\t\t/**\n\t\t * Use Finsemble to show the window. We might be tempted simply to use childWindow.moveTo() or childWindow.resizeTo()\n\t\t * but those commands limit the child window to a single monitor. We want to position the window relative to the\n\t\t * monitor on which the toolbar currently resides. showWindow() is monitor aware, so by using monitor=\"mine\" we can\n\t\t * ensure that the menu will always open on the same monitor as the toolbar. Since our toolbar has built in logic\n\t\t * to avoid straddling, we can be sure that the menu will never have to guess whether it exists on the left or right\n\t\t * side of the toolbar. Finally, showWindow() forces windows to open entirely on a monitor, so it will slide the\n\t\t * menu to the left or right as necessary to prevent it from straddling.\n\t\t */\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: name }, params);\n\n\t\t// Ensures that the menu has keyboard focus for accessibility\n\t\tfinWindow.focus();\n\n\t\t// Ensures that the menu is positioned above any other windows that have setAlwaysOnTop flagged\n\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: true });\n\t\t});\n\n\t\tif (keyboardNavigation) {\n\t\t\t// Why??\n\t\t\t(childWindow as any).keyboardNavigation = keyboardNavigation;\n\t\t\tkeyboardNavigation.attach();\n\t\t}\n\t} else {\n\t\tconst { name } = childWindow;\n\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: false });\n\t\t});\n\n\t\tfinWindow.hide();\n\t\tif (keyboardNavigation) keyboardNavigation.detach();\n\t}\n};\n\nexport const MenuPortal: React.FunctionComponent<{\n\tshow: boolean;\n}> = ({ show, children }) => {\n\tconst { thisMenuId, menuHeight, maxHeight, minHeight } = useContext(MenuContext);\n\n\t// Container div for React portal\n\tconst [element, setElement] = useState<HTMLElement>();\n\tconst [childWindow, setChildWindow] = useState<Window | null>(null);\n\n\t/**\n\t * KeyboardNavigation registers global hotkeys for navigating through a menu with cursor keys.\n\t * Those hotkeys are registered/unregistered based on visibility of the child window.\n\t * The KeyboardNavigation class is a singleton and so is memoized. It is created when the child window is available.\n\t */\n\tconst keyboardNavigation = useMemo(() => {\n\t\tif (childWindow) return new KeyboardNavigation(childWindow, \".menu-item\");\n\t\telse return null;\n\t}, [childWindow]);\n\n\t/**\n\t * Show and hide window. This effect will run whenever the `show` prop changes,\n\t * generally initiated by a click to <MenuToggle>.\n\t */\n\tuseEffect(() => {\n\t\t// If child window isn't yet initialized then no-op\n\t\tif (!childWindow) return;\n\n\t\tshowHideResizeWindow({ childWindow, keyboardNavigation, show, thisMenuId, menuHeight, maxHeight, minHeight });\n\t\treturn () => {};\n\t}, [show]);\n\n\t// Create the dropdown. (if MenuContext changes then the dropdown will be removed and recreated).\n\tuseCreateDropdown({ keyboardNavigation, childWindow, setElement, setChildWindow });\n\n\t// We should only return a react portal when window is ready\n\t// and container div appended to its body\n\t// See Dan abramov comment about this at:\n\t// https://github.com/facebook/react/issues/12355#issuecomment-410996235\n\treturn element ? ReactDOM.createPortal(children, element) : null;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"MenuPortal.js","sourceRoot":"","sources":["../../../src/components/menu/MenuPortal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ACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAOpE,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACvC,IAAI,WAAW;YAAE,OAAO,IAAI,kBAAkB,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;;YACrE,OAAO,IAAI,CAAC;IAClB,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAMlB,SAAS,CAAC,GAAG,EAAE;QAEd,IAAI,CAAC,WAAW;YAAE,OAAO;QAEzB,oBAAoB,CAAC,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9G,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;IACjB,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAGX,iBAAiB,CAAC,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC,CAAC;IAEnF,MAAM,OAAO,GAAG,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IAEvD,IAAI,OAAO;QAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAMlC,OAAO,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAClE,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { MenuContext } from \"./menuContext\";\nimport { calculateDimensions, injectCSS } from \"./menuHelpers\";\nimport { KeyboardNavigation } from \"./keyboardNavigation\";\nimport { MenuAutoResizer } from \"./MenuAutoResizer\";\nimport { useState, useEffect, useContext, useMemo } from \"react\";\nimport { useMenu } from \"../../hooks/useMenu\";\nimport { services, FEA } from \"@finsemble/finsemble-api\";\n\ntype SpawnParams = services.window.types.SpawnParams;\n\n/**\n * Proxy/fake events are needed because when `document.addEventListener` is used inside a component\n * that is rendered inside react portal, `document` will refer to the toolbar's document instead\n * of the childWindow's document. Clicking inside a portal will not therefore capture those events.\n *\n * This code intercepts these events inside the portal and then forwards them to the parent (toolbar).\n */\nconst setupEventForwarding = (newWindow: Window) => {\n\t[\"mouseDown\", \"click\", \"mouseUp\"].forEach((eventName) => {\n\t\tnewWindow.document.addEventListener(eventName, (event) => {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\tdetail: {\n\t\t\t\t\t\t// Devs may need access to the x and y of the cursor\n\t\t\t\t\t\tmouseEvent: new MouseEvent(eventName, event),\n\t\t\t\t\t\t// And possibly the target element\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t},\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t});\n\n\t/**\n\t * Proxies keyboard events from the portal up into the parent window.\n\t * instead of e.key, you'll need to access e.detail.key.\n\t */\n\t[\"keyup\", \"keydown\", \"keypress\"].forEach((eventName) => {\n\t\tnewWindow?.document.addEventListener(eventName, (event) => {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent(`portal:${eventName}`, {\n\t\t\t\t\tdetail: new KeyboardEvent(event.type, event),\n\t\t\t\t})\n\t\t\t);\n\t\t});\n\t});\n};\n\n/**\n * The window (opened by window.open) is an empty html document.\n * This function creates a containerDiv for the parent to insert its\n * React DOM. That containerDiv is set through the `setElement()` method\n * which must be passed in.\n *\n * This function also does portal housekeeping such as transferring CSS and window\n * events.\n */\nconst insertWindowContent = ({\n\tnewWindow,\n\tisAutoResizable,\n\tclassName,\n\tsetElement,\n\tmenuHeight,\n}: {\n\tnewWindow: Window;\n\tisAutoResizable: boolean;\n\tclassName?: string;\n\tmenuHeight?: number;\n\tsetElement: React.Dispatch<React.SetStateAction<HTMLElement | undefined>>;\n}) => {\n\t// Set the child window's <html> tag to class \"menu-portal\" for scrollbar styling\n\tnewWindow.document.documentElement.className = \"menu-portal\";\n\tif (isAutoResizable) newWindow.document.body.setAttribute(\"resizing\", \"true\");\n\n\t// Create the element which will hold our react elements and then append it into the child window's body.\n\tconst containerDiv: HTMLElement = document.createElement(\"div\");\n\tnewWindow.document.body.appendChild(containerDiv);\n\n\t// The className that was passed to MenuShell is added to the child window's <body>\n\tclassName?.split(\" \").forEach((name: string) => newWindow!.document.body.classList.add(name));\n\n\t// This will update local state which will cause the parent React Functional Component\n\t// to return a react portal. See comments at the end of this file.\n\tsetElement(containerDiv);\n\n\t// Inject css into the child window's <head>\n\tinjectCSS(newWindow);\n\n\t// THE FOLLOWING IS LIKELY DEPRECATED BUT KEEPING JUST IN CASE\n\t// Place height on the portal.\n\t// inside of the portal, window.outerHeight === 39 (toolbar height).\n\t// Knowing the height of the window is important because some menus use that\n\t// information to force overflow on certain sections of the menu.\n\t(newWindow as any).portalHeight = menuHeight;\n};\n\n/**\n * React hook to create a drop down menu. This hook creates a new window using window.open\n * and assigns it as the childWindow to the MenuPortal. It then uses insertWindowContent()\n * to establish the React/DOM connection with the parent (e.g. Toolbar).\n */\nconst useCreateDropdown = ({\n\tkeyboardNavigation,\n\tsetElement,\n\tchildWindow,\n\tsetChildWindow,\n}: {\n\tkeyboardNavigation: KeyboardNavigation | null;\n\tsetElement: React.Dispatch<React.SetStateAction<HTMLElement | undefined>>;\n\tchildWindow: Window | null;\n\tsetChildWindow: React.Dispatch<React.SetStateAction<Window | null>>;\n}) => {\n\tconst { thisMenuId, menuWidth, menuHeight, className, maxHeight, minHeight } = useContext(MenuContext);\n\tconst { blurMenu } = useMenu();\n\tconst isAutoResizable = !menuHeight;\n\n\t/**\n\t * Initialize the window. This should only run once though it is possible\n\t * to run multiple times if MenuContext changes.\n\t */\n\tuseEffect(() => {\n\t\tlet menuAutoResizer: any = null;\n\n\t\t/**\n\t\t * Initial size and location of the menu is irrelevant because it is hidden.\n\t\t * The menu will be resized and positioned correctly when it is shown.\n\t\t */\n\t\tconst features = `height=1,width=${menuWidth},left=0,top=0,opacity=1`;\n\n\t\t/**\n\t\t * Opens the window which will contain the menu contents. This looks like a browser window open\n\t\t * but actually opens an Electron window which FEA intercepts. FEA uses the `childWindowOptions`\n\t\t * json configuration to determine how to display the window. `childWindowOptions.show` should\n\t\t * be set to `false` otherwise a white window will flash prior to the menu being rendered.\n\t\t *\n\t\t *\n\t\t * The \"/component/toolbar/menu.html\" is just an empty page. It's necessary to reference a real page\n\t\t * rather than about:blank in order that the \"origin\" is correct for the page. Many CSS ui-assets such\n\t\t * as fonts and images are set with relative paths that require a correct origin.\n\t\t *\n\t\t * Note, we append the menu ID for automated testing. This allows Selenium to\n\t\t * uniquely identify each menu.\n\t\t */\n\t\tconst newWindow = window.open(`./menu.html#${thisMenuId}`, `(Menu) ${thisMenuId}`, features);\n\t\tsetChildWindow(newWindow);\n\n\t\tif (newWindow) {\n\t\t\tconst onLoad = () => {\n\t\t\t\tinsertWindowContent({ newWindow, isAutoResizable, className, setElement, menuHeight });\n\t\t\t\tsetupEventForwarding(newWindow);\n\t\t\t\t/* Close window when a user clicks away.\n\t\t\t\t\tAre you wondering why not just close the window without calling\n\t\t\t\t\ttoggle? because we want to update the state in the store first\n\t\t\t\t\twhich will cause openMenuId to no longer match the shell id\n\t\t\t\t\tand eventually destroy this component which will cause the window\n\t\t\t\t\tto close (see cleanup function).\n\t\t\t\t*/\n\t\t\t\tnewWindow.addEventListener(\"blur\", blurMenu);\n\n\t\t\t\t// Attach MenuAutoResizer only if the menu doesn't have a fixed height\n\t\t\t\tif (isAutoResizable)\n\t\t\t\t\tmenuAutoResizer = new MenuAutoResizer(newWindow, thisMenuId, menuWidth, maxHeight, minHeight);\n\t\t\t};\n\t\t\tnewWindow.addEventListener(\"load\", onLoad, true);\n\t\t} else {\n\t\t\tFSBL.Clients.Logger.system.error(`MenuPortal error: window.open returned null for \"./menu.html#${thisMenuId}\"`);\n\t\t}\n\n\t\treturn () => {\n\t\t\t// imesner 20210406 childwindow and keyboardNavigation were both null but hadn't closed the window or released global hotkeys\n\t\t\tconst win = childWindow || menuAutoResizer?.childWindow;\n\t\t\tconst keyboardNav = keyboardNavigation || (win as any)?.keyboardNavigation;\n\n\t\t\tkeyboardNav?.detach();\n\n\t\t\tmenuAutoResizer?.disconnect();\n\t\t\twin?.close();\n\t\t\tsetChildWindow(null);\n\t\t};\n\t}, [blurMenu, className, menuWidth, menuHeight, maxHeight, thisMenuId]);\n};\n\n/**\n * Sets visibility, size and location of the window. This can be called numerous times\n * during the lifetime of the MenuPortal.\n */\nconst showHideResizeWindow = async ({\n\tchildWindow,\n\tkeyboardNavigation,\n\tshow,\n\tthisMenuId,\n\tmenuHeight,\n\tmaxHeight,\n\tminHeight,\n}: {\n\tchildWindow: Window;\n\tkeyboardNavigation: KeyboardNavigation | null;\n\tshow: boolean;\n\tthisMenuId: string;\n\tmenuHeight?: number;\n\tmaxHeight: number;\n\tminHeight: number;\n}) => {\n\tconst finWindow: FEA.FEAWindow = childWindow.fin.desktop.Window.getCurrent();\n\tif (show) {\n\t\tconst { left, top, height } = await calculateDimensions(childWindow, thisMenuId, menuHeight, maxHeight, minHeight);\n\n\t\tconst params: SpawnParams = {\n\t\t\tposition: \"absolute\",\n\t\t\tleft: left,\n\t\t\ttop: top,\n\t\t\theight: height,\n\t\t\tforceOntoMonitor: \"monitorRect\",\n\t\t};\n\n\t\tconst { name } = childWindow;\n\n\t\t/**\n\t\t * Use Finsemble to show the window. We might be tempted simply to use childWindow.moveTo() or childWindow.resizeTo()\n\t\t * but those commands limit the child window to a single monitor. We want to position the window relative to the\n\t\t * monitor on which the toolbar currently resides. showWindow() is monitor aware, so by using monitor=\"mine\" we can\n\t\t * ensure that the menu will always open on the same monitor as the toolbar. Since our toolbar has built in logic\n\t\t * to avoid straddling, we can be sure that the menu will never have to guess whether it exists on the left or right\n\t\t * side of the toolbar. Finally, showWindow() forces windows to open entirely on a monitor, so it will slide the\n\t\t * menu to the left or right as necessary to prevent it from straddling.\n\t\t */\n\t\tFSBL.Clients.LauncherClient.showWindow({ windowName: name }, params);\n\n\t\t// Ensures that the menu has keyboard focus for accessibility\n\t\tfinWindow.focus();\n\n\t\t// Ensures that the menu is positioned above any other windows that have setAlwaysOnTop flagged\n\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: true });\n\t\t});\n\n\t\tif (keyboardNavigation) {\n\t\t\t// Why??\n\t\t\t(childWindow as any).keyboardNavigation = keyboardNavigation;\n\t\t\tkeyboardNavigation.attach();\n\t\t}\n\t} else {\n\t\tconst { name } = childWindow;\n\t\tFSBL.FinsembleWindow.getInstance({ name: name }, (e: any, fsblWindow: any) => {\n\t\t\tfsblWindow.setAlwaysOnTop({ alwaysOnTop: false });\n\t\t});\n\n\t\tfinWindow.hide();\n\t\tif (keyboardNavigation) keyboardNavigation.detach();\n\t}\n};\n\n/**\n * Closes the menu portal if the menu button is removed from the toolbar\n *\n * @param {Node} element - HTML element to observe\n *\n */\nconst closePortal = (element: Node) => {\n\tconst { closeMenu } = useMenu();\n\n\tconst options = {\n\t\tchildList: true,\n\t\tsubtree: true,\n\t};\n\n\t/**\n\t * MutationObserver interface provides the ability to watch for\n\t * changes to the DOM tree using the observe method\n\t */\n\tconst mutationObserver = new MutationObserver((mutations) => {\n\t\tmutations.forEach((mutation) => {\n\t\t\tif (mutation.removedNodes?.length) closeMenu();\n\n\t\t\t// stops the MutationObserver from receiving notification from observer\n\t\t\tmutationObserver.disconnect();\n\t\t});\n\t});\n\n\t// watches for DOM changes\n\tmutationObserver.observe(element, options);\n};\n\nexport const MenuPortal: React.FunctionComponent<{\n\tshow: boolean;\n}> = ({ show, children }) => {\n\tconst { thisMenuId, menuHeight, maxHeight, minHeight } = useContext(MenuContext);\n\n\t// Container div for React portal\n\tconst [element, setElement] = useState<HTMLElement>();\n\tconst [childWindow, setChildWindow] = useState<Window | null>(null);\n\n\t/**\n\t * KeyboardNavigation registers global hotkeys for navigating through a menu with cursor keys.\n\t * Those hotkeys are registered/unregistered based on visibility of the child window.\n\t * The KeyboardNavigation class is a singleton and so is memoized. It is created when the child window is available.\n\t */\n\tconst keyboardNavigation = useMemo(() => {\n\t\tif (childWindow) return new KeyboardNavigation(childWindow, \".menu-item\");\n\t\telse return null;\n\t}, [childWindow]);\n\n\t/**\n\t * Show and hide window. This effect will run whenever the `show` prop changes,\n\t * generally initiated by a click to <MenuToggle>.\n\t */\n\tuseEffect(() => {\n\t\t// If child window isn't yet initialized then no-op\n\t\tif (!childWindow) return;\n\n\t\tshowHideResizeWindow({ childWindow, keyboardNavigation, show, thisMenuId, menuHeight, maxHeight, minHeight });\n\t\treturn () => {};\n\t}, [show]);\n\n\t// Create the dropdown. (if MenuContext changes then the dropdown will be removed and recreated).\n\tuseCreateDropdown({ keyboardNavigation, childWindow, setElement, setChildWindow });\n\n\tconst toolbar = document.getElementById(\"Toolbar-tsx\");\n\n\tif (toolbar) closePortal(toolbar);\n\n\t// We should only return a react portal when window is ready\n\t// and container div appended to its body\n\t// See Dan abramov comment about this at:\n\t// https://github.com/facebook/react/issues/12355#issuecomment-410996235\n\treturn element ? ReactDOM.createPortal(children, element) : null;\n};\n"]}
|
package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsCenter.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsCenter/NotificationsCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,gDAAgD,CAAC;AAGxD,OAAO,gBAAgB,EA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,CAAC,IAAI,CAAC,CAAC,CAAC,CAC7B,oBAAC,QAAQ,IAAC,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,GAAI,CACpF,CAAC,CAAC,CAAC,CACH,oBAAC,QAAQ,IACR,aAAa,EAAE,aAAa,EAC5B,qBAAqB,EAAE,KAAK,CAAC,qBAAqB,EAClD,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,GAC7C,CACF,CACI,CACJ,CACH,CAAC;IAEF,MAAM,gCAAgC,GAAG,GAAG,EAAE,CAAC,oBAAC,uBAAuB,IAAC,YAAY,EAAE,oBAAoB,GAAI,CAAC;IAE/G,OAAO,CACN,oBAAC,kBAAkB,IAClB,SAAS,EAAG,MAAM,CAAC,aAAyB,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,EAC5E,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CACtB,oBAAC,aAAa,IAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAC,QAAQ,EAAC,aAAa,UACpF,QAAQ,CACM,CAChB;QAED,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,0BAA0B;YAC/D,oBAAC,MAAM,IAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IACvD,oBAAoB,CAAC,CAAC,CAAC,gCAAgC,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAC5E,CACsB,CACZ,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { CSSTransition } from \"react-transition-group\";\nimport ConditionalWrapper from \"../../../shared/ConditionalWrapper\";\n\nimport { ViewMode, SelectionMode } from \"../../constants\";\n\nimport \"../../../../assets/css/notificationsCenter.css\";\n\n// Hooks\nimport useNotifications, {\n\tuseNotificationUI,\n\tgetNotificationConfig,\n\tmoveToToolbarMonitor,\n\tgetOS,\n\tgetFetchHistoryParams,\n} from \"../../../../hooks/useNotifications\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Types\nimport { INotificationCenterProps, NotificationCenterControlsProps, NotificationsContextType } from \"../../types\";\n\n// Components\nimport CardView from \"../views/CardView\";\nimport Drawer from \"../drawer/Drawer\";\nimport DrawerControls from \"../drawer/DrawerControls\";\nimport DrawerHeader from \"../drawer/DrawerHeader\";\nimport ListView from \"../views/ListView\";\nimport NotificationDetailsView from \"../views/NotificationDetailsView\";\nimport { services } from \"@finsemble/finsemble-core\";\n\nimport FloatingFocus from \"@q42/floating-focus-a11y\";\n// The package FloatingFocus injects a focus indicator that moves around the page, but only for\n// keyboard users. (Mouse users don't see the indicator.) All that needs to be done is to envoke it.\nnew FloatingFocus();\n// If you want to make changes to the indicator, the styles are being maintained in assets/css/focus.css\n\ntype INotification = services.notification.types.INotification;\ntype IMuteFilter = services.notification.types.IMuteFilter;\n\nconst defaultControls: NotificationCenterControlsProps = {\n\tcontrols: [\n\t\t{\n\t\t\taction: \"all\",\n\t\t\tlabel: \"All\",\n\t\t\trun: (notifications: INotification[]) => notifications,\n\t\t},\n\t\t{\n\t\t\taction: \"unread\",\n\t\t\tlabel: \"Unread\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => !notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"read\",\n\t\t\tlabel: \"Read\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"snoozed\",\n\t\t\tlabel: \"Snoozed\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isSnoozed),\n\t\t},\n\t],\n\tactive: \"all\",\n};\n\nconst addPoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.add(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.add(\"notifications-popped-in\");\n};\n\nconst removePoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.remove(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.remove(\"notifications-popped-in\");\n};\n\nconst storeNotificationsCenterWindowPosition = ({ showCenter, poppedOut, position }: any) => {\n\tFSBL.Clients.StorageClient.save({\n\t\ttopic: \"finsemble.notifications\",\n\t\tkey: \"last.position\",\n\t\tvalue: {\n\t\t\tshowCenter,\n\t\t\tpoppedOut,\n\t\t\tposition,\n\t\t},\n\t});\n};\n\nconst setShowWindowForState = (centerState: any) => {\n\tif (centerState.showCenter) {\n\t\tfinsembleWindow.show({}, () => {\n\t\t\tfinsembleWindow.bringToFront();\n\t\t});\n\t}\n\n\tif (centerState.position) {\n\t\tfinsembleWindow.setBounds(centerState.position);\n\t}\n\n\t// Always on top when popped in\n\tFSBL.Clients.WindowClient.setAlwaysOnTop(!centerState.poppedOut);\n\tstoreNotificationsCenterWindowPosition(centerState);\n};\n\nconst isValidPosition = (bounds: any): boolean =>\n\tbounds &&\n\ttypeof bounds.left !== \"undefined\" &&\n\ttypeof bounds.top !== \"undefined\" &&\n\ttypeof bounds.height !== \"undefined\" &&\n\ttypeof bounds.width !== \"undefined\";\n\nconst LAZY_LOAD_NO_MORE_PAGES = -1;\n\nexport const NotificationsCenter: React.FunctionComponent<INotificationCenterProps> = (props) => {\n\tconst params = { config: { notificationsHistory: { options: { pageSize: 10 } } } };\n\tconst { notifications, setOpaqueClassName, addNotification } = useNotifications(params);\n\tconst [uiState, setUIState] = useNotificationUI();\n\n\tconst config = getNotificationConfig();\n\tconst [isInitialized, setInitialized] = useState(false);\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\tconst nextPageToFetch = useRef(1);\n\n\t// Set up references for use in callbacks to FSBL functions\n\tconst showCenterRef = useRef(false);\n\tconst poppedOutRef = useRef(false);\n\tconst subscriptionMessageRef = useRef<any>({});\n\tconst applicationState = useRef(null);\n\n\tconst checkedNotifications: INotification[] = [];\n\n\tconst [searchString, setSearchString] = useState(\"\");\n\tconst [filteredNotifications, setFilteredNotifications] = useState([...notifications]);\n\tconst [viewMode, setViewMode] = useState<ViewMode>(ViewMode.CARD);\n\tconst [selectionMode, setSelectionMode] = useState<SelectionMode>(SelectionMode.NO_SELECTION);\n\tconst [selectedNotification, setSelectedNotification] = useState<INotification | null>(null);\n\tconst [muteFilters, setMuteFilters] = useState<IMuteFilter[]>([]);\n\tconst [reloadMuteFilters, setReloadMuteFilters] = useState(true);\n\n\tconst dcp: NotificationCenterControlsProps = props.controls ? props.controls : defaultControls;\n\n\tconst [drawerControlProps, setDrawerControlProps] = useState(dcp);\n\tconst notificationsContextValues: NotificationsContextType = {\n\t\tviewMode,\n\t\tsetViewMode,\n\t\tselectionMode,\n\t\tsetSelectionMode,\n\t\tdrawerControlProps,\n\t\tsetDrawerControlProps,\n\t\tselectedNotification,\n\t\tsetSelectedNotification,\n\t\tsearchString,\n\t\tsetSearchString,\n\t\tfilteredNotifications,\n\t\tcheckedNotifications,\n\t\tsetFilteredNotifications,\n\t\tmuteFilters,\n\t\tsetMuteFilters,\n\t};\n\n\tconst togglePoppedStatus = () => {\n\t\tconst poppedOut = !uiState.poppedOut;\n\t\tpoppedOutRef.current = poppedOut;\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tpoppedOut,\n\t\t});\n\t};\n\n\tconst setFullHeight = async (monitorInfo?: any) => {\n\t\tif (!monitorInfo) {\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\tfinsembleWindow.getMonitor((monitor: any) => {\n\t\t\t\t\tmonitorInfo = monitor;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tconst { data } = await finsembleWindow.getBounds();\n\t\tif (data) {\n\t\t\tconst centerWindowPosition = {\n\t\t\t\tleft: monitorInfo.availableRect.right - data.width,\n\t\t\t\ttop: monitorInfo.availableRect.top,\n\t\t\t\theight: monitorInfo.availableRect.height,\n\t\t\t\twidth: data.width,\n\t\t\t};\n\n\t\t\tsetShowWindowForState({\n\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\t\tposition: centerWindowPosition,\n\t\t\t});\n\n\t\t\tfinsembleWindow.setShape([]);\n\t\t}\n\t};\n\n\tconst boundsChangeListener = (event: any) => {\n\t\tif (showCenterRef?.current && !poppedOutRef.current) {\n\t\t\t// Bounds Changed fires when Windows Taskbar + Finsemble Toolbar docking changes\n\t\t\tsetFullHeight();\n\t\t}\n\t\tconst position = {\n\t\t\ttop: event.data.top,\n\t\t\tleft: event.data.left,\n\t\t\theight: event.data.height,\n\t\t\twidth: event.data.width,\n\t\t};\n\n\t\tstoreNotificationsCenterWindowPosition({\n\t\t\tshowCenter: showCenterRef?.current ? showCenterRef.current : false,\n\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\tposition,\n\t\t});\n\t};\n\n\tconst getScrollPercentage = () => {\n\t\tconst maxScroll = document.body.scrollHeight;\n\t\tconst currentScroll = window.innerHeight + window.scrollY;\n\t\treturn currentScroll / maxScroll;\n\t};\n\n\tconst lazyLoadNextPage = async () =>\n\t\tnew Promise<void>(async (resolve) => {\n\t\t\tif (nextPageToFetch.current > 0) {\n\t\t\t\tconst [options, filter] = getFetchHistoryParams(config, params);\n\t\t\t\toptions.pageNumber = nextPageToFetch.current;\n\t\t\t\tconst notificationList = await FSBL.Clients.NotificationClient.fetchHistory(options, filter);\n\t\t\t\tif (notificationList.length) {\n\t\t\t\t\tnextPageToFetch.current = nextPageToFetch.current + 1;\n\t\t\t\t\tfor (const notification of notificationList) {\n\t\t\t\t\t\taddNotification(notification);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop fetching after this one\n\t\t\t\t\tnextPageToFetch.current = LAZY_LOAD_NO_MORE_PAGES;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve();\n\t\t});\n\n\tconst toggleCenter = async (show: boolean, isTransparent: boolean, poppedOut: boolean) => {\n\t\tif (isTransparent && !isMac) {\n\t\t\tif (poppedOut) {\n\t\t\t\tif (show) {\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (show) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tfinsembleWindow.setShape([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (show) {\n\t\t\t\tif (!poppedOut) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t}\n\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t}\n\t\t}\n\t};\n\n\t// When popped out we want to prevent the center to be closed when the close button is clicked (or alt +)\n\tuseEffect(() => {\n\t\tsetOpaqueClassName(!config.isTransparent);\n\n\t\tconst subscriptionId = FSBL.Clients.RouterClient.subscribe(\"Finsemble.Application.State\", (err, response) => {\n\t\t\tapplicationState.current = response.data.state;\n\t\t});\n\n\t\tconst hide = (event: any) => {\n\t\t\tconst publishValue = { ...subscriptionMessageRef.current };\n\t\t\tpublishValue[\"showCenter\"] = false;\n\t\t\tsetUIState(publishValue);\n\t\t\tif (applicationState?.current !== \"closing\") {\n\t\t\t\ttry {\n\t\t\t\t\tevent.cancel();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\"Error cancelling the window close event\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst scrollHandler = () => {\n\t\t\tif (getScrollPercentage() > 0.9) {\n\t\t\t\tlazyLoadNextPage();\n\t\t\t}\n\t\t};\n\n\t\tfinsembleWindow.addEventListener(\"close-requested\", hide);\n\t\tfinsembleWindow.addEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\twindow.addEventListener(\"scroll\", scrollHandler);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(subscriptionId);\n\t\t\tfinsembleWindow.removeEventListener(\"close-requested\", hide);\n\t\t\tfinsembleWindow.removeEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\t\twindow.removeEventListener(\"scroll\", scrollHandler);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst recursiveLoad = async () => {\n\t\t\t// Cater for the case where there is no scroll bar to trigger lazy load - keep loading until scrollbar or no pages\n\t\t\tawait lazyLoadNextPage();\n\t\t\tif (getScrollPercentage() === 1 && nextPageToFetch.current != LAZY_LOAD_NO_MORE_PAGES) {\n\t\t\t\trecursiveLoad();\n\t\t\t}\n\t\t};\n\n\t\trecursiveLoad();\n\t}, [viewMode, drawerControlProps.active]);\n\n\t// Hook to set up the center state from service data on component start\n\tuseEffect(() => {\n\t\tsubscriptionMessageRef.current = uiState;\n\t\t// Hook can execute before initial pubsub response - waiting for actual values\n\t\tif (!isInitialized && typeof uiState.showCenter !== \"undefined\") {\n\t\t\tif (uiState.poppedOut) {\n\t\t\t\tremovePoppedInClasses();\n\t\t\t} else {\n\t\t\t\taddPoppedInClasses();\n\t\t\t}\n\n\t\t\tif (isValidPosition(uiState.position)) {\n\t\t\t\tsetShowWindowForState({\n\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\tposition: uiState.position,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Setup references\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\n\t\t\tsetInitialized(true);\n\t\t}\n\t}, [uiState]);\n\n\t// Effect to run when we pop-in or pop-out the notification center\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\t\t\tfinsembleWindow.getMonitor(async (monitorInfo: any) => {\n\t\t\t\tif (uiState.poppedOut) {\n\t\t\t\t\tconst { data } = await finsembleWindow.getBounds();\n\t\t\t\t\tremovePoppedInClasses();\n\n\t\t\t\t\tif (data) {\n\t\t\t\t\t\tconst centerWindowPosition = {\n\t\t\t\t\t\t\tleft: data.left - 25,\n\t\t\t\t\t\t\ttop: data.top + 25,\n\t\t\t\t\t\t\theight: Math.round(monitorInfo.availableRect.height * 0.8),\n\t\t\t\t\t\t\twidth: data.width,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tsetShowWindowForState({\n\t\t\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\t\t\tposition: centerWindowPosition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\taddPoppedInClasses();\n\t\t\t\t\tsetFullHeight(monitorInfo);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [uiState.poppedOut]);\n\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\ttoggleCenter(uiState.showCenter, config.isTransparent as boolean, poppedOutRef.current);\n\t\t}\n\t}, [uiState.showCenter]);\n\n\tuseEffect(() => {\n\t\tsetFilteredNotifications([...notifications]);\n\t}, [notifications]);\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tsetReloadMuteFilters(true);\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\t// Sets the current active mute filters\n\tuseEffect(() => {\n\t\tasync function loadMuteFilter() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getMuteFilters();\n\t\t}\n\n\t\tloadMuteFilter().then((loadedMuteFilters: IMuteFilter[]) => {\n\t\t\tsetMuteFilters(loadedMuteFilters);\n\t\t\tsetReloadMuteFilters(false);\n\t\t});\n\t}, [reloadMuteFilters]);\n\n\tconst notificationsMainView = () => (\n\t\t<>\n\t\t\t<DrawerHeader poppedOutStatus={uiState.poppedOut} popOutToggle={togglePoppedStatus} />\n\t\t\t<DrawerControls />\n\t\t\t<div className=\"cards-container\">\n\t\t\t\t{viewMode === ViewMode.CARD ? (\n\t\t\t\t\t<CardView notifications={notifications} notificationCard={props.notificationCard} />\n\t\t\t\t) : (\n\t\t\t\t\t<ListView\n\t\t\t\t\t\tnotifications={notifications}\n\t\t\t\t\t\tnotificationHeaderRow={props.notificationHeaderRow}\n\t\t\t\t\t\tnotificationListRow={props.notificationListRow}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n\n\tconst notificationDetailsViewComponent = () => <NotificationDetailsView notification={selectedNotification} />;\n\n\treturn (\n\t\t<ConditionalWrapper\n\t\t\tcondition={(config.isTransparent as boolean) && !uiState.poppedOut && !isMac}\n\t\t\twrapper={(children) => (\n\t\t\t\t<CSSTransition in={uiState.showCenter} timeout={500} classNames=\"drawer\" unmountOnExit>\n\t\t\t\t\t{children}\n\t\t\t\t</CSSTransition>\n\t\t\t)}\n\t\t>\n\t\t\t<NotificationsContext.Provider value={notificationsContextValues}>\n\t\t\t\t<Drawer classNames={uiState.poppedOut ? \"popped-out\" : \"\"}>\n\t\t\t\t\t{selectedNotification ? notificationDetailsViewComponent() : notificationsMainView()}\n\t\t\t\t</Drawer>\n\t\t\t</NotificationsContext.Provider>\n\t\t</ConditionalWrapper>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationsCenter.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsCenter/NotificationsCenter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,kBAAkB,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,gDAAgD,CAAC;AAGxD,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,EACL,qBAAqB,GACrB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMlE,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,uBAAuB,MAAM,kCAAkC,CAAC;AAGvE,OAA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CAAC;IAE/G,OAAO,CACN,oBAAC,kBAAkB,IAClB,SAAS,EAAG,MAAM,CAAC,aAAyB,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,EAC5E,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CACtB,oBAAC,aAAa,IAAC,EAAE,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAC,QAAQ,EAAC,aAAa,UACpF,QAAQ,CACM,CAChB;QAED,oBAAC,oBAAoB,CAAC,QAAQ,IAAC,KAAK,EAAE,0BAA0B;YAC/D,oBAAC,MAAM,IAAC,UAAU,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IACvD,oBAAoB,CAAC,CAAC,CAAC,gCAAgC,EAAE,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAC5E,CACsB,CACZ,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { CSSTransition } from \"react-transition-group\";\nimport ConditionalWrapper from \"../../../shared/ConditionalWrapper\";\n\nimport { ViewMode, SelectionMode } from \"../../constants\";\n\nimport \"../../../../assets/css/notificationsCenter.css\";\n\n// Hooks\nimport useNotifications, {\n\tuseNotificationUI,\n\tgetNotificationConfig,\n\tmoveToToolbarMonitor,\n\tgetOS,\n\tgetFetchHistoryParams,\n} from \"../../../../hooks/useNotifications\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Types\nimport { INotificationCenterProps, NotificationCenterControlsProps, NotificationsContextType } from \"../../types\";\n\n// Components\nimport CardView from \"../views/CardView\";\nimport Drawer from \"../drawer/Drawer\";\nimport DrawerControls from \"../drawer/DrawerControls\";\nimport DrawerHeader from \"../drawer/DrawerHeader\";\nimport ListView from \"../views/ListView\";\nimport NotificationDetailsView from \"../views/NotificationDetailsView\";\nimport { services } from \"@finsemble/finsemble-api\";\n\nimport FloatingFocus from \"@q42/floating-focus-a11y\";\n// The package FloatingFocus injects a focus indicator that moves around the page, but only for\n// keyboard users. (Mouse users don't see the indicator.) All that needs to be done is to envoke it.\nnew FloatingFocus();\n// If you want to make changes to the indicator, the styles are being maintained in assets/css/focus.css\n\ntype INotification = services.notification.types.INotification;\ntype IMuteFilter = services.notification.types.IMuteFilter;\n\nconst defaultControls: NotificationCenterControlsProps = {\n\tcontrols: [\n\t\t{\n\t\t\taction: \"all\",\n\t\t\tlabel: \"All\",\n\t\t\trun: (notifications: INotification[]) => notifications,\n\t\t},\n\t\t{\n\t\t\taction: \"unread\",\n\t\t\tlabel: \"Unread\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => !notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"read\",\n\t\t\tlabel: \"Read\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isRead),\n\t\t},\n\t\t{\n\t\t\taction: \"snoozed\",\n\t\t\tlabel: \"Snoozed\",\n\t\t\trun: (notifications: INotification[]) =>\n\t\t\t\tnotifications.filter((notification: INotification) => notification.isSnoozed),\n\t\t},\n\t],\n\tactive: \"all\",\n};\n\nconst addPoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.add(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.add(\"notifications-popped-in\");\n};\n\nconst removePoppedInClasses = () => {\n\tdocument.getElementById(\"notifications-center-container\")?.classList.remove(\"notifications-popped-in\");\n\tdocument.getElementById(\"FSBLHeader\")?.classList.remove(\"notifications-popped-in\");\n};\n\nconst storeNotificationsCenterWindowPosition = ({ showCenter, poppedOut, position }: any) => {\n\tFSBL.Clients.StorageClient.save({\n\t\ttopic: \"finsemble.notifications\",\n\t\tkey: \"last.position\",\n\t\tvalue: {\n\t\t\tshowCenter,\n\t\t\tpoppedOut,\n\t\t\tposition,\n\t\t},\n\t});\n};\n\nconst setShowWindowForState = (centerState: any) => {\n\tif (centerState.showCenter) {\n\t\tfinsembleWindow.show({}, () => {\n\t\t\tfinsembleWindow.bringToFront();\n\t\t});\n\t}\n\n\tif (centerState.position) {\n\t\tfinsembleWindow.setBounds(centerState.position);\n\t}\n\n\t// Always on top when popped in\n\tFSBL.Clients.WindowClient.setAlwaysOnTop(!centerState.poppedOut);\n\tstoreNotificationsCenterWindowPosition(centerState);\n};\n\nconst isValidPosition = (bounds: any): boolean =>\n\tbounds &&\n\ttypeof bounds.left !== \"undefined\" &&\n\ttypeof bounds.top !== \"undefined\" &&\n\ttypeof bounds.height !== \"undefined\" &&\n\ttypeof bounds.width !== \"undefined\";\n\nconst LAZY_LOAD_NO_MORE_PAGES = -1;\n\nexport const NotificationsCenter: React.FunctionComponent<INotificationCenterProps> = (props) => {\n\tconst params = { config: { notificationsHistory: { options: { pageSize: 10 } } } };\n\tconst { notifications, setOpaqueClassName, addNotification } = useNotifications(params);\n\tconst [uiState, setUIState] = useNotificationUI();\n\n\tconst config = getNotificationConfig();\n\tconst [isInitialized, setInitialized] = useState(false);\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\tconst nextPageToFetch = useRef(1);\n\n\t// Set up references for use in callbacks to FSBL functions\n\tconst showCenterRef = useRef(false);\n\tconst poppedOutRef = useRef(false);\n\tconst subscriptionMessageRef = useRef<any>({});\n\tconst applicationState = useRef(null);\n\n\tconst checkedNotifications: INotification[] = [];\n\n\tconst [searchString, setSearchString] = useState(\"\");\n\tconst [filteredNotifications, setFilteredNotifications] = useState([...notifications]);\n\tconst [viewMode, setViewMode] = useState<ViewMode>(ViewMode.CARD);\n\tconst [selectionMode, setSelectionMode] = useState<SelectionMode>(SelectionMode.NO_SELECTION);\n\tconst [selectedNotification, setSelectedNotification] = useState<INotification | null>(null);\n\tconst [muteFilters, setMuteFilters] = useState<IMuteFilter[]>([]);\n\tconst [reloadMuteFilters, setReloadMuteFilters] = useState(true);\n\n\tconst dcp: NotificationCenterControlsProps = props.controls ? props.controls : defaultControls;\n\n\tconst [drawerControlProps, setDrawerControlProps] = useState(dcp);\n\tconst notificationsContextValues: NotificationsContextType = {\n\t\tviewMode,\n\t\tsetViewMode,\n\t\tselectionMode,\n\t\tsetSelectionMode,\n\t\tdrawerControlProps,\n\t\tsetDrawerControlProps,\n\t\tselectedNotification,\n\t\tsetSelectedNotification,\n\t\tsearchString,\n\t\tsetSearchString,\n\t\tfilteredNotifications,\n\t\tcheckedNotifications,\n\t\tsetFilteredNotifications,\n\t\tmuteFilters,\n\t\tsetMuteFilters,\n\t};\n\n\tconst togglePoppedStatus = () => {\n\t\tconst poppedOut = !uiState.poppedOut;\n\t\tpoppedOutRef.current = poppedOut;\n\t\tsetUIState({\n\t\t\t...uiState,\n\t\t\tpoppedOut,\n\t\t});\n\t};\n\n\tconst setFullHeight = async (monitorInfo?: any) => {\n\t\tif (!monitorInfo) {\n\t\t\tawait new Promise<void>((resolve) => {\n\t\t\t\tfinsembleWindow.getMonitor((monitor: any) => {\n\t\t\t\t\tmonitorInfo = monitor;\n\t\t\t\t\tresolve();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tconst { data } = await finsembleWindow.getBounds();\n\t\tif (data) {\n\t\t\tconst centerWindowPosition = {\n\t\t\t\tleft: monitorInfo.availableRect.right - data.width,\n\t\t\t\ttop: monitorInfo.availableRect.top,\n\t\t\t\theight: monitorInfo.availableRect.height,\n\t\t\t\twidth: data.width,\n\t\t\t};\n\n\t\t\tsetShowWindowForState({\n\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\t\tposition: centerWindowPosition,\n\t\t\t});\n\n\t\t\tfinsembleWindow.setShape([]);\n\t\t}\n\t};\n\n\tconst boundsChangeListener = (event: any) => {\n\t\tif (showCenterRef?.current && !poppedOutRef.current) {\n\t\t\t// Bounds Changed fires when Windows Taskbar + Finsemble Toolbar docking changes\n\t\t\tsetFullHeight();\n\t\t}\n\t\tconst position = {\n\t\t\ttop: event.data.top,\n\t\t\tleft: event.data.left,\n\t\t\theight: event.data.height,\n\t\t\twidth: event.data.width,\n\t\t};\n\n\t\tstoreNotificationsCenterWindowPosition({\n\t\t\tshowCenter: showCenterRef?.current ? showCenterRef.current : false,\n\t\t\tpoppedOut: poppedOutRef.current,\n\t\t\tposition,\n\t\t});\n\t};\n\n\tconst getScrollPercentage = () => {\n\t\tconst maxScroll = document.body.scrollHeight;\n\t\tconst currentScroll = window.innerHeight + window.scrollY;\n\t\treturn currentScroll / maxScroll;\n\t};\n\n\tconst lazyLoadNextPage = async () =>\n\t\tnew Promise<void>(async (resolve) => {\n\t\t\tif (nextPageToFetch.current > 0) {\n\t\t\t\tconst [options, filter] = getFetchHistoryParams(config, params);\n\t\t\t\toptions.pageNumber = nextPageToFetch.current;\n\t\t\t\tconst notificationList = await FSBL.Clients.NotificationClient.fetchHistory(options, filter);\n\t\t\t\tif (notificationList.length) {\n\t\t\t\t\tnextPageToFetch.current = nextPageToFetch.current + 1;\n\t\t\t\t\tfor (const notification of notificationList) {\n\t\t\t\t\t\taddNotification(notification);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Stop fetching after this one\n\t\t\t\t\tnextPageToFetch.current = LAZY_LOAD_NO_MORE_PAGES;\n\t\t\t\t}\n\t\t\t}\n\t\t\tresolve();\n\t\t});\n\n\tconst toggleCenter = async (show: boolean, isTransparent: boolean, poppedOut: boolean) => {\n\t\tif (isTransparent && !isMac) {\n\t\t\tif (poppedOut) {\n\t\t\t\tif (show) {\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (show) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t\t\tfinsembleWindow.setShape([]);\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tfinsembleWindow.setShape([\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tx: 0,\n\t\t\t\t\t\t\t\ty: 0,\n\t\t\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\t\t\theight: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]);\n\t\t\t\t\t\tfinsembleWindow.hide();\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif (show) {\n\t\t\t\tif (!poppedOut) {\n\t\t\t\t\tawait moveToToolbarMonitor();\n\t\t\t\t\tawait setFullHeight();\n\t\t\t\t}\n\t\t\t\tfinsembleWindow.show({}, () => {\n\t\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t}\n\t\t}\n\t};\n\n\t// When popped out we want to prevent the center to be closed when the close button is clicked (or alt +)\n\tuseEffect(() => {\n\t\tsetOpaqueClassName(!config.isTransparent);\n\n\t\tconst subscriptionId = FSBL.Clients.RouterClient.subscribe(\"Finsemble.Application.State\", (err, response) => {\n\t\t\tapplicationState.current = response.data.state;\n\t\t});\n\n\t\tconst hide = (event: any) => {\n\t\t\tconst publishValue = { ...subscriptionMessageRef.current };\n\t\t\tpublishValue[\"showCenter\"] = false;\n\t\t\tsetUIState(publishValue);\n\t\t\tif (applicationState?.current !== \"closing\") {\n\t\t\t\ttry {\n\t\t\t\t\tevent.cancel();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(\"Error cancelling the window close event\", error);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst scrollHandler = () => {\n\t\t\tif (getScrollPercentage() > 0.9) {\n\t\t\t\tlazyLoadNextPage();\n\t\t\t}\n\t\t};\n\n\t\tfinsembleWindow.addEventListener(\"close-requested\", hide);\n\t\tfinsembleWindow.addEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\twindow.addEventListener(\"scroll\", scrollHandler);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.unsubscribe(subscriptionId);\n\t\t\tfinsembleWindow.removeEventListener(\"close-requested\", hide);\n\t\t\tfinsembleWindow.removeEventListener(\"bounds-change-end\", boundsChangeListener);\n\t\t\twindow.removeEventListener(\"scroll\", scrollHandler);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst recursiveLoad = async () => {\n\t\t\t// Cater for the case where there is no scroll bar to trigger lazy load - keep loading until scrollbar or no pages\n\t\t\tawait lazyLoadNextPage();\n\t\t\tif (getScrollPercentage() === 1 && nextPageToFetch.current != LAZY_LOAD_NO_MORE_PAGES) {\n\t\t\t\trecursiveLoad();\n\t\t\t}\n\t\t};\n\n\t\trecursiveLoad();\n\t}, [viewMode, drawerControlProps.active]);\n\n\t// Hook to set up the center state from service data on component start\n\tuseEffect(() => {\n\t\tsubscriptionMessageRef.current = uiState;\n\t\t// Hook can execute before initial pubsub response - waiting for actual values\n\t\tif (!isInitialized && typeof uiState.showCenter !== \"undefined\") {\n\t\t\tif (uiState.poppedOut) {\n\t\t\t\tremovePoppedInClasses();\n\t\t\t} else {\n\t\t\t\taddPoppedInClasses();\n\t\t\t}\n\n\t\t\tif (isValidPosition(uiState.position)) {\n\t\t\t\tsetShowWindowForState({\n\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\tposition: uiState.position,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// Setup references\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\n\t\t\tsetInitialized(true);\n\t\t}\n\t}, [uiState]);\n\n\t// Effect to run when we pop-in or pop-out the notification center\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tpoppedOutRef.current = uiState.poppedOut;\n\t\t\tfinsembleWindow.getMonitor(async (monitorInfo: any) => {\n\t\t\t\tif (uiState.poppedOut) {\n\t\t\t\t\tconst { data } = await finsembleWindow.getBounds();\n\t\t\t\t\tremovePoppedInClasses();\n\n\t\t\t\t\tif (data) {\n\t\t\t\t\t\tconst centerWindowPosition = {\n\t\t\t\t\t\t\tleft: data.left - 25,\n\t\t\t\t\t\t\ttop: data.top + 25,\n\t\t\t\t\t\t\theight: Math.round(monitorInfo.availableRect.height * 0.8),\n\t\t\t\t\t\t\twidth: data.width,\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tsetShowWindowForState({\n\t\t\t\t\t\t\tshowCenter: uiState.showCenter,\n\t\t\t\t\t\t\tpoppedOut: uiState.poppedOut,\n\t\t\t\t\t\t\tposition: centerWindowPosition,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\taddPoppedInClasses();\n\t\t\t\t\tsetFullHeight(monitorInfo);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}, [uiState.poppedOut]);\n\n\tuseEffect(() => {\n\t\tif (isInitialized) {\n\t\t\tshowCenterRef.current = uiState.showCenter;\n\t\t\ttoggleCenter(uiState.showCenter, config.isTransparent as boolean, poppedOutRef.current);\n\t\t}\n\t}, [uiState.showCenter]);\n\n\tuseEffect(() => {\n\t\tsetFilteredNotifications([...notifications]);\n\t}, [notifications]);\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tsetReloadMuteFilters(true);\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\t// Sets the current active mute filters\n\tuseEffect(() => {\n\t\tasync function loadMuteFilter() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getMuteFilters();\n\t\t}\n\n\t\tloadMuteFilter().then((loadedMuteFilters: IMuteFilter[]) => {\n\t\t\tsetMuteFilters(loadedMuteFilters);\n\t\t\tsetReloadMuteFilters(false);\n\t\t});\n\t}, [reloadMuteFilters]);\n\n\tconst notificationsMainView = () => (\n\t\t<>\n\t\t\t<DrawerHeader poppedOutStatus={uiState.poppedOut} popOutToggle={togglePoppedStatus} />\n\t\t\t<DrawerControls />\n\t\t\t<div className=\"cards-container\">\n\t\t\t\t{viewMode === ViewMode.CARD ? (\n\t\t\t\t\t<CardView notifications={notifications} notificationCard={props.notificationCard} />\n\t\t\t\t) : (\n\t\t\t\t\t<ListView\n\t\t\t\t\t\tnotifications={notifications}\n\t\t\t\t\t\tnotificationHeaderRow={props.notificationHeaderRow}\n\t\t\t\t\t\tnotificationListRow={props.notificationListRow}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</>\n\t);\n\n\tconst notificationDetailsViewComponent = () => <NotificationDetailsView notification={selectedNotification} />;\n\n\treturn (\n\t\t<ConditionalWrapper\n\t\t\tcondition={(config.isTransparent as boolean) && !uiState.poppedOut && !isMac}\n\t\t\twrapper={(children) => (\n\t\t\t\t<CSSTransition in={uiState.showCenter} timeout={500} classNames=\"drawer\" unmountOnExit>\n\t\t\t\t\t{children}\n\t\t\t\t</CSSTransition>\n\t\t\t)}\n\t\t>\n\t\t\t<NotificationsContext.Provider value={notificationsContextValues}>\n\t\t\t\t<Drawer classNames={uiState.poppedOut ? \"popped-out\" : \"\"}>\n\t\t\t\t\t{selectedNotification ? notificationDetailsViewComponent() : notificationsMainView()}\n\t\t\t\t</Drawer>\n\t\t\t</NotificationsContext.Provider>\n\t\t</ConditionalWrapper>\n\t);\n};\n"]}
|
package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsToasts.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsToasts/NotificationsToasts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,GACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,gDAAgD,CAAC;AAcxD,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,MAAM,eAAe,GAAG,MAAM,EAAiB,CAAC;IAChD,MAAM,EAAE,YAAY,EAAE,gCAAgC,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,GACnH,KAAK,CAAC;IACP,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACd,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;QACvC,IAAI,SAAc,CAAC;QAEnB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,wBAAwB,EAAE;YAE1F,IAAI,aAAa,CAAC;YAElB,IAAI,gCAAgC,KAAK,KAAK,EAAE;gBAE/C,aAAa,GAAG,gCAAgC,GAAG,IAAI,CAAC;g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,aAAa,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,EAAE,CAAC,CACnD,oBAAC,SAAS,kBACT,GAAG,EAAE,cAAc,YAAY,CAAC,EAAE,EAAE,EACpC,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,oBAAoB,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,IAClC,KAAK,EACR,CACF,CAAC,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport useNotifications, {\n\tuseNotificationUI,\n\tmoveToToolbarMonitor,\n\tgetNotificationConfig,\n\tgetOS,\n} from \"../../../../hooks/useNotifications\";\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { INotificationToastsProps } from \"../../types\";\nimport \"../../../../assets/css/notificationsCenter.css\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\ntype ToastCardProps = {\n\tnotification: INotification;\n\tremoveFunction: Function;\n\tisActiveFunction: Function;\n\tinformationalNotificationTimeout: number | false;\n\tactionableTimeoutEnabled: boolean;\n\tnotificationCard?: React.ComponentType<any>;\n};\n\nconst ToastCard = (props: ToastCardProps) => {\n\tconst notificationRef = useRef<INotification>();\n\tconst { notification, informationalNotificationTimeout, removeFunction, isActiveFunction, actionableTimeoutEnabled } =\n\t\tprops;\n\tconst [slideIn, setSlideIn] = useState(isActiveFunction(notification));\n\tconst [showNotification] = useState(isActiveFunction(notification));\n\n\tuseEffect(() => {\n\t\tnotificationRef.current = notification;\n\t\tlet timeoutId: any;\n\n\t\tif (!notification.actions || notification.actions.length == 0 || actionableTimeoutEnabled) {\n\t\t\t// Is an informational notification or timeout enabled actionable notifications\n\t\t\tlet timeoutLength;\n\n\t\t\tif (informationalNotificationTimeout !== false) {\n\t\t\t\t// Convert to milliseconds\n\t\t\t\ttimeoutLength = informationalNotificationTimeout * 1000;\n\t\t\t\tif (notification.timeout && Number.isInteger(notification.timeout)) {\n\t\t\t\t\ttimeoutLength = notification.timeout;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (timeoutLength) {\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t}, timeoutLength);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tclearInterval(timeoutId);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!isActiveFunction(notificationRef.current)) {\n\t\t\tremoveFunction(notification);\n\t\t}\n\t\tsetSlideIn(isActiveFunction(notification));\n\t}, [notification]);\n\n\tconst onExited = () => {\n\t\tremoveFunction(notification);\n\t};\n\n\tconst Card = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\treturn (\n\t\tshowNotification && (\n\t\t\t<CSSTransition in={slideIn} timeout={500} onExited={onExited} classNames=\"notifications-toast\">\n\t\t\t\t<div className=\"notifications-toast__offscreen\">\n\t\t\t\t\t<Card\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tuiContext=\"toasts\"\n\t\t\t\t\t\tremoveNotification={() => {\n\t\t\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"divider\"> </div>\n\t\t\t\t</div>\n\t\t\t</CSSTransition>\n\t\t)\n\t);\n};\n\nexport const NotificationsToasts: React.FunctionComponent<INotificationToastsProps> = (props) => {\n\tconst { notifications, notificationIsActive, setOpaqueClassName, removeNotification, activeNotifications } =\n\t\tuseNotifications({ config: { notificationsHistory: { options: { sentAfter: \"startup\" } } } });\n\tconst notificationsRef = useRef<INotification[]>(notifications);\n\tconst [uiState] = useNotificationUI();\n\n\tconst isNotificationActive = (notification: INotification): boolean => {\n\t\tconst notificationCenterNotActive = !uiState.showCenter || uiState.poppedOut;\n\t\treturn notificationIsActive(notification) && notificationCenterNotActive;\n\t};\n\n\tconst config = getNotificationConfig();\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\n\tconst [informationalTimeout, setInformationalTimeout] = useState<number | false>(false);\n\tconst [actionableTimeoutEnabled, setActionableTimeoutEnabled] = useState<boolean>(true);\n\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data.notificationPreferences) {\n\t\t\t\t\tconst { informationalNotificationToastPeriodSeconds, toastTimeoutOnActionableNotifications } =\n\t\t\t\t\t\tdata.notificationPreferences;\n\n\t\t\t\t\tif (informationalNotificationToastPeriodSeconds) {\n\t\t\t\t\t\tsetInformationalTimeout(informationalNotificationToastPeriodSeconds);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof toastTimeoutOnActionableNotifications !== \"undefined\") {\n\t\t\t\t\t\tsetActionableTimeoutEnabled(toastTimeoutOnActionableNotifications);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst transparencySupported = config.isTransparent;\n\n\t\tsetOpaqueClassName(!transparencySupported);\n\n\t\tif (transparencySupported) {\n\t\t\tfinsembleWindow.show();\n\t\t}\n\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetInformationalTimeout(preferences.informationalNotificationToastPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tmoveToToolbarMonitor().then(async () => {\n\t\t\tlet forceHide = false;\n\t\t\tif (\n\t\t\t\tactiveNotifications(notifications).length === 0 &&\n\t\t\t\tactiveNotifications(notificationsRef.current).length === 0\n\t\t\t) {\n\t\t\t\t// Bug fix: Toasts flash when inActive components (partially caused by allowing notifications to animate out)\n\t\t\t\tforceHide = true;\n\t\t\t}\n\n\t\t\tnotificationsRef.current = notifications;\n\t\t\tconst rect = document.getElementById(\"notifications-toasts\")?.getBoundingClientRect();\n\t\t\tif (notifications.length === 0 || forceHide) {\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t};\n\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t}\n\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: Math.round(rect?.width as number),\n\t\t\t\t\t\theight: Math.round(rect?.height as number),\n\t\t\t\t\t};\n\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t} else {\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tconst { err, data } = await FSBL.Clients.LauncherClient.getMonitorInfo({ monitor: \"mine\" });\n\t\t\t\t\tif (err || !data) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\t\t\t\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\t\t\t\t\tconst height = Math.round(rect?.height as number) + 6;\n\n\t\t\t\t\tawait finsembleWindow.setBounds({\n\t\t\t\t\t\tbounds: {\n\t\t\t\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\t\t\t\theight: height + 10,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, [notifications]);\n\n\treturn (\n\t\t<div>\n\t\t\t{notifications.map((notification: INotification) => (\n\t\t\t\t<ToastCard\n\t\t\t\t\tkey={`toast-card-${notification.id}`}\n\t\t\t\t\tnotification={notification}\n\t\t\t\t\tinformationalNotificationTimeout={informationalTimeout}\n\t\t\t\t\tactionableTimeoutEnabled={actionableTimeoutEnabled}\n\t\t\t\t\tremoveFunction={removeNotification}\n\t\t\t\t\tisActiveFunction={isNotificationActive}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"NotificationsToasts.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsToasts/NotificationsToasts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,GACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,gDAAgD,CAAC;AAcxD,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,MAAM,eAAe,GAAG,MAAM,EAAiB,CAAC;IAChD,MAAM,EAAE,YAAY,EAAE,gCAAgC,EAAE,cAAc,EAAE,gBAAgB,E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E,IAAI,mCAAI,CAAC,CAAC,CAAC;oBACzD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAgB,CAAC,GAAG,CAAC,CAAC;oBAEtD,MAAM,eAAe,CAAC,SAAS,CAAC;wBAC/B,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;4BACjC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK;4BAC5C,MAAM,EAAE,MAAM,GAAG,EAAE;4BACnB,KAAK,EAAE,KAAK;yBACZ;qBACD,CAAC,CAAC;iBACH;aACD;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACN,iCACE,aAAa,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,EAAE,CAAC,CACnD,oBAAC,SAAS,kBACT,GAAG,EAAE,cAAc,YAAY,CAAC,EAAE,EAAE,EACpC,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,oBAAoB,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,IAClC,KAAK,EACR,CACF,CAAC,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport useNotifications, {\n\tuseNotificationUI,\n\tmoveToToolbarMonitor,\n\tgetNotificationConfig,\n\tgetOS,\n} from \"../../../../hooks/useNotifications\";\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { INotificationToastsProps } from \"../../types\";\nimport \"../../../../assets/css/notificationsCenter.css\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\ntype ToastCardProps = {\n\tnotification: INotification;\n\tremoveFunction: Function;\n\tisActiveFunction: Function;\n\tinformationalNotificationTimeout: number | false;\n\tactionableTimeoutEnabled: boolean;\n\tnotificationCard?: React.ComponentType<any>;\n};\n\nconst ToastCard = (props: ToastCardProps) => {\n\tconst notificationRef = useRef<INotification>();\n\tconst { notification, informationalNotificationTimeout, removeFunction, isActiveFunction, actionableTimeoutEnabled } =\n\t\tprops;\n\tconst [slideIn, setSlideIn] = useState(isActiveFunction(notification));\n\tconst [showNotification] = useState(isActiveFunction(notification));\n\n\tuseEffect(() => {\n\t\tnotificationRef.current = notification;\n\t\tlet timeoutId: any;\n\n\t\tif (!notification.actions || notification.actions.length == 0 || actionableTimeoutEnabled) {\n\t\t\t// Is an informational notification or timeout enabled actionable notifications\n\t\t\tlet timeoutLength;\n\n\t\t\tif (informationalNotificationTimeout !== false) {\n\t\t\t\t// Convert to milliseconds\n\t\t\t\ttimeoutLength = informationalNotificationTimeout * 1000;\n\t\t\t\tif (notification.timeout && Number.isInteger(notification.timeout)) {\n\t\t\t\t\ttimeoutLength = notification.timeout;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (timeoutLength) {\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t}, timeoutLength);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tclearInterval(timeoutId);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!isActiveFunction(notificationRef.current)) {\n\t\t\tremoveFunction(notification);\n\t\t}\n\t\tsetSlideIn(isActiveFunction(notification));\n\t}, [notification]);\n\n\tconst onExited = () => {\n\t\tremoveFunction(notification);\n\t};\n\n\tconst Card = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\treturn (\n\t\tshowNotification && (\n\t\t\t<CSSTransition in={slideIn} timeout={500} onExited={onExited} classNames=\"notifications-toast\">\n\t\t\t\t<div className=\"notifications-toast__offscreen\">\n\t\t\t\t\t<Card\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tuiContext=\"toasts\"\n\t\t\t\t\t\tremoveNotification={() => {\n\t\t\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"divider\"> </div>\n\t\t\t\t</div>\n\t\t\t</CSSTransition>\n\t\t)\n\t);\n};\n\nexport const NotificationsToasts: React.FunctionComponent<INotificationToastsProps> = (props) => {\n\tconst { notifications, notificationIsActive, setOpaqueClassName, removeNotification, activeNotifications } =\n\t\tuseNotifications({ config: { notificationsHistory: { options: { sentAfter: \"startup\" } } } });\n\tconst notificationsRef = useRef<INotification[]>(notifications);\n\tconst [uiState] = useNotificationUI();\n\n\tconst isNotificationActive = (notification: INotification): boolean => {\n\t\tconst notificationCenterNotActive = !uiState.showCenter || uiState.poppedOut;\n\t\treturn notificationIsActive(notification) && notificationCenterNotActive;\n\t};\n\n\tconst config = getNotificationConfig();\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\n\tconst [informationalTimeout, setInformationalTimeout] = useState<number | false>(false);\n\tconst [actionableTimeoutEnabled, setActionableTimeoutEnabled] = useState<boolean>(true);\n\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data.notificationPreferences) {\n\t\t\t\t\tconst { informationalNotificationToastPeriodSeconds, toastTimeoutOnActionableNotifications } =\n\t\t\t\t\t\tdata.notificationPreferences;\n\n\t\t\t\t\tif (informationalNotificationToastPeriodSeconds) {\n\t\t\t\t\t\tsetInformationalTimeout(informationalNotificationToastPeriodSeconds);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof toastTimeoutOnActionableNotifications !== \"undefined\") {\n\t\t\t\t\t\tsetActionableTimeoutEnabled(toastTimeoutOnActionableNotifications);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst transparencySupported = config.isTransparent;\n\n\t\tsetOpaqueClassName(!transparencySupported);\n\n\t\tif (transparencySupported) {\n\t\t\tfinsembleWindow.show();\n\t\t}\n\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetInformationalTimeout(preferences.informationalNotificationToastPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tmoveToToolbarMonitor().then(async () => {\n\t\t\tlet forceHide = false;\n\t\t\tif (\n\t\t\t\tactiveNotifications(notifications).length === 0 &&\n\t\t\t\tactiveNotifications(notificationsRef.current).length === 0\n\t\t\t) {\n\t\t\t\t// Bug fix: Toasts flash when inActive components (partially caused by allowing notifications to animate out)\n\t\t\t\tforceHide = true;\n\t\t\t}\n\n\t\t\tnotificationsRef.current = notifications;\n\t\t\tconst rect = document.getElementById(\"notifications-toasts\")?.getBoundingClientRect();\n\t\t\tif (notifications.length === 0 || forceHide) {\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t};\n\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t}\n\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: Math.round(rect?.width as number),\n\t\t\t\t\t\theight: Math.round(rect?.height as number),\n\t\t\t\t\t};\n\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t} else {\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tconst { err, data } = await FSBL.Clients.LauncherClient.getMonitorInfo({ monitor: \"mine\" });\n\t\t\t\t\tif (err || !data) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\t\t\t\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\t\t\t\t\tconst height = Math.round(rect?.height as number) + 6;\n\n\t\t\t\t\tawait finsembleWindow.setBounds({\n\t\t\t\t\t\tbounds: {\n\t\t\t\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\t\t\t\theight: height + 10,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, [notifications]);\n\n\treturn (\n\t\t<div>\n\t\t\t{notifications.map((notification: INotification) => (\n\t\t\t\t<ToastCard\n\t\t\t\t\tkey={`toast-card-${notification.id}`}\n\t\t\t\t\tnotification={notification}\n\t\t\t\t\tinformationalNotificationTimeout={informationalTimeout}\n\t\t\t\t\tactionableTimeoutEnabled={actionableTimeoutEnabled}\n\t\t\t\t\tremoveFunction={removeNotification}\n\t\t\t\t\tisActiveFunction={isNotificationActive}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare const CheckButton: React.FunctionComponent<{
|
|
5
5
|
notification: INotification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckButton.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/CheckButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,MAAM,WAAW,GAEnB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACzB,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGlD,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB,EAAE;YACzB,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC/D;IACF,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,IAAI,CAAC,SAAS,EAAE;YACf,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACxC;aAAM;YACN,IAAI,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACvD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACjB,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACtC;SACD;QACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,iBAAiB;QAC/D,2BAAG,SAAS,EAAE,mCAAmC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,CAC5E,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState, useContext, useEffect } from \"react\";\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"CheckButton.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/CheckButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,MAAM,WAAW,GAEnB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACzB,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGlD,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB,EAAE;YACzB,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC/D;IACF,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,IAAI,CAAC,SAAS,EAAE;YACf,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACxC;aAAM;YACN,IAAI,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACvD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACjB,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACtC;SACD;QACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,iBAAiB;QAC/D,2BAAG,SAAS,EAAE,mCAAmC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,CAC5E,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState, useContext, useEffect } from \"react\";\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const CheckButton: React.FunctionComponent<{\n\tnotification: INotification;\n}> = ({ notification }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { checkedNotifications } = notificationsContext;\n\tconst [isChecked, setIsChecked] = useState(false);\n\n\t// update isChecked value on action\n\tuseEffect(() => {\n\t\tif (checkedNotifications) {\n\t\t\tsetIsChecked(checkedNotifications.indexOf(notification) != -1);\n\t\t}\n\t}, [checkedNotifications]);\n\n\tconst checkNotification = () => {\n\t\tif (!isChecked) {\n\t\t\tcheckedNotifications.push(notification);\n\t\t} else {\n\t\t\tvar index = checkedNotifications.indexOf(notification);\n\t\t\tif (index !== -1) {\n\t\t\t\tcheckedNotifications.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tsetIsChecked(!isChecked);\n\t};\n\n\treturn (\n\t\t<div className=\"check_icon_container\" onClick={checkNotification}>\n\t\t\t<i className={`ff-check-mark default-img large ${isChecked ? \"checked\" : \"\"}`} />\n\t\t</div>\n\t);\n};\n\nexport default CheckButton;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare type NotificationCardPropType = {
|
|
5
5
|
notification: INotification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCardShell.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/NotificationCardShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAuBzF,MAAM,CAAC,MAAM,qBAAqB,GAAsD,CAAC,EACxF,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAEhC,MAAM,CAAC,gCAAgC,EAAE,gCAAgC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEzF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC,CAAC;IACtG,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CACnD,gBAAgB,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAChE,CAAC;IAGF,SAAS,CAAC,GAAG,EAAE;QACd,KAAK,UAAU,2BAA2B;YACzC,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,cAAc,EAAE,CAAC;Q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C,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAE7D,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,2BAA2B,IAC3B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB;QACF,oBAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,GAAI,CACvD,CACH,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { parseISO, differenceInMilliseconds, addSeconds } from \"date-fns\";\nimport { isNewNotification, isReNotification, getMostRecentAction } from \"../../utils\";\nimport { NotificationCardHeaderShell } from \"./notificationCard/NotificationCardHeaderShell\";\nimport { NotificationCardBodyShell } from \"./notificationCard/NotificationCardBodyShell\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"NotificationCardShell.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/NotificationCardShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAuBzF,MAAM,CAAC,MAAM,qBAAqB,GAAsD,CAAC,EACxF,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAEhC,MAAM,CAAC,gCAAgC,EAAE,gCAAgC,CAAC,GAAG,QAAQ,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YAAY,CAAC,uBAAuB,CAAC,CAAC;SACtC;QACD,OAAO,GAAG,EAAE;YACX,YAAY,CAAC,uBAAuB,CAAC,CAAC;QACvC,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,gCAAgC,EAAE,YAAY,CAAC,CAAC,CAAC;IACrD,OAAO,CACN,6BACC,SAAS,EAAE,qBAAqB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;KAC1F,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAE7D,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,2BAA2B,IAC3B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB;QACF,oBAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,GAAI,CACvD,CACH,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { parseISO, differenceInMilliseconds, addSeconds } from \"date-fns\";\nimport { isNewNotification, isReNotification, getMostRecentAction } from \"../../utils\";\nimport { NotificationCardHeaderShell } from \"./notificationCard/NotificationCardHeaderShell\";\nimport { NotificationCardBodyShell } from \"./notificationCard/NotificationCardBodyShell\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nexport type NotificationCardPropType = {\n\t/**\n\t * The Notification to be displayed\n\t */\n\tnotification: INotification;\n\n\t/**\n\t * Which UI context the Card is being used in\n\t */\n\tuiContext: \"toasts\" | \"center\";\n\n\t/**\n\t * The internal function that will be called on toasts when dismissed or marked as read\n\t */\n\tremoveNotification: Function;\n};\n\nexport const NotificationCardShell: React.FunctionComponent<NotificationCardPropType> = ({\n\tnotification,\n\tuiContext,\n\tremoveNotification,\n\tchildren,\n}) => {\n\tconst { isRead } = notification;\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t\tsetIsNew(isNewNotification(notification, preferences.newNotificationHaloPeriodSeconds));\n\t\t});\n\t}, []);\n\n\t// Listens for preferences change\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (\n\t\t\t\t\tdata.notificationPreferences &&\n\t\t\t\t\tdata.notificationPreferences.hasOwnProperty(\"newNotificationHaloPeriodSeconds\")\n\t\t\t\t) {\n\t\t\t\t\tsetNotificationHaloPeriodSeconds(data.notificationPreferences.newNotificationHaloPeriodSeconds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(mostRecentAction.datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\treturn (\n\t\t<div\n\t\t\tclassName={`notification-card ${isRead ? \"read\" : \"\"} ${isNew || wokeFromSnooze ? \"new\" : \"\"} \n\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardHeaderShell\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tremoveNotification={removeNotification}\n\t\t\t\t\t\tuiContext={uiContext}\n\t\t\t\t\t/>\n\t\t\t\t\t<NotificationCardBodyShell notification={notification} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { Dispatch, SetStateAction } from "react";
|
|
2
2
|
import { OverFlowMenuAction } from "../../types";
|
|
3
|
-
import { services } from "@finsemble/finsemble-
|
|
3
|
+
import { services } from "@finsemble/finsemble-api";
|
|
4
4
|
declare type INotification = services.notification.types.INotification;
|
|
5
5
|
export declare const OverflowMenuActions: {
|
|
6
6
|
[key: string]: OverFlowMenuAction;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OverflowMenu.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/OverflowMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAM5C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAKhD,MAAM,CAAC,MAAM,mBAAmB,GAA0C;IACzE,cAAc,EAAE;QACf,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,oBAAC,iBAAiB,OAAG;QAC3B,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,CAAC,YAA2B,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,YAAY,CAAC,CAAC;KAChF;IACD,YAAY,EAAE;QACb,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,oBAAC,gBAAgB,OAAG;QAC1B,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,CAAC,YAA2B,EAAE,EAAE,CAAC,qBAAqB,CAAC,CAAC,YAAY,CAAC,CAAC;KAC9E;IACD,MAAM,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,oBAAC,UAAU,OAAG;QAC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AAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAE5D,MAAM,mBAAmB,GAAG,GAAG,EAAE;;QAChC,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3D,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,0CAAE,qBAAqB,EAAE,CAAC;QAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAEnF,IAAI,aAAa,IAAI,aAAa,GAAG,cAAc,EAAE;YACpD,YAAY,CAAC,kCAAkC,CAAC,CAAC;SACjD;IACF,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,IACxC,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from \"react\";\n\n// Hooks\nimport { useOutsideClickDetector } from \"../../../../hooks/useOutsideClickDetector\";\nimport {\n\tmarkNotificationsRead,\n\tmarkNotificationsUnread,\n\tsnoozeNotifications,\n} from \"../../../../hooks/useNotifications\";\n\n// Types\nimport { OverFlowMenuAction } from \"../../types\";\n\n// Icons\nimport EnvelopeCloseIcon from \"../../icons/EnvelopeClose\";\nimport EnvelopeOpenIcon from \"../../icons/EnvelopeOpen\";\nimport SnoozeIcon from \"../../icons/SnoozeIcon\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"OverflowMenu.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/OverflowMenu.tsx"],"names":[],"mappings":"AAAA,O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AAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAEnF,IAAI,aAAa,IAAI,aAAa,GAAG,cAAc,EAAE;YACpD,YAAY,CAAC,kCAAkC,CAAC,CAAC;SACjD;IACF,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,IACxC,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from \"react\";\n\n// Hooks\nimport { useOutsideClickDetector } from \"../../../../hooks/useOutsideClickDetector\";\nimport {\n\tmarkNotificationsRead,\n\tmarkNotificationsUnread,\n\tsnoozeNotifications,\n} from \"../../../../hooks/useNotifications\";\n\n// Types\nimport { OverFlowMenuAction } from \"../../types\";\n\n// Icons\nimport EnvelopeCloseIcon from \"../../icons/EnvelopeClose\";\nimport EnvelopeOpenIcon from \"../../icons/EnvelopeOpen\";\nimport SnoozeIcon from \"../../icons/SnoozeIcon\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const OverflowMenuActions: { [key: string]: OverFlowMenuAction } = {\n\tMARK_AS_UNREAD: {\n\t\tname: \"MARK_AS_UNREAD\",\n\t\ticon: <EnvelopeCloseIcon />,\n\t\tlabel: \"Mark Unread\",\n\t\taction: (notification: INotification) => markNotificationsUnread([notification]),\n\t},\n\tMARK_AS_READ: {\n\t\tname: \"MARK_AS_READ\",\n\t\ticon: <EnvelopeOpenIcon />,\n\t\tlabel: \"Mark Read\",\n\t\taction: (notification: INotification) => markNotificationsRead([notification]),\n\t},\n\tSNOOZE: {\n\t\tname: \"SNOOZE\",\n\t\ticon: <SnoozeIcon />,\n\t\tlabel: \"Snooze\",\n\t\taction: (notification: INotification) => snoozeNotifications([notification]),\n\t},\n\tDISMISS: {\n\t\tname: \"DISMISS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-close\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Dismiss\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n\tSETTINGS: {\n\t\tname: \"SETTINGS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-settings\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Settings\",\n\t\taction: (notification: INotification) => {\n\t\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t\t{\n\t\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"mine\",\n\t\t\t\t\tleft: \"center\",\n\t\t\t\t\ttop: \"center\",\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\n\t\t\t\t\t\tpreferencesTab: \"Notifications\",\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t});\n\t\t\t\t\t// we need this timeout otherwise the UserPreferences screen does not detect the message being transmited\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsNavigationChannel\", { notification });\n\t\t\t\t\t}, 50);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t},\n\tDETAILS: {\n\t\tname: \"DETAILS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-dots-horz\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Details\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n};\n\nexport const renderOverflowMenuAction = (\n\tnotification: INotification,\n\tmenuAction: OverFlowMenuAction,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tisMuted: boolean\n) => {\n\tif (\n\t\t// Don't display read if notification is read\n\t\t(notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_READ.name) ||\n\t\t// Don't display unread if notification is unread\n\t\t(!notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_UNREAD.name)\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tkey={`${notification.id}_${menuAction.name}`}\n\t\t\tclassName=\"overflow-menu__action\"\n\t\t\ttabIndex={0}\n\t\t\tonClick={() => {\n\t\t\t\tmenuAction?.action(notification);\n\t\t\t}}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t\tmenuAction?.action(notification);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{menuAction?.icon}\n\t\t\t<span className=\"btn-label\">{menuAction?.label}</span>\n\t\t</div>\n\t);\n};\n\n/**\n * Overflow menu component for notifications that will provide a set of actions\n * a user can perform on a notification (e.g. dismiss, snooze)\n */\nconst OverflowMenu: React.FunctionComponent<{\n\tcloseSelf: Dispatch<SetStateAction<boolean>>;\n}> = ({ closeSelf, children }) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst [className, setClassName] = useState(\"overflow-menu__container\");\n\n\tuseOutsideClickDetector(wrapperRef, () => closeSelf(false));\n\n\tconst moveElementIntoView = () => {\n\t\tconst bottomViewPort = window.innerHeight + window.scrollY;\n\t\tconst domRect = wrapperRef?.current?.getBoundingClientRect();\n\t\tconst elementBottom = domRect ? domRect.y + domRect.height + window.scrollY : null;\n\n\t\tif (elementBottom && elementBottom > bottomViewPort) {\n\t\t\tsetClassName(\"overflow-menu__container flow-up\");\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tmoveElementIntoView();\n\t});\n\n\treturn (\n\t\t<div ref={wrapperRef} className={className}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n\nexport default OverflowMenu;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare const NotificationCardBodyActions: React.FunctionComponent<{
|
|
5
5
|
notification: INotification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCardBodyActions.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAuD,MAAM,mCAAmC,CAAC;AACxG,OAAO,MAAiC,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAMjE,MAAM,mBAAmB,GAAG,CAAC,YAA2B,EAAE,MAA2B,EAAE,EAAmB,EAAE,EAAE;IAC7G,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,IAAI,UAAU,GAAG,EAAyC,CAAC;QAC3D,IAAI,aAAa,GAA4B,EAAE,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE;YACzC,IAAI,KAAK,KAAK,CAAC,EAAE;gBAChB,UAAU,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;gBAClF,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC;aACpD;iBAAM;gBACN,aAAa,CAAC,IAAI,CAAC;oBAClB,WAAW,EAAE,eAAe,CAAC,UAAU;oBACvC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;iBACvE,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;QACH,OAAO,CACN,oBAAC,cAAc,IACd,GAAG,EAAE,EAAE,EACP,WAAW,EAAE,UAAU,CAAC,WAAW,EACnC,UAAU,EAAE,UAAU,CAAC,UAAU,EACjC,aAAa,EAAE,aAAa,GAC3B,CACF,CAAC;KACF;SAAM;QACN,OAAO,CACN,oBAAC,MAAM,IACN,GAAG,EAAE,EAAE,EACP,WAAW,EAAE,MAAM,CAAC,UAAU,EAC9B,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7D,CACF,CAAC;KACF;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAA6D,CAAC,EACrG,YAAY,GACZ,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;IACjC,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,0CACE,UAAU,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAC,eAAe,IAC5B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAA2B,EAAE,KAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CACvG,CACN,CAAC,CAAC,CAAC,IAAI,CACN,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport DropdownButton, { IFinsembleDropdownActionButtonProps } from \"../../../../common/DropdownButton\";\nimport Button, { IFinsembleButtonProps } from \"../../../../shared/Button\";\nimport { doAction } from \"../../../../../hooks/useNotifications\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"NotificationCardBodyActions.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAuD,MAAM,mCAAmC,CAAC;AACxG,OAAO,MAAiC,MA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,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;IACjC,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,0CACE,UAAU,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAC,eAAe,IAC5B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAA2B,EAAE,KAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CACvG,CACN,CAAC,CAAC,CAAC,IAAI,CACN,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport DropdownButton, { IFinsembleDropdownActionButtonProps } from \"../../../../common/DropdownButton\";\nimport Button, { IFinsembleButtonProps } from \"../../../../shared/Button\";\nimport { doAction } from \"../../../../../hooks/useNotifications\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IAction = services.notification.types.IAction;\n\nconst renderActionButtons = (notification: INotification, action: IAction | IAction[], id: string | number) => {\n\tif (Array.isArray(action)) {\n\t\tlet buttonData = {} as IFinsembleDropdownActionButtonProps;\n\t\tlet buttonOptions: IFinsembleButtonProps[] = [];\n\t\taction.forEach((compositeAction, index) => {\n\t\t\tif (index === 0) {\n\t\t\t\tbuttonData.mainAction = () => doAction && doAction(notification, compositeAction);\n\t\t\t\tbuttonData.buttonLabel = compositeAction.buttonText;\n\t\t\t} else {\n\t\t\t\tbuttonOptions.push({\n\t\t\t\t\tbuttonLabel: compositeAction.buttonText,\n\t\t\t\t\tclickHandler: () => doAction && doAction(notification, compositeAction),\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t<DropdownButton\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={buttonData.buttonLabel}\n\t\t\t\tmainAction={buttonData.mainAction}\n\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={action.buttonText}\n\t\t\t\tclickHandler={() => doAction && doAction(notification, action)}\n\t\t\t/>\n\t\t);\n\t}\n};\n\nexport const NotificationCardBodyActions: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n}) => {\n\tconst { actions } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t{hasActions ? (\n\t\t\t\t<div className=\"actions-panel\">\n\t\t\t\t\t{actions?.map((action: IAction | IAction[], index: any) => renderActionButtons(notification, action, index))}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</>\n\t);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare const NotificationCardBodyShell: React.FunctionComponent<{
|
|
5
5
|
notification: INotification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCardBodyShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAKpF,MAAM,CAAC,MAAM,yBAAyB,GAA6D,CAAC,EACnG,YAAY,EACZ,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,6BAAK,SAAS,EAAE,2BAA2B,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtE,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;YACC,oBAAC,+BAA+B,IAAC,WAAW,EAAE,WAAW,GAAI;YAC7D,6BAAK,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAO,CAC3D,CACH;QACD,oBAAC,2BAA2B,IAAC,YAAY,EAAE,YAAY,GAAI,CACtD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { NotificationCardBodyActions } from \"./NotificationCardBodyActions\";\nimport { NotificationCardBodyContentLogo } from \"./NotificationCardBodyContentLogo\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"NotificationCardBodyShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAKpF,MAAM,CAAC,MAAM,yBAAyB,GAA6D,CAAC,EACnG,YAAY,EACZ,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,6BAAK,SAAS,EAAE,2BAA2B,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtE,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;YACC,oBAAC,+BAA+B,IAAC,WAAW,EAAE,WAAW,GAAI;YAC7D,6BAAK,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAO,CAC3D,CACH;QACD,oBAAC,2BAA2B,IAAC,YAAY,EAAE,YAAY,GAAI,CACtD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { NotificationCardBodyActions } from \"./NotificationCardBodyActions\";\nimport { NotificationCardBodyContentLogo } from \"./NotificationCardBodyContentLogo\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardBodyShell: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n\tchildren,\n}) => {\n\tconst { actions, details, contentLogo } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<div className={`notification-card__body ${hasActions ? \"actions\" : \"\"}`}>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardBodyContentLogo contentLogo={contentLogo} />\n\t\t\t\t\t<div className=\"notification-card__body_text\">{details}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<NotificationCardBodyActions notification={notification} />\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare const NotificationCardHeaderControls: React.FunctionComponent<{
|
|
5
5
|
notification: INotification;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationCardHeaderControls.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,EAAE,EAAE,mBAAmB,EAA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AsB,CAAC,CAAC;QAC5G,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAChE,wBAAwB,CAAC,YAAY,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAClE,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC;QACrF,8BAAM,SAAS,EAAC,iCAAiC;YAChD,oBAAC,UAAU,IAAC,QAAQ,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,EAAE,kBAAkB,IACpF,gBAAgB,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,SAAS,EAAE,mBAAmB,IAAG,WAAW,CAAgB,CAAC,CAAC,CAAC,IAAI,CACzF,CACP;QACN,SAAS,IAAI,QAAQ,IAAI,CACzB,oBAAC,UAAU,IACV,QAAQ,EAAC,UAAU,EACnB,UAAU,EAAE,qCAAqC,EACjD,OAAO,EAAC,SAAS,EACjB,YAAY,EAAE,kBAAkB,GAC/B,CACF;QACA,SAAS,IAAI,QAAQ,IAAI,8BAAM,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAQ,CAChF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport IconButton from \"../IconButton\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../OverflowMenu\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { services } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"NotificationCardHeaderControls.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EA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W,CAAC,wCAAwC,EAAE,sBAAsB,CAAC,CAAC;QACxG,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,wCAAwC,EAAE,sBAAsB,CAAC,CAAC;QAC5G,CAAC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAChE,wBAAwB,CAAC,YAAY,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAClE,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,KAAK,CAAC;QACrF,8BAAM,SAAS,EAAC,iCAAiC;YAChD,oBAAC,UAAU,IAAC,QAAQ,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,EAAE,kBAAkB,IACpF,gBAAgB,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,SAAS,EAAE,mBAAmB,IAAG,WAAW,CAAgB,CAAC,CAAC,CAAC,IAAI,CACzF,CACP;QACN,SAAS,IAAI,QAAQ,IAAI,CACzB,oBAAC,UAAU,IACV,QAAQ,EAAC,UAAU,EACnB,UAAU,EAAE,qCAAqC,EACjD,OAAO,EAAC,SAAS,EACjB,YAAY,EAAE,kBAAkB,GAC/B,CACF;QACA,SAAS,IAAI,QAAQ,IAAI,8BAAM,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAQ,CAChF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport IconButton from \"../IconButton\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../OverflowMenu\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardHeaderControls: React.FunctionComponent<{\n\tnotification: INotification;\n\tuiContext?: string;\n\tremoveNotification?: Function;\n}> = ({ notification, removeNotification, uiContext = \"center\" }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters } = notificationsContext;\n\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\tconst [time, setTime] = useState(\n\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\tincludeSeconds: true,\n\t\t})\n\t);\n\n\tuseEffect(() => {\n\t\tconst id = setInterval(() => {\n\t\t\tsetTime(\n\t\t\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\t\t\tincludeSeconds: true,\n\t\t\t\t})\n\t\t\t);\n\t\t}, 60000);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\tlet optionsToggleClassName = \"notification-card__more-options__toggle\";\n\n\tif (uiContext === \"center\") {\n\t\tdelete overFlowActions.DISMISS;\n\t\toverFlowActions.DETAILS.action = (overflowNotification: INotification) => {\n\t\t\tsetSelectedNotification(overflowNotification);\n\t\t};\n\t} else {\n\t\toptionsToggleClassName = \"notification-card__more-options__no-toggle\";\n\t\tdelete overFlowActions.MARK_AS_READ;\n\t\tdelete overFlowActions.MARK_AS_UNREAD;\n\t\tdelete overFlowActions.DETAILS;\n\t\tdelete overFlowActions.DISMISS;\n\t}\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div className={optionsToggleClassName} onMouseLeave={() => setOverflowMenuOpen(false)}>\n\t\t\t<span className=\"notification-card_overflow_menu\">\n\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t</IconButton>\n\t\t\t</span>\n\t\t\t{uiContext == \"toasts\" && (\n\t\t\t\t<IconButton\n\t\t\t\t\ticonName=\"ff-close\"\n\t\t\t\t\tclassNames={\"notification-card__dismiss no-hover\"}\n\t\t\t\t\ttooltip=\"Dismiss\"\n\t\t\t\t\tclickHandler={removeNotification}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{uiContext == \"center\" && <span className=\"notification-card_timestamp\">{time}</span>}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { services } from "@finsemble/finsemble-
|
|
2
|
+
import { services } from "@finsemble/finsemble-api";
|
|
3
3
|
declare type INotification = services.notification.types.INotification;
|
|
4
4
|
export declare const NotificationCardHeaderShell: React.FunctionComponent<{
|
|
5
5
|
notification: INotification;
|