@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YesNoDialog.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,uBAAuB,GAAG;IAC/B,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,cAAc;IACxB,qBAAqB,EAAE,IAAI;IAC3B,wBAAwB,EAAE,KAAK;IAC/B,mBAAmB,EAAE,QAAQ;IAC7B,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;CACtB,CAAC;AAuBF,MAAM,eAAgB,SAAQ,KAAK,CAAC,SAAyB;IAC5D,YAAY,KAAK,GAAG,EAAE;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,uBAAuB,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,gBAAgB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AI,CAAC,KAAK,CAAC,qBAAqB,CACV;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACjC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,IAAI,CAAC,kBAAkB,IAE/B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CACR;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACtC,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,IAAI,CAAC,uBAAuB,IAEpC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CACb,CACnB,CACW,CAClB,CAAC;IACH,CAAC;CACD;AAKD,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,oBAAC,eAAe,OAAG,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React from \"react\";\nimport \"./YesNoDialog.css\";\nimport \"../../assets/css/dialogs.css\";\nimport { FinsembleDialog } from \"../legacyControls/FinsembleDialog\";\nimport { FinsembleDialogQuestion } from \"../legacyControls/FinsembleDialogQuestion\";\nimport { FinsembleDialogButton } from \"../legacyControls/FinsembleDialogButton\";\nimport Timer from \"./timer\";\nconst DEFAULT_TITLE = \"\";\nconst DEFAULT_COMPONENT_STATE = {\n\ttitle: DEFAULT_TITLE,\n\tquestion: \"No question.\",\n\tnegativeResponseLabel: \"No\",\n\taffirmativeResponseLabel: \"Yes\",\n\tcancelResponseLabel: \"Cancel\",\n\tshowNegativeButton: true,\n\tshowAffirmativeButton: true,\n\tshowCancelButton: true,\n};\n\ninterface IProps {}\ninterface IState {\n\ttitle: string;\n\tquestion: string;\n\tnegativeResponseLabel: string;\n\taffirmativeResponseLabel: string;\n\tcancelResponseLabel: string;\n\tshowNegativeButton: boolean;\n\tshowAffirmativeButton: boolean;\n\tshowCancelButton: boolean;\n\thideModalOnClose?: boolean;\n\tshowTimer?: boolean;\n\ttimerDuration?: number | null;\n}\n\n/**\n * This is our standard dialog that presents the user with 1 - 3 choices. It can be used to allow the user to confirm, reject, or cancel an action. All of these options can be included, and all can be excluded.\n *\n * @class YesNoDialog\n * @extends {React.Component}\n */\nclass YesNoDialogBase extends React.Component<IProps, IState> {\n\tconstructor(props = {}) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t\tthis.state = DEFAULT_COMPONENT_STATE;\n\t\tdocument.body.addEventListener(\"keydown\", this.handleKeydownOnBody);\n\t}\n\n\t/**\n\t * Handles escape and enter.\n\t *\n\t * @param {any} e\n\t * @memberof YesNoDialog\n\t */\n\thandleKeydownOnBody(e: any) {\n\t\tif (e.code === \"Enter\" && e.shiftKey === false) {\n\t\t\tthis.sendResponse(\"affirmative\");\n\t\t}\n\n\t\tif (e.code === \"Escape\") {\n\t\t\tthis.sendResponse(\"cancel\");\n\t\t}\n\t}\n\n\t/**\n\t * Necessary to ensure that `this` is correct when our methods are invoked.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tbindCorrectContext() {\n\t\tthis.handleKeydownOnBody = this.handleKeydownOnBody.bind(this);\n\t\tthis.onShowRequested = this.onShowRequested.bind(this);\n\t\tthis.sendAffirmativeResponse = this.sendAffirmativeResponse.bind(this);\n\t\tthis.sendCancelResponse = this.sendCancelResponse.bind(this);\n\t\tthis.sendNegativeResponse = this.sendNegativeResponse.bind(this);\n\t\tthis.sendExpiredResponse = this.sendExpiredResponse.bind(this);\n\t\tthis.sendResponse = this.sendResponse.bind(this);\n\t}\n\n\t/**\n\t * When the opener requests that the dialog show itself, it also passes in initialization data. This function grabs that data, calls setState, and then fits the window to the contents of the DOM. Then we call `showDialog`, which will display the dialog on the proper monitor.\n\t *\n\t * @param {any} err\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tonShowRequested(err: any, response: any) {\n\t\tlet { data } = response;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\ttitle: typeof data.title === \"undefined\" ? DEFAULT_TITLE : data.title,\n\t\t\t\thideModalOnClose: typeof data.hideModalOnClose === \"undefined\" ? true : data.hideModalOnClose,\n\t\t\t\tquestion: data.question,\n\t\t\t\tnegativeResponseLabel: data.negativeResponseLabel || \"No\",\n\t\t\t\taffirmativeResponseLabel: data.affirmativeResponseLabel || \"Yes\",\n\t\t\t\tcancelResponseLabel: data.cancelResponseLabel || \"Cancel\",\n\t\t\t\tshowNegativeButton: typeof data.showNegativeButton === \"undefined\" ? true : data.showNegativeButton,\n\t\t\t\tshowAffirmativeButton: typeof data.showAffirmativeButton === \"undefined\" ? true : data.showAffirmativeButton,\n\t\t\t\tshowCancelButton: typeof data.showCancelButton === \"undefined\" ? true : data.showCancelButton,\n\t\t\t\tshowTimer: typeof data.showTimer === \"undefined\" ? false : data.showTimer,\n\t\t\t\ttimerDuration: typeof data.timerDuration === \"undefined\" ? null : data.timerDuration,\n\t\t\t},\n\t\t\tthis.fitAndShow\n\t\t);\n\t}\n\n\t/**\n\t * Fits the contents of the DOM to the window, then calls `showDialog`, which positions the dialog on the proper monitor and toggles the visibility of the window.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tfitAndShow() {\n\t\tFSBL.Clients.WindowClient.fitToDOM(null, () => {\n\t\t\tFSBL.Clients.DialogManager.showDialog();\n\t\t});\n\t}\n\n\t/**\n\t * Sends user input to the opener.\n\t *\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tsendResponse(response: any) {\n\t\tconsole.log(\"Response: \", response);\n\t\tFSBL.Clients.DialogManager.respondToOpener({\n\t\t\tchoice: response,\n\t\t\thideModalOnClose: this.state.hideModalOnClose,\n\t\t});\n\t\t// This will detach the timer component from the dom. Next time the component comes up, it'll have a fresh timer.\n\t\tthis.setState({\n\t\t\tshowTimer: false,\n\t\t});\n\t}\n\n\t/**\n\t * Sends an affirmative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendAffirmativeResponse() {\n\t\tthis.sendResponse(\"affirmative\");\n\t}\n\n\t/**\n\t * Sends a negative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendNegativeResponse() {\n\t\tthis.sendResponse(\"negative\");\n\t}\n\n\t/**\n\t * Sends a cancel response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendCancelResponse() {\n\t\tthis.sendResponse(\"cancel\");\n\t}\n\n\t/**\n\t * Sends an expired response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendExpiredResponse() {\n\t\tthis.sendResponse(\"expired\");\n\t}\n\n\trender() {\n\t\treturn (\n\t\t\t<FinsembleDialog\n\t\t\t\tuserInputTimeout={10000}\n\t\t\t\tbehaviorOnResponse=\"hide\"\n\t\t\t\tonShowRequested={this.onShowRequested}\n\t\t\t\tisModal={true}\n\t\t\t>\n\t\t\t\t<div className=\"dialog-title\">{this.state.title}</div>\n\t\t\t\t<FinsembleDialogQuestion>\n\t\t\t\t\t{this.state.question}\n\t\t\t\t\t{this.state.showTimer && typeof this.state.timerDuration === \"number\" && (\n\t\t\t\t\t\t<Timer ontimerDurationExpiration={this.sendExpiredResponse} timerDuration={this.state.timerDuration} />\n\t\t\t\t\t)}\n\t\t\t\t</FinsembleDialogQuestion>\n\t\t\t\t<div className=\"button-wrapper\">\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showNegativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendNegativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.negativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showCancelButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendCancelResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.cancelResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showAffirmativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-affirmative\"\n\t\t\t\t\t\tonClick={this.sendAffirmativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.affirmativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t</div>\n\t\t\t</FinsembleDialog>\n\t\t);\n\t}\n}\n\n/**\n * This dialog window provides a binary choice to the user, and reports back the response to the opener.\n */\nexport const YesNoDialog = () => <YesNoDialogBase />;\n"]}
|
|
1
|
+
{"version":3,"file":"YesNoDialog.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,uBAAuB,GAAG;IAC/B,KAAK,EAAE,aAAa;IACpB,QAAQ,EAAE,cAAc;IACxB,qBAAqB,EAAE,IAAI;IAC3B,wBAAwB,EAAE,KAAK;IAC/B,mBAAmB,EAAE,QAAQ;IAC7B,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,IAAI;CACtB,CAAC;AAiBF;;;;;GAKG;AACH,MAAM,eAAgB,SAAQ,KAAK,CAAC,SAAyB;IAC5D,YAAY,KAAK,GAAG,EAAE;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,GA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AI,CACvG,CACwB;YAC1B,6BAAK,SAAS,EAAC,gBAAgB;gBAC9B,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,kBAAkB,EACnC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,IAAI,CAAC,oBAAoB,IAEjC,IAAI,CAAC,KAAK,CAAC,qBAAqB,CACV;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,EACjC,SAAS,EAAC,qBAAqB,EAC/B,OAAO,EAAE,IAAI,CAAC,kBAAkB,IAE/B,IAAI,CAAC,KAAK,CAAC,mBAAmB,CACR;gBAExB,oBAAC,qBAAqB,IACrB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,qBAAqB,EACtC,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,IAAI,CAAC,uBAAuB,IAEpC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CACb,CACnB,CACW,CAClB,CAAC;IACH,CAAC;CACD;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,oBAAC,eAAe,OAAG,CAAC","sourcesContent":["/*!\n * Copyright 2017 by ChartIQ, Inc.\n * All rights reserved.\n */\nimport React from \"react\";\nimport \"./YesNoDialog.css\";\nimport \"../../assets/css/dialogs.css\";\nimport { FinsembleDialog } from \"../legacyControls/FinsembleDialog\";\nimport { FinsembleDialogQuestion } from \"../legacyControls/FinsembleDialogQuestion\";\nimport { FinsembleDialogButton } from \"../legacyControls/FinsembleDialogButton\";\nimport Timer from \"./timer\";\nconst DEFAULT_TITLE = \"\";\nconst DEFAULT_COMPONENT_STATE = {\n\ttitle: DEFAULT_TITLE,\n\tquestion: \"No question.\",\n\tnegativeResponseLabel: \"No\",\n\taffirmativeResponseLabel: \"Yes\",\n\tcancelResponseLabel: \"Cancel\",\n\tshowNegativeButton: true,\n\tshowAffirmativeButton: true,\n\tshowCancelButton: true,\n};\n\ninterface IProps {}\ninterface IState {\n\ttitle: string;\n\tquestion: string;\n\tnegativeResponseLabel: string;\n\taffirmativeResponseLabel: string;\n\tcancelResponseLabel: string;\n\tshowNegativeButton: boolean;\n\tshowAffirmativeButton: boolean;\n\tshowCancelButton: boolean;\n\thideModalOnClose?: boolean;\n\tshowTimer?: boolean;\n\ttimerDuration?: number | null;\n}\n\n/**\n * This is our standard dialog that presents the user with 1 - 3 choices. It can be used to allow the user to confirm, reject, or cancel an action. All of these options can be included, and all can be excluded.\n *\n * @class YesNoDialog\n * @extends {React.Component}\n */\nclass YesNoDialogBase extends React.Component<IProps, IState> {\n\tconstructor(props = {}) {\n\t\tsuper(props);\n\t\tthis.bindCorrectContext();\n\t\tthis.state = DEFAULT_COMPONENT_STATE;\n\t\tdocument.body.addEventListener(\"keydown\", this.handleKeydownOnBody);\n\t}\n\n\t/**\n\t * Handles escape and enter.\n\t *\n\t * @param {any} e\n\t * @memberof YesNoDialog\n\t */\n\thandleKeydownOnBody(e: any) {\n\t\tif (e.code === \"Enter\" && e.shiftKey === false) {\n\t\t\tthis.sendResponse(\"affirmative\");\n\t\t}\n\n\t\tif (e.code === \"Escape\") {\n\t\t\tthis.sendResponse(\"cancel\");\n\t\t}\n\t}\n\n\t/**\n\t * Necessary to ensure that `this` is correct when our methods are invoked.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tbindCorrectContext() {\n\t\tthis.handleKeydownOnBody = this.handleKeydownOnBody.bind(this);\n\t\tthis.onShowRequested = this.onShowRequested.bind(this);\n\t\tthis.sendAffirmativeResponse = this.sendAffirmativeResponse.bind(this);\n\t\tthis.sendCancelResponse = this.sendCancelResponse.bind(this);\n\t\tthis.sendNegativeResponse = this.sendNegativeResponse.bind(this);\n\t\tthis.sendExpiredResponse = this.sendExpiredResponse.bind(this);\n\t\tthis.sendResponse = this.sendResponse.bind(this);\n\t}\n\n\t/**\n\t * When the opener requests that the dialog show itself, it also passes in initialization data. This function grabs that data, calls setState, and then fits the window to the contents of the DOM. Then we call `showDialog`, which will display the dialog on the proper monitor.\n\t *\n\t * @param {any} err\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tonShowRequested(err: any, response: any) {\n\t\tlet { data } = response;\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\ttitle: typeof data.title === \"undefined\" ? DEFAULT_TITLE : data.title,\n\t\t\t\thideModalOnClose: typeof data.hideModalOnClose === \"undefined\" ? true : data.hideModalOnClose,\n\t\t\t\tquestion: data.question,\n\t\t\t\tnegativeResponseLabel: data.negativeResponseLabel || \"No\",\n\t\t\t\taffirmativeResponseLabel: data.affirmativeResponseLabel || \"Yes\",\n\t\t\t\tcancelResponseLabel: data.cancelResponseLabel || \"Cancel\",\n\t\t\t\tshowNegativeButton: typeof data.showNegativeButton === \"undefined\" ? true : data.showNegativeButton,\n\t\t\t\tshowAffirmativeButton: typeof data.showAffirmativeButton === \"undefined\" ? true : data.showAffirmativeButton,\n\t\t\t\tshowCancelButton: typeof data.showCancelButton === \"undefined\" ? true : data.showCancelButton,\n\t\t\t\tshowTimer: typeof data.showTimer === \"undefined\" ? false : data.showTimer,\n\t\t\t\ttimerDuration: typeof data.timerDuration === \"undefined\" ? null : data.timerDuration,\n\t\t\t},\n\t\t\tthis.fitAndShow\n\t\t);\n\t}\n\n\t/**\n\t * Fits the contents of the DOM to the window, then calls `showDialog`, which positions the dialog on the proper monitor and toggles the visibility of the window.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tfitAndShow() {\n\t\tFSBL.Clients.WindowClient.fitToDOM(null, () => {\n\t\t\tFSBL.Clients.DialogManager.showDialog();\n\t\t});\n\t}\n\n\t/**\n\t * Sends user input to the opener.\n\t *\n\t * @param {any} response\n\t * @memberof YesNoDialog\n\t */\n\tsendResponse(response: any) {\n\t\tFSBL.Clients.DialogManager.respondToOpener({\n\t\t\tchoice: response,\n\t\t\thideModalOnClose: this.state.hideModalOnClose,\n\t\t});\n\t\t// This will detach the timer component from the dom. Next time the component comes up, it'll have a fresh timer.\n\t\tthis.setState({\n\t\t\tshowTimer: false,\n\t\t});\n\t}\n\n\t/**\n\t * Sends an affirmative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendAffirmativeResponse() {\n\t\tthis.sendResponse(\"affirmative\");\n\t}\n\n\t/**\n\t * Sends a negative response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendNegativeResponse() {\n\t\tthis.sendResponse(\"negative\");\n\t}\n\n\t/**\n\t * Sends a cancel response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendCancelResponse() {\n\t\tthis.sendResponse(\"cancel\");\n\t}\n\n\t/**\n\t * Sends an expired response to the opener.\n\t *\n\t * @memberof YesNoDialog\n\t */\n\tsendExpiredResponse() {\n\t\tthis.sendResponse(\"expired\");\n\t}\n\n\trender() {\n\t\tdocument.title = this.state.title;\n\t\treturn (\n\t\t\t<FinsembleDialog\n\t\t\t\tuserInputTimeout={10000}\n\t\t\t\tbehaviorOnResponse=\"hide\"\n\t\t\t\tonShowRequested={this.onShowRequested}\n\t\t\t\tisModal={true}\n\t\t\t>\n\t\t\t\t<div className=\"dialog-title\">{this.state.title}</div>\n\t\t\t\t<FinsembleDialogQuestion>\n\t\t\t\t\t{this.state.question}\n\t\t\t\t\t{this.state.showTimer && typeof this.state.timerDuration === \"number\" && (\n\t\t\t\t\t\t<Timer ontimerDurationExpiration={this.sendExpiredResponse} timerDuration={this.state.timerDuration} />\n\t\t\t\t\t)}\n\t\t\t\t</FinsembleDialogQuestion>\n\t\t\t\t<div className=\"button-wrapper\">\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showNegativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendNegativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.negativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showCancelButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-neutral\"\n\t\t\t\t\t\tonClick={this.sendCancelResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.cancelResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\n\t\t\t\t\t<FinsembleDialogButton\n\t\t\t\t\t\tshow={this.state.showAffirmativeButton}\n\t\t\t\t\t\tclassName=\"fsbl-button-affirmative\"\n\t\t\t\t\t\tonClick={this.sendAffirmativeResponse}\n\t\t\t\t\t>\n\t\t\t\t\t\t{this.state.affirmativeResponseLabel}\n\t\t\t\t\t</FinsembleDialogButton>\n\t\t\t\t</div>\n\t\t\t</FinsembleDialog>\n\t\t);\n\t}\n}\n\n/**\n * This dialog window provides a binary choice to the user, and reports back the response to the opener.\n */\nexport const YesNoDialog = () => <YesNoDialogBase />;\n"]}
|
|
@@ -54,6 +54,10 @@ describe("<YesNoDialog/>", () => {
|
|
|
54
54
|
expect(dialog_text).to.not.contain("Cancel");
|
|
55
55
|
});
|
|
56
56
|
it.skip("should handle keyboard interactions", () => {
|
|
57
|
+
// const wrapper = mount(<Basic {...(Basic.args as any)} />);
|
|
58
|
+
// Keyboard interactions are wired up to document.body.addEventListener, and Enzyme doesn't let us mock that
|
|
59
|
+
// This is a possibility, but it would require simulant and maybe also jsdom:
|
|
60
|
+
// https://github.com/enzymejs/enzyme/issues/426
|
|
57
61
|
});
|
|
58
62
|
});
|
|
59
63
|
//# sourceMappingURL=YesNoDialog.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YesNoDialog.spec.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,OAA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GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,IAAI,CAAC,qCAAqC,EAAE,GAAG,EAAE;QACnD,6DAA6D;QAC7D,4GAA4G;QAC5G,6EAA6E;QAC7E,gDAAgD;IACjD,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import * as React from \"react\";\nimport { mount } from \"enzyme\";\nimport { describe, it } from \"mocha\";\nimport { expect } from \"chai\";\nimport sinon from \"sinon\";\nimport { Basic, Empty, WithTimer, NoText, NoButtons, CustomButtonLabels } from \"./YesNoDialog.stories\";\nimport { accessibilityAssessor } from \"../sdd/tests/a11y_helper\";\n\ndescribe(\"<YesNoDialog/>\", () => {\n\tit(\"should pass accessibility scans\", async () => {\n\t\tconst wrapper = mount(<Basic />);\n\n\t\texpect(await accessibilityAssessor(wrapper)).to.be.true;\n\t});\n\tit(\"should display Yes, No, and Cancel by default\", async () => {\n\t\tconst wrapper = mount(<Empty />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Yes\");\n\t\texpect(dialog_text).to.contain(\"No\");\n\t\texpect(dialog_text).to.contain(\"Cancel\");\n\t});\n\tit(\"should display Yes and Cancel, but not No\", async () => {\n\t\tconst wrapper = mount(<Basic {...(Basic.args as any)} />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Yes\");\n\t\texpect(dialog_text).to.not.contain(\"No\");\n\t\texpect(dialog_text).to.contain(\"Cancel\");\n\t});\n\tit(\"should show 'Time remaining' until the clock ticks away\", () => {\n\t\tconst clock = sinon.useFakeTimers();\n\t\tconst wrapper = mount(<WithTimer {...(WithTimer.args as any)} />);\n\n\t\texpect(wrapper.find(\".dialog\").text(), \"Before countdown\").to.contain(\"Time remaining:\");\n\t\tclock.tick(1000);\n\t\tclock.tick(1000);\n\t\tclock.tick(1000);\n\t\texpect(wrapper.find(\".dialog\").text(), \"After countdown\").to.not.contain(\"Time remaining:\");\n\t\tclock.restore();\n\t});\n\tit(\"should display empty text if no title is provided\", () => {\n\t\tconst wrapper = mount(<NoText {...(NoText.args as any)} />);\n\t\tconst titleText = wrapper.find(\".dialog-title\").text();\n\t\texpect(titleText).to.be.empty;\n\t});\n\tit(\"should not display any buttons if none are approved\", () => {\n\t\tconst wrapper = mount(<NoButtons {...(NoButtons.args as any)} />);\n\t\texpect(wrapper.find(\"button\").length).to.equal(0);\n\t});\n\tit(\"should display custom button labels when provided\", () => {\n\t\tconst wrapper = mount(<CustomButtonLabels {...(CustomButtonLabels.args as any)} />);\n\n\t\tconst dialog_text = wrapper.find(\".dialog\").text();\n\t\texpect(dialog_text).to.contain(\"Tak\");\n\t\texpect(dialog_text).to.contain(\"Nie\");\n\t\texpect(dialog_text).to.contain(\"Anuluj\");\n\t\texpect(dialog_text).to.not.contain(\"Yes\");\n\t\texpect(dialog_text).to.not.contain(\"No\");\n\t\texpect(dialog_text).to.not.contain(\"Cancel\");\n\t});\n\tit.skip(\"should handle keyboard interactions\", () => {\n\t\t// const wrapper = mount(<Basic {...(Basic.args as any)} />);\n\t\t// Keyboard interactions are wired up to document.body.addEventListener, and Enzyme doesn't let us mock that\n\t\t// This is a possibility, but it would require simulant and maybe also jsdom:\n\t\t// https://github.com/enzymejs/enzyme/issues/426\n\t});\n});\n"]}
|
|
@@ -9,8 +9,8 @@ export default {
|
|
|
9
9
|
const Template = (args) => {
|
|
10
10
|
initFSBL(window);
|
|
11
11
|
if (args._data) {
|
|
12
|
-
FSBL.Clients.DialogManager.registerDialogCallback = (cb) => {
|
|
13
|
-
cb("", { data: args._data });
|
|
12
|
+
FSBL.Clients.DialogManager.registerDialogCallback = async (cb) => {
|
|
13
|
+
cb === null || cb === void 0 ? void 0 : cb("", { data: args._data });
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
return React.createElement(YesNoDialog, Object.assign({}, args));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YesNoDialog.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,8BAA8B,CAAC;AAEtC,eAAe;IACd,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,WAAW;CACtB,CAAC;AAEF,MAAM,QAAQ,GAAc,CAAC,IAAS,EAAE,EAAE;IACzC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,IAAI,IAAI,CAAC,KAAK,EAAE;QACf,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"YesNoDialog.stories.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/YesNoDialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,8BAA8B,CAAC;AAEtC,eAAe;IACd,KAAK,EAAE,yBAAyB;IAChC,SAAS,EAAE,WAAW;CACtB,CAAC;AAEF,MAAM,QAAQ,GAAc,CAAC,IAAS,EAAE,EAAE;IACzC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjB,IAAI,IAAI,CAAC,KAAK,EAAE;QACf,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,sBAAsB,GAAG,KAAK,EAAE,EAAO,EAAE,EAAE;YACrE,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;QAChC,CAAC,CAAC;KACF;IAED,OAAO,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BAAgB,EAAE,KAAK;KACvB;CACD,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACpD,kBAAkB,CAAC,IAAI,GAAG;IACzB,KAAK,EAAE;QACN,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,qBAAqB;QAC/B,kBAAkB,EAAE,IAAI;QACxB,qBAAqB,EAAE,IAAI;QAC3B,gBAAgB,EAAE,IAAI;QACtB,wBAAwB,EAAE,KAAK;QAC/B,qBAAqB,EAAE,KAAK;QAC5B,mBAAmB,EAAE,QAAQ;QAC7B,SAAS,EAAE,KAAK;KAChB;CACD,CAAC","sourcesContent":["import React from \"react\";\nimport { YesNoDialog } from \"./YesNoDialog\";\nimport { initFSBL } from \"../common/helpers\";\nimport { Story } from \"@storybook/react/types-6-0\";\nimport \"../../assets/css/dialogs.css\";\n\nexport default {\n\ttitle: \"YesNoDialog/YesNoDialog\",\n\tcomponent: YesNoDialog,\n};\n\nconst Template: Story<{}> = (args: any) => {\n\tinitFSBL(window);\n\n\tif (args._data) {\n\t\tFSBL.Clients.DialogManager.registerDialogCallback = async (cb: any) => {\n\t\t\tcb?.(\"\", { data: args._data });\n\t\t};\n\t}\n\n\treturn <YesNoDialog {...args} />;\n};\n\nexport const Empty = Template.bind({});\n\nexport const Basic = Template.bind({});\nBasic.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\tshowTimer: false,\n\t},\n};\n\nexport const NoText = Template.bind({});\nNoText.args = {\n\t_data: {\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t},\n};\n\nexport const WithTimer = Template.bind({});\nWithTimer.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\tshowTimer: true,\n\t\ttimerDuration: 3000,\n\t},\n};\n\nexport const NoButtons = Template.bind({});\nNoButtons.args = {\n\t_data: {\n\t\ttitle: \"No buttons\",\n\t\tquestion: \"What are you going to do about it?\",\n\t\tshowNegativeButton: false,\n\t\tshowAffirmativeButton: false,\n\t\tshowCancelButton: false,\n\t},\n};\n\nexport const CustomButtonLabels = Template.bind({});\nCustomButtonLabels.args = {\n\t_data: {\n\t\ttitle: \"Example titles\",\n\t\tquestion: \"Is this a question?\",\n\t\tshowNegativeButton: true,\n\t\tshowAffirmativeButton: true,\n\t\tshowCancelButton: true,\n\t\taffirmativeResponseLabel: \"Tak\",\n\t\tnegativeResponseLabel: \"Nie\",\n\t\tcancelResponseLabel: \"Anuluj\",\n\t\tshowTimer: false,\n\t},\n};\n"]}
|
|
@@ -6,6 +6,7 @@ export default class Timer extends React.Component {
|
|
|
6
6
|
timerDuration: props.timerDuration,
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
+
//Every second, subtract a second.
|
|
9
10
|
componentDidMount() {
|
|
10
11
|
this.interval = setInterval(() => {
|
|
11
12
|
let newTime = this.state.timerDuration - 1000;
|
|
@@ -21,6 +22,7 @@ export default class Timer extends React.Component {
|
|
|
21
22
|
}
|
|
22
23
|
}, 1000);
|
|
23
24
|
}
|
|
25
|
+
//Countdown clock.
|
|
24
26
|
render() {
|
|
25
27
|
return React.createElement("div", null,
|
|
26
28
|
"Time remaining: ",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/timer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAyB;IAGjE,YAAY,KAAU;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,KAAK,CAAC,aAAa;SAClC,CAAC;IACH,CAAC;
|
|
1
|
+
{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../src/components/yesNoDialog/timer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,KAAK,CAAC,SAAyB;IAGjE,YAAY,KAAU;QACrB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG;YACZ,aAAa,EAAE,KAAK,CAAC,aAAa;SAClC,CAAC;IACH,CAAC;IAED,kCAAkC;IAClC,iBAAiB;QAChB,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE;YAChC,IAAI,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAC;YAC9C,IAAI,OAAO,IAAI,CAAC,EAAE;gBACjB,IAAI,CAAC,KAAK,CAAC,yBAAyB,EAAE,CAAC;gBACvC,IAAI,IAAI,CAAC,QAAQ;oBAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aAChD;iBAAM;gBACN,IAAI,CAAC,QAAQ,CAAC;oBACb,aAAa,EAAE,OAAO;iBACtB,CAAC,CAAC;aACH;QACF,CAAC,EAAE,IAAI,CAAC,CAAC;IACV,CAAC;IAED,kBAAkB;IAClB,MAAM;QACL,OAAO;;YAAsB,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,IAAI,CAAO,CAAC;IACrE,CAAC;CACD","sourcesContent":["import React from \"react\";\n\nexport interface IProps {\n\ttimerDuration: number;\n\tontimerDurationExpiration: () => void;\n}\ninterface IState {\n\ttimerDuration: number;\n}\n\nexport default class Timer extends React.Component<IProps, IState> {\n\tinterval?: NodeJS.Timeout;\n\n\tconstructor(props: any) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\ttimerDuration: props.timerDuration,\n\t\t};\n\t}\n\n\t//Every second, subtract a second.\n\tcomponentDidMount() {\n\t\tthis.interval = setInterval(() => {\n\t\t\tlet newTime = this.state.timerDuration - 1000;\n\t\t\tif (newTime <= 0) {\n\t\t\t\tthis.props.ontimerDurationExpiration();\n\t\t\t\tif (this.interval) clearInterval(this.interval);\n\t\t\t} else {\n\t\t\t\tthis.setState({\n\t\t\t\t\ttimerDuration: newTime,\n\t\t\t\t});\n\t\t\t}\n\t\t}, 1000);\n\t}\n\n\t//Countdown clock.\n\trender() {\n\t\treturn <div>Time remaining: {this.state.timerDuration / 1000}</div>;\n\t}\n}\n"]}
|
package/react/enzymeSetup.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// This is a helper/setup script that should be `--require`d when calling mocha to run enzyme tests
|
|
2
|
+
// that require more real-world browser DOM objects to be exposed, like `.document` and `.window`.
|
|
3
|
+
// This is needed to use methods like `.mount()` within enzyme.
|
|
4
|
+
// It uses jsdom to set up a fake web browser in JavaScript.
|
|
5
|
+
//import Adapter from "enzyme-adapter-react-16";
|
|
1
6
|
import Adapter from "@wojtekmaj/enzyme-adapter-react-17";
|
|
2
7
|
import { configure } from "enzyme";
|
|
3
8
|
import jsdom from "jsdom";
|
|
@@ -18,6 +23,11 @@ function setUpDomEnvironment() {
|
|
|
18
23
|
userAgent: "node.js",
|
|
19
24
|
};
|
|
20
25
|
global.File = window.File;
|
|
26
|
+
global.FSBL = {
|
|
27
|
+
Clients: {
|
|
28
|
+
SearchClient: {},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
21
31
|
copyProps(window, global);
|
|
22
32
|
}
|
|
23
33
|
setUpDomEnvironment();
|
package/react/enzymeSetup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enzymeSetup.js","sourceRoot":"","sources":["../src/enzymeSetup.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enzymeSetup.js","sourceRoot":"","sources":["../src/enzymeSetup.js"],"names":[],"mappings":"AAAA,mGA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AC;AAEtB,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC","sourcesContent":["// This is a helper/setup script that should be `--require`d when calling mocha to run enzyme tests\n// that require more real-world browser DOM objects to be exposed, like `.document` and `.window`.\n// This is needed to use methods like `.mount()` within enzyme.\n// It uses jsdom to set up a fake web browser in JavaScript.\n\n//import Adapter from \"enzyme-adapter-react-16\";\nimport Adapter from \"@wojtekmaj/enzyme-adapter-react-17\";\nimport { configure } from \"enzyme\";\nimport jsdom from \"jsdom\";\n\nrequire(\"@babel/register\")();\n\nfunction copyProps(src, target) {\n\tconst props = Object.getOwnPropertyNames(src)\n\t\t.filter((prop) => typeof target[prop] === \"undefined\")\n\t\t.map((prop) => Object.getOwnPropertyDescriptor(src, prop));\n\tObject.defineProperties(target, props);\n}\n\nfunction setUpDomEnvironment() {\n\tconst { JSDOM } = jsdom;\n\tconst dom = new JSDOM(\"<!doctype html><html><body></body></html>\", { url: \"http://localhost/\" });\n\tconst { window } = dom;\n\n\tglobal.window = window;\n\tglobal.document = window.document;\n\tglobal.navigator = {\n\t\tuserAgent: \"node.js\",\n\t};\n\tglobal.File = window.File;\n\tglobal.FSBL = {\n\t\tClients: {\n\t\t\tSearchClient: {},\n\t\t},\n\t};\n\tcopyProps(window, global);\n}\n\nsetUpDomEnvironment();\n\nconfigure({ adapter: new Adapter() });\n"]}
|
|
@@ -25,6 +25,10 @@ const initializeDistributedStore = async () => {
|
|
|
25
25
|
}
|
|
26
26
|
DashbarStore = store;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* Fetches an initial list of dashbar items from the persistent distributed store,
|
|
30
|
+
* and if that doesn't exist, from spawnData
|
|
31
|
+
*/
|
|
28
32
|
const initializeDashbarItems = async () => {
|
|
29
33
|
var _a;
|
|
30
34
|
let dashbarItemList;
|
|
@@ -65,10 +69,16 @@ export const useDashbar = () => {
|
|
|
65
69
|
field: "finsemble.availableDashbarItems",
|
|
66
70
|
});
|
|
67
71
|
const newDashbarItems = [];
|
|
72
|
+
// Add the widget name as an id to help identify
|
|
73
|
+
// keys -> widgets when reordering items
|
|
68
74
|
data.value.forEach((item) => setDashbarItem(item, availableDashbarItems, newDashbarItems));
|
|
69
75
|
dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));
|
|
70
76
|
}
|
|
71
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* This effect initializes the dashbar items in the redux store. The store must only be initialized once. We use the module level variable
|
|
80
|
+
* `storageIsInitialized` as a simple flag to prevent initialization from occuring more than once.
|
|
81
|
+
*/
|
|
72
82
|
useDeepEffect(async () => {
|
|
73
83
|
if (!storageIsInitialized) {
|
|
74
84
|
storageIsInitialized = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDashbar.js","sourceRoot":"","sources":["../../src/hooks/useDashbar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAO1C,IAAI,oBAAoB,GAAY,KAAK,CAAC;AAM1C,IAAI,YAAwB,CAAC;AAE7B,MAAM,cAAc,GAAG,CACtB,QAAgB,EAChB,qBAAkD,EAClD,eAA8B,EAC7B,EAAE;IACH,IAAI,qBAAqB,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACnD,MAAM,OAAO,GAAG,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAChD,OAAO,CAAC,EAAE,GAAG,QAAQ,CAAC;QACtB,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;KAC9B;AACF,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,KAAK,IAAmB,EAAE;IAC5D,MAAM,WAAW,GAAG;QACnB,KAAK,EAAE,yBAAyB;QA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elector } from \"../store\";\nimport { ToolbarActions } from \"../actions/toolbarActions\";\nimport { useDispatch } from \"react-redux\";\nimport { DashbarItem } from \"../types/dashbarTypes\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StoreModel = types.StoreModel;\ntype StandardError = types.StandardError;\n\nlet storageIsInitialized: boolean = false;\n\ntype DashbarStoreValueType = {\n\tdashbaritems: DashbarItem[];\n};\n\nlet DashbarStore: StoreModel;\n\nconst setDashbarItem = (\n\titemName: string,\n\tavailableDashbarItems: Record<string, DashbarItem>,\n\tnewDashbarItems: DashbarItem[]\n) => {\n\tif (availableDashbarItems.hasOwnProperty(itemName)) {\n\t\tconst newItem = availableDashbarItems[itemName];\n\t\tnewItem.id = itemName;\n\t\tnewDashbarItems.push(newItem);\n\t}\n};\n\nconst initializeDistributedStore = async (): Promise<void> => {\n\tconst storeParams = {\n\t\tstore: \"Finsemble-Dashbar-Store\",\n\t\tglobal: true,\n\t\tpersist: true,\n\t};\n\tconst { err, data: store } = await FSBL.Clients.DistributedStoreClient.createStore(storeParams);\n\tif (err || !store) {\n\t\tconst error = `Error initializing dashbar: unable to retrieve stored items, falling back to config: ${err}`;\n\t\tFSBL.Clients.Logger.system.error(error);\n\t\treturn;\n\t}\n\n\tDashbarStore = store;\n};\n\n/**\n * Fetches an initial list of dashbar items from the persistent distributed store,\n * and if that doesn't exist, from spawnData\n */\nconst initializeDashbarItems = async (): Promise<DashbarItem[] | null> => {\n\tlet dashbarItemList;\n\tif (DashbarStore && Object.keys(DashbarStore.values).length > 0) {\n\t\tdashbarItemList = (DashbarStore.values as DashbarStoreValueType).dashbaritems;\n\t}\n\n\tif (!dashbarItemList) {\n\t\tconst spawnData = FSBL.Clients.WindowClient.getSpawnData();\n\t\tif (Array.isArray(spawnData?.dashbar?.items)) {\n\t\t\tdashbarItemList = spawnData.dashbar.items;\n\t\t}\n\t}\n\n\tif (!dashbarItemList) dashbarItemList = [];\n\n\tconst newDashbarItems: DashbarItem[] = [];\n\tif (dashbarItemList.length > 0) {\n\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\tfield: \"finsemble.availableDashbarItems\",\n\t\t});\n\n\t\tdashbarItemList.forEach((itemName: string) => setDashbarItem(itemName, availableDashbarItems, newDashbarItems));\n\t}\n\n\tif (!DashbarStore.values.dashbaritems) {\n\t\tDashbarStore.setValue({\n\t\t\tfield: \"dashbaritems\",\n\t\t\tvalue: dashbarItemList,\n\t\t});\n\t\treturn null;\n\t} else {\n\t\treturn newDashbarItems;\n\t}\n};\n\nexport const useDashbar = () => {\n\tconst dispatch = useDispatch();\n\n\tconst setDashbarItems = async (err: StandardError, data: any) => {\n\t\tif (!err && data) {\n\t\t\tconst { data: availableDashbarItems } = await FSBL.Clients.ConfigClient.getValue({\n\t\t\t\tfield: \"finsemble.availableDashbarItems\",\n\t\t\t});\n\t\t\tconst newDashbarItems: DashbarItem[] = [];\n\t\t\t// Add the widget name as an id to help identify\n\t\t\t// keys -> widgets when reordering items\n\t\t\tdata.value.forEach((item: string) => setDashbarItem(item, availableDashbarItems, newDashbarItems));\n\n\t\t\tdispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\n\t\t}\n\t};\n\n\t/**\n\t * This effect initializes the dashbar items in the redux store. The store must only be initialized once. We use the module level variable\n\t * `storageIsInitialized` as a simple flag to prevent initialization from occuring more than once.\n\t */\n\tuseDeepEffect(async () => {\n\t\tif (!storageIsInitialized) {\n\t\t\tstorageIsInitialized = true;\n\t\t\tawait initializeDistributedStore();\n\t\t\tconst newDashbarItems = await initializeDashbarItems();\n\t\t\tif (newDashbarItems) dispatch(ToolbarActions.SET_DASHBAR_ITEMS(newDashbarItems));\n\t\t\tDashbarStore.addListener({ field: \"dashbaritems\" }, setDashbarItems);\n\t\t}\n\t\treturn function cleanup() {\n\t\t\tDashbarStore.removeListener({ field: \"dashbaritems\" }, setDashbarItems);\n\t\t};\n\t}, [dispatch]);\n\n\tconst { dashbarItems } = useSelector((state) => state.toolbar);\n\n\tconst reorderDashbarItems = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tconst dashbarItemsNewOrder = [...dashbarItems];\n\t\tconst dashbarItemToMove = dashbarItemsNewOrder[oldIndex];\n\t\tdashbarItemsNewOrder.splice(oldIndex, 1);\n\t\tdashbarItemsNewOrder.splice(newIndex, 0, dashbarItemToMove);\n\n\t\tconst newOrderList = dashbarItemsNewOrder.map((dashbarItem) => dashbarItem.id);\n\n\t\tDashbarStore.setValue(\n\t\t\t{\n\t\t\t\tfield: \"dashbaritems\",\n\t\t\t\tvalue: newOrderList,\n\t\t\t},\n\t\t\t() => {\n\t\t\t\tdispatch(ToolbarActions.REORDER_DASHBAR_ITEMS({ oldIndex, newIndex }));\n\t\t\t}\n\t\t);\n\t};\n\n\treturn {\n\t\tdashbarItems,\n\t\treorderDashbarItems,\n\t};\n};\n"]}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use this just like useEffect() except that this will compare objects and arrays using lodash's isEqual() method.
|
|
3
|
+
* Always pass an array of dependencies as the second parameter!!!
|
|
4
|
+
*/
|
|
1
5
|
export declare function useDeepEffect(callback: any, dependencies: Array<any>): void;
|
|
@@ -7,7 +7,28 @@ function useDeepCompareMemoize(value) {
|
|
|
7
7
|
}
|
|
8
8
|
return ref.current;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Use this just like useEffect() except that this will compare objects and arrays using lodash's isEqual() method.
|
|
12
|
+
* Always pass an array of dependencies as the second parameter!!!
|
|
13
|
+
*/
|
|
10
14
|
export function useDeepEffect(callback, dependencies) {
|
|
11
15
|
useEffect(callback, useDeepCompareMemoize(dependencies));
|
|
12
16
|
}
|
|
17
|
+
/*
|
|
18
|
+
// Previous implementation that had bugs. Keep around for a bit until we shake out the new version.
|
|
19
|
+
export function useDeepEffect(effectFunc : Function, deps : Array<any>) {
|
|
20
|
+
const isFirst = useRef(true);
|
|
21
|
+
const prevDeps = useRef(deps);
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
const isSame = prevDeps.current.every((obj: any, index: any) => isEqual(obj, deps[index]));
|
|
25
|
+
if (isFirst.current || !isSame) {
|
|
26
|
+
effectFunc();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
isFirst.current = false;
|
|
30
|
+
prevDeps.current = deps;
|
|
31
|
+
}, deps);
|
|
32
|
+
}
|
|
33
|
+
*/
|
|
13
34
|
//# sourceMappingURL=useDeepEffect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeepEffect.js","sourceRoot":"","sources":["../../src/hooks/useDeepEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,SAAS,qBAAqB,CAAC,KAAU;IACxC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QACjC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"useDeepEffect.js","sourceRoot":"","sources":["../../src/hooks/useDeepEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,SAAS,qBAAqB,CAAC,KAAU;IACxC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC;IAErB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QACjC,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;KACpB;IAED,OAAO,GAAG,CAAC,OAAO,CAAC;AACpB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,QAAa,EAAE,YAAwB;IACpE,SAAS,CAAC,QAAQ,EAAE,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED;;;;;;;;;;;;;;;;EAgBE","sourcesContent":["import { useEffect, useRef } from \"react\";\nimport isEqual from \"lodash/isEqual\";\n\nfunction useDeepCompareMemoize(value: any) {\n\tconst ref = useRef();\n\n\tif (!isEqual(value, ref.current)) {\n\t\tref.current = value;\n\t}\n\n\treturn ref.current;\n}\n\n/**\n * Use this just like useEffect() except that this will compare objects and arrays using lodash's isEqual() method.\n * Always pass an array of dependencies as the second parameter!!!\n */\nexport function useDeepEffect(callback: any, dependencies: Array<any>) {\n\tuseEffect(callback, useDeepCompareMemoize(dependencies));\n}\n\n/*\n// Previous implementation that had bugs. Keep around for a bit until we shake out the new version.\nexport function useDeepEffect(effectFunc : Function, deps : Array<any>) {\n\tconst isFirst = useRef(true);\n\tconst prevDeps = useRef(deps);\n\n\tuseEffect(() => {\n\t\tconst isSame = prevDeps.current.every((obj: any, index: any) => isEqual(obj, deps[index]));\n\t\tif (isFirst.current || !isSame) {\n\t\t\teffectFunc();\n\t\t}\n\n\t\tisFirst.current = false;\n\t\tprevDeps.current = deps;\n\t}, deps);\n}\n*/\n"]}
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
import { Favorite } from "../types/favoriteTypes";
|
|
2
2
|
declare type FavoritesHook = {
|
|
3
|
+
/**
|
|
4
|
+
* The current favorites list from the store.
|
|
5
|
+
*/
|
|
3
6
|
favorites: Favorite[];
|
|
7
|
+
/**
|
|
8
|
+
* Adds a favorite to the favorites store.
|
|
9
|
+
*/
|
|
4
10
|
addFavorite: (favorite: Favorite) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Removes the favorite for the given id from the favorites store.
|
|
13
|
+
*/
|
|
5
14
|
removeFavorite: (id: Favorite["id"]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Returns true if the current id has been favorited.
|
|
17
|
+
*/
|
|
6
18
|
isFavorited: (id: Favorite["id"]) => boolean;
|
|
7
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* The useFavorites() hook is used by FavoriteMaker to interact with the redux store.
|
|
22
|
+
*/
|
|
8
23
|
export declare const useFavorites: () => FavoritesHook;
|
|
9
24
|
export {};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { useDispatch, useSelector } from "../store";
|
|
2
2
|
import { FavoriteActions } from "../actions/favoriteActions";
|
|
3
|
+
/**
|
|
4
|
+
* The useFavorites() hook is used by FavoriteMaker to interact with the redux store.
|
|
5
|
+
*/
|
|
3
6
|
export const useFavorites = () => {
|
|
4
7
|
const dispatch = useDispatch();
|
|
5
8
|
const { favorites } = useSelector((state) => state.favorite);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFavorites.js","sourceRoot":"","sources":["../../src/hooks/useFavorites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"useFavorites.js","sourceRoot":"","sources":["../../src/hooks/useFavorites.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAwB7D;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,GAAkB,EAAE;IAC/C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,SAAS,EAAE,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEpD,MAAM,WAAW,GAAG,CAAC,QAAkB,EAAE,EAAE;QAC1C,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClD,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,CAAC,EAAkB,EAAE,EAAE;QAC7C,QAAQ,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC,CAAC;IAEF,MAAM,WAAW,GAAG,CAAC,EAAkB,EAAE,EAAE,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEtE,OAAO;QACN,SAAS;QACT,WAAW;QACX,cAAc;QACd,WAAW;KACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\nimport { Favorite } from \"../types/favoriteTypes\";\nimport { FavoriteActions } from \"../actions/favoriteActions\";\n\ntype FavoritesHook = {\n\t/**\n\t * The current favorites list from the store.\n\t */\n\tfavorites: Favorite[];\n\n\t/**\n\t * Adds a favorite to the favorites store.\n\t */\n\taddFavorite: (favorite: Favorite) => void;\n\n\t/**\n\t * Removes the favorite for the given id from the favorites store.\n\t */\n\tremoveFavorite: (id: Favorite[\"id\"]) => void;\n\n\t/**\n\t * Returns true if the current id has been favorited.\n\t */\n\tisFavorited: (id: Favorite[\"id\"]) => boolean;\n};\n\n/**\n * The useFavorites() hook is used by FavoriteMaker to interact with the redux store.\n */\nexport const useFavorites = (): FavoritesHook => {\n\tconst dispatch = useDispatch();\n\tconst { favorites } = useSelector((state) => state.favorite);\n\tconst favoritesIds = favorites.map((fav) => fav.id);\n\n\tconst addFavorite = (favorite: Favorite) => {\n\t\tdispatch(FavoriteActions.ADD_FAVORITE(favorite));\n\t};\n\n\tconst removeFavorite = (id: Favorite[\"id\"]) => {\n\t\tdispatch(FavoriteActions.REMOVE_FAVORITE(id));\n\t};\n\n\tconst isFavorited = (id: Favorite[\"id\"]) => favoritesIds.includes(id);\n\n\treturn {\n\t\tfavorites,\n\t\taddFavorite,\n\t\tremoveFavorite,\n\t\tisFavorited,\n\t};\n};\n"]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Favorite } from "../types/favoriteTypes";
|
|
2
|
+
/**
|
|
3
|
+
* The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store
|
|
4
|
+
* and storage.
|
|
5
|
+
*/
|
|
2
6
|
export declare const useFavoritesShell: () => {
|
|
3
7
|
favorites: Favorite[];
|
|
4
8
|
removeFavorite: (id: string) => void;
|
|
@@ -3,9 +3,20 @@ import { FavoriteActions } from "../actions/favoriteActions";
|
|
|
3
3
|
import { useFavorites } from "./useFavorites";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
5
|
let storageIsInitialized = false;
|
|
6
|
+
/**
|
|
7
|
+
* The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store
|
|
8
|
+
* and storage.
|
|
9
|
+
*/
|
|
6
10
|
export const useFavoritesShell = () => {
|
|
7
11
|
const dispatch = useDispatch();
|
|
8
12
|
const { favorites, removeFavorite } = useFavorites();
|
|
13
|
+
// Ideally in the future the following function will be decoupled from implementation, allowing Favorites to generically dispatch actions.
|
|
14
|
+
/**
|
|
15
|
+
* Given a favorite item, trigger the associated action on that item.
|
|
16
|
+
* I.e. If it's a finsemble component, a new window of that component is launched. If it's a workspace, the workspace would be switched to.
|
|
17
|
+
* @param id The favorite item's id
|
|
18
|
+
* @param category The to be triggered favorite item's category
|
|
19
|
+
*/
|
|
9
20
|
const triggerFavorite = async (id, category) => {
|
|
10
21
|
if (category === "Application") {
|
|
11
22
|
FSBL.Clients.LauncherClient.spawn(id, {
|
|
@@ -24,13 +35,24 @@ export const useFavoritesShell = () => {
|
|
|
24
35
|
});
|
|
25
36
|
}
|
|
26
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* We need to persist the right order in whent he user reorders favorites in the toolbar. This ensures
|
|
40
|
+
* that favorites will appear in the right order on future Toolbar launches.
|
|
41
|
+
* @param favElements The ordered collection of favorite elements
|
|
42
|
+
*/
|
|
27
43
|
const setFavoritesOrder = ({ oldIndex, newIndex }) => {
|
|
28
44
|
dispatch(FavoriteActions.REORDER_FAVORITES({ oldIndex, newIndex }));
|
|
29
45
|
};
|
|
46
|
+
/**
|
|
47
|
+
* This effect initializes the favorites redux store. The store must only be initialized once, even though useFavorites may be
|
|
48
|
+
* referenced by many different React components. We use the module level variable `storageIsInitialized` as a simple flag to
|
|
49
|
+
* prevent initialization from occuring more than once.
|
|
50
|
+
*/
|
|
30
51
|
useEffect(() => {
|
|
31
52
|
if (storageIsInitialized)
|
|
32
53
|
return;
|
|
33
54
|
storageIsInitialized = true;
|
|
55
|
+
// Copy the persisted favorites from Storage to the redux store
|
|
34
56
|
FSBL.Clients.StorageClient.get({ topic: "favorites", key: "allCurrentFavorites" }, (err, data) => {
|
|
35
57
|
if (err) {
|
|
36
58
|
return FSBL.Clients.Logger.system.error(`Favorite Hook -> Failed to retrieve favorites from StorageClient: ${err}`);
|
|
@@ -38,6 +60,7 @@ export const useFavoritesShell = () => {
|
|
|
38
60
|
dispatch(FavoriteActions.INITIALIZE_FAVORITES(data));
|
|
39
61
|
});
|
|
40
62
|
}, [dispatch]);
|
|
63
|
+
// When the list of favorite items change, we want to persist that data to the store.
|
|
41
64
|
useEffect(() => {
|
|
42
65
|
FSBL.Clients.StorageClient.save({
|
|
43
66
|
topic: "favorites",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFavoritesShell.js","sourceRoot":"","sources":["../../src/hooks/useFavoritesShell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,IAAI,oBAAoB,GAAY,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"useF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;QAC5F,QAAQ,CAAC,eAAe,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC,CAAC;IAEF;;;;OAIG;IACH,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB;YAAE,OAAO;QACjC,oBAAoB,GAAG,IAAI,CAAC;QAC5B,+DAA+D;QAC/D,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,qBAAqB,EAAE,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;YAChG,IAAI,GAAG,EAAE;gBACR,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CACtC,qEAAqE,GAAG,EAAE,CAC1E,CAAC;aACF;YACD,QAAQ,CAAC,eAAe,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEf,qFAAqF;IACrF,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC;YAC/B,KAAK,EAAE,WAAW;YAClB,GAAG,EAAE,qBAAqB;YAC1B,KAAK,EAAE,SAAS;SAChB,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAEhB,OAAO;QACN,SAAS;QACT,cAAc;QACd,eAAe;QACf,iBAAiB;KACjB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import { useDispatch } from \"../store\";\nimport { Favorite } from \"../types/favoriteTypes\";\nimport { FavoriteActions } from \"../actions/favoriteActions\";\nimport { useFavorites } from \"./useFavorites\";\nimport { useEffect } from \"react\";\nimport { types } from \"@finsemble/finsemble-api\";\n\ntype StandardError = types.StandardError;\n\nlet storageIsInitialized: boolean = false;\n\n/**\n * The useFavoritesShell() hook is used by FavoritesShell to interact with the redux store\n * and storage.\n */\nexport const useFavoritesShell = () => {\n\tconst dispatch = useDispatch();\n\tconst { favorites, removeFavorite } = useFavorites();\n\n\t// Ideally in the future the following function will be decoupled from implementation, allowing Favorites to generically dispatch actions.\n\t/**\n\t * Given a favorite item, trigger the associated action on that item.\n\t * I.e. If it's a finsemble component, a new window of that component is launched. If it's a workspace, the workspace would be switched to.\n\t * @param id The favorite item's id\n\t * @param category The to be triggered favorite item's category\n\t */\n\tconst triggerFavorite = async (id: Favorite[\"id\"], category: Favorite[\"category\"]) => {\n\t\tif (category === \"Application\") {\n\t\t\tFSBL.Clients.LauncherClient.spawn(id, {\n\t\t\t\taddToWorkspace: true,\n\t\t\t\tmonitor: \"mine\",\n\t\t\t});\n\t\t} else if (category === \"Workspace\") {\n\t\t\tFSBL.Clients.DistributedStoreClient.getStore(\n\t\t\t\t{ store: \"Finsemble-WorkspaceMenu-Global-Store\", global: true },\n\t\t\t\t(err: StandardError, store?: any) => {\n\t\t\t\t\tstore.Dispatcher.dispatch({\n\t\t\t\t\t\tactionType: \"switchToWorkspace\",\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tname: id,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\t/**\n\t * We need to persist the right order in whent he user reorders favorites in the toolbar. This ensures\n\t * that favorites will appear in the right order on future Toolbar launches.\n\t * @param favElements The ordered collection of favorite elements\n\t */\n\tconst setFavoritesOrder = ({ oldIndex, newIndex }: { oldIndex: number; newIndex: number }) => {\n\t\tdispatch(FavoriteActions.REORDER_FAVORITES({ oldIndex, newIndex }));\n\t};\n\n\t/**\n\t * This effect initializes the favorites redux store. The store must only be initialized once, even though useFavorites may be\n\t * referenced by many different React components. We use the module level variable `storageIsInitialized` as a simple flag to\n\t * prevent initialization from occuring more than once.\n\t */\n\tuseEffect(() => {\n\t\tif (storageIsInitialized) return;\n\t\tstorageIsInitialized = true;\n\t\t// Copy the persisted favorites from Storage to the redux store\n\t\tFSBL.Clients.StorageClient.get({ topic: \"favorites\", key: \"allCurrentFavorites\" }, (err, data) => {\n\t\t\tif (err) {\n\t\t\t\treturn FSBL.Clients.Logger.system.error(\n\t\t\t\t\t`Favorite Hook -> Failed to retrieve favorites from StorageClient: ${err}`\n\t\t\t\t);\n\t\t\t}\n\t\t\tdispatch(FavoriteActions.INITIALIZE_FAVORITES(data));\n\t\t});\n\t}, [dispatch]);\n\n\t// When the list of favorite items change, we want to persist that data to the store.\n\tuseEffect(() => {\n\t\tFSBL.Clients.StorageClient.save({\n\t\t\ttopic: \"favorites\",\n\t\t\tkey: \"allCurrentFavorites\",\n\t\t\tvalue: favorites,\n\t\t});\n\t}, [favorites]);\n\n\treturn {\n\t\tfavorites,\n\t\tremoveFavorite,\n\t\ttriggerFavorite,\n\t\tsetFavoritesOrder,\n\t};\n};\n"]}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import { HotkeyCombination } from "../types/hotkeyTypes";
|
|
2
|
+
/**
|
|
3
|
+
* This hook can be used to register a global hotkey. It makes use of Finsemble's HotkeyClient API.
|
|
4
|
+
*
|
|
5
|
+
* @param keyCombination [Array<string>] - A hotkey Combination. If null or undefined then no operation will occur.
|
|
6
|
+
* @param action Function - The function to call when the hotkey combination is pressed.
|
|
7
|
+
*/
|
|
2
8
|
export declare const useHotkey: (keyCombination: HotkeyCombination | undefined | null, action: Function) => void;
|
package/react/hooks/useHotkey.js
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { useDeepEffect } from "./useDeepEffect";
|
|
2
|
+
/**
|
|
3
|
+
* This hook can be used to register a global hotkey. It makes use of Finsemble's HotkeyClient API.
|
|
4
|
+
*
|
|
5
|
+
* @param keyCombination [Array<string>] - A hotkey Combination. If null or undefined then no operation will occur.
|
|
6
|
+
* @param action Function - The function to call when the hotkey combination is pressed.
|
|
7
|
+
*/
|
|
2
8
|
export const useHotkey = (keyCombination, action) => {
|
|
9
|
+
// We use a deep effect comparison because we expect arrays to be passed in.
|
|
10
|
+
// React's useEffect() hook only performs shallow comparisons. We use the literal ["escape"] which would trigger an effect with every render.
|
|
11
|
+
// useDeepEffect() is a custom hook that will compare the *contents* of the arrays. This way, two literal instances will still be perceived by React as identical.
|
|
3
12
|
useDeepEffect(() => {
|
|
4
13
|
let actionIsAFunction = typeof action === "function";
|
|
5
14
|
if (!actionIsAFunction)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHotkey.js","sourceRoot":"","sources":["../../src/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"useHotkey.js","sourceRoot":"","sources":["../../src/hooks/useHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,cAAoD,EAAE,MAAgB,EAAE,EAAE;IACnG,4EAA4E;IAC5E,6IAA6I;IAC7I,kKAAkK;IAElK,aAAa,CAAC,GAAG,EAAE;QAClB,IAAI,iBAAiB,GAAG,OAAO,MAAM,KAAK,UAAU,CAAC;QACrD,IAAI,CAAC,iBAAiB;YAAE,OAAO,CAAC,KAAK,CAAC,0DAA0D,CAAC,CAAC;QAClG,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QACzG,OAAO,SAAS,OAAO;YACtB,cAAc,IAAI,iBAAiB,IAAI,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,kBAAkB,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;QAC7G,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["import { useDeepEffect } from \"./useDeepEffect\";\nimport { HotkeyCombination } from \"../types/hotkeyTypes\";\n\n/**\n * This hook can be used to register a global hotkey. It makes use of Finsemble's HotkeyClient API.\n *\n * @param keyCombination [Array<string>] - A hotkey Combination. If null or undefined then no operation will occur.\n * @param action Function - The function to call when the hotkey combination is pressed.\n */\nexport const useHotkey = (keyCombination: HotkeyCombination | undefined | null, action: Function) => {\n\t// We use a deep effect comparison because we expect arrays to be passed in.\n\t// React's useEffect() hook only performs shallow comparisons. We use the literal [\"escape\"] which would trigger an effect with every render.\n\t// useDeepEffect() is a custom hook that will compare the *contents* of the arrays. This way, two literal instances will still be perceived by React as identical.\n\n\tuseDeepEffect(() => {\n\t\tlet actionIsAFunction = typeof action === \"function\";\n\t\tif (!actionIsAFunction) console.error(\"useHotkey() invalid parameters: action is not a function\");\n\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.addGlobalHotkey(keyCombination, action);\n\t\treturn function cleanup() {\n\t\t\tkeyCombination && actionIsAFunction && FSBL.Clients.HotkeyClient.removeGlobalHotkey(keyCombination, action);\n\t\t};\n\t}, [keyCombination, action]);\n};\n"]}
|
package/react/hooks/useLinker.js
CHANGED
|
@@ -2,10 +2,14 @@ import { useDispatch, useSelector } from "../store";
|
|
|
2
2
|
import { useEffect } from "react";
|
|
3
3
|
import { LinkerActions } from "../actions/linkerActions";
|
|
4
4
|
import { MAXIMUM_ALLOWED_ACTIVE_CHANNELS } from "../types/linkerTypes";
|
|
5
|
+
// Encapsulate the linker initialization and Redux dispatch functions inside the hook
|
|
5
6
|
export const useLinker = () => {
|
|
6
7
|
const dispatch = useDispatch();
|
|
7
8
|
const linkerState = useSelector((state) => state.linker);
|
|
8
9
|
const hideWindow = () => {
|
|
10
|
+
// Must blur or you end up having to click twice to show the window.
|
|
11
|
+
// If you just hide, the first time the user clicks
|
|
12
|
+
// on the linker button, the blur will trigger, which will hide the window.
|
|
9
13
|
finsembleWindow.blur();
|
|
10
14
|
finsembleWindow.hide();
|
|
11
15
|
};
|
|
@@ -29,6 +33,12 @@ export const useLinker = () => {
|
|
|
29
33
|
};
|
|
30
34
|
FSBL.Clients.ConfigClient.getValue("finsemble.accessibleLinker", accessibilityCallback);
|
|
31
35
|
};
|
|
36
|
+
/** If user switches the linker channel for different components, this function would be invoked. It will dispatch another
|
|
37
|
+
* action to update the linker's state according to the linker setup on the switched component.
|
|
38
|
+
*
|
|
39
|
+
* @param err error from FSBL
|
|
40
|
+
* @param msg msg from FSBL
|
|
41
|
+
*/
|
|
32
42
|
const onActiveChannelsChanged = (err, msg) => {
|
|
33
43
|
const componentLinkerState = FSBL.Clients.LinkerClient.getState(msg.data.windowIdentifier);
|
|
34
44
|
if (err) {
|
|
@@ -77,9 +87,13 @@ export const useLinker = () => {
|
|
|
77
87
|
}));
|
|
78
88
|
};
|
|
79
89
|
const numberOfActiveChannels = Object.values(linkerState.channels).filter((c) => c === null || c === void 0 ? void 0 : c.active).length;
|
|
90
|
+
// We're activating if the channel is currently inactive
|
|
80
91
|
const activating = !channelActive;
|
|
81
92
|
const deactivating = channelActive;
|
|
82
93
|
const allowedToActivateAnotherChannel = numberOfActiveChannels < MAXIMUM_ALLOWED_ACTIVE_CHANNELS;
|
|
94
|
+
// if we're toggling a channel to be inactive OR
|
|
95
|
+
// we're trying to toggle one to be active AND we have not hit our maximum,
|
|
96
|
+
// let the call go through. Otherwise log an error.
|
|
83
97
|
if (deactivating) {
|
|
84
98
|
FSBL.Clients.LinkerClient.unlinkFromChannel(channelName, windowIdentifier, updateActivationTo(false));
|
|
85
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinker.js","sourceRoot":"","sources":["../../src/hooks/useLinker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;A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AC,CACF,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,MAAM,CAAC,CAAC,MAAM,CAAC;QAEnG,wDAAwD;QACxD,MAAM,UAAU,GAAG,CAAC,aAAa,CAAC;QAClC,MAAM,YAAY,GAAG,aAAa,CAAC;QACnC,MAAM,+BAA+B,GAAG,sBAAsB,GAAG,+BAA+B,CAAC;QACjG,gDAAgD;QAChD,2EAA2E;QAC3E,mDAAmD;QACnD,IAAI,YAAY,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC;SACtG;aAAM,IAAI,UAAU,IAAI,+BAA+B,EAAE;YACzD,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,WAAW,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;SACjG;aAAM;YACN,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAC/B,iCAAiC,+BAA+B,8HAA8H,+BAA+B,2CAA2C,CACxQ,CAAC;SACF;QACD,UAAU,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["import { useDispatch, useSelector } from \"../store\";\nimport { useEffect } from \"react\";\nimport { LinkerActions } from \"../actions/linkerActions\";\nimport { Channel, MAXIMUM_ALLOWED_ACTIVE_CHANNELS } from \"../types/linkerTypes\";\n\ndeclare const finsembleWindow: any;\n\n// Encapsulate the linker initialization and Redux dispatch functions inside the hook\nexport const useLinker = () => {\n\tconst dispatch = useDispatch();\n\tconst linkerState = useSelector((state) => state.linker);\n\n\tconst hideWindow = () => {\n\t\t// Must blur or you end up having to click twice to show the window.\n\t\t// If you just hide, the first time the user clicks\n\t\t// on the linker button, the blur will trigger, which will hide the window.\n\t\tfinsembleWindow.blur();\n\t\tfinsembleWindow.hide();\n\t};\n\n\tuseEffect(() => {\n\t\tconst setInitialChannels = () => {\n\t\t\tconst channels: Channel[] = FSBL.Clients.LinkerClient.getAllChannels();\n\t\t\tdispatch(LinkerActions.SET_CHANNELS({ channels }));\n\t\t};\n\n\t\tconst focusWindow = () => {\n\t\t\tfinsembleWindow.focus();\n\t\t};\n\n\t\tconst initAccessibleLinkerMode = () => {\n\t\t\tconst accessibilityCallback = (err: any, value: any) => {\n\t\t\t\tif (err) {\n\t\t\t\t\tFSBL.Clients.Logger.system.error(`Failed to get accessibleLinker value: ${err}`);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdispatch(\n\t\t\t\t\tLinkerActions.SET_ACCESSIBILITY({\n\t\t\t\t\t\tisAccessibleLinker: Boolean(value),\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t};\n\t\t\tFSBL.Clients.ConfigClient.getValue(\"finsemble.accessibleLinker\", accessibilityCallback);\n\t\t};\n\n\t\t/** If user switches the linker channel for different components, this function would be invoked. It will dispatch another\n\t\t * action to update the linker's state according to the linker setup on the switched component.\n\t\t *\n\t\t * @param err error from FSBL\n\t\t * @param msg msg from FSBL\n\t\t */\n\t\tconst onActiveChannelsChanged = (err: any, msg: any) => {\n\t\t\tconst componentLinkerState = FSBL.Clients.LinkerClient.getState(msg.data.windowIdentifier);\n\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Failed to update the linker state.\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch(\n\t\t\t\tLinkerActions.UPDATE_ACTIVE_CHANNELS({\n\t\t\t\t\tchannelNames: componentLinkerState.channels,\n\t\t\t\t\twindowIdentifier: msg.data.windowIdentifier,\n\t\t\t\t})\n\t\t\t);\n\n\t\t\tmsg.sendQueryResponse(null, null);\n\t\t};\n\n\t\tFSBL.Clients.Logger.system.log(\"Linker component is mounted. Initializing.\");\n\t\tfinsembleWindow.addEventListener(\"blurred\", hideWindow);\n\t\tfinsembleWindow.addEventListener(\"shown\", focusWindow);\n\t\tsetInitialChannels();\n\t\tinitAccessibleLinkerMode();\n\t\tFSBL.Clients.RouterClient.addResponder(\"Finsemble.LinkerWindow.SetActiveChannels\", onActiveChannelsChanged);\n\n\t\treturn () => {\n\t\t\tFSBL.Clients.Logger.system.log(\"Linker component is unmounted. Cleaning up the event listeners.\");\n\t\t\tfinsembleWindow.removeEventListener(\"blurred\", hideWindow);\n\t\t\tfinsembleWindow.removeEventListener(\"shown\", focusWindow);\n\t\t\tFSBL.Clients.RouterClient.removeResponder(\"Finsemble.LinkerWindow.SetActiveChannels\");\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tFSBL.Clients.WindowClient.fitToDOM();\n\t}, [linkerState]);\n\n\tconst toggleChannel = (channelId: number) => {\n\t\tconst channel = linkerState.channels[channelId];\n\t\tif (!channel) {\n\t\t\tFSBL.Clients.Logger.system.error(\"Targeted channel to toggle is not found.\");\n\t\t\treturn;\n\t\t}\n\t\tconst channelName = channel.name;\n\t\tconst channelActive = channel.active;\n\t\tconst { windowIdentifier } = linkerState;\n\n\t\tconst updateActivationTo = (isActive: boolean) => (err: any) => {\n\t\t\tif (err) {\n\t\t\t\tFSBL.Clients.Logger.system.error(\"Error in linkerHook, linkCallback\", err);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatch(\n\t\t\t\tLinkerActions.UPDATE_CHANNEL_STATUS({\n\t\t\t\t\tchannelId,\n\t\t\t\t\tactive: isActive,\n\t\t\t\t})\n\t\t\t);\n\t\t};\n\n\t\tconst numberOfActiveChannels = Object.values(linkerState.channels).filter((c) => c?.active).length;\n\n\t\t// We're activating if the channel is currently inactive\n\t\tconst activating = !channelActive;\n\t\tconst deactivating = channelActive;\n\t\tconst allowedToActivateAnotherChannel = numberOfActiveChannels < MAXIMUM_ALLOWED_ACTIVE_CHANNELS;\n\t\t// if we're toggling a channel to be inactive OR\n\t\t// we're trying to toggle one to be active AND we have not hit our maximum,\n\t\t// let the call go through. Otherwise log an error.\n\t\tif (deactivating) {\n\t\t\tFSBL.Clients.LinkerClient.unlinkFromChannel(channelName, windowIdentifier, updateActivationTo(false));\n\t\t} else if (activating && allowedToActivateAnotherChannel) {\n\t\t\tFSBL.Clients.LinkerClient.linkToChannel(channelName, windowIdentifier, updateActivationTo(true));\n\t\t} else {\n\t\t\tFSBL.Clients.Logger.system.error(\n\t\t\t\t`Attempted to toggle more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} channels. This could result in an unacceptable UX. Please contact finsemble support if you would like to render more than ${MAXIMUM_ALLOWED_ACTIVE_CHANNELS} linker channels in the window title bar.`\n\t\t\t);\n\t\t}\n\t\thideWindow();\n\t};\n\n\treturn { state: linkerState, toggleChannel };\n};\n"]}
|