@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppLauncherMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/appLauncher/AppLauncherMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"AppLauncherMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/appLauncher/AppLauncherMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AA6BhE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA0B,EAAE,EAAE;IAC7D,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAW,EAAE,CAAC,CAAC;IAEjD,MAAM,UAAU,GAAG,GAAG,EAAE;QACvB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9E,QAAQ,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,UAAU,EAAE,CAAC;QAGb,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,wBAAwB,EAAE,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC,EAAE,EAAE,CAAC,CAAC;IAGP,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACpC,OAAO,CACN,0CACE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;aACnB,IAAI,CAAC,CAAC,CAAc,EAAE,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;aACjE,GAAG,CAAC,CAAC,OAAoB,EAAE,KAAa,EAAE,EAAE,CAAC,CAC7C,oBAAC,qBAAqB,IACrB,GAAG,EAAE,KAAK,EACV,EAAE,EAAE,eAAe,KAAK,EAAE,EAC1B,KAAK,EAAE,OAAO,CAAC,WAAW,EAC1B,eAAe,EAAE,OAAO,CAAC,YAAY,EACrC,iBAAiB,EAAE,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,GACzE,CACF,CAAC,CACD,CACH,CAAC;KACF;SAAM;QACN,OAAO,oBAAC,qBAAqB,oBAAK,KAAK,EAAI,CAAC;KAC5C;AACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { StaticAppLauncherMenu } from \"./StaticAppLauncherMenu\";\nimport { MenuProps } from \"../../menu/Menu\";\nimport { MenuObjType, MenuType } from \"../../../types/smartDesktopDesignerTypes\";\n\ntype AppLauncherMenuType = MenuProps & {\n\tenableQuickComponents?: boolean; // DEPRECATED: Quick Components will be removed in a future version\n\tcomponentFilter?: string[];\n\tsuppressFavorites?: boolean;\n\tdynamic?: boolean; //DEPRECATED\n};\n\n/**\n * The menu, or collection of menus, that lists all configured Finsemble applications, and provides\n * the ability to launch any listed app.\n *\n * @param {boolean} [enableQuickComponents=false] DEPRECATED: Set to true to allow users to create their own components\n * @param {string} [title] The title of the menu that appears in the menu's <MenuToggle> button, as viewed in the toolbar. Can be string or any ReactNode.\n * @param {string[]} [componentFilter] Custom list of menu items to display\n * @param {boolean} [suppressFavorites=false]\n * @param {boolean} [dynamic=false] If dynamic=true, get list of menus from manifest, as well as listening for updates to list\n * @param {string} [className] - Custom body class for the menu contents. These classes will be set on the <body> tag for the Menu's drop down window.\n * @param {string} [id] - Unique ID for the menu. Defaults to a random string.\n * @param {number} [maxHeight=Infinity] - Maximum height of the menu.\n * @param {number} [minHeight] - Minimum height of the menu\n * @param {array} [openHotkey] - A hotkey combination to open the menu.\n * @param {array} [closeHotkey=[\"escape\"] ] - A hotkey combination to close the menu. Defaults to [\"escape\"].\n * @param {number} [width=180] - Custom width for the menu.\n * @param {number} [height] - Custom height for the menu. If not set then the height will be automatically calculated based on the content height and available monitor space.\n */\nexport const AppLauncherMenu = (props: AppLauncherMenuType) => {\n\tconst [menus, setMenus] = useState<MenuType>({});\n\n\tconst updateMenu = () => {\n\t\tFSBL.Clients.ConfigClient.getValue(\"finsemble.toolbarMenus\").then(({ data }) => {\n\t\t\tsetMenus(data);\n\t\t});\n\t};\n\n\tuseEffect(() => {\n\t\tupdateMenu();\n\n\t\t// Listen for notifications that the menu has changed\n\t\tFSBL.Clients.ConfigClient.addListener({ field: \"finsemble.toolbarMenus\" }, updateMenu);\n\t}, []);\n\n\t// dynamic menu\n\tif (Object.values(menus).length > 0) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{Object.values(menus)\n\t\t\t\t\t.sort((a: MenuObjType, b: MenuObjType) => a.position - b.position)\n\t\t\t\t\t.map((menuObj: MenuObjType, index: number) => (\n\t\t\t\t\t\t<StaticAppLauncherMenu\n\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\tid={`AppLauncher-${index}`}\n\t\t\t\t\t\t\ttitle={menuObj.displayName}\n\t\t\t\t\t\t\tcomponentFilter={menuObj.applications}\n\t\t\t\t\t\t\tsuppressFavorites={menuObj.applications && menuObj.applications.length > 0}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t</>\n\t\t);\n\t} else {\n\t\treturn <StaticAppLauncherMenu {...props} />;\n\t}\n};\n"]}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import React from "react";
|
|
6
|
-
import { StandardError } from "@finsemble/finsemble-
|
|
7
|
-
import { WindowIdentifier } from "@finsemble/finsemble-
|
|
6
|
+
import { StandardError } from "@finsemble/finsemble-api/types/types";
|
|
7
|
+
import { WindowIdentifier } from "@finsemble/finsemble-api";
|
|
8
8
|
declare type AppLauncherContainerProps = {
|
|
9
9
|
componentFilter?: string[];
|
|
10
10
|
suppressFavorites?: boolean;
|
|
@@ -7,7 +7,6 @@ import { getStore, Actions as appLauncherActions } from "../stores/appLauncherSt
|
|
|
7
7
|
import { MenuItem } from "../../../menu/MenuItem";
|
|
8
8
|
import { FavoriteMaker } from "../../../favorites/FavoriteMaker";
|
|
9
9
|
import { useFavorites } from "../../../../hooks/useFavorites";
|
|
10
|
-
import { iconFromConfig } from "../../../icon/Icon";
|
|
11
10
|
let appLauncherStore;
|
|
12
11
|
const DeleteComponent = ({ name }) => {
|
|
13
12
|
const { isFavorited, removeFavorite } = useFavorites();
|
|
@@ -88,7 +87,7 @@ export default class appLauncherContainer extends React.Component {
|
|
|
88
87
|
}
|
|
89
88
|
}
|
|
90
89
|
buildComponentItem(params) {
|
|
91
|
-
var _a, _b, _c, _d
|
|
90
|
+
var _a, _b, _c, _d;
|
|
92
91
|
const { key, isUserDefined } = params;
|
|
93
92
|
const config = (_a = this.state.componentList) === null || _a === void 0 ? void 0 : _a[key];
|
|
94
93
|
let displayName = key;
|
|
@@ -107,13 +106,13 @@ export default class appLauncherContainer extends React.Component {
|
|
|
107
106
|
if (config.component && config.component.displayName) {
|
|
108
107
|
({ displayName } = config.component);
|
|
109
108
|
}
|
|
110
|
-
const
|
|
109
|
+
const iconDescriptor = config.icons.toolbarIcon;
|
|
111
110
|
return (React.createElement(MenuItem, { key: key, onClick: () => this.launchComponent(config, {}) },
|
|
112
111
|
React.createElement("div", { className: "menu-item-row" },
|
|
113
112
|
React.createElement("span", { className: "app-name", title: displayName }, displayName),
|
|
114
113
|
React.createElement("span", { className: "menu-item-row-push-right" },
|
|
115
114
|
isUserDefined && React.createElement(DeleteComponent, { name: displayName }),
|
|
116
|
-
!this.props.suppressFavorites && (React.createElement(FavoriteMaker, { id: (
|
|
115
|
+
!this.props.suppressFavorites && (React.createElement(FavoriteMaker, { id: (_d = config === null || config === void 0 ? void 0 : config.component) === null || _d === void 0 ? void 0 : _d.type, category: "Application", name: displayName, icon: iconDescriptor, className: "menu-item-icon" }))))));
|
|
117
116
|
}
|
|
118
117
|
renderComponentsList() {
|
|
119
118
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentList.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/appLauncher/components/componentList.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAKpD,IAAI,gBAAwC,CAAC;AAU7C,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,EAAwB,EAAE,EAAE;IAC1D,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,iBAAiB,GAAG,CAAC,CAAoC,EAAE,EAAE;QAClE,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;QACpB,kBAAkB,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAC,UAAmB,EAAE,EAAE;YAC5E,IAAI,UAAU,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;gBACpC,cAAc,CAAC,IAAI,CAAC,CAAC;aACrB;QACF,CAAC,CAAC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AAa,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QACH,OAAO,CACN,6BAAK,SAAS,EAAC,mBAAmB,IAChC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CACvB,aAAa,CACb,CAAC,CAAC,CAAC,CACH;YACE,GAAG;8HAGD,CACJ,CACI,CACN,CAAC;IACH,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,gCAAW,CAAC;IAC7E,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n/**\n * This is the list of all components in the appLauncher.\n */\nimport React from \"react\";\nimport { getStore, Actions as appLauncherActions } from \"../stores/appLauncherStore\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\nimport { iconFromConfig } from \"../../../icon/Icon\";\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\nimport { StandardError } from \"@finsemble/finsemble-core/types/types\";\nimport { WindowIdentifier } from \"@finsemble/finsemble-core\";\n\nlet appLauncherStore: StoreModel | undefined;\n\ntype DeleteComponentProps = {\n\tname: string;\n};\n\n/**\n * Handles deleting a component and removing it from favorites if necessary\n * @param {} props\n */\nconst DeleteComponent = ({ name }: DeleteComponentProps) => {\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst doDeleteComponent = (e: React.MouseEvent<HTMLSpanElement>) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tappLauncherActions.handleRemoveCustomComponent(name, (wasDeleted: boolean) => {\n\t\t\tif (wasDeleted && isFavorited(name)) {\n\t\t\t\tremoveFavorite(name);\n\t\t\t}\n\t\t});\n\t};\n\treturn (\n\t\t<span onClick={doDeleteComponent} className=\"menu-item-icon\">\n\t\t\t<i className=\"ff-adp-trash-outline\" title=\"Delete\"></i>\n\t\t</span>\n\t);\n};\n\ntype AppLauncherContainerProps = {\n\tcomponentFilter?: string[];\n\tsuppressFavorites?: boolean;\n};\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\ninterface IState {\n\tcomponentList: ComponentList;\n\tfilteredListOfComponents: string[];\n}\n\nexport default class appLauncherContainer extends React.Component<AppLauncherContainerProps, IState> {\n\tconstructor(props: AppLauncherContainerProps) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tcomponentList: {},\n\t\t\t// list of components to display instead of all components\n\t\t\tfilteredListOfComponents: props.componentFilter ?? [],\n\t\t};\n\t\tthis.bindCorrectContext();\n\t}\n\n\tcomponentDidUpdate(prevProps: AppLauncherContainerProps) {\n\t\tif (this.props.componentFilter !== prevProps.componentFilter) {\n\t\t\tthis.setState({\n\t\t\t\tfilteredListOfComponents: this.props.componentFilter ?? [],\n\t\t\t});\n\t\t}\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.onComponentListUpdate = this.onComponentListUpdate.bind(this);\n\t\tthis.buildComponentItem = this.buildComponentItem.bind(this);\n\t}\n\n\tonComponentListUpdate(err: StandardError, data: { field: string; value: ComponentList }) {\n\t\tFSBL.Clients.Logger.system.debug(\"appLauncher onComponentListUpdate\");\n\t\tthis.setState({\n\t\t\tcomponentList: data.value,\n\t\t});\n\t}\n\n\tsetInitialState() {\n\t\tlet self = this;\n\t\tappLauncherStore?.getValue({ field: \"componentList\" }, (err: StandardError, data?: ComponentList) => {\n\t\t\tif (typeof data !== \"undefined\") {\n\t\t\t\tself.setState({\n\t\t\t\t\tcomponentList: data,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tappLauncherStore = getStore();\n\t\tthis.setInitialState();\n\t\tappLauncherStore?.addListener({ field: \"componentList\" }, this.onComponentListUpdate);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tappLauncherStore?.removeListener({ field: \"componentList\" }, this.onComponentListUpdate);\n\t}\n\n\tlaunchComponent(component: any, params: any, cb?: (win?: WindowIdentifier) => void) {\n\t\t// If we are launching a group\n\t\tif (component.group) {\n\t\t\tfor (let i of Object.keys(component.list)) {\n\t\t\t\tconst cloneParams = Object.assign({}, params);\n\t\t\t\tconst c = component.list[i];\n\t\t\t\tif (c.component.windowGroup) {\n\t\t\t\t\tcloneParams.groupName = c.component.windowGroup;\n\t\t\t\t}\n\t\t\t\tappLauncherActions.launchComponent(component.list[i], params, cb);\n\t\t\t}\n\t\t} else {\n\t\t\tif (component.component.windowGroup) {\n\t\t\t\tparams.groupName = component.component.windowGroup;\n\t\t\t}\n\t\t\tappLauncherActions.launchComponent(component, params, cb);\n\t\t}\n\t}\n\n\tbuildComponentItem(params: { i: number; key: string; isUserDefined: boolean }) {\n\t\tconst { key, isUserDefined } = params;\n\t\tconst config = this.state.componentList?.[key];\n\t\tlet displayName = key;\n\n\t\t// If the app isn't launchable by the user, don't show it\n\t\tif (\n\t\t\t(!config ||\n\t\t\t\t!config.window ||\n\t\t\t\t!config.foreign ||\n\t\t\t\t!config.foreign.components ||\n\t\t\t\t!config.foreign.components[\"App Launcher\"] ||\n\t\t\t\t!config.foreign.components[\"App Launcher\"].launchableByUser) &&\n\t\t\t!config?.group\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the app is temporary (actively being configured in the Smart Desktop Designer), don't show it\n\t\tif (config.appDConfig?.manifest?.temporary) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Component developers can define a display name that will show instead of the component's type.\n\t\tif (config.component && config.component.displayName) {\n\t\t\t({ displayName } = config.component);\n\t\t}\n\t\tconst iconObject = iconFromConfig(config.foreign?.components?.Toolbar, displayName);\n\t\treturn (\n\t\t\t<MenuItem key={key} onClick={() => this.launchComponent(config, {})}>\n\t\t\t\t<div className=\"menu-item-row\">\n\t\t\t\t\t<span className=\"app-name\" title={displayName}>\n\t\t\t\t\t\t{displayName}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"menu-item-row-push-right\">\n\t\t\t\t\t\t{isUserDefined && <DeleteComponent name={displayName} />}\n\t\t\t\t\t\t{!this.props.suppressFavorites && (\n\t\t\t\t\t\t\t<FavoriteMaker\n\t\t\t\t\t\t\t\tid={config?.component?.type}\n\t\t\t\t\t\t\t\tcategory=\"Application\"\n\t\t\t\t\t\t\t\tname={displayName}\n\t\t\t\t\t\t\t\ticon={iconObject}\n\t\t\t\t\t\t\t\tclassName=\"menu-item-icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n\n\trenderComponentsList() {\n\t\tconst { state } = this;\n\t\tconst components = Object.keys(state.componentList ?? {}).filter((componentType) => {\n\t\t\tif (state.filteredListOfComponents.length) {\n\t\t\t\treturn state.filteredListOfComponents.includes(componentType);\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\t// if this is greater than 0, we don't show a note telling the user to check their configs.\n\t\t// iterate through componentList and render a componentItem for each one.\n\t\tconst componentList = components.map((key, i) => {\n\t\t\tconst { component } = state.componentList[key];\n\t\t\tconst isUserDefined = Boolean(component && component.isUserDefined);\n\t\t\treturn this.buildComponentItem({ i, key, isUserDefined });\n\t\t});\n\t\treturn (\n\t\t\t<div className=\"app-launcher-list\">\n\t\t\t\t{componentList.length ? (\n\t\t\t\t\tcomponentList\n\t\t\t\t) : (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\tNo components loaded. Make sure to check ./src/components.json to make sure you've set everything up\n\t\t\t\t\t\tcorrectly.\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn this.state.componentList ? this.renderComponentsList() : <div></div>;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"componentList.js","sourceRoot":"","sources":["../../../../../src/components/toolbar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zB,CACF,CACK,CACF,CACI,CACX,CAAC;IACH,CAAC;IAED,oBAAoB;;QACnB,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QACvB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,MAAA,KAAK,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,aAAa,EAAE,EAAE;YAClF,IAAI,KAAK,CAAC,wBAAwB,CAAC,MAAM,EAAE;gBAC1C,OAAO,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;aAC9D;YACD,OAAO,IAAI,CAAC;QACb,CAAC,CAAC,CAAC;QAGH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;YAC/C,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;YAC/C,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,IAAI,SAAS,CAAC,aAAa,CAAC,CAAC;YACpE,OAAO,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;QACH,OAAO,CACN,6BAAK,SAAS,EAAC,mBAAmB,IAChC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC,CACvB,aAAa,CACb,CAAC,CAAC,CAAC,CACH;YACE,GAAG;8HAGD,CACJ,CACI,CACN,CAAC;IACH,CAAC;IAED,MAAM;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC,CAAC,gCAAW,CAAC;IAC7E,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n/**\n * This is the list of all components in the appLauncher.\n */\nimport React from \"react\";\nimport { getStore, Actions as appLauncherActions } from \"../stores/appLauncherStore\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport { WindowIdentifier } from \"@finsemble/finsemble-api\";\n\nlet appLauncherStore: StoreModel | undefined;\n\ntype DeleteComponentProps = {\n\tname: string;\n};\n\n/**\n * Handles deleting a component and removing it from favorites if necessary\n * @param {} props\n */\nconst DeleteComponent = ({ name }: DeleteComponentProps) => {\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst doDeleteComponent = (e: React.MouseEvent<HTMLSpanElement>) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\tappLauncherActions.handleRemoveCustomComponent(name, (wasDeleted: boolean) => {\n\t\t\tif (wasDeleted && isFavorited(name)) {\n\t\t\t\tremoveFavorite(name);\n\t\t\t}\n\t\t});\n\t};\n\treturn (\n\t\t<span onClick={doDeleteComponent} className=\"menu-item-icon\">\n\t\t\t<i className=\"ff-adp-trash-outline\" title=\"Delete\"></i>\n\t\t</span>\n\t);\n};\n\ntype AppLauncherContainerProps = {\n\tcomponentFilter?: string[];\n\tsuppressFavorites?: boolean;\n};\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\ninterface IState {\n\tcomponentList: ComponentList;\n\tfilteredListOfComponents: string[];\n}\n\nexport default class appLauncherContainer extends React.Component<AppLauncherContainerProps, IState> {\n\tconstructor(props: AppLauncherContainerProps) {\n\t\tsuper(props);\n\n\t\tthis.state = {\n\t\t\tcomponentList: {},\n\t\t\t// list of components to display instead of all components\n\t\t\tfilteredListOfComponents: props.componentFilter ?? [],\n\t\t};\n\t\tthis.bindCorrectContext();\n\t}\n\n\tcomponentDidUpdate(prevProps: AppLauncherContainerProps) {\n\t\tif (this.props.componentFilter !== prevProps.componentFilter) {\n\t\t\tthis.setState({\n\t\t\t\tfilteredListOfComponents: this.props.componentFilter ?? [],\n\t\t\t});\n\t\t}\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.onComponentListUpdate = this.onComponentListUpdate.bind(this);\n\t\tthis.buildComponentItem = this.buildComponentItem.bind(this);\n\t}\n\n\tonComponentListUpdate(err: StandardError, data: { field: string; value: ComponentList }) {\n\t\tFSBL.Clients.Logger.system.debug(\"appLauncher onComponentListUpdate\");\n\t\tthis.setState({\n\t\t\tcomponentList: data.value,\n\t\t});\n\t}\n\n\tsetInitialState() {\n\t\tlet self = this;\n\t\tappLauncherStore?.getValue({ field: \"componentList\" }, (err: StandardError, data?: ComponentList) => {\n\t\t\tif (typeof data !== \"undefined\") {\n\t\t\t\tself.setState({\n\t\t\t\t\tcomponentList: data,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tappLauncherStore = getStore();\n\t\tthis.setInitialState();\n\t\tappLauncherStore?.addListener({ field: \"componentList\" }, this.onComponentListUpdate);\n\t}\n\n\tcomponentWillUnmount() {\n\t\tappLauncherStore?.removeListener({ field: \"componentList\" }, this.onComponentListUpdate);\n\t}\n\n\tlaunchComponent(component: any, params: any, cb?: (win?: WindowIdentifier) => void) {\n\t\t// If we are launching a group\n\t\tif (component.group) {\n\t\t\tfor (let i of Object.keys(component.list)) {\n\t\t\t\tconst cloneParams = Object.assign({}, params);\n\t\t\t\tconst c = component.list[i];\n\t\t\t\tif (c.component.windowGroup) {\n\t\t\t\t\tcloneParams.groupName = c.component.windowGroup;\n\t\t\t\t}\n\t\t\t\tappLauncherActions.launchComponent(component.list[i], params, cb);\n\t\t\t}\n\t\t} else {\n\t\t\tif (component.component.windowGroup) {\n\t\t\t\tparams.groupName = component.component.windowGroup;\n\t\t\t}\n\t\t\tappLauncherActions.launchComponent(component, params, cb);\n\t\t}\n\t}\n\n\tbuildComponentItem(params: { i: number; key: string; isUserDefined: boolean }) {\n\t\tconst { key, isUserDefined } = params;\n\t\tconst config = this.state.componentList?.[key];\n\t\tlet displayName = key;\n\n\t\t// If the app isn't launchable by the user, don't show it\n\t\tif (\n\t\t\t(!config ||\n\t\t\t\t!config.window ||\n\t\t\t\t!config.foreign ||\n\t\t\t\t!config.foreign.components ||\n\t\t\t\t!config.foreign.components[\"App Launcher\"] ||\n\t\t\t\t!config.foreign.components[\"App Launcher\"].launchableByUser) &&\n\t\t\t!config?.group\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the app is temporary (actively being configured in the Smart Desktop Designer), don't show it\n\t\tif (config.appDConfig?.manifest?.temporary) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Component developers can define a display name that will show instead of the component's type.\n\t\tif (config.component && config.component.displayName) {\n\t\t\t({ displayName } = config.component);\n\t\t}\n\t\tconst iconDescriptor = config.icons.toolbarIcon;\n\t\treturn (\n\t\t\t<MenuItem key={key} onClick={() => this.launchComponent(config, {})}>\n\t\t\t\t<div className=\"menu-item-row\">\n\t\t\t\t\t<span className=\"app-name\" title={displayName}>\n\t\t\t\t\t\t{displayName}\n\t\t\t\t\t</span>\n\t\t\t\t\t<span className=\"menu-item-row-push-right\">\n\t\t\t\t\t\t{isUserDefined && <DeleteComponent name={displayName} />}\n\t\t\t\t\t\t{!this.props.suppressFavorites && (\n\t\t\t\t\t\t\t<FavoriteMaker\n\t\t\t\t\t\t\t\tid={config?.component?.type}\n\t\t\t\t\t\t\t\tcategory=\"Application\"\n\t\t\t\t\t\t\t\tname={displayName}\n\t\t\t\t\t\t\t\ticon={iconDescriptor}\n\t\t\t\t\t\t\t\tclassName=\"menu-item-icon\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n\n\trenderComponentsList() {\n\t\tconst { state } = this;\n\t\tconst components = Object.keys(state.componentList ?? {}).filter((componentType) => {\n\t\t\tif (state.filteredListOfComponents.length) {\n\t\t\t\treturn state.filteredListOfComponents.includes(componentType);\n\t\t\t}\n\t\t\treturn true;\n\t\t});\n\t\t// if this is greater than 0, we don't show a note telling the user to check their configs.\n\t\t// iterate through componentList and render a componentItem for each one.\n\t\tconst componentList = components.map((key, i) => {\n\t\t\tconst { component } = state.componentList[key];\n\t\t\tconst isUserDefined = Boolean(component && component.isUserDefined);\n\t\t\treturn this.buildComponentItem({ i, key, isUserDefined });\n\t\t});\n\t\treturn (\n\t\t\t<div className=\"app-launcher-list\">\n\t\t\t\t{componentList.length ? (\n\t\t\t\t\tcomponentList\n\t\t\t\t) : (\n\t\t\t\t\t<p>\n\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\tNo components loaded. Make sure to check ./src/components.json to make sure you've set everything up\n\t\t\t\t\t\tcorrectly.\n\t\t\t\t\t</p>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t}\n\n\trender() {\n\t\treturn this.state.componentList ? this.renderComponentsList() : <div></div>;\n\t}\n}\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Copyright 2017 by ChartIQ, Inc.
|
|
3
3
|
* All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
import StoreModel from "@finsemble/finsemble-
|
|
6
|
-
import { WindowIdentifier } from "@finsemble/finsemble-
|
|
5
|
+
import StoreModel from "@finsemble/finsemble-api/types/clients/StoreModel";
|
|
6
|
+
import { WindowIdentifier } from "@finsemble/finsemble-api";
|
|
7
7
|
declare let appLauncherStore: StoreModel | undefined;
|
|
8
8
|
declare type VoidCallback = () => void;
|
|
9
9
|
declare type ComponentDescriptor = Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appLauncherStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/appLauncher/stores/appLauncherStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,IAAI,gBAAwC,CAAC;AAC7C,IAAI,wBA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C,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACjE,CAAC;CACD;AACD,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,IAAI,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport StoreModel from \"@finsemble/finsemble-core/types/clients/StoreModel\";\nimport { SpawnResponse } from \"@finsemble/finsemble-core/types/clients/launcherClient\";\nimport { StandardError } from \"@finsemble/finsemble-core/types/types\";\nimport async from \"async\";\nimport { WindowIdentifier } from \"@finsemble/finsemble-core\";\nlet appLauncherStore: StoreModel | undefined;\nlet COMPONENT_UPDATE_CHANNEL: string;\ntype VoidCallback = () => void;\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\nconst Actions = {\n\tcomponentList: {} as ComponentList,\n\tinitialize: function (cb: VoidCallback) {\n\t\tasync.parallel(\n\t\t\t[\n\t\t\t\tActions.initializeComponentList,\n\t\t\t\tActions.getUserDefinedComponentList,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\t\tsetupHotkeys,\n\t\t\t],\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"Actions.initialize done\");\n\t\t\t\tcb();\n\t\t\t}\n\t\t);\n\t},\n\tgetComponentList(cb?: VoidCallback) {\n\t\tFSBL.Clients.LauncherClient.getComponentList((err: StandardError, response) => {\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\tthrow new Error(err);\n\t\t\t}\n\t\t\t// Each AppLauncher\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentList from LauncherClient\", response);\n\t\t\tActions.filterComponents(response);\n\t\t\tif (cb) {\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\t},\n\tinitializeComponentList(cb: VoidCallback) {\n\t\tconst self = Actions;\n\t\tlet firstTime = true;\n\n\t\t// When an app launcher button is clicked, it sends over the types of components that the app launcher can spawn. We assign that data to an object in the windowClient, and then use that to render the app launcher.\n\t\tFSBL.Clients.RouterClient.subscribe(COMPONENT_UPDATE_CHANNEL, (_err, response) => {\n\t\t\tif (!FSBL.Clients.WindowClient.options.customData.spawnData) {\n\t\t\t\tFSBL.Clients.WindowClient.options.customData.spawnData = {};\n\t\t\t}\n\t\t\tObject.assign(FSBL.Clients.WindowClient.options.customData.spawnData, response.data);\n\t\t\tif (firstTime) {\n\t\t\t\t// only update component list the first time to eliminate re-rendering the menu\n\t\t\t\tActions.getComponentList(cb);\n\t\t\t\tfirstTime = false;\n\t\t\t}\n\t\t});\n\n\t\t// Whenever we add or remove a component, this event is fired. We get a list of all components, then filter it out to include only the ones that this particular launcher is capable of spawning.\n\t\tFSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.system.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\tself.filterComponents(response.data.componentList);\n\t\t});\n\t},\n\t// get quick components that the user created from storage.\n\tgetUserDefinedComponentList(cb: VoidCallback) {\n\t\treturn cb();\n\t},\n\t// saves quick components\n\tsaveCustomComponents() {\n\t\tconst UDCs: { [key: string]: any } = {};\n\t\tconst components = Object.keys(Actions.componentList);\n\t\tfor (let i = 0; i < components.length; i++) {\n\t\t\tconst config = Actions.componentList[components[i]];\n\t\t\tif (config.component && config.component.isUserDefined) {\n\t\t\t\tUDCs[config.component.type] = config;\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.StorageClient.save({\n\t\t\ttopic: \"finsemble\",\n\t\t\tkey: \"userDefinedComponents\",\n\t\t\tvalue: UDCs,\n\t\t});\n\t},\n\t/**\n\t * Produce a filtered component list based on the settings for this menu (either \"mode\" or \"list\").\n\t *\n\t * Components will only be added to the returned list if they match the specified mode or\n\t * are found in the specified list\n\t */\n\tprocessSettings(settings: any, components: ComponentList): ComponentList {\n\t\tlet componentList: ComponentList = {};\n\t\tconst keys = Object.keys(components);\n\t\tif (settings.mode) {\n\t\t\tconst settingsMode = Array.isArray(settings.mode) ? settings.mode : [settings.mode];\n\n\t\t\tkeys.forEach((componentType) => {\n\t\t\t\tconst config = components[componentType];\n\t\t\t\tconst mode = config?.component?.mode || [\"\"];\n\t\t\t\tconst coponentMode = Array.isArray(mode) ? mode : [mode];\n\n\t\t\t\tconst commonModes = coponentMode.filter((n: ComponentDescriptor) => settingsMode.indexOf(n) !== -1);\n\n\t\t\t\t// If the current mode isn't in the list of modes for the component then don't include it in our list\n\t\t\t\tif (commonModes.length) {\n\t\t\t\t\tcomponentList[componentType] = components[componentType];\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (settings.list) {\n\t\t\tconst commonItems = settings.list.filter((n: any) => keys.indexOf(n) !== -1);\n\n\t\t\tfor (let i = 0; i < commonItems.length; i++) {\n\t\t\t\tcomponentList[commonItems[i]] = components[commonItems[i]];\n\t\t\t}\n\t\t}\n\t\treturn componentList;\n\t},\n\t// This filters components based on the mode and list settings in customData\n\t// Available settings are list - where you list specific individual component Types, mode - which piggybacks on config.mode and lists all components where the mode matches\n\t// If neither mode not list are set, all components are shown\n\t// Custom Components are always shown\n\tfilterComponents(components: ComponentList = {}) {\n\t\tconst settings = FSBL.Clients.WindowClient.getSpawnData() ?? {};\n\t\tthis.componentList = settings.mode || settings.list ? this.processSettings(settings, components) : components;\n\n\t\tFSBL.Clients.Logger.system.debug(\n\t\t\t\"appLauncher filterComponents\",\n\t\t\tthis.componentList,\n\t\t\t\"settings\",\n\t\t\tsettings,\n\t\t\t\"customData\",\n\t\t\tFSBL.Clients.WindowClient.options.customData\n\t\t);\n\t\tappLauncherStore?.setValue({\n\t\t\tfield: \"componentList\",\n\t\t\tvalue: this.componentList,\n\t\t});\n\t\tthis.saveCustomComponents();\n\t},\n\t// Handler for when the user wants to remove a quick component.\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\thandleRemoveCustomComponent(componentName: string, cb = (wasDeconsted: boolean) => {}) {\n\t\tconst self = this;\n\t\tFSBL.Clients.DialogManager.open(\n\t\t\t\"yesNo\",\n\t\t\t{\n\t\t\t\ttitle: \"Delete this App?\",\n\t\t\t\tquestion: `Are you sure you would like to delete \"${componentName}\"?`,\n\t\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t},\n\t\t\t(err, response) => {\n\t\t\t\t// If the user chooses \"affirmative\" then delete the component.\n\t\t\t\t// We should never get an error, but if we do then go ahead and delete the component too.\n\t\t\t\tif (err || response.choice === \"affirmative\") {\n\t\t\t\t\tcb(true);\n\t\t\t\t\tself.removeCustomComponent(componentName);\n\t\t\t\t} else {\n\t\t\t\t\tcb(false);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\t// Remove the component, notify others.\n\tremoveCustomComponent(componentName: string) {\n\t\tFSBL.Clients.LauncherClient.removeUserDefinedComponent(\n\t\t\t{\n\t\t\t\tname: componentName,\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn console.error(err);\n\t\t\t\t}\n\t\t\t\tActions.getComponentList();\n\t\t\t}\n\t\t);\n\t},\n\t// Hide the window.\n\thideWindow() {\n\t\tfinsembleWindow.hide();\n\t},\n\t// Spawn a component.\n\tlaunchComponent(config: any, params: any, cb?: (win?: WindowIdentifier) => void) {\n\t\t// Actions.hideWindow();\n\t\tconst defaultParams = {\n\t\t\taddToWorkspace: true,\n\t\t\tmonitor: \"mine\",\n\t\t\toptions: { customData: {} },\n\t\t};\n\t\tparams = Object.assign(defaultParams, params);\n\t\tif (!params.options.customData) {\n\t\t\tparams.options.customData = {};\n\t\t}\n\t\tif (!params.options.customData.component) {\n\t\t\tparams.options.customData.component = {};\n\t\t}\n\t\tif (config.component.windowGroup) {\n\t\t\tparams.groupName = config.component.windowGroup;\n\t\t}\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\tconfig.component.type,\n\t\t\tparams,\n\t\t\t(_err: StandardError, windowInfo?: SpawnResponse) => {\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(windowInfo?.windowIdentifier);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n};\n\nfunction createLocalStore(done: VoidCallback) {\n\tconst defaultData = {\n\t\tcomponentList: {},\n\t\tmonitorDimensions: {},\n\t};\n\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"Finsemble-AppLauncher-Local-Store\", values: defaultData },\n\t\t(_err, store) => {\n\t\t\tappLauncherStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getWindowGroupStore(done: VoidCallback) {\n\tFSBL.Clients.DistributedStoreClient.createStore({ global: true, store: \"Finsemble-WindowGroups\" }, () => {\n\t\tdone();\n\t});\n}\n\nfunction initialize(cb: (store?: StoreModel) => void) {\n\tCOMPONENT_UPDATE_CHANNEL = `${finsembleWindow.name}.ComponentsToRender`;\n\tFSBL.Clients.RouterClient.addPubSubResponder(COMPONENT_UPDATE_CHANNEL, {});\n\tasync.parallel([createLocalStore, getWindowGroupStore, Actions.initialize], (err) => {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"appLauncherstore init done\");\n\t\tcb(appLauncherStore);\n\t});\n}\n\nconst keys: { [key: string]: any } = {};\nfunction setupHotkeys(cb: VoidCallback) {\n\tFSBL.Clients.RouterClient.subscribe(\"humanInterface.keydown\", (_err, response) => {\n\t\tif (!keys[response.data.key]) {\n\t\t\tkeys[response.data.key] = {};\n\t\t}\n\t\tkeys[response.data.key] = true;\n\t\tif (keys[160] && keys[162] && keys[68] && Actions.componentList[\"Advanced Chart\"]) {\n\t\t\tFSBL.Clients.LauncherClient.spawn(\"Advanced Chart\", { addToWorkspace: true, monitor: \"mine\" });\n\t\t}\n\t});\n\tFSBL.Clients.RouterClient.subscribe(\"humanInterface.keyup\", (_err, response) => {\n\t\tif (!keys[response.data.key]) {\n\t\t\tkeys[response.data.key] = {};\n\t\t}\n\t\tkeys[response.data.key] = false;\n\t});\n\n\treturn cb();\n}\n\nconst getStore = () => appLauncherStore;\n\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | undefined | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store?: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport { storeManager, initialize, appLauncherStore as Store, Actions, getStore };\n"]}
|
|
1
|
+
{"version":3,"file":"appLauncherStore.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/appLauncher/stores/appLauncherStore.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,IAAI,gBAAwC,CAAC;AAC7C,IAAI,wBAAgC,CAAC;AAKrC,MAAM,OAAO,GAAG;IACf,aAAa,EAAE,EAAmB;IAClC,UAAU,EAAE,UAAU,EAAgB;QACrC,KAAK,CAAC,QAAQ,CACb;YACC,OAAO,CAAC,uBAAuB;YAC/B,OAAO,CAAC,2BAA2B;YAEnC,YAAY;SACZ,EACD,CAAC,GAAG,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AE,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\nimport { SpawnResponse } from \"@finsemble/finsemble-api/types/clients/launcherClient\";\nimport { StandardError } from \"@finsemble/finsemble-api/types/types\";\nimport async from \"async\";\nimport { WindowIdentifier } from \"@finsemble/finsemble-api\";\nlet appLauncherStore: StoreModel | undefined;\nlet COMPONENT_UPDATE_CHANNEL: string;\ntype VoidCallback = () => void;\ntype ComponentDescriptor = Record<string, any>;\ntype ComponentList = Record<string, ComponentDescriptor>;\n\nconst Actions = {\n\tcomponentList: {} as ComponentList,\n\tinitialize: function (cb: VoidCallback) {\n\t\tasync.parallel(\n\t\t\t[\n\t\t\t\tActions.initializeComponentList,\n\t\t\t\tActions.getUserDefinedComponentList,\n\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-use-before-define\n\t\t\t\tsetupHotkeys,\n\t\t\t],\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t}\n\t\t\t\tFSBL.Clients.Logger.system.debug(\"Actions.initialize done\");\n\t\t\t\tcb();\n\t\t\t}\n\t\t);\n\t},\n\tgetComponentList(cb?: VoidCallback) {\n\t\tFSBL.Clients.LauncherClient.getComponentList((err: StandardError, response) => {\n\t\t\tif (typeof err === \"string\") {\n\t\t\t\tthrow new Error(err);\n\t\t\t}\n\t\t\t// Each AppLauncher\n\t\t\tFSBL.Clients.Logger.system.debug(\"getComponentList from LauncherClient\", response);\n\t\t\tActions.filterComponents(response);\n\t\t\tif (cb) {\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\t},\n\tinitializeComponentList(cb: VoidCallback) {\n\t\tconst self = Actions;\n\t\tlet firstTime = true;\n\n\t\t// When an app launcher button is clicked, it sends over the types of components that the app launcher can spawn. We assign that data to an object in the windowClient, and then use that to render the app launcher.\n\t\tFSBL.Clients.RouterClient.subscribe(COMPONENT_UPDATE_CHANNEL, (_err, response) => {\n\t\t\tif (!FSBL.Clients.WindowClient.options.customData.spawnData) {\n\t\t\t\tFSBL.Clients.WindowClient.options.customData.spawnData = {};\n\t\t\t}\n\t\t\tObject.assign(FSBL.Clients.WindowClient.options.customData.spawnData, response.data);\n\t\t\tif (firstTime) {\n\t\t\t\t// only update component list the first time to eliminate re-rendering the menu\n\t\t\t\tActions.getComponentList(cb);\n\t\t\t\tfirstTime = false;\n\t\t\t}\n\t\t});\n\n\t\t// Whenever we add or remove a component, this event is fired. We get a list of all components, then filter it out to include only the ones that this particular launcher is capable of spawning.\n\t\tFSBL.Clients.RouterClient.subscribe(\"Launcher.update\", (err, response) => {\n\t\t\tFSBL.Clients.Logger.system.debug(\"list updated\", err, response);\n\t\t\tif (err) {\n\t\t\t\treturn console.error(err);\n\t\t\t}\n\t\t\tself.filterComponents(response.data.componentList);\n\t\t});\n\t},\n\t// get quick components that the user created from storage.\n\tgetUserDefinedComponentList(cb: VoidCallback) {\n\t\treturn cb();\n\t},\n\t// saves quick components\n\tsaveCustomComponents() {\n\t\tconst UDCs: { [key: string]: any } = {};\n\t\tconst components = Object.keys(Actions.componentList);\n\t\tfor (let i = 0; i < components.length; i++) {\n\t\t\tconst config = Actions.componentList[components[i]];\n\t\t\tif (config.component && config.component.isUserDefined) {\n\t\t\t\tUDCs[config.component.type] = config;\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.StorageClient.save({\n\t\t\ttopic: \"finsemble\",\n\t\t\tkey: \"userDefinedComponents\",\n\t\t\tvalue: UDCs,\n\t\t});\n\t},\n\t/**\n\t * Produce a filtered component list based on the settings for this menu (either \"mode\" or \"list\").\n\t *\n\t * Components will only be added to the returned list if they match the specified mode or\n\t * are found in the specified list\n\t */\n\tprocessSettings(settings: any, components: ComponentList): ComponentList {\n\t\tlet componentList: ComponentList = {};\n\t\tconst keys = Object.keys(components);\n\t\tif (settings.mode) {\n\t\t\tconst settingsMode = Array.isArray(settings.mode) ? settings.mode : [settings.mode];\n\n\t\t\tkeys.forEach((componentType) => {\n\t\t\t\tconst config = components[componentType];\n\t\t\t\tconst mode = config?.component?.mode || [\"\"];\n\t\t\t\tconst coponentMode = Array.isArray(mode) ? mode : [mode];\n\n\t\t\t\tconst commonModes = coponentMode.filter((n: ComponentDescriptor) => settingsMode.indexOf(n) !== -1);\n\n\t\t\t\t// If the current mode isn't in the list of modes for the component then don't include it in our list\n\t\t\t\tif (commonModes.length) {\n\t\t\t\t\tcomponentList[componentType] = components[componentType];\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tif (settings.list) {\n\t\t\tconst commonItems = settings.list.filter((n: any) => keys.indexOf(n) !== -1);\n\n\t\t\tfor (let i = 0; i < commonItems.length; i++) {\n\t\t\t\tcomponentList[commonItems[i]] = components[commonItems[i]];\n\t\t\t}\n\t\t}\n\t\treturn componentList;\n\t},\n\t// This filters components based on the mode and list settings in customData\n\t// Available settings are list - where you list specific individual component Types, mode - which piggybacks on config.mode and lists all components where the mode matches\n\t// If neither mode not list are set, all components are shown\n\t// Custom Components are always shown\n\tfilterComponents(components: ComponentList = {}) {\n\t\tconst settings = FSBL.Clients.WindowClient.getSpawnData() ?? {};\n\t\tthis.componentList = settings.mode || settings.list ? this.processSettings(settings, components) : components;\n\n\t\tFSBL.Clients.Logger.system.debug(\n\t\t\t\"appLauncher filterComponents\",\n\t\t\tthis.componentList,\n\t\t\t\"settings\",\n\t\t\tsettings,\n\t\t\t\"customData\",\n\t\t\tFSBL.Clients.WindowClient.options.customData\n\t\t);\n\t\tappLauncherStore?.setValue({\n\t\t\tfield: \"componentList\",\n\t\t\tvalue: this.componentList,\n\t\t});\n\t\tthis.saveCustomComponents();\n\t},\n\t// Handler for when the user wants to remove a quick component.\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\thandleRemoveCustomComponent(componentName: string, cb = (wasDeconsted: boolean) => {}) {\n\t\tconst self = this;\n\t\tFSBL.Clients.DialogManager.open(\n\t\t\t\"yesNo\",\n\t\t\t{\n\t\t\t\ttitle: \"Delete this App?\",\n\t\t\t\tquestion: `Are you sure you would like to delete \"${componentName}\"?`,\n\t\t\t\taffirmativeResponseLabel: \"Delete\",\n\t\t\t\tshowNegativeButton: false,\n\t\t\t},\n\t\t\t(err, response) => {\n\t\t\t\t// If the user chooses \"affirmative\" then delete the component.\n\t\t\t\t// We should never get an error, but if we do then go ahead and delete the component too.\n\t\t\t\tif (err || response.choice === \"affirmative\") {\n\t\t\t\t\tcb(true);\n\t\t\t\t\tself.removeCustomComponent(componentName);\n\t\t\t\t} else {\n\t\t\t\t\tcb(false);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\t// Remove the component, notify others.\n\tremoveCustomComponent(componentName: string) {\n\t\tFSBL.Clients.LauncherClient.removeUserDefinedComponent(\n\t\t\t{\n\t\t\t\tname: componentName,\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tif (err) {\n\t\t\t\t\treturn console.error(err);\n\t\t\t\t}\n\t\t\t\tActions.getComponentList();\n\t\t\t}\n\t\t);\n\t},\n\t// Hide the window.\n\thideWindow() {\n\t\tfinsembleWindow.hide();\n\t},\n\t// Spawn a component.\n\tlaunchComponent(config: any, params: any, cb?: (win?: WindowIdentifier) => void) {\n\t\t// Actions.hideWindow();\n\t\tconst defaultParams = {\n\t\t\taddToWorkspace: true,\n\t\t\tmonitor: \"mine\",\n\t\t\toptions: { customData: {} },\n\t\t};\n\t\tparams = Object.assign(defaultParams, params);\n\t\tif (!params.options.customData) {\n\t\t\tparams.options.customData = {};\n\t\t}\n\t\tif (!params.options.customData.component) {\n\t\t\tparams.options.customData.component = {};\n\t\t}\n\t\tif (config.component.windowGroup) {\n\t\t\tparams.groupName = config.component.windowGroup;\n\t\t}\n\t\tFSBL.Clients.LauncherClient.spawn(\n\t\t\tconfig.component.type,\n\t\t\tparams,\n\t\t\t(_err: StandardError, windowInfo?: SpawnResponse) => {\n\t\t\t\tif (cb) {\n\t\t\t\t\tcb(windowInfo?.windowIdentifier);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n};\n\nfunction createLocalStore(done: VoidCallback) {\n\tconst defaultData = {\n\t\tcomponentList: {},\n\t\tmonitorDimensions: {},\n\t};\n\n\tFSBL.Clients.DistributedStoreClient.createStore(\n\t\t{ store: \"Finsemble-AppLauncher-Local-Store\", values: defaultData },\n\t\t(_err, store) => {\n\t\t\tappLauncherStore = store;\n\t\t\tdone();\n\t\t}\n\t);\n}\n\nfunction getWindowGroupStore(done: VoidCallback) {\n\tFSBL.Clients.DistributedStoreClient.createStore({ global: true, store: \"Finsemble-WindowGroups\" }, () => {\n\t\tdone();\n\t});\n}\n\nfunction initialize(cb: (store?: StoreModel) => void) {\n\tCOMPONENT_UPDATE_CHANNEL = `${finsembleWindow.name}.ComponentsToRender`;\n\tFSBL.Clients.RouterClient.addPubSubResponder(COMPONENT_UPDATE_CHANNEL, {});\n\tasync.parallel([createLocalStore, getWindowGroupStore, Actions.initialize], (err) => {\n\t\tif (err) {\n\t\t\tconsole.error(err);\n\t\t}\n\t\tFSBL.Clients.Logger.system.debug(\"appLauncherstore init done\");\n\t\tcb(appLauncherStore);\n\t});\n}\n\nconst keys: { [key: string]: any } = {};\nfunction setupHotkeys(cb: VoidCallback) {\n\tFSBL.Clients.RouterClient.subscribe(\"humanInterface.keydown\", (_err, response) => {\n\t\tif (!keys[response.data.key]) {\n\t\t\tkeys[response.data.key] = {};\n\t\t}\n\t\tkeys[response.data.key] = true;\n\t\tif (keys[160] && keys[162] && keys[68] && Actions.componentList[\"Advanced Chart\"]) {\n\t\t\tFSBL.Clients.LauncherClient.spawn(\"Advanced Chart\", { addToWorkspace: true, monitor: \"mine\" });\n\t\t}\n\t});\n\tFSBL.Clients.RouterClient.subscribe(\"humanInterface.keyup\", (_err, response) => {\n\t\tif (!keys[response.data.key]) {\n\t\t\tkeys[response.data.key] = {};\n\t\t}\n\t\tkeys[response.data.key] = false;\n\t});\n\n\treturn cb();\n}\n\nconst getStore = () => appLauncherStore;\n\nclass StoreManager {\n\tinitialized: boolean;\n\n\tinitializing: boolean;\n\n\tcallbacks: Function[];\n\n\tstore: StoreModel | undefined | null;\n\n\tconstructor() {\n\t\tthis.initialized = false;\n\t\tthis.initializing = false;\n\t\tthis.callbacks = [];\n\t\tthis.store = null;\n\t}\n\n\tinitialize() {\n\t\tif (this.initializing) return;\n\t\tthis.initializing = true;\n\t\tinitialize((store?: StoreModel) => {\n\t\t\tthis.initialized = true;\n\t\t\tthis.store = store;\n\t\t\tthis.callbacks.forEach((cb) => cb(store));\n\t\t});\n\t}\n\n\taddInitializedListener(cb: (store: StoreModel) => void) {\n\t\tif (this.initialized && this.store) return cb(this.store);\n\t\tthis.callbacks.push(cb);\n\t}\n\n\tremoveInitializedListener(cb: Function) {\n\t\tthis.callbacks = this.callbacks.filter((entry) => entry !== cb);\n\t}\n}\nconst storeManager = new StoreManager();\n\nexport { storeManager, initialize, appLauncherStore as Store, Actions, getStore };\n"]}
|
|
@@ -58,7 +58,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
58
58
|
};
|
|
59
59
|
const [leftButtonTooltip, setLeftButtonTooltip] = useState("");
|
|
60
60
|
const [rightButtonTooltip, setRightButtonTooltip] = useState("");
|
|
61
|
-
const setWidgetsPositions = async (
|
|
61
|
+
const setWidgetsPositions = async () => {
|
|
62
62
|
var _a;
|
|
63
63
|
const { data: bounds } = await finsembleWindow.getBounds();
|
|
64
64
|
const scrollButtonsEnabled = document.querySelectorAll("#dashbar-container > .chevron-container").length > 0;
|
|
@@ -102,9 +102,6 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
102
102
|
}
|
|
103
103
|
setLeftButtonTooltip(`${leftItemsCount} more`);
|
|
104
104
|
setRightButtonTooltip(`${rightItemsCount} more`);
|
|
105
|
-
if (!isCalledFromDashbar) {
|
|
106
|
-
await setWidgetsPositions(true);
|
|
107
|
-
}
|
|
108
105
|
};
|
|
109
106
|
const addWidgets = async () => {
|
|
110
107
|
const _widgets = widgets;
|
|
@@ -117,8 +114,10 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
117
114
|
height: item.height || dashbar.height,
|
|
118
115
|
};
|
|
119
116
|
if (!_widgets.hasOwnProperty(item.id)) {
|
|
117
|
+
const webContentsName = `(Dashbar) ${item.id}`;
|
|
120
118
|
const res = await finsembleWindow.addBrowserView({
|
|
121
119
|
url: item.url,
|
|
120
|
+
webContentsName,
|
|
122
121
|
bounds: widgetBounds,
|
|
123
122
|
allowAutoResize: false,
|
|
124
123
|
});
|
|
@@ -136,7 +135,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
136
135
|
setWidgets(_widgets);
|
|
137
136
|
setHorizontalBounds(tempHorizontalBounds);
|
|
138
137
|
};
|
|
139
|
-
const removeWidgets = () => {
|
|
138
|
+
const removeWidgets = async () => {
|
|
140
139
|
const _widgets = widgets;
|
|
141
140
|
const toRemove = [];
|
|
142
141
|
Object.keys(_widgets).forEach((widgetId) => {
|
|
@@ -152,10 +151,10 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
152
151
|
toRemove.push(widgetId);
|
|
153
152
|
}
|
|
154
153
|
});
|
|
154
|
+
let tempNewHorizontalBounds = 0;
|
|
155
155
|
for (const id of toRemove) {
|
|
156
156
|
if (_widgets.hasOwnProperty(id)) {
|
|
157
|
-
|
|
158
|
-
_widgets[id].view.remove(() => {
|
|
157
|
+
await _widgets[id].view.remove(() => {
|
|
159
158
|
delete _widgets[id];
|
|
160
159
|
Object.values(_widgets).forEach((widget) => {
|
|
161
160
|
widget.bounds = {
|
|
@@ -167,14 +166,14 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
167
166
|
widget.view.setBounds(widget.bounds);
|
|
168
167
|
tempNewHorizontalBounds = tempNewHorizontalBounds + widget.bounds.width;
|
|
169
168
|
});
|
|
170
|
-
setWidgets(_widgets);
|
|
171
|
-
setHorizontalBounds(tempNewHorizontalBounds);
|
|
172
169
|
});
|
|
173
170
|
}
|
|
174
171
|
else {
|
|
175
172
|
FSBL.Clients.Logger.system.error(`Error removing widget: ${id} from dashbar`);
|
|
176
173
|
}
|
|
177
174
|
}
|
|
175
|
+
setWidgets(_widgets);
|
|
176
|
+
setHorizontalBounds(tempNewHorizontalBounds);
|
|
178
177
|
};
|
|
179
178
|
const reorganizeWidgets = () => {
|
|
180
179
|
const _widgets = widgets;
|
|
@@ -203,7 +202,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
203
202
|
setTotalWidgetsWidth(getTotalWidth());
|
|
204
203
|
}
|
|
205
204
|
else if (dashbarItems.length < WIDGET_COUNT) {
|
|
206
|
-
removeWidgets();
|
|
205
|
+
await removeWidgets();
|
|
207
206
|
setTotalWidgetsWidth(getTotalWidth());
|
|
208
207
|
}
|
|
209
208
|
else if (wasReorganized) {
|
|
@@ -211,7 +210,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
211
210
|
return;
|
|
212
211
|
reorganizeWidgets();
|
|
213
212
|
}
|
|
214
|
-
await setWidgetsPositions(
|
|
213
|
+
await setWidgetsPositions();
|
|
215
214
|
setIsUpdatingState(false);
|
|
216
215
|
};
|
|
217
216
|
if (isUpdatingState === false) {
|
|
@@ -281,7 +280,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
281
280
|
titleGrabPosition = location;
|
|
282
281
|
};
|
|
283
282
|
return (React.createElement("div", { className: wrapperClasses, style: { height: dashbarHeight } },
|
|
284
|
-
WIDGET_COUNT > 0 && (React.createElement(FinsembleDnDContext, { onDragEnd: reorderItems, onDragStart: startMove, onDragMove: moveItem, onLayoutUpdate: setWidgetsPositions, className: "finsemble-dashbar-section rearrange-region", id: "dashbar-container", axis: AllowableDnDAxis.x, lockAxis: AllowableDnDAxis.x, allowHorizontalScroll: true, showScrollButtonsTooltip: true, leftButtonTooltip: leftButtonTooltip, rightButtonTooltip: rightButtonTooltip }, Object.values(widgets).map((widget, i) => (React.createElement(DashbarItem, { key: i, id: Object.keys(widgets)[i], index: i, widgetTitleGenerator: titleGenerator, widget: widget, dashbarHeight: dashbar.height, widgetDividerWidth: widgetDividerWidth, setTitleHeight: setTitleHeight, setGrabLocation: setGrabLocation }))))),
|
|
283
|
+
WIDGET_COUNT > 0 && (React.createElement(FinsembleDnDContext, { onDragEnd: reorderItems, onDragStart: startMove, onDragMove: moveItem, onLayoutUpdate: setWidgetsPositions, className: "finsemble-dashbar-section rearrange-region", id: "dashbar-container", axis: AllowableDnDAxis.x, lockAxis: AllowableDnDAxis.x, allowHorizontalScroll: true, showScrollButtonsTooltip: true, leftButtonTooltip: leftButtonTooltip, rightButtonTooltip: rightButtonTooltip, metadata: { dashbar } }, Object.values(widgets).map((widget, i) => (React.createElement(DashbarItem, { key: i, id: Object.keys(widgets)[i], index: i, widgetTitleGenerator: titleGenerator, widget: widget, dashbarHeight: dashbar.height, widgetDividerWidth: widgetDividerWidth, setTitleHeight: setTitleHeight, setGrabLocation: setGrabLocation }))))),
|
|
285
284
|
WIDGET_COUNT === 0 && (React.createElement("div", { className: "add-dashbar-item-button", onClick: launchDashbar },
|
|
286
285
|
React.createElement("span", null,
|
|
287
286
|
React.createElement("i", { className: "ff-plus" })))),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashbar.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/Dashbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEj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,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAC1C,oBAAC,WAAW,IACX,GAAG,EAAE,CAAC,EACN,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,CAAC,EACR,oBAAoB,EAAE,cAAc,EACpC,MAAM,EAAE,MAAqB,EAC7B,aAAa,EAAE,OAAO,CAAC,MAAM,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAC/B,CACF,CAAC,CACmB,CACtB;QACA,YAAY,KAAK,CAAC,IAAI,CACtB,6BAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,aAAa;YAC9D;gBACC,2BAAG,SAAS,EAAC,SAAS,GAAK,CACrB,CACF,CACN;QACA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { DashbarItem } from \"./DashbarItem\";\nimport { Dashbar as DashbarType, DashbarItem as DashbarItemType, DashbarView } from \"../../../types/dashbarTypes\";\nimport { useDashbar } from \"../../../hooks/useDashbar\";\nimport { useToolbar } from \"../../../hooks/useToolbar\";\nimport { FinsembleDnDContext, AllowableDnDAxis } from \"../../legacyControls/FinsembleDnDContext\";\n\nimport \"../../../assets/css/dashbar.css\";\n\ntype DashbarViews = {\n\t[key: string]: DashbarView;\n} & {};\n\nlet cachedWidgetTop: number;\nlet cachedWidgetHeight: number;\n\nexport const Dashbar = ({ className, children, widgetTitleGenerator }: DashbarType) => {\n\tconst { dashbarItems, reorderDashbarItems } = useDashbar();\n\tconst { launchPreferences } = useToolbar();\n\n\tconst [widgets, setWidgets] = useState({});\n\tconst [horizontalBounds, setHorizontalBounds] = useState(0);\n\tconst [wasReorganized, setReorganized] = useState(false);\n\tconst [totalWidgetsWidth, setTotalWidgetsWidth] = useState(0);\n\tconst [isUpdatingState, setIsUpdatingState] = useState(false);\n\tconst [secondUpdateRequired, setSecondUpdateRequired] = useState(false);\n\n\tlet movingIndex: number | null = null; // The dasharItem index being dragged, null if none\n\tlet titleGrabPosition: number | null = null; // The mouse of event when a widget title is dragged\n\tlet offsetX: number | null = null; // The original grab location of a given view titlebar\n\n\tconst WIDGET_COUNT: number = Object.keys(widgets).length;\n\tconst SCROLL_BUTTON_WIDTH = 30;\n\n\tconst defaultWidgetTitleGenerator = (widget: DashbarView, titleRef: React.MutableRefObject<null>) => {\n\t\tconst handleWidgetTitleClick = () => {\n\t\t\tif (widget.raiseIntentOptions) {\n\t\t\t\tfdc3.raiseIntent(\n\t\t\t\t\twidget.raiseIntentOptions.intent,\n\t\t\t\t\twidget.raiseIntentOptions.context,\n\t\t\t\t\twidget.raiseIntentOptions.targetApp\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<div ref={titleRef} onClick={() => handleWidgetTitleClick()}>\n\t\t\t\t<span dangerouslySetInnerHTML={{ __html: widget.title }}></span>\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst titleGenerator = widgetTitleGenerator ?? defaultWidgetTitleGenerator;\n\n\t/**\n\t *\n\t * @param {object} params\n\t * @param {number} oldIndex The index of the item being moved\n\t * @param {number} newIndex The index to move the item to\n\t */\n\tconst reorderItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tmovingIndex = null;\n\t\ttitleGrabPosition = null;\n\t\toffsetX = null;\n\t\tsetReorganized(true);\n\t\t// Update the redux store\n\t\treorderDashbarItems({ oldIndex, newIndex });\n\t};\n\n\tconst launchDashbar = () => {\n\t\tlaunchPreferences(\"Dashbar\");\n\t};\n\n\tconst { dashbar } = FSBL.Clients.WindowClient.getSpawnData();\n\n\t// Dashbar is disabled (no config in toolbar) or dashbar height is not specified\n\tif (!dashbar || !dashbar.height) {\n\t\treturn null;\n\t}\n\tconst toolbarHeight = finsembleWindow.windowOptions.height;\n\tconst dashbarHeight = `${dashbar.height}px`;\n\tconst verticalBounds = toolbarHeight - dashbar.height;\n\tconst widgetDividerWidth = dashbar.widgetDividerWidth || 0;\n\n\tconst wrapperClasses = `finsemble-dashbar ${className || \"\"}`.trim();\n\n\tconst getTotalWidth = () => {\n\t\tlet totalWidth = 0;\n\t\tdashbarItems.forEach((item: DashbarItemType) => {\n\t\t\ttotalWidth = totalWidth + item.width;\n\t\t});\n\t\treturn totalWidth;\n\t};\n\n\tconst [leftButtonTooltip, setLeftButtonTooltip] = useState(\"\");\n\tconst [rightButtonTooltip, setRightButtonTooltip] = useState(\"\");\n\n\tconst setWidgetsPositions = async (isCalledFromDashbar?: boolean) => {\n\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\tconst scrollButtonsEnabled = document.querySelectorAll(\"#dashbar-container > .chevron-container\").length > 0;\n\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\tlet toolbarWidth = bounds?.width ?? 0;\n\t\tif (scrollButtonsEnabled) toolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;\n\n\t\tlet tempLeft = 0;\n\t\tlet leftButtonSize = 0;\n\t\tif (scrollButtonsEnabled) {\n\t\t\ttempLeft = SCROLL_BUTTON_WIDTH;\n\t\t\tleftButtonSize = SCROLL_BUTTON_WIDTH;\n\t\t}\n\n\t\tlet leftItemsCount = 0;\n\t\tlet rightItemsCount = 0;\n\n\t\tfor (const element of elements) {\n\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\tconst widget = (widgets as DashbarViews)[element.id];\n\t\t\t// Happens when widgets were removed, but dom-elements still exists. So just ignore.\n\t\t\tif (!widget) continue;\n\n\t\t\tif (rect.left < SCROLL_BUTTON_WIDTH && scrollButtonsEnabled) {\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t\tleftItemsCount++;\n\t\t\t} else {\n\t\t\t\twidget.bounds.width = rect.width - widgetDividerWidth;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t}\n\t\t\ttempLeft = tempLeft + widget.bounds.width + widgetDividerWidth;\n\n\t\t\tlet offsetRight = rect.left + rect.width + widgetDividerWidth - leftButtonSize - toolbarWidth;\n\t\t\tif (offsetRight > 0) {\n\t\t\t\t// hide title for invisible items\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"hidden\";\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\trightItemsCount++;\n\t\t\t} else {\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"visible\";\n\t\t\t}\n\t\t\twidget.view.setBounds(widget.bounds);\n\t\t}\n\n\t\tsetLeftButtonTooltip(`${leftItemsCount} more`);\n\t\tsetRightButtonTooltip(`${rightItemsCount} more`);\n\n\t\t//double call for fix fake empty space between widgets while scrolling\n\t\tif (!isCalledFromDashbar) {\n\t\t\tawait setWidgetsPositions(true);\n\t\t}\n\t};\n\n\tconst addWidgets = async () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tlet tempHorizontalBounds = horizontalBounds;\n\n\t\tfor (const item of dashbarItems) {\n\t\t\tconst widgetBounds = {\n\t\t\t\ttop: verticalBounds,\n\t\t\t\tleft: tempHorizontalBounds,\n\t\t\t\twidth: item.width - widgetDividerWidth,\n\t\t\t\theight: item.height || dashbar.height,\n\t\t\t};\n\n\t\t\tif (!_widgets.hasOwnProperty(item.id)) {\n\t\t\t\tconst res: any = await finsembleWindow.addBrowserView({\n\t\t\t\t\turl: item.url,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tallowAutoResize: false,\n\t\t\t\t});\n\n\t\t\t\t_widgets[item.id] = {\n\t\t\t\t\turl: item.url,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tview: res,\n\t\t\t\t\twidth: item.width,\n\t\t\t\t\traiseIntentOptions: item.raiseIntentOptions,\n\t\t\t\t};\n\n\t\t\t\ttempHorizontalBounds = tempHorizontalBounds + item.width;\n\t\t\t}\n\t\t}\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempHorizontalBounds);\n\t};\n\n\tconst removeWidgets = () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Widgets is an object, with each key being a reference to an item in dashbarItems\n\t\t// but dashbarItems is an array of objects. Its necessary to loop through them to determine\n\t\t// the differences to figure out which items were removed.\n\t\tconst toRemove: string[] = [];\n\t\tObject.keys(_widgets).forEach((widgetId) => {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < dashbarItems.length; i++) {\n\t\t\t\tconst dashItem = dashbarItems[i];\n\t\t\t\tif (dashItem.id === widgetId) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\ttoRemove.push(widgetId);\n\t\t\t}\n\t\t});\n\n\t\t// toRemove is an array of widgetIds which were no longer found in dashbarItems\n\t\t// As items are removed, the remaining items have to be shuffled to fill the space\n\t\tfor (const id of toRemove) {\n\t\t\tif (_widgets.hasOwnProperty(id)) {\n\t\t\t\tlet tempNewHorizontalBounds = 0;\n\t\t\t\t_widgets[id].view.remove(() => {\n\t\t\t\t\tdelete _widgets[id];\n\t\t\t\t\t// Shuffle remaining views to fill any gaps that were left\n\t\t\t\t\tObject.values(_widgets).forEach((widget) => {\n\t\t\t\t\t\twidget.bounds = {\n\t\t\t\t\t\t\twidth: widget.bounds.width,\n\t\t\t\t\t\t\theight: widget.bounds.height,\n\t\t\t\t\t\t\tleft: tempNewHorizontalBounds,\n\t\t\t\t\t\t\ttop: widget.bounds.top,\n\t\t\t\t\t\t};\n\t\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t\t\ttempNewHorizontalBounds = tempNewHorizontalBounds + widget.bounds.width;\n\t\t\t\t\t});\n\t\t\t\t\tsetWidgets(_widgets);\n\t\t\t\t\tsetHorizontalBounds(tempNewHorizontalBounds);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(`Error removing widget: ${id} from dashbar`);\n\t\t\t}\n\t\t}\n\t};\n\n\tconst reorganizeWidgets = () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Each view needs to be resituated to fill any holes\n\t\t// left by views that have been removed. Use a tempBounds\n\t\t// int to keep track of new widths and set the overall width\n\t\t// once everything is re-seated\n\t\tlet tempBounds = 0;\n\t\tdashbarItems.forEach((item) => {\n\t\t\tconst widget = _widgets[item.id];\n\n\t\t\twidget.bounds = {\n\t\t\t\theight: cachedWidgetHeight || widget.bounds.height,\n\t\t\t\twidth: widget.bounds.width,\n\t\t\t\ttop: cachedWidgetTop || verticalBounds,\n\t\t\t\tleft: tempBounds,\n\t\t\t};\n\n\t\t\twidget.view.setBounds(widget.bounds);\n\n\t\t\tdelete _widgets[item.id];\n\t\t\t_widgets[item.id] = widget;\n\n\t\t\ttempBounds = tempBounds + item.width;\n\t\t});\n\n\t\tsetReorganized(false);\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempBounds);\n\t};\n\n\tconst updateItems = () => {\n\t\tconst doUpdate = async () => {\n\t\t\tif (dashbarItems.length > WIDGET_COUNT) {\n\t\t\t\t//Items have been added\n\t\t\t\tawait addWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (dashbarItems.length < WIDGET_COUNT) {\n\t\t\t\t//Items have been removed\n\t\t\t\tremoveWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (wasReorganized) {\n\t\t\t\tif (movingIndex) return;\n\t\t\t\t// Length is the same, order has changed\n\t\t\t\treorganizeWidgets();\n\t\t\t}\n\n\t\t\tawait setWidgetsPositions(true);\n\t\t\tsetIsUpdatingState(false);\n\t\t};\n\n\t\tif (isUpdatingState === false) {\n\t\t\tsetIsUpdatingState(true);\n\t\t\tdoUpdate();\n\t\t} else if (!secondUpdateRequired) {\n\t\t\tsetSecondUpdateRequired(true);\n\t\t}\n\t};\n\n\t/**\n\t * When the distributed store's 'dashbaritems' is updated it will cause this hook to\n\t * execute. The local representation of widgets will be mutated, then a call to\n\t * setWidgets will re-render the component\n\t */\n\tuseEffect(() => {\n\t\tupdateItems();\n\t}, [dashbarItems]);\n\n\t/**\n\t * DashbarItems can be changed very quickly before all widgets will be initialized.\n\t * Double-calling updateItems() fixes a bug.\n\t */\n\tuseEffect(() => {\n\t\tif (secondUpdateRequired && !isUpdatingState) {\n\t\t\tupdateItems();\n\t\t\tsetSecondUpdateRequired(false);\n\t\t}\n\t}, [isUpdatingState, secondUpdateRequired]);\n\n\t/**\n\t * Sets the title height as determined by the DashbarItem\n\t * component, since the CSS can be changed by the user\n\t * the component will render the title and pass back\n\t * computed height of that title, then the Dashbar will\n\t * make room for item\n\t *\n\t * @param {number} titleHeight The height of the span containing the title\n\t * @param {string} id The key'ed id of the view\n\t */\n\tconst setTitleHeight = (titleHeight: number, id: string) => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tconst widget = _widgets[id];\n\t\tif (cachedWidgetTop) {\n\t\t\ttitleHeight = 0;\n\t\t}\n\n\t\tconst newBounds = {\n\t\t\ttop: cachedWidgetTop || widget.bounds.top + titleHeight,\n\t\t\tleft: widget.bounds.left,\n\t\t\theight: cachedWidgetHeight || widget.bounds.height - titleHeight,\n\t\t\twidth: widget.bounds.width,\n\t\t};\n\t\tcachedWidgetTop = newBounds.top;\n\t\tcachedWidgetHeight = newBounds.height;\n\n\t\twidget.view.setBounds(newBounds);\n\t\twidget.bounds = newBounds;\n\t\tsetWidgets(_widgets);\n\t};\n\n\t/**\n\t * When a view starts moving, bring it to the front\n\t *\n\t * @param {MouseEvent} event The event passed by react-sortable-hoc\n\t */\n\tconst startMove = (node: any, event: any) => {\n\t\tmovingIndex = node.index;\n\t\tif (offsetX === null && titleGrabPosition !== null) {\n\t\t\toffsetX = event.clientX - titleGrabPosition;\n\t\t}\n\t\tconst widget = Object.values(widgets)[node.index] as DashbarView;\n\t\twidget.view.bringToFront();\n\t};\n\n\t/**\n\t * Event triggered by view movement\n\t *\n\t * @param {MouseEvent} event\n\t */\n\tconst moveItem = (event: any) => {\n\t\tif (movingIndex !== null) {\n\t\t\tconst movingWidget = Object.values(widgets)[movingIndex] as DashbarView;\n\n\t\t\tmovingWidget.view.setBounds({\n\t\t\t\ttop: movingWidget.bounds.top,\n\t\t\t\theight: movingWidget.bounds.height,\n\t\t\t\twidth: movingWidget.bounds.width,\n\t\t\t\tleft: event.clientX - (offsetX || 0),\n\t\t\t});\n\n\t\t\t// Some completely not react very hacky stuff to make browserviews move in conjunction with the titles\n\t\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\t\tfor (const element of elements) {\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tconst widget = (widgets as any)[element.id];\n\t\t\t\tif (widget !== movingWidget && widget.bounds.left !== rect.left) {\n\t\t\t\t\twidget.bounds.left = rect.left;\n\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst setGrabLocation = (location: number) => {\n\t\ttitleGrabPosition = location;\n\t};\n\n\treturn (\n\t\t<div className={wrapperClasses} style={{ height: dashbarHeight }}>\n\t\t\t{WIDGET_COUNT > 0 && (\n\t\t\t\t<FinsembleDnDContext\n\t\t\t\t\tonDragEnd={reorderItems}\n\t\t\t\t\tonDragStart={startMove}\n\t\t\t\t\tonDragMove={moveItem}\n\t\t\t\t\tonLayoutUpdate={setWidgetsPositions}\n\t\t\t\t\tclassName=\"finsemble-dashbar-section rearrange-region\"\n\t\t\t\t\tid=\"dashbar-container\"\n\t\t\t\t\taxis={AllowableDnDAxis.x}\n\t\t\t\t\tlockAxis={AllowableDnDAxis.x}\n\t\t\t\t\tallowHorizontalScroll={true}\n\t\t\t\t\tshowScrollButtonsTooltip={true}\n\t\t\t\t\tleftButtonTooltip={leftButtonTooltip}\n\t\t\t\t\trightButtonTooltip={rightButtonTooltip}\n\t\t\t\t>\n\t\t\t\t\t{Object.values(widgets).map((widget, i) => (\n\t\t\t\t\t\t<DashbarItem\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tid={Object.keys(widgets)[i]}\n\t\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\t\twidgetTitleGenerator={titleGenerator}\n\t\t\t\t\t\t\twidget={widget as DashbarView}\n\t\t\t\t\t\t\tdashbarHeight={dashbar.height}\n\t\t\t\t\t\t\twidgetDividerWidth={widgetDividerWidth}\n\t\t\t\t\t\t\tsetTitleHeight={setTitleHeight}\n\t\t\t\t\t\t\tsetGrabLocation={setGrabLocation}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</FinsembleDnDContext>\n\t\t\t)}\n\t\t\t{WIDGET_COUNT === 0 && (\n\t\t\t\t<div className=\"add-dashbar-item-button\" onClick={launchDashbar}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<i className=\"ff-plus\"></i>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Dashbar.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/Dashbar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEjG,OAAO,iCAAiC,CAAC;AAMzC,IAAI,eAAuB,CAAC;AAC5B,IAAI,kBAA0B,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAA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AC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC3B,KAAK,EAAE,CAAC,EACR,oBAAoB,EAAE,cAAc,EACpC,MAAM,EAAE,MAAqB,EAC7B,aAAa,EAAE,OAAO,CAAC,MAAM,EAC7B,kBAAkB,EAAE,kBAAkB,EACtC,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,GAC/B,CACF,CAAC,CACmB,CACtB;QACA,YAAY,KAAK,CAAC,IAAI,CACtB,6BAAK,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,aAAa;YAC9D;gBACC,2BAAG,SAAS,EAAC,SAAS,GAAK,CACrB,CACF,CACN;QACA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from \"react\";\nimport { DashbarItem } from \"./DashbarItem\";\nimport { Dashbar as DashbarType, DashbarItem as DashbarItemType, DashbarView } from \"../../../types/dashbarTypes\";\nimport { useDashbar } from \"../../../hooks/useDashbar\";\nimport { useToolbar } from \"../../../hooks/useToolbar\";\nimport { FinsembleDnDContext, AllowableDnDAxis } from \"../../legacyControls/FinsembleDnDContext\";\n\nimport \"../../../assets/css/dashbar.css\";\n\ntype DashbarViews = {\n\t[key: string]: DashbarView;\n} & {};\n\nlet cachedWidgetTop: number;\nlet cachedWidgetHeight: number;\n\nexport const Dashbar = ({ className, children, widgetTitleGenerator }: DashbarType) => {\n\tconst { dashbarItems, reorderDashbarItems } = useDashbar();\n\tconst { launchPreferences } = useToolbar();\n\n\tconst [widgets, setWidgets] = useState({});\n\tconst [horizontalBounds, setHorizontalBounds] = useState(0);\n\tconst [wasReorganized, setReorganized] = useState(false);\n\tconst [totalWidgetsWidth, setTotalWidgetsWidth] = useState(0);\n\tconst [isUpdatingState, setIsUpdatingState] = useState(false);\n\tconst [secondUpdateRequired, setSecondUpdateRequired] = useState(false);\n\n\tlet movingIndex: number | null = null; // The dasharItem index being dragged, null if none\n\tlet titleGrabPosition: number | null = null; // The mouse of event when a widget title is dragged\n\tlet offsetX: number | null = null; // The original grab location of a given view titlebar\n\n\tconst WIDGET_COUNT: number = Object.keys(widgets).length;\n\tconst SCROLL_BUTTON_WIDTH = 30;\n\n\tconst defaultWidgetTitleGenerator = (widget: DashbarView, titleRef: React.MutableRefObject<null>) => {\n\t\tconst handleWidgetTitleClick = () => {\n\t\t\tif (widget.raiseIntentOptions) {\n\t\t\t\tfdc3.raiseIntent(\n\t\t\t\t\twidget.raiseIntentOptions.intent,\n\t\t\t\t\twidget.raiseIntentOptions.context,\n\t\t\t\t\twidget.raiseIntentOptions.targetApp\n\t\t\t\t);\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<div ref={titleRef} onClick={() => handleWidgetTitleClick()}>\n\t\t\t\t<span dangerouslySetInnerHTML={{ __html: widget.title }}></span>\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst titleGenerator = widgetTitleGenerator ?? defaultWidgetTitleGenerator;\n\n\t/**\n\t *\n\t * @param {object} params\n\t * @param {number} oldIndex The index of the item being moved\n\t * @param {number} newIndex The index to move the item to\n\t */\n\tconst reorderItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tmovingIndex = null;\n\t\ttitleGrabPosition = null;\n\t\toffsetX = null;\n\t\tsetReorganized(true);\n\t\t// Update the redux store\n\t\treorderDashbarItems({ oldIndex, newIndex });\n\t};\n\n\tconst launchDashbar = () => {\n\t\tlaunchPreferences(\"Dashbar\");\n\t};\n\n\tconst { dashbar } = FSBL.Clients.WindowClient.getSpawnData();\n\n\t// Dashbar is disabled (no config in toolbar) or dashbar height is not specified\n\tif (!dashbar || !dashbar.height) {\n\t\treturn null;\n\t}\n\tconst toolbarHeight = finsembleWindow.windowOptions.height;\n\tconst dashbarHeight = `${dashbar.height}px`;\n\tconst verticalBounds = toolbarHeight - dashbar.height;\n\tconst widgetDividerWidth = dashbar.widgetDividerWidth || 0;\n\n\tconst wrapperClasses = `finsemble-dashbar ${className || \"\"}`.trim();\n\n\tconst getTotalWidth = () => {\n\t\tlet totalWidth = 0;\n\t\tdashbarItems.forEach((item: DashbarItemType) => {\n\t\t\ttotalWidth = totalWidth + item.width;\n\t\t});\n\t\treturn totalWidth;\n\t};\n\n\tconst [leftButtonTooltip, setLeftButtonTooltip] = useState(\"\");\n\tconst [rightButtonTooltip, setRightButtonTooltip] = useState(\"\");\n\n\tconst setWidgetsPositions = async () => {\n\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\tconst scrollButtonsEnabled = document.querySelectorAll(\"#dashbar-container > .chevron-container\").length > 0;\n\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\tlet toolbarWidth = bounds?.width ?? 0;\n\t\tif (scrollButtonsEnabled) toolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;\n\n\t\tlet tempLeft = 0;\n\t\tlet leftButtonSize = 0;\n\t\tif (scrollButtonsEnabled) {\n\t\t\ttempLeft = SCROLL_BUTTON_WIDTH;\n\t\t\tleftButtonSize = SCROLL_BUTTON_WIDTH;\n\t\t}\n\n\t\tlet leftItemsCount = 0;\n\t\tlet rightItemsCount = 0;\n\n\t\tfor (const element of elements) {\n\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\tconst widget = (widgets as DashbarViews)[element.id];\n\t\t\t// Happens when widgets were removed, but dom-elements still exists. So just ignore.\n\t\t\tif (!widget) continue;\n\n\t\t\tif (rect.left < SCROLL_BUTTON_WIDTH && scrollButtonsEnabled) {\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t\tleftItemsCount++;\n\t\t\t} else {\n\t\t\t\twidget.bounds.width = rect.width - widgetDividerWidth;\n\t\t\t\twidget.bounds.left = tempLeft;\n\t\t\t}\n\t\t\ttempLeft = tempLeft + widget.bounds.width + widgetDividerWidth;\n\n\t\t\tlet offsetRight = rect.left + rect.width + widgetDividerWidth - leftButtonSize - toolbarWidth;\n\t\t\tif (offsetRight > 0) {\n\t\t\t\t// hide title for invisible items\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"hidden\";\n\t\t\t\twidget.bounds.width = 0;\n\t\t\t\trightItemsCount++;\n\t\t\t} else {\n\t\t\t\t(element.childNodes[0] as HTMLElement).style.visibility = \"visible\";\n\t\t\t}\n\t\t\twidget.view.setBounds(widget.bounds);\n\t\t}\n\n\t\tsetLeftButtonTooltip(`${leftItemsCount} more`);\n\t\tsetRightButtonTooltip(`${rightItemsCount} more`);\n\t};\n\n\tconst addWidgets = async () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tlet tempHorizontalBounds = horizontalBounds;\n\n\t\tfor (const item of dashbarItems) {\n\t\t\tconst widgetBounds = {\n\t\t\t\ttop: verticalBounds,\n\t\t\t\tleft: tempHorizontalBounds,\n\t\t\t\twidth: item.width - widgetDividerWidth,\n\t\t\t\theight: item.height || dashbar.height,\n\t\t\t};\n\n\t\t\tif (!_widgets.hasOwnProperty(item.id)) {\n\t\t\t\tconst webContentsName = `(Dashbar) ${item.id}`;\n\t\t\t\tconst res: any = await finsembleWindow.addBrowserView({\n\t\t\t\t\turl: item.url,\n\t\t\t\t\twebContentsName,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tallowAutoResize: false,\n\t\t\t\t});\n\n\t\t\t\t_widgets[item.id] = {\n\t\t\t\t\turl: item.url,\n\t\t\t\t\ttitle: item.title,\n\t\t\t\t\tbounds: widgetBounds,\n\t\t\t\t\tview: res,\n\t\t\t\t\twidth: item.width,\n\t\t\t\t\traiseIntentOptions: item.raiseIntentOptions,\n\t\t\t\t};\n\n\t\t\t\ttempHorizontalBounds = tempHorizontalBounds + item.width;\n\t\t\t}\n\t\t}\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempHorizontalBounds);\n\t};\n\n\tconst removeWidgets = async () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Widgets is an object, with each key being a reference to an item in dashbarItems\n\t\t// but dashbarItems is an array of objects. Its necessary to loop through them to determine\n\t\t// the differences to figure out which items were removed.\n\t\tconst toRemove: string[] = [];\n\t\tObject.keys(_widgets).forEach((widgetId) => {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < dashbarItems.length; i++) {\n\t\t\t\tconst dashItem = dashbarItems[i];\n\t\t\t\tif (dashItem.id === widgetId) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!found) {\n\t\t\t\ttoRemove.push(widgetId);\n\t\t\t}\n\t\t});\n\n\t\tlet tempNewHorizontalBounds = 0;\n\t\t// toRemove is an array of widgetIds which were no longer found in dashbarItems\n\t\t// As items are removed, the remaining items have to be shuffled to fill the space\n\t\tfor (const id of toRemove) {\n\t\t\tif (_widgets.hasOwnProperty(id)) {\n\t\t\t\tawait _widgets[id].view.remove(() => {\n\t\t\t\t\tdelete _widgets[id];\n\t\t\t\t\t// Shuffle remaining views to fill any gaps that were left\n\t\t\t\t\tObject.values(_widgets).forEach((widget) => {\n\t\t\t\t\t\twidget.bounds = {\n\t\t\t\t\t\t\twidth: widget.bounds.width,\n\t\t\t\t\t\t\theight: widget.bounds.height,\n\t\t\t\t\t\t\tleft: tempNewHorizontalBounds,\n\t\t\t\t\t\t\ttop: widget.bounds.top,\n\t\t\t\t\t\t};\n\t\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t\t\ttempNewHorizontalBounds = tempNewHorizontalBounds + widget.bounds.width;\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tFSBL.Clients.Logger.system.error(`Error removing widget: ${id} from dashbar`);\n\t\t\t}\n\t\t}\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempNewHorizontalBounds);\n\t};\n\n\tconst reorganizeWidgets = () => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\t// Each view needs to be resituated to fill any holes\n\t\t// left by views that have been removed. Use a tempBounds\n\t\t// int to keep track of new widths and set the overall width\n\t\t// once everything is re-seated\n\t\tlet tempBounds = 0;\n\t\tdashbarItems.forEach((item) => {\n\t\t\tconst widget = _widgets[item.id];\n\n\t\t\twidget.bounds = {\n\t\t\t\theight: cachedWidgetHeight || widget.bounds.height,\n\t\t\t\twidth: widget.bounds.width,\n\t\t\t\ttop: cachedWidgetTop || verticalBounds,\n\t\t\t\tleft: tempBounds,\n\t\t\t};\n\n\t\t\twidget.view.setBounds(widget.bounds);\n\n\t\t\tdelete _widgets[item.id];\n\t\t\t_widgets[item.id] = widget;\n\n\t\t\ttempBounds = tempBounds + item.width;\n\t\t});\n\n\t\tsetReorganized(false);\n\t\tsetWidgets(_widgets);\n\t\tsetHorizontalBounds(tempBounds);\n\t};\n\n\tconst updateItems = () => {\n\t\tconst doUpdate = async () => {\n\t\t\tif (dashbarItems.length > WIDGET_COUNT) {\n\t\t\t\t//Items have been added\n\t\t\t\tawait addWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (dashbarItems.length < WIDGET_COUNT) {\n\t\t\t\t//Items have been removed\n\t\t\t\tawait removeWidgets();\n\t\t\t\tsetTotalWidgetsWidth(getTotalWidth());\n\t\t\t} else if (wasReorganized) {\n\t\t\t\tif (movingIndex) return;\n\t\t\t\t// Length is the same, order has changed\n\t\t\t\treorganizeWidgets();\n\t\t\t}\n\n\t\t\tawait setWidgetsPositions();\n\t\t\tsetIsUpdatingState(false);\n\t\t};\n\n\t\tif (isUpdatingState === false) {\n\t\t\tsetIsUpdatingState(true);\n\t\t\tdoUpdate();\n\t\t} else if (!secondUpdateRequired) {\n\t\t\tsetSecondUpdateRequired(true);\n\t\t}\n\t};\n\n\t/**\n\t * When the distributed store's 'dashbaritems' is updated it will cause this hook to\n\t * execute. The local representation of widgets will be mutated, then a call to\n\t * setWidgets will re-render the component\n\t */\n\tuseEffect(() => {\n\t\tupdateItems();\n\t}, [dashbarItems]);\n\n\t/**\n\t * DashbarItems can be changed very quickly before all widgets will be initialized.\n\t * Double-calling updateItems() fixes a bug.\n\t */\n\tuseEffect(() => {\n\t\tif (secondUpdateRequired && !isUpdatingState) {\n\t\t\tupdateItems();\n\t\t\tsetSecondUpdateRequired(false);\n\t\t}\n\t}, [isUpdatingState, secondUpdateRequired]);\n\n\t/**\n\t * Sets the title height as determined by the DashbarItem\n\t * component, since the CSS can be changed by the user\n\t * the component will render the title and pass back\n\t * computed height of that title, then the Dashbar will\n\t * make room for item\n\t *\n\t * @param {number} titleHeight The height of the span containing the title\n\t * @param {string} id The key'ed id of the view\n\t */\n\tconst setTitleHeight = (titleHeight: number, id: string) => {\n\t\tconst _widgets: DashbarViews = widgets;\n\t\tconst widget = _widgets[id];\n\t\tif (cachedWidgetTop) {\n\t\t\ttitleHeight = 0;\n\t\t}\n\n\t\tconst newBounds = {\n\t\t\ttop: cachedWidgetTop || widget.bounds.top + titleHeight,\n\t\t\tleft: widget.bounds.left,\n\t\t\theight: cachedWidgetHeight || widget.bounds.height - titleHeight,\n\t\t\twidth: widget.bounds.width,\n\t\t};\n\t\tcachedWidgetTop = newBounds.top;\n\t\tcachedWidgetHeight = newBounds.height;\n\n\t\twidget.view.setBounds(newBounds);\n\t\twidget.bounds = newBounds;\n\t\tsetWidgets(_widgets);\n\t};\n\n\t/**\n\t * When a view starts moving, bring it to the front\n\t *\n\t * @param {MouseEvent} event The event passed by react-sortable-hoc\n\t */\n\tconst startMove = (node: any, event: any) => {\n\t\tmovingIndex = node.index;\n\t\tif (offsetX === null && titleGrabPosition !== null) {\n\t\t\toffsetX = event.clientX - titleGrabPosition;\n\t\t}\n\t\tconst widget = Object.values(widgets)[node.index] as DashbarView;\n\t\twidget.view.bringToFront();\n\t};\n\n\t/**\n\t * Event triggered by view movement\n\t *\n\t * @param {MouseEvent} event\n\t */\n\tconst moveItem = (event: any) => {\n\t\tif (movingIndex !== null) {\n\t\t\tconst movingWidget = Object.values(widgets)[movingIndex] as DashbarView;\n\n\t\t\tmovingWidget.view.setBounds({\n\t\t\t\ttop: movingWidget.bounds.top,\n\t\t\t\theight: movingWidget.bounds.height,\n\t\t\t\twidth: movingWidget.bounds.width,\n\t\t\t\tleft: event.clientX - (offsetX || 0),\n\t\t\t});\n\n\t\t\t// Some completely not react very hacky stuff to make browserviews move in conjunction with the titles\n\t\t\tconst elements = document.getElementsByClassName(\"dashbar-item-frame\");\n\t\t\tfor (const element of elements) {\n\t\t\t\tconst rect = element.getBoundingClientRect();\n\t\t\t\tconst widget = (widgets as any)[element.id];\n\t\t\t\tif (widget !== movingWidget && widget.bounds.left !== rect.left) {\n\t\t\t\t\twidget.bounds.left = rect.left;\n\t\t\t\t\twidget.view.setBounds(widget.bounds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\tconst setGrabLocation = (location: number) => {\n\t\ttitleGrabPosition = location;\n\t};\n\n\treturn (\n\t\t<div className={wrapperClasses} style={{ height: dashbarHeight }}>\n\t\t\t{WIDGET_COUNT > 0 && (\n\t\t\t\t<FinsembleDnDContext\n\t\t\t\t\tonDragEnd={reorderItems}\n\t\t\t\t\tonDragStart={startMove}\n\t\t\t\t\tonDragMove={moveItem}\n\t\t\t\t\tonLayoutUpdate={setWidgetsPositions}\n\t\t\t\t\tclassName=\"finsemble-dashbar-section rearrange-region\"\n\t\t\t\t\tid=\"dashbar-container\"\n\t\t\t\t\taxis={AllowableDnDAxis.x}\n\t\t\t\t\tlockAxis={AllowableDnDAxis.x}\n\t\t\t\t\tallowHorizontalScroll={true}\n\t\t\t\t\tshowScrollButtonsTooltip={true}\n\t\t\t\t\tleftButtonTooltip={leftButtonTooltip}\n\t\t\t\t\trightButtonTooltip={rightButtonTooltip}\n\t\t\t\t\tmetadata={{ dashbar }}\n\t\t\t\t>\n\t\t\t\t\t{Object.values(widgets).map((widget, i) => (\n\t\t\t\t\t\t<DashbarItem\n\t\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\t\tid={Object.keys(widgets)[i]}\n\t\t\t\t\t\t\tindex={i}\n\t\t\t\t\t\t\twidgetTitleGenerator={titleGenerator}\n\t\t\t\t\t\t\twidget={widget as DashbarView}\n\t\t\t\t\t\t\tdashbarHeight={dashbar.height}\n\t\t\t\t\t\t\twidgetDividerWidth={widgetDividerWidth}\n\t\t\t\t\t\t\tsetTitleHeight={setTitleHeight}\n\t\t\t\t\t\t\tsetGrabLocation={setGrabLocation}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</FinsembleDnDContext>\n\t\t\t)}\n\t\t\t{WIDGET_COUNT === 0 && (\n\t\t\t\t<div className=\"add-dashbar-item-button\" onClick={launchDashbar}>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<i className=\"ff-plus\"></i>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Workspace as WorkspaceType } from "@finsemble/finsemble-
|
|
2
|
+
import { Workspace as WorkspaceType } from "@finsemble/finsemble-api/types/common/workspace";
|
|
3
3
|
import "./workspaceManagementMenu.css";
|
|
4
|
-
import StoreModel from "@finsemble/finsemble-
|
|
4
|
+
import StoreModel from "@finsemble/finsemble-api/types/clients/StoreModel";
|
|
5
5
|
interface IProps {
|
|
6
6
|
id?: string;
|
|
7
7
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceManagementMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;A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AgB,OAAG;YACpB,oBAAC,aAAa,IACb,qBAAqB,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACvD,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAC3C,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GACnC,CACA,CACH,CAAC,CAAC,CAAC,IAAI,CACF,CACP,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React from \"react\";\nimport { Actions as WorkspaceManagementMenuActions } from \"./stores/workspaceManagementMenuStore\";\nimport WorkspaceActions from \"./components/WorkspaceActions\";\nimport WorkspaceList from \"./components/WorkspaceList\";\nimport { Menu } from \"../../menu/Menu\";\nimport { storeManager } from \"./stores/workspaceManagementMenuStore\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"WorkspaceManagementMenu.js","sourceRoot":"","sources":["../../../../src/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,uCAAuC,CAAC;AAClG,OAAO,gBAAgB,MAAM,+BAA+B,CAAC;AAC7D,OAAO,aAAa,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAGrE,OAAO,+BAA+B,CAAC;AAuBvC,MAAM,OAAO,uBAAwB,SAAQ,KAAK,CAAC,SAAyB;IAG3E,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,EAAE;YACjB,eAAe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kspaceManagementMenuActions } from \"./stores/workspaceManagementMenuStore\";\nimport WorkspaceActions from \"./components/WorkspaceActions\";\nimport WorkspaceList from \"./components/WorkspaceList\";\nimport { Menu } from \"../../menu/Menu\";\nimport { storeManager } from \"./stores/workspaceManagementMenuStore\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/common/workspace\";\n\nimport \"./workspaceManagementMenu.css\";\nimport StoreModel from \"@finsemble/finsemble-api/types/clients/StoreModel\";\n\ninterface IProps {\n\tid?: string;\n\tclassName?: string;\n\twidth?: number;\n\theight?: number;\n\tmaxHeight?: number;\n\ttitle?: React.ReactNode;\n\topenHotkey?: Array<string>;\n\tcloseHotkey?: Array<string>;\n}\ninterface IState {\n\tWorkspaceList: WorkspaceType[];\n\tactiveWorkspace: WorkspaceType | null;\n\tinitialized: boolean;\n\tisSwitchingWorkspaces: boolean;\n}\n\n/**\n * A button that opens the workspace management menu when clicked.\n */\nexport class WorkspaceManagementMenu extends React.Component<IProps, IState> {\n\tstore: StoreModel | null;\n\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t\tthis.store = null;\n\t\tthis.state = {\n\t\t\tWorkspaceList: [],\n\t\t\tactiveWorkspace: null,\n\t\t\tinitialized: false,\n\t\t\tisSwitchingWorkspaces: false,\n\t\t};\n\t}\n\n\tbindCorrectContext() {\n\t\tthis.onStoreChange = this.onStoreChange.bind(this);\n\t\tthis.onInitialized = this.onInitialized.bind(this);\n\t}\n\n\tonInitialized(store: StoreModel) {\n\t\tthis.store = store;\n\t\tthis.store.addListener({ field: \"WorkspaceList\" }, this.onStoreChange);\n\t\tthis.store.addListener({ field: \"activeWorkspace\" }, this.onStoreChange);\n\t\tthis.store.addListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\n\t\tthis.onStoreChange();\n\t\tthis.setState({\n\t\t\tinitialized: true,\n\t\t});\n\t}\n\n\tonStoreChange() {\n\t\tthis.setState({\n\t\t\tWorkspaceList: WorkspaceManagementMenuActions.getWorkspaceList(),\n\t\t\tactiveWorkspace: WorkspaceManagementMenuActions.getActiveWorkspace(),\n\t\t\tisSwitchingWorkspaces: WorkspaceManagementMenuActions.getIsSwitchingWorkspaces(),\n\t\t});\n\t}\n\n\tcomponentDidMount() {\n\t\tstoreManager.addInitializedListener(this.onInitialized);\n\t\tstoreManager.initialize();\n\t}\n\n\tcomponentWillUnmount() {\n\t\tstoreManager.removeInitializedListener(this.onInitialized);\n\t\tif (this.state.initialized) {\n\t\t\tthis.store?.removeListener({ field: \"WorkspaceList\" }, this.onStoreChange);\n\t\t\tthis.store?.removeListener({ field: \"activeWorkspace\" }, this.onStoreChange);\n\t\t\tthis.store?.removeListener({ field: \"isSwitchingWorkspaces\" }, this.onStoreChange);\n\t\t}\n\t}\n\n\trender() {\n\t\tlet completeProps = {\n\t\t\t...this.props,\n\t\t\twidth: this.props.width ?? 330,\n\t\t\tclassName: this.props.className ?? \"workspace-management-menu\",\n\t\t\tid: this.props.id ?? \"WorkspaceMenu\",\n\t\t\ttitle: this.state.activeWorkspace?.name,\n\t\t};\n\n\t\treturn (\n\t\t\t<Menu {...completeProps}>\n\t\t\t\t{this.state.initialized && this.state.activeWorkspace ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<WorkspaceActions />\n\t\t\t\t\t\t<WorkspaceList\n\t\t\t\t\t\t\tisSwitchingWorkspaces={this.state.isSwitchingWorkspaces}\n\t\t\t\t\t\t\tactiveWorkspace={this.state.activeWorkspace}\n\t\t\t\t\t\t\tworkspaces={this.state.WorkspaceList}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : null}\n\t\t\t</Menu>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This is a single workspace. When clicked, it requests that the app switch to the clicked workspace.
|
|
5
5
|
*/
|
|
6
6
|
import React from "react";
|
|
7
|
-
import { Workspace as WorkspaceType } from "@finsemble/finsemble-
|
|
7
|
+
import { Workspace as WorkspaceType } from "@finsemble/finsemble-api/types/common/workspace";
|
|
8
8
|
declare type WorkspaceActionType = WorkspaceType & {
|
|
9
9
|
permanent?: boolean;
|
|
10
10
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/Workspace.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAW9D,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,uBAAuB,GAAG,CAAC,CAAmB,EAAE,EAAE;QACvD,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;QAIpB,8BAA8B,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;YACxE,IAAI,UAAU,IAAI,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;gBAC9C,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;aAC/B;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACN,8BAAM,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAC,gBAAgB;QACjE,2BAAG,SAAS,EAAC,sBAAsB,EAAC,KAAK,EAAC,QAAQ,GAAK,CACjD,CACP,CAAC;AACH,CAAC,CAAC;AAUF,MAAM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,CAAC,IAAI,EAClB,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAC,gBAAgB,GACzB,CACG,CACD,CACI,CACX,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a single workspace. When clicked, it requests that the app switch to the clicked workspace.\n */\n\nimport React from \"react\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"Workspace.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/Workspace.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAW9D,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAE,EAAE;IACvD,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC;IACvD,MAAM,uBAAuB,GAAG,CAAC,CAAmB,EAAE,EAAE;QACvD,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;QAIpB,8BAA8B,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;YACxE,IAAI,UAAU,IAAI,WAAW,CAA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AAS,EAAE,UAAU,CAAC,SAAS,GAAS;gBACrG,8BAAM,SAAS,EAAC,gBAAgB,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,IACpD,SAAS,CAAC,IAAI,CACT;gBACP,6BAAK,SAAS,EAAC,0BAA0B;oBACvC,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,oBAAC,eAAe,IAAC,SAAS,EAAE,SAAS,GAAI;oBACxF,oBAAC,aAAa,IACb,EAAE,EAAE,SAAS,CAAC,IAAI,EAClB,IAAI,EAAE,SAAS,CAAC,IAAI,EACpB,QAAQ,EAAE,WAAW,EACrB,SAAS,EAAC,gBAAgB,GACzB,CACG,CACD,CACI,CACX,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a single workspace. When clicked, it requests that the app switch to the clicked workspace.\n */\n\nimport React from \"react\";\nimport { MenuItem } from \"../../../menu/MenuItem\";\nimport { Actions as WorkspaceManagementMenuActions } from \"../stores/workspaceManagementMenuStore\";\nimport { FavoriteMaker } from \"../../../favorites/FavoriteMaker\";\nimport { useFavorites } from \"../../../../hooks/useFavorites\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/common/workspace\";\n\ntype WorkspaceActionType = WorkspaceType & {\n\tpermanent?: boolean;\n};\n\ninterface RemoveWorkspaceProps {\n\tworkspace: WorkspaceActionType;\n}\n\nconst RemoveWorkspace = (props: RemoveWorkspaceProps) => {\n\tconst { workspace } = props;\n\tconst { isFavorited, removeFavorite } = useFavorites();\n\tconst actuallyRemoveWorkspace = (e: React.MouseEvent) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t\t// Trigger the remove. This will throw a dialog. It will return a boolean\n\t\t// for whether it was or was not deleted.\n\t\t// If the thing was deleted, remove it from favorites.\n\t\tWorkspaceManagementMenuActions.removeWorkspace(workspace, (wasDeleted) => {\n\t\t\tif (wasDeleted && isFavorited(workspace.name)) {\n\t\t\t\tremoveFavorite(workspace.name);\n\t\t\t}\n\t\t});\n\t};\n\n\treturn (\n\t\t<span onClick={actuallyRemoveWorkspace} className=\"menu-item-icon\">\n\t\t\t<i className=\"ff-adp-trash-outline\" title=\"Delete\"></i>\n\t\t</span>\n\t);\n};\n\ninterface IProps {\n\tisSwitchingWorkspaces: boolean;\n\tisActiveWorkspace: boolean;\n\tdragHandle: { iconClass: string };\n\tworkspace: WorkspaceActionType;\n\tmainAction: (data: { name: string }) => void;\n}\n\nexport default class Workspace extends React.Component<IProps> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t}\n\n\t/**\n\t * This is necessary to make sure that the `this` inside of the callback is correct.\n\t *\n\t * @memberof Workspace\n\t */\n\tbindCorrectContext() {\n\t\tthis.onClick = this.onClick.bind(this);\n\t}\n\n\t/**\n\t * When the main body of the component is clicked, we fire off the mainAction. By default this is to switch workspaces.\n\t *\n\t * @memberof Workspace\n\t */\n\tonClick() {\n\t\tthis.props.mainAction({\n\t\t\tname: this.props.workspace.name,\n\t\t});\n\t}\n\n\t/**\n\t * Render method.\n\t *\n\t * @returns\n\t * @memberof Workspace\n\t */\n\trender() {\n\t\tconst { isSwitchingWorkspaces, workspace, isActiveWorkspace, dragHandle } = this.props;\n\n\t\t// Actions are remove and pin workspace.\n\n\t\tconst showSpinner = isSwitchingWorkspaces && isActiveWorkspace;\n\n\t\tlet classes = isActiveWorkspace ? \"menu-item active-workspace workspace-name\" : \"menu-item workspace-name\";\n\n\t\treturn (\n\t\t\t<MenuItem onClick={this.onClick} className={classes}>\n\t\t\t\t<div className=\"menu-item-row\">\n\t\t\t\t\t{showSpinner && <span className=\"fsbl-loader\">Loading...</span>}\n\t\t\t\t\t{!showSpinner && dragHandle && dragHandle.iconClass && <span className={dragHandle.iconClass}></span>}\n\t\t\t\t\t<span className=\"workspace-name\" title={workspace.name}>\n\t\t\t\t\t\t{workspace.name}\n\t\t\t\t\t</span>\n\t\t\t\t\t<div className=\"menu-item-row-push-right\">\n\t\t\t\t\t\t{!isActiveWorkspace && !workspace.permanent && <RemoveWorkspace workspace={workspace} />}\n\t\t\t\t\t\t<FavoriteMaker\n\t\t\t\t\t\t\tid={workspace.name}\n\t\t\t\t\t\t\tname={workspace.name}\n\t\t\t\t\t\t\tcategory={\"Workspace\"}\n\t\t\t\t\t\t\tclassName=\"menu-item-icon\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</MenuItem>\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { Workspace as WorkspaceType } from "@finsemble/finsemble-
|
|
2
|
+
import { Workspace as WorkspaceType } from "@finsemble/finsemble-api/types/common/workspace";
|
|
3
3
|
interface IProps {
|
|
4
4
|
isSwitchingWorkspaces: boolean;
|
|
5
5
|
activeWorkspace: WorkspaceType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceList.js","sourceRoot":"","sources":["../../../../../src/components/toolbar/workspaceManagementMenu/components/WorkspaceList.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAalF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiB;IACjE,YAAY,KAAa;QACxB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IAED,SAAS,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAe;QAC5C,OAAO,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,MAAM;QACL,MAAM,EAAE,qBAAqB,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC9D,IAAI,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE;YAE3D,IAAI,iBAAiB,GAAG,SAAS,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,CAAC;YAChE,MAAM,UAAU,GAAG,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;YAErD,OAAO,CACN,oBAAC,kBAAkB,IAAC,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,IAAI;gBAChE,oBAAC,SAAS,IACT,GAAG,EAAE,CAAC,EACN,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,OAAO,CAAC,iBAAiB,EACrC,qBAAqB,EAAE,qBAAqB,GAC3C,CACkB,CACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CACN,oBAAC,mBAAmB,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAC,gBAAgB,IACxE,UAAU,CACU,CACtB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a list of workspaces that the user can click on, loading them.\n */\nimport React from \"react\";\nimport Workspace from \"./Workspace\";\nimport { Actions } from \"../stores/workspaceManagementMenuStore\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-
|
|
1
|
+
{"version":3,"file":"WorkspaceList.js","sourceRoot":"","sources":["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AO,CAAC,iBAAiB,EACrC,qBAAqB,EAAE,qBAAqB,GAC3C,CACkB,CACrB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CACN,oBAAC,mBAAmB,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAC,gBAAgB,IACxE,UAAU,CACU,CACtB,CAAC;IACH,CAAC;CACD","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n * This is a list of workspaces that the user can click on, loading them.\n */\nimport React from \"react\";\nimport Workspace from \"./Workspace\";\nimport { Actions } from \"../stores/workspaceManagementMenuStore\";\nimport { FinsembleDraggable } from \"../../../legacyControls/FinsembleDraggable\";\nimport { FinsembleDnDContext } from \"../../../legacyControls/FinsembleDnDContext\";\nimport { Workspace as WorkspaceType } from \"@finsemble/finsemble-api/types/common/workspace\";\n\ninterface IProps {\n\tisSwitchingWorkspaces: boolean;\n\tactiveWorkspace: WorkspaceType;\n\tworkspaces: WorkspaceType[];\n}\n\ntype ReorderType = {\n\toldIndex: number;\n\tnewIndex: number;\n};\nexport default class WorkspaceList extends React.Component<IProps> {\n\tconstructor(props: IProps) {\n\t\tsuper(props);\n\t\tthis.onDragEnd = this.onDragEnd.bind(this);\n\t}\n\n\tonDragEnd({ oldIndex, newIndex }: ReorderType) {\n\t\tActions.reorderWorkspaceList({ oldIndex, newIndex });\n\t}\n\n\trender() {\n\t\tconst { isSwitchingWorkspaces, activeWorkspace } = this.props;\n\t\tlet workspaces = this.props.workspaces.map((workspace, i) => {\n\t\t\t// Separate array for each workspace. This way, the activeWorkspace can be rendered without a trashcan.\n\t\t\tlet isActiveWorkspace = workspace.name === activeWorkspace.name;\n\t\t\tconst dragHandle = { iconClass: \"ff-adp-hamburger\" };\n\n\t\t\treturn (\n\t\t\t\t<FinsembleDraggable index={i} key={i} draggableId={workspace.name}>\n\t\t\t\t\t<Workspace\n\t\t\t\t\t\tkey={i}\n\t\t\t\t\t\tisActiveWorkspace={isActiveWorkspace}\n\t\t\t\t\t\tdragHandle={dragHandle}\n\t\t\t\t\t\tworkspace={workspace}\n\t\t\t\t\t\tmainAction={Actions.switchToWorkspace}\n\t\t\t\t\t\tisSwitchingWorkspaces={isSwitchingWorkspaces}\n\t\t\t\t\t/>\n\t\t\t\t</FinsembleDraggable>\n\t\t\t);\n\t\t});\n\n\t\treturn (\n\t\t\t<FinsembleDnDContext onDragEnd={this.onDragEnd} className=\"workspace-list\">\n\t\t\t\t{workspaces}\n\t\t\t</FinsembleDnDContext>\n\t\t);\n\t}\n}\n"]}
|
package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import StoreModel from "@finsemble/finsemble-
|
|
2
|
-
import { StandardCallback } from "@finsemble/finsemble-
|
|
3
|
-
import { Workspace as WorkspaceType } from "@finsemble/finsemble-
|
|
4
|
-
import { types } from "@finsemble/finsemble-
|
|
1
|
+
import StoreModel from "@finsemble/finsemble-api/types/clients/StoreModel";
|
|
2
|
+
import { StandardCallback } from "@finsemble/finsemble-api/types/types";
|
|
3
|
+
import { Workspace as WorkspaceType } from "@finsemble/finsemble-api/types/common/workspace";
|
|
4
|
+
import { types } from "@finsemble/finsemble-api";
|
|
5
5
|
declare type StandardErrorCallback = types.StandardErrorCallback;
|
|
6
6
|
declare type UserInputResponseType = {
|
|
7
7
|
choice: string;
|