@finsemble/finsemble-ui 6.6.3 → 7.0.0-beta-X
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 -43
- package/react/actions/favoriteActions.d.ts +1 -0
- package/react/actions/favoriteActions.js +1 -0
- package/react/actions/favoriteActions.js.map +1 -1
- package/react/actions/menuActions.d.ts +1 -0
- package/react/actions/menuActions.js +1 -0
- package/react/actions/menuActions.js.map +1 -1
- package/react/actions/rootActions.d.ts +1 -0
- package/react/actions/rootActions.js +1 -0
- package/react/actions/rootActions.js.map +1 -1
- package/react/actions/searchActions.d.ts +1 -0
- package/react/actions/searchActions.js +1 -0
- package/react/actions/searchActions.js.map +1 -1
- package/react/actions/toolbarActions.d.ts +34 -0
- package/react/actions/toolbarActions.js +17 -0
- package/react/actions/toolbarActions.js.map +1 -1
- package/react/actions/workspaceActions.d.ts +1 -0
- package/react/actions/workspaceActions.js +1 -0
- package/react/actions/workspaceActions.js.map +1 -1
- package/react/assets/css/advancedAppLauncher.css +22 -19
- package/react/assets/css/appCatalog.css +67 -72
- package/react/assets/css/authentication.css +4 -3
- package/react/assets/css/button.css +4 -11
- package/react/assets/css/core/formElements.css +1 -1
- package/react/assets/css/core/icons.css +3 -2
- package/react/assets/css/core/notifications.css +2 -2
- package/react/assets/css/core/windowFrame.css +9 -9
- package/react/assets/css/dashbar.css +1 -1
- package/react/assets/css/defaultTheme.css +9 -53
- package/react/assets/css/dialogs.css +13 -11
- package/react/assets/css/favorites.css +3 -48
- package/react/assets/css/finsemble.css +6 -2
- package/react/assets/css/font-finance.css +233 -120
- package/react/assets/css/fonts/Open_Sans/OpenSans-Definition.css +10 -10
- package/react/assets/css/linkerWindow.css +15 -3
- package/react/assets/css/menus.css +12 -12
- package/react/assets/css/notificationsCenter.css +49 -33
- package/react/assets/css/processMonitor.css +7 -4
- package/react/assets/css/search.css +1 -1
- package/react/assets/css/shared/animations.css +10 -4
- package/react/assets/css/shared/common.css +40 -0
- package/react/assets/css/tags.css +10 -10
- package/react/assets/css/toolbar.css +22 -19
- package/react/assets/css/userPreferences.css +29 -26
- package/react/assets/css/windowTitleBar.css +86 -40
- package/react/assets/icons/server.svg +26 -0
- package/react/componentTemplateGenerator.js +3 -2
- package/react/componentTemplateGenerator.js.map +1 -1
- package/react/components/FinsembleProvider.d.ts +7 -0
- package/react/components/FinsembleProvider.js +2 -0
- package/react/components/FinsembleProvider.js.map +1 -1
- package/react/components/appCatalog/AppCatalog.d.ts +4 -0
- package/react/components/appCatalog/AppCatalog.js +4 -0
- package/react/components/appCatalog/AppCatalog.js.map +1 -1
- package/react/components/appCatalog/AppCatalogComponent.d.ts +58 -0
- package/react/components/appCatalog/AppCatalogComponent.js +70 -1
- package/react/components/appCatalog/AppCatalogComponent.js.map +1 -1
- package/react/components/appCatalog/components/AppCard.d.ts +35 -0
- package/react/components/appCatalog/components/AppCard.js +42 -0
- package/react/components/appCatalog/components/AppCard.js.map +1 -1
- package/react/components/appCatalog/components/AppResults.d.ts +10 -0
- package/react/components/appCatalog/components/AppResults.js +24 -0
- package/react/components/appCatalog/components/AppResults.js.map +1 -1
- package/react/components/appCatalog/components/Carousel.d.ts +26 -0
- package/react/components/appCatalog/components/Carousel.js +34 -0
- package/react/components/appCatalog/components/Carousel.js.map +1 -1
- package/react/components/appCatalog/components/EmptyResults.d.ts +4 -0
- package/react/components/appCatalog/components/EmptyResults.js +8 -0
- package/react/components/appCatalog/components/EmptyResults.js.map +1 -1
- package/react/components/appCatalog/components/Hero.d.ts +15 -0
- package/react/components/appCatalog/components/Hero.js +15 -0
- package/react/components/appCatalog/components/Hero.js.map +1 -1
- package/react/components/appCatalog/components/Home.d.ts +6 -4
- package/react/components/appCatalog/components/Home.js +10 -0
- package/react/components/appCatalog/components/Home.js.map +1 -1
- package/react/components/appCatalog/components/SearchBar.d.ts +31 -0
- package/react/components/appCatalog/components/SearchBar.js +33 -0
- package/react/components/appCatalog/components/SearchBar.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDescription.d.ts +5 -0
- package/react/components/appCatalog/components/Showcase/AppDescription.js +9 -0
- package/react/components/appCatalog/components/Showcase/AppDescription.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppDevNotes.d.ts +7 -0
- package/react/components/appCatalog/components/Showcase/AppDevNotes.js +15 -0
- package/react/components/appCatalog/components/Showcase/AppDevNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/AppShowcase.d.ts +17 -0
- package/react/components/appCatalog/components/Showcase/AppShowcase.js +25 -0
- package/react/components/appCatalog/components/Showcase/AppShowcase.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Header.d.ts +7 -0
- package/react/components/appCatalog/components/Showcase/Header.js +12 -0
- package/react/components/appCatalog/components/Showcase/Header.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/ImageCarousel.d.ts +7 -0
- package/react/components/appCatalog/components/Showcase/ImageCarousel.js +11 -0
- package/react/components/appCatalog/components/Showcase/ImageCarousel.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/Modal.d.ts +10 -0
- package/react/components/appCatalog/components/Showcase/Modal.js +10 -0
- package/react/components/appCatalog/components/Showcase/Modal.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/ReleaseNotes.d.ts +5 -0
- package/react/components/appCatalog/components/Showcase/ReleaseNotes.js +9 -0
- package/react/components/appCatalog/components/Showcase/ReleaseNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/SupportNotes.d.ts +6 -0
- package/react/components/appCatalog/components/Showcase/SupportNotes.js +11 -0
- package/react/components/appCatalog/components/Showcase/SupportNotes.js.map +1 -1
- package/react/components/appCatalog/components/Showcase/VersionNotes.d.ts +5 -0
- package/react/components/appCatalog/components/Showcase/VersionNotes.js +9 -0
- package/react/components/appCatalog/components/Showcase/VersionNotes.js.map +1 -1
- package/react/components/appCatalog/components/Tag.d.ts +6 -0
- package/react/components/appCatalog/components/Tag.js +10 -0
- package/react/components/appCatalog/components/Tag.js.map +1 -1
- package/react/components/appCatalog/components/Toast.d.ts +5 -0
- package/react/components/appCatalog/components/Toast.js +9 -0
- package/react/components/appCatalog/components/Toast.js.map +1 -1
- package/react/components/appCatalog/components/helpers.js +1 -0
- package/react/components/appCatalog/components/helpers.js.map +1 -1
- package/react/components/appCatalog/modules/AppDirectory.d.ts +5 -0
- package/react/components/appCatalog/modules/AppDirectory.js +5 -0
- package/react/components/appCatalog/modules/AppDirectory.js.map +1 -1
- package/react/components/appCatalog/modules/FDC3.d.ts +37 -0
- package/react/components/appCatalog/modules/FDC3.js +40 -0
- package/react/components/appCatalog/modules/FDC3.js.map +1 -1
- package/react/components/appCatalog/stores/appStore.js +1 -0
- package/react/components/appCatalog/stores/appStore.js.map +1 -1
- package/react/components/appCatalog/stores/storeActions.d.ts +91 -0
- package/react/components/appCatalog/stores/storeActions.js +116 -1
- package/react/components/appCatalog/stores/storeActions.js.map +1 -1
- package/react/components/common/ButtonIcon.js +1 -1
- package/react/components/common/ButtonIcon.js.map +1 -1
- package/react/components/common/ButtonRow.js +2 -2
- package/react/components/common/ButtonRow.js.map +1 -1
- package/react/components/common/Checkbox.d.ts +1 -0
- package/react/components/common/Checkbox.js +3 -3
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/ColorPicker.d.ts +5 -0
- package/react/components/common/ColorPicker.js +56 -15
- package/react/components/common/ColorPicker.js.map +1 -1
- package/react/components/common/DropZone.d.ts +11 -0
- package/react/components/common/DropZone.js +21 -1
- package/react/components/common/DropZone.js.map +1 -1
- package/react/components/common/DropdownButton.d.ts +4 -0
- package/react/components/common/DropdownButton.js +4 -0
- package/react/components/common/DropdownButton.js.map +1 -1
- package/react/components/common/ErrorBoundary.d.ts +34 -0
- package/react/components/common/ErrorBoundary.js +43 -0
- package/react/components/common/ErrorBoundary.js.map +1 -0
- package/react/components/common/FileInput.d.ts +8 -1
- package/react/components/common/FileInput.js +19 -4
- package/react/components/common/FileInput.js.map +1 -1
- package/react/components/common/FinsembleIcon.d.ts +13 -2
- package/react/components/common/FinsembleIcon.js +61 -5
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleLink.d.ts +6 -0
- package/react/components/common/FinsembleLink.js +12 -0
- package/react/components/common/FinsembleLink.js.map +1 -0
- package/react/components/common/FinsembleSelect.js +5 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/FinsembleToggle.d.ts +1 -2
- package/react/components/common/FinsembleToggle.js +2 -6
- package/react/components/common/FinsembleToggle.js.map +1 -1
- package/react/components/common/FinsembleToggleButtonBar.d.ts +13 -0
- package/react/components/common/FinsembleToggleButtonBar.js +44 -0
- package/react/components/common/FinsembleToggleButtonBar.js.map +1 -0
- package/react/components/common/InputTable.d.ts +10 -3
- package/react/components/common/InputTable.js +20 -13
- package/react/components/common/InputTable.js.map +1 -1
- package/react/components/common/Tab.js +36 -5
- package/react/components/common/Tab.js.map +1 -1
- package/react/components/common/TimeSelect.js +34 -3
- package/react/components/common/TimeSelect.js.map +1 -1
- package/react/components/common/Tooltip.js +2 -0
- package/react/components/common/Tooltip.js.map +1 -1
- package/react/components/common/css/FinsembleToggle.css +22 -0
- package/react/components/common/css/accordion.css +9 -6
- package/react/components/common/css/application-edit-page.css +48 -45
- package/react/components/common/css/button.css +10 -5
- package/react/components/common/css/color-picker.css +3 -3
- package/react/components/common/css/drop-zone.css +2 -6
- package/react/components/common/css/file-input.css +5 -5
- package/react/components/common/css/header.css +3 -2
- package/react/components/common/css/icon.css +1 -1
- package/react/components/common/css/loading-spinner.css +7 -12
- package/react/components/common/css/selector.css +4 -4
- package/react/components/common/css/styles.css +22 -16
- package/react/components/common/css/tab.css +14 -14
- package/react/components/common/css/time-select.css +2 -1
- package/react/components/common/css/toggle.css +4 -12
- package/react/components/common/css/tooltip.css +2 -3
- package/react/components/common/file_helpers.js +2 -0
- package/react/components/common/file_helpers.js.map +1 -1
- package/react/components/common/helpers.js +12 -1
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ColorPicker.stories.js +9 -11
- package/react/components/common/stories/ColorPicker.stories.js.map +1 -1
- package/react/components/common/stories/FileInput.stories.d.ts +3 -1
- package/react/components/common/stories/FileInput.stories.js +12 -0
- package/react/components/common/stories/FileInput.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggle.stories.d.ts +1 -2
- package/react/components/common/stories/FinsembleToggle.stories.js +0 -7
- package/react/components/common/stories/FinsembleToggle.stories.js.map +1 -1
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.d.ts +14 -0
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.js +97 -0
- package/react/components/common/stories/FinsembleToggleButtonBar.stories.js.map +1 -0
- package/react/components/common/stories/InputTable.stories.d.ts +4 -3
- package/react/components/common/stories/InputTable.stories.js +18 -8
- package/react/components/common/stories/InputTable.stories.js.map +1 -1
- package/react/components/common/tests/Accordion.spec.js +6 -0
- package/react/components/common/tests/Accordion.spec.js.map +1 -1
- package/react/components/common/tests/ButtonRow.spec.js +5 -0
- package/react/components/common/tests/ButtonRow.spec.js.map +1 -1
- package/react/components/common/tests/Checkbox.spec.js +1 -0
- package/react/components/common/tests/Checkbox.spec.js.map +1 -1
- package/react/components/common/tests/ColorPicker.spec.js +6 -0
- package/react/components/common/tests/ColorPicker.spec.js.map +1 -1
- package/react/components/common/tests/DropZone.spec.js +1 -0
- package/react/components/common/tests/DropZone.spec.js.map +1 -1
- package/react/components/common/tests/FileInput.spec.js +22 -0
- package/react/components/common/tests/FileInput.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleSelect.spec.js +1 -0
- package/react/components/common/tests/FinsembleSelect.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggle.spec.js +2 -6
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.d.ts +1 -0
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +41 -0
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.js.map +1 -0
- package/react/components/common/tests/InputTable.spec.js +3 -3
- package/react/components/common/tests/InputTable.spec.js.map +1 -1
- package/react/components/common/tests/TimeSelect.spec.js +4 -0
- package/react/components/common/tests/TimeSelect.spec.js.map +1 -1
- package/react/components/common/tests/Tooltip.spec.js +16 -0
- package/react/components/common/tests/Tooltip.spec.js.map +1 -1
- package/react/components/favorites/FavoriteMaker.d.ts +8 -0
- package/react/components/favorites/FavoriteMaker.js +10 -1
- package/react/components/favorites/FavoriteMaker.js.map +1 -1
- package/react/components/favorites/FavoritesShell.d.ts +4 -0
- package/react/components/favorites/FavoritesShell.js +13 -1
- package/react/components/favorites/FavoritesShell.js.map +1 -1
- package/react/components/favorites/FavoritesShell.spec.js +3 -0
- package/react/components/favorites/FavoritesShell.spec.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverContainer.js +12 -7
- package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.css +16 -3
- package/react/components/fdc3Resolver/ResolverDialog.js +7 -2
- package/react/components/fdc3Resolver/ResolverDialog.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.spec.js +3 -2
- package/react/components/fdc3Resolver/ResolverDialog.spec.js.map +1 -1
- package/react/components/fdc3Resolver/ResolverDialog.stories.js +2 -0
- package/react/components/fdc3Resolver/ResolverDialog.stories.js.map +1 -1
- package/react/components/icon/Icon.d.ts +14 -1
- package/react/components/icon/Icon.js +42 -1
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialog.d.ts +4 -0
- package/react/components/legacyControls/FinsembleDialog.js +16 -1
- package/react/components/legacyControls/FinsembleDialog.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogButton.d.ts +3 -0
- package/react/components/legacyControls/FinsembleDialogButton.js +6 -1
- package/react/components/legacyControls/FinsembleDialogButton.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogQuestion.d.ts +7 -0
- package/react/components/legacyControls/FinsembleDialogQuestion.js +7 -0
- package/react/components/legacyControls/FinsembleDialogQuestion.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialogTextInput.d.ts +3 -0
- package/react/components/legacyControls/FinsembleDialogTextInput.js +14 -0
- package/react/components/legacyControls/FinsembleDialogTextInput.js.map +1 -1
- package/react/components/legacyControls/FinsembleDnDContext.d.ts +19 -0
- package/react/components/legacyControls/FinsembleDnDContext.js +133 -8
- package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
- package/react/components/legacyControls/FinsembleDraggable.d.ts +3 -0
- package/react/components/legacyControls/FinsembleDraggable.js +3 -0
- package/react/components/legacyControls/FinsembleDraggable.js.map +1 -1
- package/react/components/legacyControls/FinsembleHoverDetector.d.ts +15 -0
- package/react/components/legacyControls/FinsembleHoverDetector.js +26 -1
- package/react/components/legacyControls/FinsembleHoverDetector.js.map +1 -1
- package/react/components/legacyControls/FinsembleMenuSection.d.ts +4 -0
- package/react/components/legacyControls/FinsembleMenuSection.js +38 -0
- package/react/components/legacyControls/FinsembleMenuSection.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js +1 -0
- package/react/components/legacyControls/tests/FinsembleDialogButton.spec.js.map +1 -1
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js +1 -0
- package/react/components/legacyControls/tests/FinsembleDialogTextInput.spec.js.map +1 -1
- package/react/components/linker/LinkerMenu.d.ts +3 -0
- package/react/components/linker/LinkerMenu.js +21 -0
- package/react/components/linker/LinkerMenu.js.map +1 -1
- package/react/components/linker/LinkerMenuDeprecated.d.ts +3 -0
- package/react/components/linker/LinkerMenuDeprecated.js +9 -0
- package/react/components/linker/LinkerMenuDeprecated.js.map +1 -1
- package/react/components/linker/remoteRedux.js +1 -0
- package/react/components/linker/remoteRedux.js.map +1 -1
- package/react/components/menu/Menu.d.ts +15 -0
- package/react/components/menu/Menu.js +15 -0
- package/react/components/menu/Menu.js.map +1 -1
- package/react/components/menu/MenuAutoResizer.d.ts +7 -0
- package/react/components/menu/MenuAutoResizer.js +27 -0
- package/react/components/menu/MenuAutoResizer.js.map +1 -1
- package/react/components/menu/MenuContent.d.ts +4 -0
- package/react/components/menu/MenuContent.js +4 -0
- package/react/components/menu/MenuContent.js.map +1 -1
- package/react/components/menu/MenuHotKey.d.ts +14 -0
- package/react/components/menu/MenuHotKey.js +15 -0
- package/react/components/menu/MenuHotKey.js.map +1 -1
- package/react/components/menu/MenuItem.d.ts +8 -0
- package/react/components/menu/MenuItem.js +13 -2
- package/react/components/menu/MenuItem.js.map +1 -1
- package/react/components/menu/MenuPortal.js +125 -24
- package/react/components/menu/MenuPortal.js.map +1 -1
- package/react/components/menu/MenuShell.d.ts +16 -0
- package/react/components/menu/MenuShell.js +26 -0
- package/react/components/menu/MenuShell.js.map +1 -1
- package/react/components/menu/MenuToggle.d.ts +3 -0
- package/react/components/menu/MenuToggle.js +5 -2
- package/react/components/menu/MenuToggle.js.map +1 -1
- package/react/components/menu/keyboardNavigation.d.ts +13 -22
- package/react/components/menu/keyboardNavigation.js +165 -160
- package/react/components/menu/keyboardNavigation.js.map +1 -1
- package/react/components/menu/menuContext.d.ts +6 -0
- package/react/components/menu/menuContext.js +6 -0
- package/react/components/menu/menuContext.js.map +1 -1
- package/react/components/menu/menuHelpers.d.ts +22 -0
- package/react/components/menu/menuHelpers.js +58 -1
- package/react/components/menu/menuHelpers.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerControls.js +47 -25
- package/react/components/notifications/components/drawer/DrawerControls.js.map +1 -1
- package/react/components/notifications/components/drawer/DrawerHeader.js +5 -0
- package/react/components/notifications/components/drawer/DrawerHeader.js.map +1 -1
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js +37 -6
- package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js +3 -0
- package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
- package/react/components/notifications/components/shared/CheckButton.js +19 -8
- package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
- package/react/components/notifications/components/shared/NotificationCardShell.d.ts +9 -0
- package/react/components/notifications/components/shared/NotificationCardShell.js +15 -7
- package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
- package/react/components/notifications/components/shared/OverflowMenu.d.ts +4 -0
- package/react/components/notifications/components/shared/OverflowMenu.js +16 -2
- package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js +2 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js +2 -1
- package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
- package/react/components/notifications/components/views/CardView.js +8 -3
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +11 -1
- package/react/components/notifications/components/views/ListView.js.map +1 -1
- package/react/components/notifications/notificationsContext.d.ts +4 -0
- package/react/components/notifications/notificationsContext.js +4 -0
- package/react/components/notifications/notificationsContext.js.map +1 -1
- package/react/components/notifications/types.d.ts +6 -0
- package/react/components/notifications/types.js.map +1 -1
- package/react/components/notifications/utils.d.ts +4 -0
- package/react/components/notifications/utils.js +4 -0
- package/react/components/notifications/utils.js.map +1 -1
- package/react/components/processMonitor/ProcessMonitor.d.ts +3 -0
- package/react/components/processMonitor/ProcessMonitor.js +21 -3
- package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
- package/react/components/processMonitor/components/ChildWindow.d.ts +3 -0
- package/react/components/processMonitor/components/ChildWindow.js +5 -0
- package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
- package/react/components/processMonitor/components/ListHeader.d.ts +5 -0
- package/react/components/processMonitor/components/ListHeader.js +7 -0
- package/react/components/processMonitor/components/ListHeader.js.map +1 -1
- package/react/components/processMonitor/components/ProcessStatistics.js +12 -3
- package/react/components/processMonitor/components/ProcessStatistics.js.map +1 -1
- package/react/components/processMonitor/constants.js +6 -0
- package/react/components/processMonitor/constants.js.map +1 -1
- package/react/components/processMonitor/helpers.d.ts +13 -0
- package/react/components/processMonitor/helpers.js +27 -6
- package/react/components/processMonitor/helpers.js.map +1 -1
- package/react/components/processMonitor/helpers.spec.js +7 -3
- package/react/components/processMonitor/helpers.spec.js.map +1 -1
- package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +39 -0
- package/react/components/processMonitor/stores/ProcessMonitorStore.js +50 -0
- package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
- package/react/components/quickComponentForm/QuickComponentForm.d.ts +3 -0
- package/react/components/quickComponentForm/QuickComponentForm.js +20 -0
- package/react/components/quickComponentForm/QuickComponentForm.js.map +1 -1
- package/react/components/quickComponentForm/quickComponent.css +1 -1
- package/react/components/sdd/AddApp.d.ts +7 -4
- package/react/components/sdd/AddApp.js +144 -34
- package/react/components/sdd/AddApp.js.map +1 -1
- package/react/components/sdd/AppEditAccess.d.ts +4 -3
- package/react/components/sdd/AppEditAccess.js +8 -0
- package/react/components/sdd/AppEditAccess.js.map +1 -1
- package/react/components/sdd/AppEditPage.d.ts +6 -4
- package/react/components/sdd/AppEditPage.js +205 -393
- package/react/components/sdd/AppEditPage.js.map +1 -1
- package/react/components/sdd/Appearance.css +1 -1
- package/react/components/sdd/Appearance.d.ts +2 -1
- package/react/components/sdd/Appearance.js +18 -7
- package/react/components/sdd/Appearance.js.map +1 -1
- package/react/components/sdd/Application.d.ts +5 -4
- package/react/components/sdd/Application.js +94 -44
- package/react/components/sdd/Application.js.map +1 -1
- package/react/components/sdd/Applications.d.ts +12 -11
- package/react/components/sdd/Applications.js +110 -15
- package/react/components/sdd/Applications.js.map +1 -1
- package/react/components/sdd/AssetsPage.css +3 -3
- package/react/components/sdd/Authentication.js +1 -6
- package/react/components/sdd/Authentication.js.map +1 -1
- package/react/components/sdd/AuthenticationProviderConfig.js +5 -3
- package/react/components/sdd/AuthenticationProviderConfig.js.map +1 -1
- package/react/components/sdd/EditPreload.d.ts +4 -3
- package/react/components/sdd/EditPreload.js +49 -22
- package/react/components/sdd/EditPreload.js.map +1 -1
- package/react/components/sdd/Export.d.ts +7 -6
- package/react/components/sdd/Export.js +4 -3
- package/react/components/sdd/Export.js.map +1 -1
- package/react/components/sdd/ExportCloud.js +4 -0
- package/react/components/sdd/ExportCloud.js.map +1 -1
- package/react/components/sdd/GettingStarted.js +3 -3
- package/react/components/sdd/GettingStarted.js.map +1 -1
- package/react/components/sdd/Navigation.js +28 -4
- package/react/components/sdd/Navigation.js.map +1 -1
- package/react/components/sdd/OptionalSettingsView.d.ts +6 -5
- package/react/components/sdd/OptionalSettingsView.js +2 -10
- package/react/components/sdd/OptionalSettingsView.js.map +1 -1
- package/react/components/sdd/ProjectErrors.js +1 -1
- package/react/components/sdd/ProjectErrors.js.map +1 -1
- package/react/components/sdd/Publish.js +4 -2
- package/react/components/sdd/Publish.js.map +1 -1
- package/react/components/sdd/PublishProgress.js +11 -1
- package/react/components/sdd/PublishProgress.js.map +1 -1
- package/react/components/sdd/SmartDesktopDesigner.d.ts +17 -16
- package/react/components/sdd/SmartDesktopDesigner.js +54 -34
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
- package/react/components/sdd/ThemePage.css +6 -23
- package/react/components/sdd/ThemePage.js +8 -5
- package/react/components/sdd/ThemePage.js.map +1 -1
- package/react/components/sdd/Themes.d.ts +2 -1
- package/react/components/sdd/Themes.js +4 -2
- package/react/components/sdd/Themes.js.map +1 -1
- package/react/components/sdd/Toolbar.d.ts +5 -4
- package/react/components/sdd/Toolbar.js +18 -9
- package/react/components/sdd/Toolbar.js.map +1 -1
- package/react/components/sdd/appEditPage/Behavior.d.ts +34 -0
- package/react/components/sdd/appEditPage/Behavior.js +134 -0
- package/react/components/sdd/appEditPage/Behavior.js.map +1 -0
- package/react/components/sdd/appEditPage/Component.d.ts +22 -0
- package/react/components/sdd/appEditPage/Component.js +76 -0
- package/react/components/sdd/appEditPage/Component.js.map +1 -0
- package/react/components/sdd/appEditPage/DebugToolkit.d.ts +9 -0
- package/react/components/sdd/appEditPage/DebugToolkit.js +20 -0
- package/react/components/sdd/appEditPage/DebugToolkit.js.map +1 -0
- package/react/components/sdd/appEditPage/Interop.d.ts +10 -0
- package/react/components/sdd/appEditPage/Interop.js +40 -0
- package/react/components/sdd/appEditPage/Interop.js.map +1 -0
- package/react/components/sdd/appEditPage/Position.d.ts +18 -0
- package/react/components/sdd/appEditPage/Position.js +72 -0
- package/react/components/sdd/appEditPage/Position.js.map +1 -0
- package/react/components/sdd/appEditPage/Preloads.d.ts +9 -0
- package/react/components/sdd/appEditPage/Preloads.js +16 -0
- package/react/components/sdd/appEditPage/Preloads.js.map +1 -0
- package/react/components/sdd/appEditPage/SelectConnect.d.ts +15 -0
- package/react/components/sdd/appEditPage/SelectConnect.js +28 -0
- package/react/components/sdd/appEditPage/SelectConnect.js.map +1 -0
- package/react/components/sdd/appEditPage/Workspace.d.ts +12 -0
- package/react/components/sdd/appEditPage/Workspace.js +30 -0
- package/react/components/sdd/appEditPage/Workspace.js.map +1 -0
- package/react/components/sdd/common/getCSSVars.js +7 -2
- package/react/components/sdd/common/getCSSVars.js.map +1 -1
- package/react/components/sdd/common/setPreloadDefaults.d.ts +1 -1
- package/react/components/sdd/common/setPreloadDefaults.js +9 -4
- package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
- package/react/components/sdd/common/views.js +7 -4
- package/react/components/sdd/common/views.js.map +1 -1
- package/react/components/sdd/css/addApp.css +65 -0
- package/react/components/sdd/css/appearance.css +6 -0
- package/react/components/sdd/css/applications.css +27 -34
- package/react/components/sdd/css/authentication.css +7 -6
- package/react/components/sdd/css/buttons.css +1 -1
- package/react/components/sdd/css/export.css +5 -3
- package/react/components/sdd/css/getting-started.css +2 -2
- package/react/components/sdd/css/nav.css +11 -14
- package/react/components/sdd/css/project-header.css +5 -7
- package/react/components/sdd/css/styles.css +29 -23
- package/react/components/sdd/css/views.css +4 -3
- package/react/components/sdd/fixtures/apps.js +12 -0
- package/react/components/sdd/fixtures/apps.js.map +1 -1
- package/react/components/sdd/fixtures/authenticationProps.js +15 -1
- package/react/components/sdd/fixtures/authenticationProps.js.map +1 -1
- package/react/components/sdd/fixtures/configTemplate.js +1 -0
- package/react/components/sdd/fixtures/configTemplate.js.map +1 -1
- package/react/components/sdd/fixtures/preloads.js +14 -12
- package/react/components/sdd/fixtures/preloads.js.map +1 -1
- package/react/components/sdd/fixtures/publishProgress.js +40 -0
- package/react/components/sdd/fixtures/publishProgress.js.map +1 -1
- package/react/components/sdd/sdd_helpers.d.ts +6 -0
- package/react/components/sdd/sdd_helpers.js +6 -0
- package/react/components/sdd/sdd_helpers.js.map +1 -1
- package/react/components/sdd/smartDesktopClient.d.ts +466 -0
- package/react/components/sdd/smartDesktopClient.js +906 -0
- package/react/components/sdd/smartDesktopClient.js.map +1 -0
- package/react/components/sdd/smartDesktopClient.spec.d.ts +1 -0
- package/react/components/sdd/smartDesktopClient.spec.js +64 -0
- package/react/components/sdd/smartDesktopClient.spec.js.map +1 -0
- package/react/components/sdd/stories/AddApp.stories.d.ts +11 -0
- package/react/components/sdd/stories/AddApp.stories.js +26 -0
- package/react/components/sdd/stories/AddApp.stories.js.map +1 -0
- package/react/components/sdd/stories/AppEditPage.stories.d.ts +5 -1
- package/react/components/sdd/stories/AppEditPage.stories.js +5 -0
- package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/sdd/stories/Appearance.stories.d.ts +1 -1
- package/react/components/sdd/stories/Appearance.stories.js +2 -0
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
- package/react/components/sdd/stories/Authentication.stories.js +2 -16
- package/react/components/sdd/stories/Authentication.stories.js.map +1 -1
- package/react/components/sdd/stories/OptionalSettingsView.stories.js +1 -1
- package/react/components/sdd/stories/OptionalSettingsView.stories.js.map +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.d.ts +1 -1
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js +3 -0
- package/react/components/sdd/stories/SmartDesktopDesigner.stories.js.map +1 -1
- package/react/components/sdd/stories/Themes.stories.d.ts +1 -1
- package/react/components/sdd/stories/Themes.stories.js +1 -0
- package/react/components/sdd/stories/Themes.stories.js.map +1 -1
- package/react/components/sdd/tests/AddApp.spec.d.ts +1 -0
- package/react/components/sdd/tests/AddApp.spec.js +133 -0
- package/react/components/sdd/tests/AddApp.spec.js.map +1 -0
- package/react/components/sdd/tests/AppEditPage.spec.js +108 -23
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/sdd/tests/Application.spec.js +351 -369
- package/react/components/sdd/tests/Application.spec.js.map +1 -1
- package/react/components/sdd/tests/Applications.spec.d.ts +1 -1
- package/react/components/sdd/tests/Applications.spec.js +30 -50
- package/react/components/sdd/tests/Applications.spec.js.map +1 -1
- package/react/components/sdd/tests/Authentication.spec.js +8 -1
- package/react/components/sdd/tests/Authentication.spec.js.map +1 -1
- package/react/components/sdd/tests/ContentHeader.spec.js +2 -0
- package/react/components/sdd/tests/ContentHeader.spec.js.map +1 -1
- package/react/components/sdd/tests/EditPreload.spec.js +63 -7
- package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
- package/react/components/sdd/tests/Export.spec.js +8 -1
- package/react/components/sdd/tests/Export.spec.js.map +1 -1
- package/react/components/sdd/tests/ItemList.spec.js +4 -0
- package/react/components/sdd/tests/ItemList.spec.js.map +1 -1
- package/react/components/sdd/tests/Navigation.spec.js +2 -2
- package/react/components/sdd/tests/Navigation.spec.js.map +1 -1
- package/react/components/sdd/tests/OptionalSettingsView.spec.js +264 -0
- package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
- package/react/components/sdd/tests/ProjectErrors.spec.js +3 -1
- package/react/components/sdd/tests/ProjectErrors.spec.js.map +1 -1
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js +2 -2
- package/react/components/sdd/tests/SmartDesktopDesigner.spec.js.map +1 -1
- package/react/components/sdd/tests/Themes.spec.js +1 -1
- package/react/components/sdd/tests/Themes.spec.js.map +1 -1
- package/react/components/sdd/tests/Toolbar.spec.js +53 -0
- package/react/components/sdd/tests/Toolbar.spec.js.map +1 -1
- package/react/components/sdd/tests/a11y_helper.js +8 -0
- package/react/components/sdd/tests/a11y_helper.js.map +1 -1
- package/react/components/search/Highlight.d.ts +6 -0
- package/react/components/search/Highlight.js +19 -0
- package/react/components/search/Highlight.js.map +1 -1
- package/react/components/search/Highlight.stories.js +1 -1
- package/react/components/search/Highlight.stories.js.map +1 -1
- package/react/components/search/Search.js +1 -1
- package/react/components/search/Search.js.map +1 -1
- package/react/components/search/SearchBestMatch.d.ts +4 -0
- package/react/components/search/SearchBestMatch.js +11 -0
- package/react/components/search/SearchBestMatch.js.map +1 -1
- package/react/components/search/SearchInput.d.ts +5 -0
- package/react/components/search/SearchInput.js +6 -0
- package/react/components/search/SearchInput.js.map +1 -1
- package/react/components/search/SearchProviderResults.js +2 -0
- package/react/components/search/SearchProviderResults.js.map +1 -1
- package/react/components/search/SearchResult.d.ts +5 -0
- package/react/components/search/SearchResult.js +6 -0
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/search/SearchResult.spec.d.ts +1 -0
- package/react/components/search/SearchResult.spec.js +46 -0
- package/react/components/search/SearchResult.spec.js.map +1 -0
- package/react/components/search/SearchResult.stories.d.ts +16 -0
- package/react/components/search/SearchResult.stories.js +113 -0
- package/react/components/search/SearchResult.stories.js.map +1 -0
- package/react/components/search/SearchResults.js +5 -1
- package/react/components/search/SearchResults.js.map +1 -1
- package/react/components/search/SearchResults.spec.d.ts +1 -0
- package/react/components/search/SearchResults.spec.js +35 -0
- package/react/components/search/SearchResults.spec.js.map +1 -0
- package/react/components/search/SearchResults.stories.d.ts +11 -0
- package/react/components/search/SearchResults.stories.js +458 -0
- package/react/components/search/SearchResults.stories.js.map +1 -0
- package/react/components/shared/Animate.d.ts +5 -0
- package/react/components/shared/Animate.js +12 -1
- package/react/components/shared/Animate.js.map +1 -1
- package/react/components/shared/DefaultDropdownButton.js +26 -6
- package/react/components/shared/DefaultDropdownButton.js.map +1 -1
- package/react/components/shared/Tag.d.ts +0 -4
- package/react/components/shared/Tag.js +4 -0
- package/react/components/shared/Tag.js.map +1 -1
- package/react/components/shared/TagsMenu.d.ts +6 -0
- package/react/components/shared/TagsMenu.js +7 -0
- package/react/components/shared/TagsMenu.js.map +1 -1
- package/react/components/shared/addProtocolToValidURL.d.ts +6 -0
- package/react/components/shared/addProtocolToValidURL.js +6 -0
- package/react/components/shared/addProtocolToValidURL.js.map +1 -1
- package/react/components/shared/openQuitConfirmationDialog.d.ts +1 -1
- package/react/components/shared/openQuitConfirmationDialog.js +4 -4
- package/react/components/shared/openQuitConfirmationDialog.js.map +1 -1
- package/react/components/shared/tests/DefaultDropdownButton.spec.js +12 -0
- package/react/components/shared/tests/DefaultDropdownButton.spec.js.map +1 -1
- package/react/components/shared/tests/addProtocolToValidURL.spec.js +1 -0
- package/react/components/shared/tests/addProtocolToValidURL.spec.js.map +1 -1
- package/react/components/shared/validateURL.d.ts +18 -0
- package/react/components/shared/validateURL.js +24 -5
- package/react/components/shared/validateURL.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.css +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.d.ts +3 -0
- package/react/components/singleInputDialog/SingleInputDialog.js +46 -0
- package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
- package/react/components/singleInputDialog/SingleInputDialog.stories.js +2 -2
- package/react/components/singleInputDialog/SingleInputDialog.stories.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.d.ts +1 -16
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +5 -3
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
- package/react/components/system/System.d.ts +22 -0
- package/react/components/system/System.js +23 -1
- package/react/components/system/System.js.map +1 -1
- package/react/components/system/System.stories.js +1 -0
- package/react/components/system/System.stories.js.map +1 -1
- package/react/components/system/SystemTrayComponentShell.d.ts +6 -0
- package/react/components/system/SystemTrayComponentShell.js +9 -0
- package/react/components/system/SystemTrayComponentShell.js.map +1 -1
- package/react/components/toolbar/AutoArrange.d.ts +5 -0
- package/react/components/toolbar/AutoArrange.js +8 -1
- package/react/components/toolbar/AutoArrange.js.map +1 -1
- package/react/components/toolbar/AutoArrange.spec.js +10 -4
- package/react/components/toolbar/AutoArrange.spec.js.map +1 -1
- package/react/components/toolbar/AutoArrange.stories.js +1 -0
- package/react/components/toolbar/AutoArrange.stories.js.map +1 -1
- package/react/components/toolbar/DragHandle.d.ts +4 -0
- package/react/components/toolbar/DragHandle.js +11 -0
- package/react/components/toolbar/DragHandle.js.map +1 -1
- package/react/components/toolbar/DragHandle.spec.js +1 -0
- package/react/components/toolbar/DragHandle.spec.js.map +1 -1
- package/react/components/toolbar/DragHandle.stories.js +1 -0
- package/react/components/toolbar/DragHandle.stories.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.d.ts +4 -0
- package/react/components/toolbar/MinimizeAll.js +7 -1
- package/react/components/toolbar/MinimizeAll.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.spec.js +1 -0
- package/react/components/toolbar/MinimizeAll.spec.js.map +1 -1
- package/react/components/toolbar/MinimizeAll.stories.js +1 -0
- package/react/components/toolbar/MinimizeAll.stories.js.map +1 -1
- package/react/components/toolbar/NotificationControl.d.ts +5 -0
- package/react/components/toolbar/NotificationControl.js +8 -1
- package/react/components/toolbar/NotificationControl.js.map +1 -1
- package/react/components/toolbar/RevealAll.d.ts +4 -0
- package/react/components/toolbar/RevealAll.js +7 -1
- package/react/components/toolbar/RevealAll.js.map +1 -1
- package/react/components/toolbar/RevealAll.spec.js +1 -0
- package/react/components/toolbar/RevealAll.spec.js.map +1 -1
- package/react/components/toolbar/RevealAll.stories.js +1 -0
- package/react/components/toolbar/RevealAll.stories.js.map +1 -1
- package/react/components/toolbar/SddButton.d.ts +4 -0
- package/react/components/toolbar/SddButton.js +4 -0
- package/react/components/toolbar/SddButton.js.map +1 -1
- package/react/components/toolbar/ToolbarIcon.d.ts +4 -0
- package/react/components/toolbar/ToolbarIcon.js +6 -2
- package/react/components/toolbar/ToolbarIcon.js.map +1 -1
- package/react/components/toolbar/ToolbarSection.d.ts +8 -9
- package/react/components/toolbar/ToolbarSection.js +21 -7
- package/react/components/toolbar/ToolbarSection.js.map +1 -1
- package/react/components/toolbar/ToolbarShell.d.ts +5 -0
- package/react/components/toolbar/ToolbarShell.js +7 -0
- package/react/components/toolbar/ToolbarShell.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +16 -0
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js +20 -0
- package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.d.ts +52 -0
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js +58 -0
- package/react/components/toolbar/advancedAppLauncher/components/AddNewAppForm.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.d.ts +5 -0
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js +5 -0
- package/react/components/toolbar/advancedAppLauncher/components/AddNewFolder.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.d.ts +27 -0
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js +49 -0
- package/react/components/toolbar/advancedAppLauncher/components/AppActionsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.d.ts +13 -0
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js +14 -0
- package/react/components/toolbar/advancedAppLauncher/components/AppDefinition.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +5 -0
- package/react/components/toolbar/advancedAppLauncher/components/Content.js +19 -0
- package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.d.ts +4 -0
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js +4 -0
- package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +16 -0
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js +39 -0
- package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.d.ts +4 -0
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js +9 -0
- package/react/components/toolbar/advancedAppLauncher/components/LeftNavBottomLinks.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js +3 -0
- package/react/components/toolbar/advancedAppLauncher/components/SearchBox.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.d.ts +6 -0
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js +7 -0
- package/react/components/toolbar/advancedAppLauncher/components/TagsMenu.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.d.ts +5 -0
- package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js +5 -0
- package/react/components/toolbar/advancedAppLauncher/components/ToggleFavoriteDropdown.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.d.ts +5 -0
- package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js +5 -0
- package/react/components/toolbar/advancedAppLauncher/modules/AppDirectory.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.d.ts +37 -0
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js +40 -0
- package/react/components/toolbar/advancedAppLauncher/modules/FDC3.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.d.ts +3 -0
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js +83 -1
- package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.d.ts +10 -0
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js +12 -3
- package/react/components/toolbar/advancedAppLauncher/utils/sort-functions.js.map +1 -1
- package/react/components/toolbar/appLauncher/AppLauncherMenu.d.ts +18 -0
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js +20 -0
- package/react/components/toolbar/appLauncher/AppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.d.ts +9 -0
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js +12 -0
- package/react/components/toolbar/appLauncher/StaticAppLauncherMenu.js.map +1 -1
- package/react/components/toolbar/appLauncher/appLauncher.css +1 -1
- package/react/components/toolbar/appLauncher/components/componentList.d.ts +3 -0
- package/react/components/toolbar/appLauncher/components/componentList.js +17 -3
- package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +6 -0
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js +26 -0
- package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
- package/react/components/toolbar/dashbar/Dashbar.js +91 -15
- package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
- package/react/components/toolbar/dashbar/DashbarItem.js +5 -0
- package/react/components/toolbar/dashbar/DashbarItem.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +8 -1
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js +7 -0
- package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +17 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +21 -1
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.d.ts +26 -0
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js +29 -0
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceActions.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +6 -1
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js +6 -0
- package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +78 -2
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +191 -40
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
- package/react/components/toolbar/workspaceManagementMenu/workspaceManagementMenu.css +8 -18
- package/react/components/userPreferences/NotificationsPreferencesContext.d.ts +4 -0
- package/react/components/userPreferences/NotificationsPreferencesContext.js +4 -0
- package/react/components/userPreferences/NotificationsPreferencesContext.js.map +1 -1
- package/react/components/userPreferences/UserPreferenceTypes.d.ts +3 -0
- package/react/components/userPreferences/UserPreferences.d.ts +8 -0
- package/react/components/userPreferences/UserPreferences.js +8 -0
- package/react/components/userPreferences/UserPreferences.js.map +1 -1
- package/react/components/userPreferences/UserPreferencesBase.js +4 -0
- package/react/components/userPreferences/UserPreferencesBase.js.map +1 -1
- package/react/components/userPreferences/components/ContentSection.d.ts +5 -0
- package/react/components/userPreferences/components/ContentSection.js +1 -1
- package/react/components/userPreferences/components/ContentSection.js.map +1 -1
- package/react/components/userPreferences/components/LeftNav.d.ts +4 -0
- package/react/components/userPreferences/components/content/DashbarEditor.js +3 -0
- package/react/components/userPreferences/components/content/DashbarEditor.js.map +1 -1
- package/react/components/userPreferences/components/content/Notifications.js +3 -0
- package/react/components/userPreferences/components/content/Notifications.js.map +1 -1
- package/react/components/userPreferences/components/content/Workspaces.d.ts +14 -2
- package/react/components/userPreferences/components/content/Workspaces.js +78 -38
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +7 -3
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js +3 -0
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js +3 -0
- package/react/components/userPreferences/components/content/notificationViews/NotificationsSourcesPreferences.js.map +1 -1
- package/react/components/userPreferences/components/general/ScheduledClose.js +26 -5
- package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceButton.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.d.ts +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +20 -10
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +18 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.js +35 -6
- package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
- package/react/components/userPreferences/tests/LeftNav.spec.js +15 -1
- package/react/components/userPreferences/tests/LeftNav.spec.js.map +1 -1
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js +1 -0
- package/react/components/userPreferences/tests/NotificationsPreferencesHome.spec.js.map +1 -1
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js +42 -0
- package/react/components/userPreferences/tests/UserPreferencesBase.spec.js.map +1 -0
- package/react/components/userPreferences/tests/Workspace.spec.d.ts +1 -0
- package/react/components/userPreferences/tests/Workspace.spec.js +139 -0
- package/react/components/userPreferences/tests/Workspace.spec.js.map +1 -0
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +130 -2
- package/react/components/windowTitleBar/WindowTitleBarShell.js +386 -27
- package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
- package/react/components/windowTitleBar/components/center/Tab.d.ts +3 -0
- package/react/components/windowTitleBar/components/center/Tab.js +3 -0
- package/react/components/windowTitleBar/components/center/Tab.js.map +1 -1
- package/react/components/windowTitleBar/components/center/TabList.d.ts +90 -0
- package/react/components/windowTitleBar/components/center/TabList.js +170 -4
- package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.d.ts +9 -1
- package/react/components/windowTitleBar/components/left/LinkerButton.js +27 -5
- package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.d.ts +47 -0
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js +76 -1
- package/react/components/windowTitleBar/components/left/LinkerButtonDeprecated.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerGroups.d.ts +4 -0
- package/react/components/windowTitleBar/components/left/LinkerGroups.js +5 -0
- package/react/components/windowTitleBar/components/left/LinkerGroups.js.map +1 -1
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.d.ts +18 -0
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js +49 -0
- package/react/components/windowTitleBar/components/left/LinkerGroupsDeprecated.js.map +1 -1
- package/react/components/windowTitleBar/components/left/ShareButton.d.ts +17 -0
- package/react/components/windowTitleBar/components/left/ShareButton.js +39 -0
- package/react/components/windowTitleBar/components/left/ShareButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js +4 -0
- package/react/components/windowTitleBar/components/right/AlwaysOnTopButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/CloseButton.d.ts +27 -0
- package/react/components/windowTitleBar/components/right/CloseButton.js +27 -0
- package/react/components/windowTitleBar/components/right/CloseButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/GroupingButton.d.ts +37 -0
- package/react/components/windowTitleBar/components/right/GroupingButton.js +40 -0
- package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MaximizeButton.d.ts +46 -0
- package/react/components/windowTitleBar/components/right/MaximizeButton.js +54 -0
- package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/right/MinimizeButton.d.ts +26 -0
- package/react/components/windowTitleBar/components/right/MinimizeButton.js +26 -0
- package/react/components/windowTitleBar/components/right/MinimizeButton.js.map +1 -1
- package/react/components/windowTitleBar/components/windowTitle.d.ts +40 -0
- package/react/components/windowTitleBar/components/windowTitle.js +245 -48
- package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
- package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +5 -0
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js +81 -6
- package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.css +1 -1
- package/react/components/yesNoDialog/YesNoDialog.d.ts +3 -0
- package/react/components/yesNoDialog/YesNoDialog.js +64 -1
- package/react/components/yesNoDialog/YesNoDialog.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.spec.js +4 -0
- package/react/components/yesNoDialog/YesNoDialog.spec.js.map +1 -1
- package/react/components/yesNoDialog/YesNoDialog.stories.js +2 -2
- package/react/components/yesNoDialog/YesNoDialog.stories.js.map +1 -1
- package/react/components/yesNoDialog/timer.js +2 -0
- package/react/components/yesNoDialog/timer.js.map +1 -1
- package/react/enzymeSetup.js +10 -0
- package/react/enzymeSetup.js.map +1 -1
- package/react/hooks/useDashbar.js +10 -0
- package/react/hooks/useDashbar.js.map +1 -1
- package/react/hooks/useDeepEffect.d.ts +4 -0
- package/react/hooks/useDeepEffect.js +21 -0
- package/react/hooks/useDeepEffect.js.map +1 -1
- package/react/hooks/useFavorites.d.ts +15 -0
- package/react/hooks/useFavorites.js +3 -0
- package/react/hooks/useFavorites.js.map +1 -1
- package/react/hooks/useFavoritesShell.d.ts +4 -0
- package/react/hooks/useFavoritesShell.js +23 -0
- package/react/hooks/useFavoritesShell.js.map +1 -1
- package/react/hooks/useHotkey.d.ts +6 -0
- package/react/hooks/useHotkey.js +9 -0
- package/react/hooks/useHotkey.js.map +1 -1
- package/react/hooks/useLinker.js +14 -0
- package/react/hooks/useLinker.js.map +1 -1
- package/react/hooks/useMenu.d.ts +29 -0
- package/react/hooks/useMenu.js +12 -1
- package/react/hooks/useMenu.js.map +1 -1
- package/react/hooks/useNotifications.d.ts +44 -0
- package/react/hooks/useNotifications.js +104 -12
- package/react/hooks/useNotifications.js.map +1 -1
- package/react/hooks/useOutsideClickDetector.d.ts +3 -0
- package/react/hooks/useOutsideClickDetector.js +3 -0
- package/react/hooks/useOutsideClickDetector.js.map +1 -1
- package/react/hooks/usePubSub.d.ts +17 -0
- package/react/hooks/usePubSub.js +18 -0
- package/react/hooks/usePubSub.js.map +1 -1
- package/react/hooks/useSearch.d.ts +5 -0
- package/react/hooks/useSearch.js +30 -0
- package/react/hooks/useSearch.js.map +1 -1
- package/react/hooks/useToolbar.d.ts +1 -1
- package/react/hooks/useToolbar.js +54 -2
- package/react/hooks/useToolbar.js.map +1 -1
- package/react/reducers/favoriteReducer.d.ts +3 -0
- package/react/reducers/linkerReducer.d.ts +3 -0
- package/react/reducers/linkerReducer.js +4 -0
- package/react/reducers/linkerReducer.js.map +1 -1
- package/react/reducers/menuReducer.d.ts +28 -0
- package/react/reducers/menuReducer.js +34 -0
- package/react/reducers/menuReducer.js.map +1 -1
- package/react/reducers/rootReducer.d.ts +2 -2
- package/react/reducers/rootReducer.js +3 -0
- package/react/reducers/rootReducer.js.map +1 -1
- package/react/reducers/searchReducer.d.ts +7 -0
- package/react/reducers/searchReducer.js +6 -0
- package/react/reducers/searchReducer.js.map +1 -1
- package/react/reducers/workspaceReducer.js +1 -0
- package/react/reducers/workspaceReducer.js.map +1 -1
- package/react/store.d.ts +8 -4
- package/react/store.js +11 -0
- package/react/store.js.map +1 -1
- package/react/tsconfig.tsbuildinfo +1 -0
- package/react/types/fdc3.d.ts +2 -0
- package/react/types/linkerTypes.d.ts +13 -0
- package/react/types/linkerTypes.js +1 -0
- package/react/types/linkerTypes.js.map +1 -1
- package/react/types/smartDesktopDesignerTypes.d.ts +8 -0
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/workspaceTypes.d.ts +8 -0
|
@@ -11,6 +11,7 @@ const Actions = {
|
|
|
11
11
|
async.parallel([
|
|
12
12
|
Actions.initializeComponentList,
|
|
13
13
|
Actions.getUserDefinedComponentList,
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
14
15
|
setupHotkeys,
|
|
15
16
|
], (err) => {
|
|
16
17
|
if (err) {
|
|
@@ -25,6 +26,7 @@ const Actions = {
|
|
|
25
26
|
if (typeof err === "string") {
|
|
26
27
|
throw new Error(err);
|
|
27
28
|
}
|
|
29
|
+
// Each AppLauncher
|
|
28
30
|
FSBL.Clients.Logger.system.debug("getComponentList from LauncherClient", response);
|
|
29
31
|
Actions.filterComponents(response);
|
|
30
32
|
if (cb) {
|
|
@@ -35,16 +37,19 @@ const Actions = {
|
|
|
35
37
|
initializeComponentList(cb) {
|
|
36
38
|
const self = Actions;
|
|
37
39
|
let firstTime = true;
|
|
40
|
+
// 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.
|
|
38
41
|
FSBL.Clients.RouterClient.subscribe(COMPONENT_UPDATE_CHANNEL, (_err, response) => {
|
|
39
42
|
if (!FSBL.Clients.WindowClient.options.customData.spawnData) {
|
|
40
43
|
FSBL.Clients.WindowClient.options.customData.spawnData = {};
|
|
41
44
|
}
|
|
42
45
|
Object.assign(FSBL.Clients.WindowClient.options.customData.spawnData, response.data);
|
|
43
46
|
if (firstTime) {
|
|
47
|
+
// only update component list the first time to eliminate re-rendering the menu
|
|
44
48
|
Actions.getComponentList(cb);
|
|
45
49
|
firstTime = false;
|
|
46
50
|
}
|
|
47
51
|
});
|
|
52
|
+
// 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.
|
|
48
53
|
FSBL.Clients.RouterClient.subscribe("Launcher.update", (err, response) => {
|
|
49
54
|
FSBL.Clients.Logger.system.debug("list updated", err, response);
|
|
50
55
|
if (err) {
|
|
@@ -53,9 +58,11 @@ const Actions = {
|
|
|
53
58
|
self.filterComponents(response.data.componentList);
|
|
54
59
|
});
|
|
55
60
|
},
|
|
61
|
+
// get quick components that the user created from storage.
|
|
56
62
|
getUserDefinedComponentList(cb) {
|
|
57
63
|
return cb();
|
|
58
64
|
},
|
|
65
|
+
// saves quick components
|
|
59
66
|
saveCustomComponents() {
|
|
60
67
|
const UDCs = {};
|
|
61
68
|
const components = Object.keys(Actions.componentList);
|
|
@@ -71,6 +78,12 @@ const Actions = {
|
|
|
71
78
|
value: UDCs,
|
|
72
79
|
});
|
|
73
80
|
},
|
|
81
|
+
/**
|
|
82
|
+
* Produce a filtered component list based on the settings for this menu (either "mode" or "list").
|
|
83
|
+
*
|
|
84
|
+
* Components will only be added to the returned list if they match the specified mode or
|
|
85
|
+
* are found in the specified list
|
|
86
|
+
*/
|
|
74
87
|
processSettings(settings, components) {
|
|
75
88
|
let componentList = {};
|
|
76
89
|
const keys = Object.keys(components);
|
|
@@ -82,6 +95,7 @@ const Actions = {
|
|
|
82
95
|
const mode = ((_a = config === null || config === void 0 ? void 0 : config.component) === null || _a === void 0 ? void 0 : _a.mode) || [""];
|
|
83
96
|
const coponentMode = Array.isArray(mode) ? mode : [mode];
|
|
84
97
|
const commonModes = coponentMode.filter((n) => settingsMode.indexOf(n) !== -1);
|
|
98
|
+
// If the current mode isn't in the list of modes for the component then don't include it in our list
|
|
85
99
|
if (commonModes.length) {
|
|
86
100
|
componentList[componentType] = components[componentType];
|
|
87
101
|
}
|
|
@@ -95,6 +109,10 @@ const Actions = {
|
|
|
95
109
|
}
|
|
96
110
|
return componentList;
|
|
97
111
|
},
|
|
112
|
+
// This filters components based on the mode and list settings in customData
|
|
113
|
+
// 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
|
|
114
|
+
// If neither mode not list are set, all components are shown
|
|
115
|
+
// Custom Components are always shown
|
|
98
116
|
filterComponents(components = {}) {
|
|
99
117
|
var _a;
|
|
100
118
|
const settings = (_a = FSBL.Clients.WindowClient.getSpawnData()) !== null && _a !== void 0 ? _a : {};
|
|
@@ -106,6 +124,8 @@ const Actions = {
|
|
|
106
124
|
});
|
|
107
125
|
this.saveCustomComponents();
|
|
108
126
|
},
|
|
127
|
+
// Handler for when the user wants to remove a quick component.
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
109
129
|
handleRemoveCustomComponent(componentName, cb = (wasDeconsted) => { }) {
|
|
110
130
|
const self = this;
|
|
111
131
|
FSBL.Clients.DialogManager.open("yesNo", {
|
|
@@ -114,6 +134,8 @@ const Actions = {
|
|
|
114
134
|
affirmativeResponseLabel: "Delete",
|
|
115
135
|
showNegativeButton: false,
|
|
116
136
|
}, (err, response) => {
|
|
137
|
+
// If the user chooses "affirmative" then delete the component.
|
|
138
|
+
// We should never get an error, but if we do then go ahead and delete the component too.
|
|
117
139
|
if (err || response.choice === "affirmative") {
|
|
118
140
|
cb(true);
|
|
119
141
|
self.removeCustomComponent(componentName);
|
|
@@ -123,6 +145,7 @@ const Actions = {
|
|
|
123
145
|
}
|
|
124
146
|
});
|
|
125
147
|
},
|
|
148
|
+
// Remove the component, notify others.
|
|
126
149
|
removeCustomComponent(componentName) {
|
|
127
150
|
FSBL.Clients.LauncherClient.removeUserDefinedComponent({
|
|
128
151
|
name: componentName,
|
|
@@ -133,10 +156,13 @@ const Actions = {
|
|
|
133
156
|
Actions.getComponentList();
|
|
134
157
|
});
|
|
135
158
|
},
|
|
159
|
+
// Hide the window.
|
|
136
160
|
hideWindow() {
|
|
137
161
|
finsembleWindow.hide();
|
|
138
162
|
},
|
|
163
|
+
// Spawn a component.
|
|
139
164
|
launchComponent(config, params, cb) {
|
|
165
|
+
// Actions.hideWindow();
|
|
140
166
|
const defaultParams = {
|
|
141
167
|
addToWorkspace: true,
|
|
142
168
|
monitor: "mine",
|
|
@@ -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,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,EAAE,EAAE;YACP,IAAI,GAAG,EAAE;gBACR,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC5D,EAAE,EAAE,CAAC;QACN,CAAC,CACD,CAAC;IACH,CAAC;IACD,gBAAgB,CAAC,EAAiB;QACjC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,GAAkB,EAAE,QAAQ,EAAE,EAAE;YAC7E,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACrB;YAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,QAAQ,CAAC,CAAC;YACnF,OAAO,CAAC,gBAAgB,CAAC,QAAQ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AAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAA+B;QACrD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,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-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"]}
|
|
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;YACnC,mEAAmE;YACnE,YAAY;SACZ,EACD,CAAC,GAAG,EAAE,EAAE;YACP,IAAI,GAAG,EAAE;gBACR,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aACnB;YACD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;YAC5D,EAAE,EAAE,CAAC;QACN,CAAC,CACD,CAAC;IACH,CAAC;IACD,gBAAgB,CAAC,EAAiB;QACjC,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,GAAkB,EAAE,QAAQ,EAAE,EAAE;YAC7E,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;gBAC5B,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;aACrB;YACD,mBAAmB;YACnB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,EAAE,QAAQ,CAAC,CAAC;YACnF,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YACnC,IAAI,EAAE,EAAE;gBACP,EAAE,EAAE,CAAC;aACL;QACF,CAAC,CAAC,CAAC;IACJ,CAAC;IACD,uBAAuB,CAAC,EAAgB;QACvC,MAAM,IAAI,GAAG,OAAO,CAAC;QACrB,IAAI,SAAS,G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IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,sBAAsB,CAAC,EAA+B;QACrD,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzB,CAAC;IAED,yBAAyB,CAAC,EAAY;QACrC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,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-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"]}
|
|
@@ -16,11 +16,11 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
16
16
|
const [totalWidgetsWidth, setTotalWidgetsWidth] = useState(0);
|
|
17
17
|
const [isUpdatingState, setIsUpdatingState] = useState(false);
|
|
18
18
|
const [secondUpdateRequired, setSecondUpdateRequired] = useState(false);
|
|
19
|
-
let movingIndex = null;
|
|
20
|
-
let titleGrabPosition = null;
|
|
21
|
-
let offsetX = null;
|
|
19
|
+
let movingIndex = null; // The dashbarItem index being dragged, null if none
|
|
20
|
+
let titleGrabPosition = null; // The mouse of event when a widget title is dragged
|
|
21
|
+
let offsetX = null; // The original grab location of a given view titlebar
|
|
22
22
|
const WIDGET_COUNT = Object.keys(widgets).length;
|
|
23
|
-
const
|
|
23
|
+
const SCROLL_BUTTON_DEFAULT_WIDTH = 30;
|
|
24
24
|
const defaultWidgetTitleGenerator = (widget, titleRef) => {
|
|
25
25
|
const handleWidgetTitleClick = () => {
|
|
26
26
|
if (widget.raiseIntentOptions) {
|
|
@@ -31,17 +31,25 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
31
31
|
React.createElement("span", { dangerouslySetInnerHTML: { __html: widget.title } })));
|
|
32
32
|
};
|
|
33
33
|
const titleGenerator = widgetTitleGenerator !== null && widgetTitleGenerator !== void 0 ? widgetTitleGenerator : defaultWidgetTitleGenerator;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* @param {object} params
|
|
37
|
+
* @param {number} oldIndex The index of the item being moved
|
|
38
|
+
* @param {number} newIndex The index to move the item to
|
|
39
|
+
*/
|
|
34
40
|
const reorderItems = ({ oldIndex, newIndex }) => {
|
|
35
41
|
movingIndex = null;
|
|
36
42
|
titleGrabPosition = null;
|
|
37
43
|
offsetX = null;
|
|
38
44
|
setReorganized(true);
|
|
45
|
+
// Update the redux store
|
|
39
46
|
reorderDashbarItems({ oldIndex, newIndex });
|
|
40
47
|
};
|
|
41
48
|
const launchDashbar = () => {
|
|
42
49
|
launchPreferences("Dashbar");
|
|
43
50
|
};
|
|
44
51
|
const { dashbar } = FSBL.Clients.WindowClient.getSpawnData();
|
|
52
|
+
// Dashbar is disabled (no config in toolbar) or dashbar height is not specified
|
|
45
53
|
if (!dashbar || !dashbar.height) {
|
|
46
54
|
return null;
|
|
47
55
|
}
|
|
@@ -59,14 +67,21 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
59
67
|
};
|
|
60
68
|
const [leftButtonTooltip, setLeftButtonTooltip] = useState("");
|
|
61
69
|
const [rightButtonTooltip, setRightButtonTooltip] = useState("");
|
|
70
|
+
// For calculation widgets position that function uses the HTML elements.
|
|
71
|
+
// If something will be changed in HTML hierarchy for widgets, that function should be refactored.
|
|
62
72
|
const setWidgetsPositions = async () => {
|
|
63
73
|
var _a;
|
|
64
74
|
const { data: bounds } = await finsembleWindow.getBounds();
|
|
65
75
|
const scrollButtonsEnabled = document.querySelectorAll("#dashbar-container > .chevron-container").length > 0;
|
|
66
|
-
const elements = document.getElementsByClassName("dashbar-item
|
|
76
|
+
const elements = document.getElementsByClassName("finsemble-dashbar-item");
|
|
67
77
|
let toolbarWidth = (_a = bounds === null || bounds === void 0 ? void 0 : bounds.width) !== null && _a !== void 0 ? _a : 0;
|
|
68
|
-
|
|
78
|
+
let SCROLL_BUTTON_WIDTH = SCROLL_BUTTON_DEFAULT_WIDTH;
|
|
79
|
+
if (scrollButtonsEnabled) {
|
|
80
|
+
// Get actual width in case of client styling
|
|
81
|
+
SCROLL_BUTTON_WIDTH = document.querySelectorAll("#dashbar-container > .chevron-container")[0]
|
|
82
|
+
.offsetWidth;
|
|
69
83
|
toolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;
|
|
84
|
+
}
|
|
70
85
|
let tempLeft = 0;
|
|
71
86
|
let leftButtonSize = 0;
|
|
72
87
|
if (scrollButtonsEnabled) {
|
|
@@ -75,9 +90,13 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
75
90
|
}
|
|
76
91
|
let leftItemsCount = 0;
|
|
77
92
|
let rightItemsCount = 0;
|
|
78
|
-
for (const
|
|
79
|
-
|
|
80
|
-
const
|
|
93
|
+
for (const dashbarItem of elements) {
|
|
94
|
+
// rect.width already contains the divider width
|
|
95
|
+
const rect = dashbarItem.getBoundingClientRect();
|
|
96
|
+
const dashbarItemFrame = dashbarItem.firstChild;
|
|
97
|
+
const widgetId = dashbarItemFrame.id;
|
|
98
|
+
const widget = widgets[widgetId];
|
|
99
|
+
// Happens when widgets were removed, but dom-elements still exists. So just ignore.
|
|
81
100
|
if (!widget)
|
|
82
101
|
continue;
|
|
83
102
|
if (rect.left < SCROLL_BUTTON_WIDTH && scrollButtonsEnabled) {
|
|
@@ -88,16 +107,17 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
88
107
|
else {
|
|
89
108
|
widget.bounds.width = rect.width - widgetDividerWidth;
|
|
90
109
|
widget.bounds.left = tempLeft;
|
|
110
|
+
tempLeft = tempLeft + rect.width;
|
|
91
111
|
}
|
|
92
|
-
|
|
93
|
-
let offsetRight = rect.left + rect.width + widgetDividerWidth - leftButtonSize - toolbarWidth;
|
|
112
|
+
let offsetRight = rect.left + rect.width - widgetDividerWidth - leftButtonSize - toolbarWidth;
|
|
94
113
|
if (offsetRight > 0) {
|
|
95
|
-
|
|
114
|
+
// hide title for invisible items
|
|
115
|
+
dashbarItemFrame.firstChild.style.visibility = "hidden";
|
|
96
116
|
widget.bounds.width = 0;
|
|
97
117
|
rightItemsCount++;
|
|
98
118
|
}
|
|
99
119
|
else {
|
|
100
|
-
|
|
120
|
+
dashbarItemFrame.firstChild.style.visibility = "visible";
|
|
101
121
|
}
|
|
102
122
|
widget.view.setBounds(widget.bounds);
|
|
103
123
|
}
|
|
@@ -138,6 +158,9 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
138
158
|
};
|
|
139
159
|
const removeWidgets = async () => {
|
|
140
160
|
const _widgets = clone(widgets);
|
|
161
|
+
// Widgets is an object, with each key being a reference to an item in dashbarItems
|
|
162
|
+
// but dashbarItems is an array of objects. Its necessary to loop through them to determine
|
|
163
|
+
// the differences to figure out which items were removed.
|
|
141
164
|
const toRemove = [];
|
|
142
165
|
Object.keys(_widgets).forEach((widgetId) => {
|
|
143
166
|
let found = false;
|
|
@@ -153,10 +176,13 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
153
176
|
}
|
|
154
177
|
});
|
|
155
178
|
let tempNewHorizontalBounds = 0;
|
|
179
|
+
// toRemove is an array of widgetIds which were no longer found in dashbarItems
|
|
180
|
+
// As items are removed, the remaining items have to be shuffled to fill the space
|
|
156
181
|
for (const id of toRemove) {
|
|
157
182
|
if (_widgets.hasOwnProperty(id)) {
|
|
158
183
|
await _widgets[id].view.remove(() => {
|
|
159
184
|
delete _widgets[id];
|
|
185
|
+
// Shuffle remaining views to fill any gaps that were left
|
|
160
186
|
Object.values(_widgets).forEach((widget) => {
|
|
161
187
|
widget.bounds = {
|
|
162
188
|
width: widget.bounds.width,
|
|
@@ -178,6 +204,10 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
178
204
|
};
|
|
179
205
|
const reorganizeWidgets = () => {
|
|
180
206
|
const _widgets = clone(widgets);
|
|
207
|
+
// Each view needs to be resituated to fill any holes
|
|
208
|
+
// left by views that have been removed. Use a tempBounds
|
|
209
|
+
// int to keep track of new widths and set the overall width
|
|
210
|
+
// once everything is re-seated
|
|
181
211
|
let tempBounds = 0;
|
|
182
212
|
dashbarItems.forEach((item) => {
|
|
183
213
|
const widget = _widgets[item.id];
|
|
@@ -199,16 +229,19 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
199
229
|
const updateItems = () => {
|
|
200
230
|
const doUpdate = async () => {
|
|
201
231
|
if (dashbarItems.length > WIDGET_COUNT) {
|
|
232
|
+
//Items have been added
|
|
202
233
|
await addWidgets();
|
|
203
234
|
setTotalWidgetsWidth(getTotalWidth());
|
|
204
235
|
}
|
|
205
236
|
else if (dashbarItems.length < WIDGET_COUNT) {
|
|
237
|
+
//Items have been removed
|
|
206
238
|
await removeWidgets();
|
|
207
239
|
setTotalWidgetsWidth(getTotalWidth());
|
|
208
240
|
}
|
|
209
241
|
else if (wasReorganized) {
|
|
210
242
|
if (movingIndex)
|
|
211
243
|
return;
|
|
244
|
+
// Length is the same, order has changed
|
|
212
245
|
reorganizeWidgets();
|
|
213
246
|
}
|
|
214
247
|
await setWidgetsPositions();
|
|
@@ -222,15 +255,34 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
222
255
|
setSecondUpdateRequired(true);
|
|
223
256
|
}
|
|
224
257
|
};
|
|
258
|
+
/**
|
|
259
|
+
* When the distributed store's 'dashbaritems' is updated it will cause this hook to
|
|
260
|
+
* execute. The local representation of widgets will be mutated, then a call to
|
|
261
|
+
* setWidgets will re-render the component
|
|
262
|
+
*/
|
|
225
263
|
useEffect(() => {
|
|
226
264
|
updateItems();
|
|
227
265
|
}, [dashbarItems]);
|
|
266
|
+
/**
|
|
267
|
+
* DashbarItems can be changed very quickly before all widgets will be initialized.
|
|
268
|
+
* Double-calling updateItems() fixes a bug.
|
|
269
|
+
*/
|
|
228
270
|
useEffect(() => {
|
|
229
271
|
if (secondUpdateRequired && !isUpdatingState) {
|
|
230
272
|
updateItems();
|
|
231
273
|
setSecondUpdateRequired(false);
|
|
232
274
|
}
|
|
233
275
|
}, [isUpdatingState, secondUpdateRequired]);
|
|
276
|
+
/**
|
|
277
|
+
* Sets the title height as determined by the DashbarItem
|
|
278
|
+
* component, since the CSS can be changed by the user
|
|
279
|
+
* the component will render the title and pass back
|
|
280
|
+
* computed height of that title, then the Dashbar will
|
|
281
|
+
* make room for item
|
|
282
|
+
*
|
|
283
|
+
* @param {number} titleHeight The height of the span containing the title
|
|
284
|
+
* @param {string} id The key'ed id of the view
|
|
285
|
+
*/
|
|
234
286
|
const setTitleHeight = (titleHeight, id) => {
|
|
235
287
|
const _widgets = widgets;
|
|
236
288
|
const widget = _widgets[id];
|
|
@@ -247,8 +299,12 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
247
299
|
cachedWidgetHeight = newBounds.height;
|
|
248
300
|
widget.view.setBounds(newBounds);
|
|
249
301
|
widget.bounds = newBounds;
|
|
250
|
-
setWidgets(_widgets);
|
|
251
302
|
};
|
|
303
|
+
/**
|
|
304
|
+
* When a view starts moving, bring it to the front
|
|
305
|
+
*
|
|
306
|
+
* @param {MouseEvent} event The event passed by react-sortable-hoc
|
|
307
|
+
*/
|
|
252
308
|
const startMove = (node, event) => {
|
|
253
309
|
movingIndex = node.index;
|
|
254
310
|
if (offsetX === null && titleGrabPosition !== null) {
|
|
@@ -257,6 +313,11 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
257
313
|
const widget = Object.values(widgets)[node.index];
|
|
258
314
|
widget.view.bringToFront();
|
|
259
315
|
};
|
|
316
|
+
/**
|
|
317
|
+
* Event triggered by view movement
|
|
318
|
+
*
|
|
319
|
+
* @param {MouseEvent} event
|
|
320
|
+
*/
|
|
260
321
|
const moveItem = (event) => {
|
|
261
322
|
if (movingIndex !== null) {
|
|
262
323
|
const movingWidget = Object.values(widgets)[movingIndex];
|
|
@@ -266,6 +327,7 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
266
327
|
width: movingWidget.bounds.width,
|
|
267
328
|
left: event.clientX - (offsetX || 0),
|
|
268
329
|
});
|
|
330
|
+
// Some completely not react very hacky stuff to make browserviews move in conjunction with the titles
|
|
269
331
|
const elements = document.getElementsByClassName("dashbar-item-frame");
|
|
270
332
|
for (const element of elements) {
|
|
271
333
|
const rect = element.getBoundingClientRect();
|
|
@@ -280,8 +342,22 @@ export const Dashbar = ({ className, children, widgetTitleGenerator }) => {
|
|
|
280
342
|
const setGrabLocation = (location) => {
|
|
281
343
|
titleGrabPosition = location;
|
|
282
344
|
};
|
|
345
|
+
/**
|
|
346
|
+
* Every time a widget is added or removed, modify the key on the FinsembleDnDContext element forcing a rerender.
|
|
347
|
+
*
|
|
348
|
+
* This is a workaround for certain cases where removing a dashbar item would align the panels incorrectly in
|
|
349
|
+
* FinsembleDnDContext. The scrolling works by the FinsembleDnDContext setting scrollLeft value. All calculations
|
|
350
|
+
* in FinsembleDnDContext are correct but due to a browser bug, when removing component under certain conditions,
|
|
351
|
+
* it somehow sets false maximum value for this scrollLeft value. Any value higher than the maximum is capped
|
|
352
|
+
* causing it to half scroll an element.
|
|
353
|
+
*
|
|
354
|
+
*/
|
|
355
|
+
const elementKey = Object.entries(widgets)
|
|
356
|
+
.map((entry) => entry[0])
|
|
357
|
+
.sort()
|
|
358
|
+
.join("-");
|
|
283
359
|
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, 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 }))))),
|
|
360
|
+
WIDGET_COUNT > 0 && (React.createElement(FinsembleDnDContext, { key: elementKey, 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
361
|
WIDGET_COUNT === 0 && (React.createElement("div", { className: "add-dashbar-item-button", onClick: launchDashbar },
|
|
286
362
|
React.createElement("span", null,
|
|
287
363
|
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;AACjG,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,OAAO,iCAAiC,CAAC;AAMzC,IAAI,eAAuB,CAAC;AAC5B,IAAI,kBAA0B,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAe,EAAE,EAAE;IACrF,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,G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BAAoB,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\";\nimport clone from \"lodash/cloneDeep\";\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 = clone(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 = clone(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 = clone(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
|
+
{"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;AACjG,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,OAAO,iCAAiC,CAAC;AAMzC,IAAI,eAAuB,CAAC;AAC5B,IAAI,kBAA0B,CAAC;AAE/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,EAAe,EAAE,EAAE;IACrF,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,GAAG,UAAU,EAAE,CAAC;IAC3D,MAAM,EAAE,iBAAiB,EAAE,GAAG,UAAU,EAAE,CAAC;IAE3C,MAAM,CA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barItem } 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\";\nimport clone from \"lodash/cloneDeep\";\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 dashbarItem 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_DEFAULT_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\t// For calculation widgets position that function uses the HTML elements.\n\t// If something will be changed in HTML hierarchy for widgets, that function should be refactored.\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(\"finsemble-dashbar-item\");\n\t\tlet toolbarWidth = bounds?.width ?? 0;\n\t\tlet SCROLL_BUTTON_WIDTH = SCROLL_BUTTON_DEFAULT_WIDTH;\n\t\tif (scrollButtonsEnabled) {\n\t\t\t// Get actual width in case of client styling\n\t\t\tSCROLL_BUTTON_WIDTH = (document.querySelectorAll(\"#dashbar-container > .chevron-container\")[0] as HTMLElement)\n\t\t\t\t.offsetWidth;\n\t\t\ttoolbarWidth = toolbarWidth - 2 * SCROLL_BUTTON_WIDTH;\n\t\t}\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 dashbarItem of elements) {\n\t\t\t// rect.width already contains the divider width\n\t\t\tconst rect = dashbarItem.getBoundingClientRect();\n\t\t\tconst dashbarItemFrame = dashbarItem.firstChild as Element;\n\t\t\tconst widgetId = dashbarItemFrame.id;\n\t\t\tconst widget = (widgets as DashbarViews)[widgetId];\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\ttempLeft = tempLeft + rect.width;\n\t\t\t}\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(dashbarItemFrame.firstChild 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(dashbarItemFrame.firstChild 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 = clone(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 = clone(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 = clone(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};\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\t/**\n\t * Every time a widget is added or removed, modify the key on the FinsembleDnDContext element forcing a rerender.\n\t *\n\t * This is a workaround for certain cases where removing a dashbar item would align the panels incorrectly in\n\t * FinsembleDnDContext. The scrolling works by the FinsembleDnDContext setting scrollLeft value. All calculations\n\t * in FinsembleDnDContext are correct but due to a browser bug, when removing component under certain conditions,\n\t * it somehow sets false maximum value for this scrollLeft value. Any value higher than the maximum is capped\n\t * causing it to half scroll an element.\n\t *\n\t */\n\tconst elementKey = Object.entries(widgets)\n\t\t.map((entry) => entry[0])\n\t\t.sort()\n\t\t.join(\"-\");\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\tkey={elementKey}\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"]}
|
|
@@ -12,6 +12,11 @@ export const DashbarItem = ({ id = `finsemble-draggable-${Date.now()}-${Math.ran
|
|
|
12
12
|
setTitleHeight(titleHeight, id);
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
+
/**
|
|
16
|
+
* Sets the location the titlebar of a view is clicked on when a user grabs a dashbar item
|
|
17
|
+
*
|
|
18
|
+
* @param event
|
|
19
|
+
*/
|
|
15
20
|
const _setGrabLocation = () => {
|
|
16
21
|
if (divRef === null || divRef === void 0 ? void 0 : divRef.current) {
|
|
17
22
|
const rect = divRef.current.getBoundingClientRect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashbarItem.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/DashbarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAG7E,OAAO,iCAAiC,CAAC;AAezC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC3B,EAAE,GAAG,uBAAuB,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE,EACzD,KAAK,EACL,SAAS,EACT,MAAM,EACN,MAAM,EACN,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,oBAAoB,GACF,EAAE,EAAE;IACtB,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAE5C,eAAe,CAAC,GAAG,EAAE;QACpB,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,KAAI,aAAa,EAAE;YACvC,MAAM,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;YAE1C,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;YAClE,cAAc,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;SAChC;IACF,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DashbarItem.js","sourceRoot":"","sources":["../../../../src/components/toolbar/dashbar/DashbarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CA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B,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAErD,OAAO,CACN,oBAAC,kBAAkB,IAAC,WAAW,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,YAAY;QACrF,6BAAK,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,gBAAgB,EAAE,SAAS,EAAC,oBAAoB,EAAC,KAAK,EAAE,SAAS;YACvG,iCAAM,KAAK,CAAO;YAClB,6BAAK,SAAS,EAAC,aAAa,GAAO,CAC9B,CACc,CACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { useRef, useLayoutEffect } from \"react\";\nimport { FinsembleDraggable } from \"../../legacyControls/FinsembleDraggable\";\nimport { DashbarView } from \"../../../types/dashbarTypes\";\n\nimport \"../../../assets/css/dashbar.css\";\n\ntype DashbarItemProps = {\n\tid?: string;\n\tindex: number;\n\tclassName?: string;\n\theight?: number;\n\twidget: DashbarView;\n\tdashbarHeight?: number;\n\twidgetDividerWidth?: number;\n\tsetTitleHeight: Function;\n\tsetGrabLocation: Function;\n\twidgetTitleGenerator: Function;\n};\n\nexport const DashbarItem = ({\n\tid = `finsemble-draggable-${Date.now()}-${Math.random()}`,\n\tindex,\n\tclassName,\n\twidget,\n\theight,\n\tdashbarHeight,\n\twidgetDividerWidth,\n\tsetTitleHeight,\n\tsetGrabLocation,\n\twidgetTitleGenerator,\n}: DashbarItemProps) => {\n\tconst titleRef = useRef<HTMLDivElement>(null);\n\tconst divRef = useRef<HTMLDivElement>(null);\n\n\tuseLayoutEffect(() => {\n\t\tif (titleRef?.current && dashbarHeight) {\n\t\t\tconst { offsetHeight } = titleRef.current;\n\n\t\t\tconst titleHeight = height ? height + offsetHeight : offsetHeight;\n\t\t\tsetTitleHeight(titleHeight, id);\n\t\t}\n\t});\n\n\t/**\n\t * Sets the location the titlebar of a view is clicked on when a user grabs a dashbar item\n\t *\n\t * @param event\n\t */\n\tconst _setGrabLocation = () => {\n\t\tif (divRef?.current) {\n\t\t\tconst rect = (divRef.current as HTMLElement).getBoundingClientRect();\n\t\t\tsetGrabLocation(rect.left);\n\t\t}\n\t};\n\n\tconst wrapperClass = `finsemble-dashbar-item ${className || \"\"}`;\n\tconst itemStyle = {\n\t\tdisplay: \"flex\",\n\t\twidth: widget.width,\n\t\tborderRight: `${widgetDividerWidth}px solid var(--dashbar-divider-color)`,\n\t};\n\n\tconst title = widgetTitleGenerator(widget, titleRef);\n\n\treturn (\n\t\t<FinsembleDraggable draggableId={id} index={index} key={id} wrapperClass={wrapperClass}>\n\t\t\t<div ref={divRef} id={id} onMouseDown={_setGrabLocation} className=\"dashbar-item-frame\" style={itemStyle}>\n\t\t\t\t<div>{title}</div>\n\t\t\t\t<div className=\"empty-space\"></div>\n\t\t\t</div>\n\t\t</FinsembleDraggable>\n\t);\n};\n"]}
|