@finsemble/finsemble-ui 7.0.0 → 7.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -11
- 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 +3 -10
- 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 -1
- package/react/assets/css/finsemble.css +3 -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 +2 -2
- package/react/assets/css/menus.css +10 -10
- package/react/assets/css/notificationsCenter.css +16 -31
- 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 +2 -2
- package/react/assets/css/tags.css +10 -10
- package/react/assets/css/toolbar.css +22 -19
- package/react/assets/css/userPreferences.css +12 -14
- package/react/assets/css/windowTitleBar.css +75 -36
- 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/Checkbox.d.ts +1 -0
- package/react/components/common/Checkbox.js +2 -2
- package/react/components/common/Checkbox.js.map +1 -1
- package/react/components/common/ColorPicker.d.ts +5 -0
- package/react/components/common/ColorPicker.js +40 -0
- 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 +18 -0
- package/react/components/common/ErrorBoundary.js +21 -0
- package/react/components/common/ErrorBoundary.js.map +1 -1
- 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 +10 -0
- package/react/components/common/FinsembleIcon.js +51 -2
- package/react/components/common/FinsembleIcon.js.map +1 -1
- package/react/components/common/FinsembleSelect.js +5 -1
- package/react/components/common/FinsembleSelect.js.map +1 -1
- package/react/components/common/FinsembleToggleButtonBar.js +1 -1
- package/react/components/common/FinsembleToggleButtonBar.js.map +1 -1
- package/react/components/common/InputTable.d.ts +7 -0
- package/react/components/common/InputTable.js +7 -0
- package/react/components/common/InputTable.js.map +1 -1
- package/react/components/common/Tab.js +3 -0
- package/react/components/common/Tab.js.map +1 -1
- package/react/components/common/TimeSelect.js +24 -0
- 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/accordion.css +9 -6
- package/react/components/common/css/application-edit-page.css +39 -44
- 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 +8 -8
- package/react/components/common/css/time-select.css +1 -0
- package/react/components/common/css/toggle.css +4 -4
- 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 +1 -0
- package/react/components/common/helpers.js.map +1 -1
- package/react/components/common/stories/ColorPicker.stories.js +3 -0
- 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/tests/Accordion.spec.js +6 -0
- package/react/components/common/tests/Accordion.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 +1 -0
- package/react/components/common/tests/FinsembleToggle.spec.js.map +1 -1
- package/react/components/common/tests/FinsembleToggleButtonBar.spec.js +1 -0
- package/react/components/common/tests/FinsembleToggleButtonBar.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 +9 -0
- 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 +8 -0
- 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 +13 -0
- package/react/components/icon/Icon.js +34 -0
- package/react/components/icon/Icon.js.map +1 -1
- package/react/components/legacyControls/FinsembleDialog.d.ts +4 -0
- package/react/components/legacyControls/FinsembleDialog.js +15 -0
- 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 +126 -1
- 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/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 +112 -2
- 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 +3 -0
- package/react/components/menu/MenuToggle.js.map +1 -1
- package/react/components/menu/keyboardNavigation.d.ts +12 -0
- package/react/components/menu/keyboardNavigation.js +55 -0
- 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 +8 -0
- 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 +18 -0
- 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 +1 -1
- 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 +13 -6
- 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/views/CardView.js +3 -0
- package/react/components/notifications/components/views/CardView.js.map +1 -1
- package/react/components/notifications/components/views/ListView.js +8 -0
- 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 +3 -0
- 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 +17 -2
- 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 -1
- 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 +23 -3
- package/react/components/processMonitor/helpers.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 +4 -2
- package/react/components/sdd/AddApp.js +57 -49
- package/react/components/sdd/AddApp.js.map +1 -1
- package/react/components/sdd/AppEditAccess.js +8 -0
- package/react/components/sdd/AppEditAccess.js.map +1 -1
- package/react/components/sdd/AppEditPage.d.ts +2 -1
- package/react/components/sdd/AppEditPage.js +148 -361
- package/react/components/sdd/AppEditPage.js.map +1 -1
- package/react/components/sdd/Appearance.css +1 -1
- package/react/components/sdd/Appearance.js +3 -0
- package/react/components/sdd/Appearance.js.map +1 -1
- package/react/components/sdd/Application.js +39 -7
- package/react/components/sdd/Application.js.map +1 -1
- package/react/components/sdd/Applications.js +89 -13
- package/react/components/sdd/Applications.js.map +1 -1
- package/react/components/sdd/AssetsPage.css +3 -3
- package/react/components/sdd/EditPreload.js +10 -0
- package/react/components/sdd/EditPreload.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/Publish.js +2 -0
- 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.js +17 -0
- package/react/components/sdd/SmartDesktopDesigner.js.map +1 -1
- package/react/components/sdd/ThemePage.css +6 -23
- package/react/components/sdd/ThemePage.js +1 -1
- package/react/components/sdd/ThemePage.js.map +1 -1
- package/react/components/sdd/Themes.js +2 -0
- package/react/components/sdd/Themes.js.map +1 -1
- package/react/components/sdd/Toolbar.js +7 -0
- 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.js +4 -0
- package/react/components/sdd/common/setPreloadDefaults.js.map +1 -1
- package/react/components/sdd/css/addApp.css +18 -5
- package/react/components/sdd/css/appearance.css +6 -0
- package/react/components/sdd/css/applications.css +27 -14
- 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 +8 -11
- 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/configTemplate.js +1 -0
- package/react/components/sdd/fixtures/configTemplate.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 +303 -0
- package/react/components/sdd/smartDesktopClient.js +334 -1
- package/react/components/sdd/smartDesktopClient.js.map +1 -1
- package/react/components/sdd/smartDesktopClient.spec.js +5 -2
- package/react/components/sdd/smartDesktopClient.spec.js.map +1 -1
- package/react/components/sdd/stories/AddApp.stories.d.ts +2 -1
- package/react/components/sdd/stories/AddApp.stories.js +8 -0
- package/react/components/sdd/stories/AddApp.stories.js.map +1 -1
- package/react/components/sdd/stories/AppEditPage.stories.d.ts +3 -1
- package/react/components/sdd/stories/AppEditPage.stories.js +3 -0
- package/react/components/sdd/stories/AppEditPage.stories.js.map +1 -1
- package/react/components/sdd/stories/Appearance.stories.js +1 -0
- package/react/components/sdd/stories/Appearance.stories.js.map +1 -1
- package/react/components/sdd/tests/AddApp.spec.js +40 -3
- package/react/components/sdd/tests/AddApp.spec.js.map +1 -1
- package/react/components/sdd/tests/AppEditPage.spec.js +16 -0
- package/react/components/sdd/tests/AppEditPage.spec.js.map +1 -1
- package/react/components/sdd/tests/Application.spec.js +33 -438
- 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 +29 -5
- package/react/components/sdd/tests/Applications.spec.js.map +1 -1
- package/react/components/sdd/tests/Authentication.spec.js +7 -0
- 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 +13 -0
- package/react/components/sdd/tests/EditPreload.spec.js.map +1 -1
- package/react/components/sdd/tests/Export.spec.js +2 -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/OptionalSettingsView.spec.js +29 -0
- package/react/components/sdd/tests/OptionalSettingsView.spec.js.map +1 -1
- package/react/components/sdd/tests/ProjectErrors.spec.js +2 -0
- package/react/components/sdd/tests/ProjectErrors.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/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.js +6 -0
- package/react/components/search/SearchResult.js.map +1 -1
- package/react/components/search/SearchResult.spec.js +7 -0
- package/react/components/search/SearchResult.spec.js.map +1 -1
- package/react/components/search/SearchResult.stories.js +4 -0
- package/react/components/search/SearchResult.stories.js.map +1 -1
- package/react/components/search/SearchResults.js +5 -1
- package/react/components/search/SearchResults.js.map +1 -1
- package/react/components/search/SearchResults.spec.js +7 -0
- package/react/components/search/SearchResults.spec.js.map +1 -1
- 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 +9 -0
- 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/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 +44 -0
- package/react/components/singleInputDialog/SingleInputDialog.js.map +1 -1
- package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js +6 -0
- 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 +1 -0
- 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 +4 -0
- package/react/components/toolbar/ToolbarIcon.js.map +1 -1
- package/react/components/toolbar/ToolbarSection.d.ts +7 -0
- package/react/components/toolbar/ToolbarSection.js +19 -1
- 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 +82 -0
- 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 +11 -0
- 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 +70 -3
- 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 +7 -0
- 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 +16 -0
- package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js +20 -0
- 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 +5 -0
- 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 +76 -0
- package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +140 -1
- 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/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 +12 -0
- package/react/components/userPreferences/components/content/Workspaces.js +33 -1
- package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
- package/react/components/userPreferences/components/content/notificationViews/NotificationsPreferencesHome.js +3 -0
- 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 +11 -0
- package/react/components/userPreferences/components/general/ScheduledClose.js.map +1 -1
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js +3 -0
- package/react/components/userPreferences/components/workspaces/WorkspaceItem.js.map +1 -1
- package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +17 -0
- package/react/components/userPreferences/stores/UserPreferencesStore.js +27 -0
- package/react/components/userPreferences/stores/UserPreferencesStore.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/Workspace.spec.js +20 -0
- package/react/components/userPreferences/tests/Workspace.spec.js.map +1 -1
- package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +124 -0
- package/react/components/windowTitleBar/WindowTitleBarShell.js +284 -35
- 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 +25 -9
- 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 +172 -10
- 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 +72 -1
- 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 +63 -0
- 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/timer.js +2 -0
- package/react/components/yesNoDialog/timer.js.map +1 -1
- package/react/enzymeSetup.js +5 -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 +90 -0
- 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.js +52 -0
- 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.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 +4 -0
- package/react/store.js +11 -0
- package/react/store.js.map +1 -1
- package/react/tsconfig.tsbuildinfo +1 -1
- 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 +5 -0
- package/react/types/smartDesktopDesignerTypes.js.map +1 -1
- package/react/types/workspaceTypes.d.ts +8 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FinsembleIcon } from "./FinsembleIcon";
|
|
3
3
|
import "./css/checkbox.css";
|
|
4
|
-
export const Checkbox = ({ checked = false, disabled = false, label = "", onClick = () => { }, }) => {
|
|
4
|
+
export const Checkbox = ({ checked = false, disabled = false, label = "", showLabel = true, onClick = () => { }, }) => {
|
|
5
5
|
let checkboxClasses = "complex-menu-checkbox";
|
|
6
6
|
if (checked) {
|
|
7
7
|
checkboxClasses = `${checkboxClasses} checked`;
|
|
@@ -19,6 +19,6 @@ export const Checkbox = ({ checked = false, disabled = false, label = "", onClic
|
|
|
19
19
|
}
|
|
20
20
|
} },
|
|
21
21
|
React.createElement("div", { className: checkboxClasses }, checked && React.createElement(FinsembleIcon, { icon: "check" })),
|
|
22
|
-
React.createElement("div", { className: "complex-menu-checkbox-label" }, label)));
|
|
22
|
+
showLabel && React.createElement("div", { className: "complex-menu-checkbox-label" }, label)));
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=Checkbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/common/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../../../src/components/common/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,oBAAoB,CAAC;AAU5B,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EACjD,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,KAAK,GAAG,EAAE,EACV,SAAS,GAAG,IAAI,EAChB,OAAO,GAAG,GAAG,EAAE,GAAE,CAAC,GAClB,EAAE,EAAE;IACJ,IAAI,eAAe,GAAG,uBAAuB,CAAC;IAC9C,IAAI,OAAO,EAAE;QACZ,eAAe,GAAG,GAAG,eAAe,UAAU,CAAC;KAC/C;IACD,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,QAAQ,EAAE;QACb,KAAK,GAAG;YACP,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,IAAI;SACb,CAAC;KACF;IACD,OAAO,CACN,6BACC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAC,+BAA+B,EACzC,IAAI,EAAC,UAAU,kBACD,OAAO,gBACT,KAAK,EACjB,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,OAAO,EACtC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;YAChB,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE;gBACvC,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;aACxB;QACF,CAAC;QAED,6BAAK,SAAS,EAAE,eAAe,IAAG,OAAO,IAAI,oBAAC,aAAa,IAAC,IAAI,EAAC,OAAO,GAAG,CAAO;QACjF,SAAS,IAAI,6BAAK,SAAS,EAAC,6BAA6B,IAAE,KAAK,CAAO,CACnE,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { FinsembleIcon } from \"./FinsembleIcon\";\nimport \"./css/checkbox.css\";\n\nexport interface CheckboxProps {\n\tchecked?: boolean;\n\tdisabled?: boolean;\n\tlabel?: string;\n\tshowLabel?: boolean;\n\tonClick?: (e: React.MouseEvent<HTMLDivElement> | React.KeyboardEvent<HTMLDivElement>) => void;\n}\n\nexport const Checkbox: React.FC<CheckboxProps> = ({\n\tchecked = false,\n\tdisabled = false,\n\tlabel = \"\",\n\tshowLabel = true,\n\tonClick = () => {},\n}) => {\n\tlet checkboxClasses = \"complex-menu-checkbox\";\n\tif (checked) {\n\t\tcheckboxClasses = `${checkboxClasses} checked`;\n\t}\n\tlet style = {};\n\tif (disabled) {\n\t\tstyle = {\n\t\t\tcursor: \"default\",\n\t\t\topacity: \".3\",\n\t\t};\n\t}\n\treturn (\n\t\t<div\n\t\t\tstyle={style}\n\t\t\tclassName=\"complex-menu-checkbox-wrapper\"\n\t\t\trole=\"checkbox\"\n\t\t\taria-checked={checked}\n\t\t\taria-label={label}\n\t\t\ttabIndex={0}\n\t\t\tonClick={disabled ? () => {} : onClick}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (e.key === \"Enter\" || e.key === \" \") {\n\t\t\t\t\t!disabled && onClick(e);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<div className={checkboxClasses}>{checked && <FinsembleIcon icon=\"check\" />}</div>\n\t\t\t{showLabel && <div className=\"complex-menu-checkbox-label\">{label}</div>}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -12,4 +12,9 @@ export interface ColorPickerProps {
|
|
|
12
12
|
updateColor: (newColor: string) => void;
|
|
13
13
|
id?: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* ColorPicker component to update theme variables. Displays a browser color input alongside a text version for hex color values.
|
|
17
|
+
*
|
|
18
|
+
* @param {{ [id]: string, startColor: string; updateColor: function }} { id, startColor, callback }
|
|
19
|
+
*/
|
|
15
20
|
export declare const ColorPicker: ({ id, startColor, updateColor }: ColorPickerProps) => JSX.Element;
|
|
@@ -8,7 +8,14 @@ export var RGBA_CHANNEL;
|
|
|
8
8
|
RGBA_CHANNEL[RGBA_CHANNEL["BLUE"] = 2] = "BLUE";
|
|
9
9
|
RGBA_CHANNEL[RGBA_CHANNEL["ALPHA"] = 3] = "ALPHA";
|
|
10
10
|
})(RGBA_CHANNEL || (RGBA_CHANNEL = {}));
|
|
11
|
+
// From https://stackoverflow.com/a/24390910
|
|
11
12
|
export function colorToRGBA(color) {
|
|
13
|
+
// Returns the color as an array of [r, g, b, a] -- all range from 0 - 255
|
|
14
|
+
// color must be a valid canvas fillStyle. This will cover most anything
|
|
15
|
+
// you'd want to use.
|
|
16
|
+
// Examples:
|
|
17
|
+
// colorToRGBA('red') # [255, 0, 0, 255]
|
|
18
|
+
// colorToRGBA('#f00') # [255, 0, 0, 255]
|
|
12
19
|
const cvs = document.createElement("canvas");
|
|
13
20
|
cvs.height = 1;
|
|
14
21
|
cvs.width = 1;
|
|
@@ -18,9 +25,15 @@ export function colorToRGBA(color) {
|
|
|
18
25
|
return ctx.getImageData(0, 0, 1, 1).data;
|
|
19
26
|
}
|
|
20
27
|
function byteToHex(num) {
|
|
28
|
+
// Turns a number (0-255) into a 2-character hex number (00-ff)
|
|
21
29
|
return `0${num.toString(16)}`.slice(-2);
|
|
22
30
|
}
|
|
23
31
|
function colorToHex(color) {
|
|
32
|
+
// Convert any CSS color to a hex representation
|
|
33
|
+
// Examples:
|
|
34
|
+
// colorToHex('red') # '#ff0000'
|
|
35
|
+
// colorToHex('rgb(255, 0, 0)') # '#ff0000'
|
|
36
|
+
// colorToHex('#ff0000') # '#ff0000'
|
|
24
37
|
if (color.match(RE_HEX_COLOR) !== null) {
|
|
25
38
|
return color;
|
|
26
39
|
}
|
|
@@ -28,18 +41,45 @@ function colorToHex(color) {
|
|
|
28
41
|
const hex = [0, 1, 2].map((idx) => byteToHex(rgba[idx])).join("");
|
|
29
42
|
return `#${hex}`;
|
|
30
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* ColorPicker component to update theme variables. Displays a browser color input alongside a text version for hex color values.
|
|
46
|
+
*
|
|
47
|
+
* @param {{ [id]: string, startColor: string; updateColor: function }} { id, startColor, callback }
|
|
48
|
+
*/
|
|
31
49
|
export const ColorPicker = ({ id, startColor, updateColor }) => {
|
|
50
|
+
/**
|
|
51
|
+
* There is a delicate ballet here between the color picket and the input box. This is because this color picker
|
|
52
|
+
* has state (when the end user is in the midst of picking a color by editing the input field) and also
|
|
53
|
+
* receives state (via props). When prop startColor is received, it overrides the input box. But when the user is editing,
|
|
54
|
+
* the input box overrides the prop.
|
|
55
|
+
*/
|
|
32
56
|
const [priorColor, setPriorColor] = useState(startColor);
|
|
57
|
+
/**
|
|
58
|
+
* inputValue state is set _whenever the user is editing the input box_. Only at this time, the value in the input
|
|
59
|
+
* box reflects the user's editing. If at any point the editing yields a valid color then it is immediately
|
|
60
|
+
* passed up as an action, which updates the screen and resets the startColor prop. Whenever an invalid color has
|
|
61
|
+
* been entered, the value is flagged invalid which causes the input box to be underlined red.
|
|
62
|
+
*/
|
|
33
63
|
const [inputValue, setInputValue] = useState(null);
|
|
64
|
+
/**
|
|
65
|
+
* If the value of the startColor prop changes then we reset the input to the new color. This occurs for instance
|
|
66
|
+
* when the user presses the light or dark themes on the theme page. At that point, the parent sends new values
|
|
67
|
+
* down to all color pickers as a new prop.
|
|
68
|
+
*/
|
|
34
69
|
if (priorColor !== startColor) {
|
|
35
70
|
setPriorColor(startColor);
|
|
36
71
|
setInputValue(null);
|
|
37
72
|
}
|
|
73
|
+
// If the value in the input box isn't valid then give UI feedback
|
|
38
74
|
const isValid = inputValue === null || inputValue.match(RE_HEX_COLOR) !== null;
|
|
75
|
+
// The swatch always displays the current color from prop. This won't change
|
|
76
|
+
// until a valid alternative color is picked.
|
|
39
77
|
const color = colorToHex(startColor);
|
|
40
78
|
const onColorChanged = ({ target }) => {
|
|
41
79
|
const maybeNewColor = target.value;
|
|
80
|
+
// Update the value in the input box
|
|
42
81
|
setInputValue(maybeNewColor);
|
|
82
|
+
// If the color is valid then send an update
|
|
43
83
|
const isNewValueValid = maybeNewColor.match(RE_HEX_COLOR) !== null;
|
|
44
84
|
if (isNewValueValid) {
|
|
45
85
|
updateColor(maybeNewColor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.js","sourceRoot":"","sources":["../../../src/components/common/ColorPicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACnD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAEvC,MA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,MAAM,EAAgC,EAAE,EAAE;QACnE,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC;QACnC,oCAAoC;QACpC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC7B,4CAA4C;QAC5C,MAAM,eAAe,GAAG,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;QACnE,IAAI,eAAe,EAAE;YACpB,WAAW,CAAC,aAAa,CAAC,CAAC;SAC3B;IACF,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,cAAc;QAC5B,+BACC,SAAS,EAAC,oBAAoB,EAC9B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,cAAc,iBACZ,MAAM,GACV;QACT,6CACC,SAAS,EAAC,yBAAyB,EACnC,IAAI,EAAC,MAAM,kBACG,CAAC,OAAO,EACtB,KAAK,EAAE,UAAU,aAAV,UAAU,cAAV,UAAU,GAAI,KAAK,EAC1B,QAAQ,EAAE,cAAc,IACpB,EAAE,EAAE,EAAE,EACF,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport \"./css/color-picker.css\";\n\nconst RE_HEX_COLOR = /^#[0-9a-f]{6}$/i;\n\nexport enum RGBA_CHANNEL {\n\tRED = 0,\n\tGREEN = 1,\n\tBLUE = 2,\n\tALPHA = 3,\n}\n\n// From https://stackoverflow.com/a/24390910\nexport function colorToRGBA(color: string) {\n\t// Returns the color as an array of [r, g, b, a] -- all range from 0 - 255\n\t// color must be a valid canvas fillStyle. This will cover most anything\n\t// you'd want to use.\n\t// Examples:\n\t// colorToRGBA('red') # [255, 0, 0, 255]\n\t// colorToRGBA('#f00') # [255, 0, 0, 255]\n\tconst cvs = document.createElement(\"canvas\");\n\tcvs.height = 1;\n\tcvs.width = 1;\n\n\tconst ctx = cvs.getContext(\"2d\")!;\n\tctx.fillStyle = color;\n\tctx.fillRect(0, 0, 1, 1);\n\treturn ctx.getImageData(0, 0, 1, 1).data;\n}\n\nfunction byteToHex(num: number) {\n\t// Turns a number (0-255) into a 2-character hex number (00-ff)\n\treturn `0${num.toString(16)}`.slice(-2);\n}\n\nfunction colorToHex(color: string) {\n\t// Convert any CSS color to a hex representation\n\t// Examples:\n\t// colorToHex('red') # '#ff0000'\n\t// colorToHex('rgb(255, 0, 0)') # '#ff0000'\n\t// colorToHex('#ff0000') # '#ff0000'\n\tif (color.match(RE_HEX_COLOR) !== null) {\n\t\treturn color;\n\t}\n\tconst rgba = colorToRGBA(color);\n\tconst hex = [0, 1, 2].map((idx) => byteToHex(rgba[idx])).join(\"\");\n\treturn `#${hex}`;\n}\n\nexport interface ColorPickerProps {\n\tstartColor: string;\n\tupdateColor: (newColor: string) => void;\n\tid?: string;\n}\n\n/**\n * ColorPicker component to update theme variables. Displays a browser color input alongside a text version for hex color values.\n *\n * @param {{ [id]: string, startColor: string; updateColor: function }} { id, startColor, callback }\n */\nexport const ColorPicker = ({ id, startColor, updateColor }: ColorPickerProps) => {\n\t/**\n\t * There is a delicate ballet here between the color picket and the input box. This is because this color picker\n\t * has state (when the end user is in the midst of picking a color by editing the input field) and also\n\t * receives state (via props). When prop startColor is received, it overrides the input box. But when the user is editing,\n\t * the input box overrides the prop.\n\t */\n\tconst [priorColor, setPriorColor] = useState(startColor);\n\t/**\n\t * inputValue state is set _whenever the user is editing the input box_. Only at this time, the value in the input\n\t * box reflects the user's editing. If at any point the editing yields a valid color then it is immediately\n\t * passed up as an action, which updates the screen and resets the startColor prop. Whenever an invalid color has\n\t * been entered, the value is flagged invalid which causes the input box to be underlined red.\n\t */\n\tconst [inputValue, setInputValue] = useState<string | null>(null);\n\n\t/**\n\t * If the value of the startColor prop changes then we reset the input to the new color. This occurs for instance\n\t * when the user presses the light or dark themes on the theme page. At that point, the parent sends new values\n\t * down to all color pickers as a new prop.\n\t */\n\tif (priorColor !== startColor) {\n\t\tsetPriorColor(startColor);\n\t\tsetInputValue(null);\n\t}\n\n\t// If the value in the input box isn't valid then give UI feedback\n\tconst isValid = inputValue === null || inputValue.match(RE_HEX_COLOR) !== null;\n\n\t// The swatch always displays the current color from prop. This won't change\n\t// until a valid alternative color is picked.\n\tconst color = colorToHex(startColor);\n\n\tconst onColorChanged = ({ target }: { target: HTMLInputElement }) => {\n\t\tconst maybeNewColor = target.value;\n\t\t// Update the value in the input box\n\t\tsetInputValue(maybeNewColor);\n\t\t// If the color is valid then send an update\n\t\tconst isNewValueValid = maybeNewColor.match(RE_HEX_COLOR) !== null;\n\t\tif (isNewValueValid) {\n\t\t\tupdateColor(maybeNewColor);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"color-picker\">\n\t\t\t<input\n\t\t\t\tclassName=\"theme-color-picker\"\n\t\t\t\ttype=\"color\"\n\t\t\t\tvalue={color}\n\t\t\t\tonChange={onColorChanged}\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></input>\n\t\t\t<input\n\t\t\t\tclassName=\"theme-color-picker-text\"\n\t\t\t\ttype=\"text\"\n\t\t\t\taria-invalid={!isValid}\n\t\t\t\tvalue={inputValue ?? color}\n\t\t\t\tonChange={onColorChanged}\n\t\t\t\t{...{ id }}\n\t\t\t></input>\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -8,4 +8,15 @@ export declare type DropZoneProps = {
|
|
|
8
8
|
processFile: (fileObj: FileWithPath, index: number) => void;
|
|
9
9
|
suppress?: boolean;
|
|
10
10
|
};
|
|
11
|
+
/***
|
|
12
|
+
* Component that serves as a drop zone. It also keeps track of visual concerns and event handlers for
|
|
13
|
+
* drag-and-drop.
|
|
14
|
+
*
|
|
15
|
+
* The DropZone component is intended to be a container element for other elements, such as text, lists,
|
|
16
|
+
* images, input elements, etc.
|
|
17
|
+
*
|
|
18
|
+
* @callback processFile - This function will be called for each file that is dropped in the dropzone.
|
|
19
|
+
* @param {ReactNode} children - React will fill this in.
|
|
20
|
+
* @param {boolean} suppress=false - If the dropzone-ness should be suppressed, which would turn this container into just a div
|
|
21
|
+
*/
|
|
11
22
|
export declare const DropZone: ({ processFile, children, suppress }: DropZoneProps) => JSX.Element;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import "./css/drop-zone.css";
|
|
3
|
+
/***
|
|
4
|
+
* Component that serves as a drop zone. It also keeps track of visual concerns and event handlers for
|
|
5
|
+
* drag-and-drop.
|
|
6
|
+
*
|
|
7
|
+
* The DropZone component is intended to be a container element for other elements, such as text, lists,
|
|
8
|
+
* images, input elements, etc.
|
|
9
|
+
*
|
|
10
|
+
* @callback processFile - This function will be called for each file that is dropped in the dropzone.
|
|
11
|
+
* @param {ReactNode} children - React will fill this in.
|
|
12
|
+
* @param {boolean} suppress=false - If the dropzone-ness should be suppressed, which would turn this container into just a div
|
|
13
|
+
*/
|
|
3
14
|
export const DropZone = ({ processFile, children, suppress = false }) => {
|
|
4
15
|
const [isDragging, setIsDragging] = useState(false);
|
|
5
16
|
const [potential, setPotential] = useState(false);
|
|
@@ -8,17 +19,26 @@ export const DropZone = ({ processFile, children, suppress = false }) => {
|
|
|
8
19
|
e.preventDefault();
|
|
9
20
|
e.stopPropagation();
|
|
10
21
|
};
|
|
22
|
+
// Check if something is being dragged somewhere on the page
|
|
23
|
+
// If dragging is happening on the page, there will be a visual indication for potential drop zone
|
|
11
24
|
if (singleton) {
|
|
25
|
+
// "dragenter" and "dragleave" events are fired off of every single child element, and counting them isn't reliable
|
|
26
|
+
// so, when "dragover" events are fired, we know dragging is happening.
|
|
27
|
+
// we will wait 100ms after the last "dragover" event is fired, and then turn off the potential zone.
|
|
12
28
|
let timeout = null;
|
|
13
29
|
document.addEventListener("dragover", (e) => {
|
|
14
30
|
preventDefaults(e);
|
|
15
31
|
setPotential(true);
|
|
32
|
+
// If timeout was previously set, clear it
|
|
16
33
|
if (timeout !== null) {
|
|
17
34
|
clearTimeout(timeout);
|
|
18
35
|
}
|
|
36
|
+
// Set a new timeout, now that we've gotten a new dragover event
|
|
19
37
|
timeout = setTimeout(() => {
|
|
38
|
+
// If it's been 100ms and no dragover event has been fired, assume the user isn't dragging anymore.
|
|
20
39
|
setPotential(false);
|
|
21
|
-
}, 100);
|
|
40
|
+
}, 100); // 100ms was chosen by trial and error.
|
|
41
|
+
// 10ms was too little time, and caused flicker. 100ms doesn't have a flicker, and turns off potential without a noticeable delay
|
|
22
42
|
});
|
|
23
43
|
setSingleton(false);
|
|
24
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/common/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DropZone.js","sourceRoot":"","sources":["../../../src/components/common/DropZone.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,qBAAqB,CAAC;AAW7B;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,EAAiB,EAAE,EAAE;IACtF,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEjD,MAAM,eAAe,GAAG,CAAC,CAA0D,EAAE,EAAE;QACtF,CAAC,CAAC,cAAc,EAAE,CAAC;QACnB,CAAC,CAAC,eAAe,EAAE,CAAC;IACrB,CAAC,CAAC;IAEF,4DAA4D;IAC5D,kGAAkG;IAClG,IAAI,SAAS,EAAE;QACd,mHAAmH;QAC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KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACtC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;oBACtB,SAAS;iBACT;gBACD,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aACzB;YAED,eAAe,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC,IAEA,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState } from \"react\";\nimport \"./css/drop-zone.css\";\n\n// Electron adds File.path\nexport type FileWithPath = File & { path?: string };\n\nexport type DropZoneProps = {\n\tchildren: React.ReactNode;\n\tprocessFile: (fileObj: FileWithPath, index: number) => void;\n\tsuppress?: boolean;\n};\n\n/***\n * Component that serves as a drop zone. It also keeps track of visual concerns and event handlers for\n * drag-and-drop.\n *\n * The DropZone component is intended to be a container element for other elements, such as text, lists,\n * images, input elements, etc.\n *\n * @callback processFile - This function will be called for each file that is dropped in the dropzone.\n * @param {ReactNode} children - React will fill this in.\n * @param {boolean} suppress=false - If the dropzone-ness should be suppressed, which would turn this container into just a div\n */\nexport const DropZone = ({ processFile, children, suppress = false }: DropZoneProps) => {\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst [potential, setPotential] = useState(false);\n\tconst [singleton, setSingleton] = useState(true);\n\n\tconst preventDefaults = (e: { preventDefault: Function; stopPropagation: Function }) => {\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t};\n\n\t// Check if something is being dragged somewhere on the page\n\t// If dragging is happening on the page, there will be a visual indication for potential drop zone\n\tif (singleton) {\n\t\t// \"dragenter\" and \"dragleave\" events are fired off of every single child element, and counting them isn't reliable\n\t\t// so, when \"dragover\" events are fired, we know dragging is happening.\n\t\t// we will wait 100ms after the last \"dragover\" event is fired, and then turn off the potential zone.\n\t\tlet timeout: NodeJS.Timeout | null = null;\n\t\tdocument.addEventListener(\"dragover\", (e) => {\n\t\t\tpreventDefaults(e);\n\t\t\tsetPotential(true);\n\n\t\t\t// If timeout was previously set, clear it\n\t\t\tif (timeout !== null) {\n\t\t\t\tclearTimeout(timeout);\n\t\t\t}\n\n\t\t\t// Set a new timeout, now that we've gotten a new dragover event\n\t\t\ttimeout = setTimeout(() => {\n\t\t\t\t// If it's been 100ms and no dragover event has been fired, assume the user isn't dragging anymore.\n\t\t\t\tsetPotential(false);\n\t\t\t}, 100); // 100ms was chosen by trial and error.\n\t\t\t// 10ms was too little time, and caused flicker. 100ms doesn't have a flicker, and turns off potential without a noticeable delay\n\t\t});\n\t\tsetSingleton(false);\n\t}\n\n\tconst isPotentialStr = potential ? \"isPotential\" : \"\";\n\tconst isDraggingStr = isDragging ? \"isDragging\" : isPotentialStr;\n\n\treturn suppress ? (\n\t\t<>{children}</>\n\t) : (\n\t\t<div\n\t\t\tclassName={`dropZone ${isDraggingStr}`}\n\t\t\tonDragEnter={(e) => {\n\t\t\t\tpreventDefaults(e);\n\t\t\t\tsetIsDragging(true);\n\t\t\t}}\n\t\t\tonDragLeave={(e) => {\n\t\t\t\tpreventDefaults(e);\n\t\t\t\tsetIsDragging(false);\n\t\t\t}}\n\t\t\tonDrop={(e) => {\n\t\t\t\tsetIsDragging(false);\n\n\t\t\t\tconst { files } = e.dataTransfer;\n\t\t\t\tfor (let i = 0; i < files.length; i++) {\n\t\t\t\t\tif (files[i] === null) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tprocessFile(files[i], i);\n\t\t\t\t}\n\n\t\t\t\tpreventDefaults(e);\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n"]}
|
|
@@ -6,5 +6,9 @@ export interface IFinsembleDropdownActionButtonProps {
|
|
|
6
6
|
buttonOptions: Array<IFinsembleButtonProps>;
|
|
7
7
|
mainAction: Function;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* @TODO: Consolidate this and DefaultDropDownButton and change all usages to use DefaultDropDownButton.
|
|
11
|
+
* @deprecated Use DefaultDropDownButton instead.
|
|
12
|
+
*/
|
|
9
13
|
declare const DropdownButton: React.FunctionComponent<IFinsembleDropdownActionButtonProps>;
|
|
10
14
|
export default DropdownButton;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import React, { useState, useRef } from "react";
|
|
2
2
|
import "../../assets/css/button.css";
|
|
3
3
|
import { useOutsideClickDetector } from "../../hooks/useOutsideClickDetector";
|
|
4
|
+
/**
|
|
5
|
+
* @TODO: Consolidate this and DefaultDropDownButton and change all usages to use DefaultDropDownButton.
|
|
6
|
+
* @deprecated Use DefaultDropDownButton instead.
|
|
7
|
+
*/
|
|
4
8
|
const DropdownButton = ({ buttonLabel = "Label", buttonOptions = [], mainAction, }) => {
|
|
5
9
|
const wrapperRef = useRef(null);
|
|
6
10
|
const [expanded, setExpanded] = useState(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownButton.js","sourceRoot":"","sources":["../../../src/components/common/DropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"DropdownButton.js","sourceRoot":"","sources":["../../../src/components/common/DropdownButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAS9E;;;GAGG;AACH,MAAM,cAAc,GAAiE,CAAC,EACrF,WAAW,GAAG,OAAO,EACrB,aAAa,GAAG,EAAE,EAClB,UAAU,GAC2B,EAAE,EAAE;IACzC,MAAM,UAAU,GAAG,MAAM,CAA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;AACH,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import React, { useState, useRef } from \"react\";\nimport \"../../assets/css/button.css\";\nimport { useOutsideClickDetector } from \"../../hooks/useOutsideClickDetector\";\nimport { IFinsembleButtonProps } from \"../shared/Button\";\n\nexport interface IFinsembleDropdownActionButtonProps {\n\tbuttonLabel: string;\n\tbuttonOptions: Array<IFinsembleButtonProps>;\n\tmainAction: Function;\n}\n\n/**\n * @TODO: Consolidate this and DefaultDropDownButton and change all usages to use DefaultDropDownButton.\n * @deprecated Use DefaultDropDownButton instead.\n */\nconst DropdownButton: React.FunctionComponent<IFinsembleDropdownActionButtonProps> = ({\n\tbuttonLabel = \"Label\",\n\tbuttonOptions = [],\n\tmainAction,\n}: IFinsembleDropdownActionButtonProps) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst [expanded, setExpanded] = useState(false);\n\n\tuseOutsideClickDetector(wrapperRef, () => setExpanded(false));\n\n\tconst options = buttonOptions.map((option, index) => (\n\t\t<div\n\t\t\tkey={index}\n\t\t\tclassName=\"finsemble-dropdown-action__btn-option\"\n\t\t\tonClick={() => {\n\t\t\t\toption.clickHandler();\n\t\t\t\tsetExpanded(false);\n\t\t\t}}\n\t\t>\n\t\t\t{option.buttonLabel}\n\t\t</div>\n\t));\n\n\tconst buttonAction = () => {\n\t\tif (expanded) {\n\t\t\tsetExpanded(false);\n\t\t\treturn;\n\t\t}\n\n\t\tif (mainAction) {\n\t\t\tmainAction();\n\t\t} else {\n\t\t\t() => setExpanded(!expanded);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div ref={wrapperRef} className=\"finsemble-dropdown-action__btn-container\">\n\t\t\t<div className=\"finsemble-dropdown-action__btn\">\n\t\t\t\t<span className=\"btn-label\" onClick={buttonAction}>\n\t\t\t\t\t{buttonLabel}\n\t\t\t\t</span>\n\t\t\t\t<span className=\"separator\"></span>\n\t\t\t\t<div className=\"expand-options\" onClick={() => setExpanded(!expanded)}>\n\t\t\t\t\t<span className=\"caret\"></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t{expanded ? <div className=\"finsemble-dropdown-action__btn-options\">{options}</div> : null}\n\t\t</div>\n\t);\n};\n\nexport default DropdownButton;\n"]}
|
|
@@ -5,6 +5,24 @@ declare type ErrorBoundaryProps = {
|
|
|
5
5
|
declare type ErrorBoundaryState = {
|
|
6
6
|
hasError: boolean;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Something like a try catch in React component form with some exceptions. Catches Errors and logs them to the central
|
|
10
|
+
* logger. Prevents uncaught exceptions on the render of child components from unintentionally breaking the entire UI.
|
|
11
|
+
* Has the added benefit of sending the errors to the Central Logger
|
|
12
|
+
*
|
|
13
|
+
* Note: The exceptions are that it not catch errors in Event handlers and Asynchronous code.
|
|
14
|
+
* Note: This does not catch errors in the current component directly, only child components. See below for example
|
|
15
|
+
*
|
|
16
|
+
* Eg: WON'T WORK
|
|
17
|
+
*
|
|
18
|
+
* const ContainerComponent = ({test}:any) => <ErrorBoundary><div>{test.undefined.length}</div></ErrorBoundary>
|
|
19
|
+
*
|
|
20
|
+
* WILL WORK:
|
|
21
|
+
* const BrokenComponent = ({test}:any) => <div>{test.undefined.length}</div>
|
|
22
|
+
* const ContainerComponent = ({test}:any) => <ErrorBoundary><BrokenComponent test={test}/></ErrorBoundary>
|
|
23
|
+
*
|
|
24
|
+
* @see https://reactjs.org/docs/error-boundaries.html for more information on Error Boundaries
|
|
25
|
+
*/
|
|
8
26
|
export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
|
|
9
27
|
constructor(props: ErrorBoundaryProps);
|
|
10
28
|
static getDerivedStateFromError(error: Error): {
|
|
@@ -1,19 +1,40 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Something like a try catch in React component form with some exceptions. Catches Errors and logs them to the central
|
|
4
|
+
* logger. Prevents uncaught exceptions on the render of child components from unintentionally breaking the entire UI.
|
|
5
|
+
* Has the added benefit of sending the errors to the Central Logger
|
|
6
|
+
*
|
|
7
|
+
* Note: The exceptions are that it not catch errors in Event handlers and Asynchronous code.
|
|
8
|
+
* Note: This does not catch errors in the current component directly, only child components. See below for example
|
|
9
|
+
*
|
|
10
|
+
* Eg: WON'T WORK
|
|
11
|
+
*
|
|
12
|
+
* const ContainerComponent = ({test}:any) => <ErrorBoundary><div>{test.undefined.length}</div></ErrorBoundary>
|
|
13
|
+
*
|
|
14
|
+
* WILL WORK:
|
|
15
|
+
* const BrokenComponent = ({test}:any) => <div>{test.undefined.length}</div>
|
|
16
|
+
* const ContainerComponent = ({test}:any) => <ErrorBoundary><BrokenComponent test={test}/></ErrorBoundary>
|
|
17
|
+
*
|
|
18
|
+
* @see https://reactjs.org/docs/error-boundaries.html for more information on Error Boundaries
|
|
19
|
+
*/
|
|
2
20
|
export class ErrorBoundary extends React.Component {
|
|
3
21
|
constructor(props) {
|
|
4
22
|
super(props);
|
|
5
23
|
this.state = { hasError: false };
|
|
6
24
|
}
|
|
7
25
|
static getDerivedStateFromError(error) {
|
|
26
|
+
// Update state so the next render will show the fallback UI.
|
|
8
27
|
return { hasError: true };
|
|
9
28
|
}
|
|
10
29
|
componentDidCatch(error, errorInfo) {
|
|
30
|
+
// Log the error to the dev tools where developers will expect it but also send it to the central logger
|
|
11
31
|
console.error(error, errorInfo);
|
|
12
32
|
FSBL.Clients.Logger.system.error(error, errorInfo);
|
|
13
33
|
}
|
|
14
34
|
render() {
|
|
15
35
|
var _a;
|
|
16
36
|
if (this.state.hasError) {
|
|
37
|
+
// Render custom fallback UI or default to nothing
|
|
17
38
|
return (_a = this.props.fallBackUI) !== null && _a !== void 0 ? _a : React.createElement(React.Fragment, null);
|
|
18
39
|
}
|
|
19
40
|
return this.props.children;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/components/common/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../../src/components/common/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AASpD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK,CAAC,SAAiD;IACzF,YAAY,KAAyB;QACpC,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,MAAM,CAAC,wBAAwB,CAAC,KAAY;QAC3C,6DAA6D;QAC7D,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,iBAAiB,CAAC,KAAY,EAAE,SAAoB;QACnD,wGAAwG;QACxG,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACpD,CAAC;IAED,MAAM;;QACL,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACxB,kDAAkD;YAClD,OAAO,MAAA,IAAI,CAAC,KAAK,CAAC,UAAU,mCAAI,yCAAK,CAAC;SACtC;QAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5B,CAAC;CACD","sourcesContent":["import React, { ErrorInfo, ReactNode } from \"react\";\n\ntype ErrorBoundaryProps = {\n\tfallBackUI?: ReactNode;\n};\ntype ErrorBoundaryState = {\n\thasError: boolean;\n};\n\n/**\n * Something like a try catch in React component form with some exceptions. Catches Errors and logs them to the central\n * logger. Prevents uncaught exceptions on the render of child components from unintentionally breaking the entire UI.\n * Has the added benefit of sending the errors to the Central Logger\n *\n * Note: The exceptions are that it not catch errors in Event handlers and Asynchronous code.\n * Note: This does not catch errors in the current component directly, only child components. See below for example\n *\n * Eg: WON'T WORK\n *\n * const ContainerComponent = ({test}:any) => <ErrorBoundary><div>{test.undefined.length}</div></ErrorBoundary>\n *\n * WILL WORK:\n * const BrokenComponent = ({test}:any) => <div>{test.undefined.length}</div>\n * const ContainerComponent = ({test}:any) => <ErrorBoundary><BrokenComponent test={test}/></ErrorBoundary>\n *\n * @see https://reactjs.org/docs/error-boundaries.html for more information on Error Boundaries\n */\nexport class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {\n\tconstructor(props: ErrorBoundaryProps) {\n\t\tsuper(props);\n\t\tthis.state = { hasError: false };\n\t}\n\n\tstatic getDerivedStateFromError(error: Error) {\n\t\t// Update state so the next render will show the fallback UI.\n\t\treturn { hasError: true };\n\t}\n\n\tcomponentDidCatch(error: Error, errorInfo: ErrorInfo) {\n\t\t// Log the error to the dev tools where developers will expect it but also send it to the central logger\n\t\tconsole.error(error, errorInfo);\n\t\tFSBL.Clients.Logger.system.error(error, errorInfo);\n\t}\n\n\trender() {\n\t\tif (this.state.hasError) {\n\t\t\t// Render custom fallback UI or default to nothing\n\t\t\treturn this.props.fallBackUI ?? <></>;\n\t\t}\n\n\t\treturn this.props.children;\n\t}\n}\n"]}
|
|
@@ -19,5 +19,12 @@ export declare type FileInputProps = {
|
|
|
19
19
|
suppressDropzone?: boolean;
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
allowClearing?: boolean;
|
|
22
|
+
textEditable?: boolean;
|
|
22
23
|
};
|
|
23
|
-
|
|
24
|
+
/**
|
|
25
|
+
* A Browse button with a hidden file input to allow for a file select dialog and extraction of a path
|
|
26
|
+
*
|
|
27
|
+
* @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}
|
|
28
|
+
* @return {*}
|
|
29
|
+
*/
|
|
30
|
+
export declare const FileInput: ({ acceptTypes, value, onSetValue, id, shouldUpload, uploadFunction, presetFile, suppressDropzone, disabled, allowClearing, textEditable, }: FileInputProps) => JSX.Element;
|
|
@@ -17,12 +17,18 @@ const INVALID_FILE_TYPE_ERROR = {
|
|
|
17
17
|
const defaultUploadFunction = async () => {
|
|
18
18
|
return { err: null, path: "" };
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A Browse button with a hidden file input to allow for a file select dialog and extraction of a path
|
|
22
|
+
*
|
|
23
|
+
* @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}
|
|
24
|
+
* @return {*}
|
|
25
|
+
*/
|
|
26
|
+
export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = true, uploadFunction = defaultUploadFunction, presetFile = null, suppressDropzone = false, disabled = false, allowClearing = true, textEditable = false, }) => {
|
|
21
27
|
const dispatch = useDispatch();
|
|
22
28
|
const fileInputElement = useRef({});
|
|
23
29
|
const [isUploading, setIsUploading] = useState(false);
|
|
24
30
|
const [uploadProgress, setUploadProgress] = useState(0);
|
|
25
|
-
const [fileInput, setFileInput] = useState({});
|
|
31
|
+
const [fileInput, setFileInput] = useState({}); // cast to correct type so typescript doesn't complain
|
|
26
32
|
const [path, setPath] = useState(value || "");
|
|
27
33
|
const [errorMessage, setErrorMessage] = useState(null);
|
|
28
34
|
const [handedFile, setHandedFile] = useState(presetFile);
|
|
@@ -45,6 +51,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
|
|
|
45
51
|
setErrorMessage(err);
|
|
46
52
|
};
|
|
47
53
|
const uploadFile = (fileObj) => {
|
|
54
|
+
// If it's not a file, we can't do anything with it
|
|
48
55
|
if (!(fileObj instanceof File)) {
|
|
49
56
|
return;
|
|
50
57
|
}
|
|
@@ -61,6 +68,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
|
|
|
61
68
|
uploadFile(fileObj);
|
|
62
69
|
}
|
|
63
70
|
else if (fileObj === null || fileObj === void 0 ? void 0 : fileObj.path) {
|
|
71
|
+
// If the consumer doesn't want the file actually uploaded, just return the file name
|
|
64
72
|
uploadSuccess({
|
|
65
73
|
err: null,
|
|
66
74
|
path: fileObj.path,
|
|
@@ -81,6 +89,7 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
|
|
|
81
89
|
}
|
|
82
90
|
setFileInput(e.target);
|
|
83
91
|
};
|
|
92
|
+
// Check if props updated
|
|
84
93
|
if (handedFile !== presetFile) {
|
|
85
94
|
setHandedFile(presetFile);
|
|
86
95
|
if (presetFile !== null) {
|
|
@@ -94,13 +103,19 @@ export const FileInput = ({ acceptTypes, value, onSetValue, id, shouldUpload = t
|
|
|
94
103
|
React.createElement(Button, { fashion: "primary", text: "Select file", disabled: disabled, onClick: () => {
|
|
95
104
|
fileInputElement.current.click();
|
|
96
105
|
} })),
|
|
97
|
-
React.createElement("div", { className: "file-input-
|
|
106
|
+
textEditable ? (React.createElement("div", { className: "file-input-field" },
|
|
107
|
+
React.createElement("input", { type: "text", onChange: (e) => {
|
|
108
|
+
if (onSetValue) {
|
|
109
|
+
onSetValue === null || onSetValue === void 0 ? void 0 : onSetValue(e.target.value);
|
|
110
|
+
}
|
|
111
|
+
setPath(e.target.value);
|
|
112
|
+
}, "aria-label": "File name", value: path }))) : (React.createElement("div", { className: "file-input-value" },
|
|
98
113
|
React.createElement("span", Object.assign({ className: `file-input-value-input ${isInvalid && "invalid"}` }, { id }), path),
|
|
99
114
|
allowClearing && path !== "" && (React.createElement(ButtonIcon, { text: "Cancel", icon: "times", onClick: () => {
|
|
100
115
|
setPath("");
|
|
101
116
|
onSetValue === null || onSetValue === void 0 ? void 0 : onSetValue("");
|
|
102
117
|
} })),
|
|
103
|
-
errorMessage && React.createElement("div", { className: "file-input-error" }, errorMessage)),
|
|
118
|
+
errorMessage && React.createElement("div", { className: "file-input-error" }, errorMessage))),
|
|
104
119
|
React.createElement("div", { className: "file-input-status" }, isUploading ? (React.createElement("div", { className: "file-input-progress-container" },
|
|
105
120
|
uploadProgress,
|
|
106
121
|
"% uploaded")) : (!errorMessage && React.createElement(React.Fragment, null))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/common/FileInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAoBlD,MAAM,uBAAuB,GAAiB;IAC7C,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,iDAAiD;CAC1D,CAAC;AAEF,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAChC,CAAC,CAAC;AAQF,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACzB,WAAW,EACX,KAAK,EACL,UAAU,EACV,EAAE,EACF,YAAY,GAAG,IAAI,EACnB,cAAc,GAAG,qBAAqB,EACtC,UAAU,GAAG,IAAI,EACjB,gBAAgB,GAAG,KAAK,EACxB,QAAQ,GAAG,KAAK,EAChB,aAAa,GAAG,IAAI,GACJ,EAAE,EAAE;IACpB,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAsB,CAAC,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,Q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AC,CAAC,CACd,6BAAK,SAAS,EAAC,+BAA+B;gBAAE,cAAc;6BAAiB,CAC/E,CAAC,CAAC,CAAC,CACH,CAAC,YAAY,IAAI,yCAAK,CACtB,CACI,CACD,CACI,CACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 - 2020 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { useDispatch } from \"../../store\";\nimport { ProjectError } from \"../../types/smartDesktopDesignerTypes\";\n\nimport { Button } from \"./Button\";\nimport { ButtonIcon } from \"./ButtonIcon\";\nimport \"./css/file-input.css\";\n\nimport { DropZone, FileWithPath } from \"./DropZone\";\nimport { validateFilename } from \"./file_helpers\";\n\nexport type FileInputUploadCb = (\n\tfileObject: File,\n\tcb?: (progress: number) => void\n) => Promise<{ err: string | null; path: string }>;\n\nexport type FileInputProps = {\n\tacceptTypes: string[];\n\tvalue: string;\n\tid?: string;\n\tshouldUpload?: boolean;\n\tonSetValue?: (value: string) => void;\n\tuploadFunction?: FileInputUploadCb;\n\tpresetFile?: null | File;\n\tsuppressDropzone?: boolean;\n\tdisabled?: boolean;\n\tallowClearing?: boolean;\n};\n\nconst INVALID_FILE_TYPE_ERROR: ProjectError = {\n\tviewId: \"themes\",\n\tmessage: \"Your uploaded file is not in the correct format\",\n};\n\nconst defaultUploadFunction = async () => {\n\treturn { err: null, path: \"\" };\n};\n\n/**\n * A Browse button with a hidden file input to allow for a file select dialog and extraction of a path\n *\n * @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}\n * @return {*}\n */\nexport const FileInput = ({\n\tacceptTypes,\n\tvalue,\n\tonSetValue,\n\tid,\n\tshouldUpload = true,\n\tuploadFunction = defaultUploadFunction,\n\tpresetFile = null,\n\tsuppressDropzone = false,\n\tdisabled = false,\n\tallowClearing = true,\n}: FileInputProps) => {\n\tconst dispatch = useDispatch();\n\tconst fileInputElement = useRef({} as HTMLInputElement);\n\tconst [isUploading, setIsUploading] = useState(false);\n\tconst [uploadProgress, setUploadProgress] = useState(0);\n\tconst [fileInput, setFileInput] = useState({} as HTMLInputElement); // cast to correct type so typescript doesn't complain\n\tconst [path, setPath] = useState(value || \"\");\n\tconst [errorMessage, setErrorMessage] = useState(null as string | null);\n\tconst [handedFile, setHandedFile] = useState<FileWithPath | null>(presetFile);\n\n\tconst isInvalid = validateFilename(acceptTypes, path);\n\n\tconst uploadSuccess = ({ err, path: successPath }: { err: string | null; path: string }) => {\n\t\tif (err) {\n\t\t\tdispatch(SmartDesktopDesignerActions.set_project_error(INVALID_FILE_TYPE_ERROR));\n\n\t\t\tsetErrorMessage(err);\n\t\t\tsetPath(\"\");\n\t\t} else {\n\t\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(INVALID_FILE_TYPE_ERROR));\n\t\t\tsetErrorMessage(null);\n\t\t\tsetPath(successPath);\n\n\t\t\tonSetValue?.(successPath);\n\n\t\t\tfileInput.value = \"\";\n\t\t}\n\t};\n\n\tconst uploadError = (err: string) => {\n\t\tsetErrorMessage(err);\n\t};\n\n\tconst uploadFile = (fileObj: FileWithPath | undefined) => {\n\t\t// If it's not a file, we can't do anything with it\n\t\tif (!(fileObj instanceof File)) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsUploading(true);\n\t\tuploadFunction?.(fileObj, (progress: number) => {\n\t\t\tsetUploadProgress(progress);\n\t\t})\n\t\t\t.then(uploadSuccess)\n\t\t\t.catch(uploadError)\n\t\t\t.finally(() => {\n\t\t\t\tsetIsUploading(false);\n\t\t\t\tsetUploadProgress(0);\n\t\t\t});\n\t};\n\n\tconst processFile = (fileObj: FileWithPath) => {\n\t\tif (shouldUpload) {\n\t\t\tuploadFile(fileObj);\n\t\t} else if (fileObj?.path) {\n\t\t\t// If the consumer doesn't want the file actually uploaded, just return the file name\n\t\t\tuploadSuccess({\n\t\t\t\terr: null,\n\t\t\t\tpath: fileObj.path,\n\t\t\t});\n\t\t}\n\t\tsetIsUploading(false);\n\t\tsetUploadProgress(0);\n\t\tsetErrorMessage(null);\n\t};\n\n\tuseEffect(() => {\n\t\tsetPath(value || \"\");\n\t}, [value]);\n\n\tconst onFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst fileObj = e.target.files?.[0] as FileWithPath | undefined;\n\n\t\tif (fileObj !== undefined) {\n\t\t\tprocessFile(fileObj);\n\t\t}\n\n\t\tsetFileInput(e.target);\n\t};\n\n\t// Check if props updated\n\tif (handedFile !== presetFile) {\n\t\tsetHandedFile(presetFile);\n\t\tif (presetFile !== null) {\n\t\t\tuploadFile(presetFile);\n\t\t}\n\t}\n\n\treturn (\n\t\t<DropZone processFile={processFile} suppress={suppressDropzone}>\n\t\t\t<div className=\"file-input-container\">\n\t\t\t\t<div className=\"file-input-actions\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={fileInputElement}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tonChange={onFileChange}\n\t\t\t\t\t\taccept={acceptTypes.join(\", \")}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tfashion=\"primary\"\n\t\t\t\t\t\ttext=\"Select file\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tfileInputElement.current.click();\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"file-input-value\">\n\t\t\t\t\t<span className={`file-input-value-input ${isInvalid && \"invalid\"}`} {...{ id }}>\n\t\t\t\t\t\t{path}\n\t\t\t\t\t</span>\n\t\t\t\t\t{allowClearing && path !== \"\" && (\n\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\ttext=\"Cancel\"\n\t\t\t\t\t\t\ticon=\"times\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tsetPath(\"\");\n\t\t\t\t\t\t\t\tonSetValue?.(\"\");\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{errorMessage && <div className=\"file-input-error\">{errorMessage}</div>}\n\t\t\t\t</div>\n\t\t\t\t<div className=\"file-input-status\">\n\t\t\t\t\t{isUploading ? (\n\t\t\t\t\t\t<div className=\"file-input-progress-container\">{uploadProgress}% uploaded</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t!errorMessage && <></>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</DropZone>\n\t);\n};\n"]}
|
|
1
|
+
{"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../../src/components/common/FileInput.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,sBAAsB,CAAC;AAE9B,OAAO,EAAE,QAAQ,EAAgB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAqBlD,MAAM,uBAAuB,GAAiB;IAC7C,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,iDAAiD;CAC1D,CAAC;AAEF,MAAM,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AAChC,CAAC,CAAC;AAEF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AAC,CAAC,CACf,6BAAK,SAAS,EAAC,kBAAkB;gBAChC,+BACC,IAAI,EAAC,MAAM,EACX,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;wBACf,IAAI,UAAU,EAAE;4BACf,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;yBAC7B;wBACD,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACzB,CAAC,gBACU,WAAW,EACtB,KAAK,EAAE,IAAI,GACV,CACG,CACN,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,kBAAkB;gBAChC,4CAAM,SAAS,EAAE,0BAA0B,SAAS,IAAI,SAAS,EAAE,IAAM,EAAE,EAAE,EAAE,GAC7E,IAAI,CACC;gBACN,aAAa,IAAI,IAAI,KAAK,EAAE,IAAI,CAChC,oBAAC,UAAU,IACV,IAAI,EAAC,QAAQ,EACb,IAAI,EAAC,OAAO,EACZ,OAAO,EAAE,GAAG,EAAE;wBACb,OAAO,CAAC,EAAE,CAAC,CAAC;wBACZ,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAG,EAAE,CAAC,CAAC;oBAClB,CAAC,GACA,CACF;gBACA,YAAY,IAAI,6BAAK,SAAS,EAAC,kBAAkB,IAAE,YAAY,CAAO,CAClE,CACN;YACD,6BAAK,SAAS,EAAC,mBAAmB,IAChC,WAAW,CAAC,CAAC,CAAC,CACd,6BAAK,SAAS,EAAC,+BAA+B;gBAAE,cAAc;6BAAiB,CAC/E,CAAC,CAAC,CAAC,CACH,CAAC,YAAY,IAAI,yCAAK,CACtB,CACI,CACD,CACI,CACX,CAAC;AACH,CAAC,CAAC","sourcesContent":["/*!\n * Copyright 2017 - 2020 by ChartIQ, Inc.\n * All rights reserved.\n */\n\nimport React, { useState, useRef, useEffect } from \"react\";\nimport { SmartDesktopDesignerActions } from \"../../actions/smartDesktopDesignerActions\";\nimport { useDispatch } from \"../../store\";\nimport { ProjectError } from \"../../types/smartDesktopDesignerTypes\";\n\nimport { Button } from \"./Button\";\nimport { ButtonIcon } from \"./ButtonIcon\";\nimport \"./css/file-input.css\";\n\nimport { DropZone, FileWithPath } from \"./DropZone\";\nimport { validateFilename } from \"./file_helpers\";\n\nexport type FileInputUploadCb = (\n\tfileObject: File,\n\tcb?: (progress: number) => void\n) => Promise<{ err: string | null; path: string }>;\n\nexport type FileInputProps = {\n\tacceptTypes: string[];\n\tvalue: string;\n\tid?: string;\n\tshouldUpload?: boolean;\n\tonSetValue?: (value: string) => void;\n\tuploadFunction?: FileInputUploadCb;\n\tpresetFile?: null | File;\n\tsuppressDropzone?: boolean;\n\tdisabled?: boolean;\n\tallowClearing?: boolean;\n\ttextEditable?: boolean;\n};\n\nconst INVALID_FILE_TYPE_ERROR: ProjectError = {\n\tviewId: \"themes\",\n\tmessage: \"Your uploaded file is not in the correct format\",\n};\n\nconst defaultUploadFunction = async () => {\n\treturn { err: null, path: \"\" };\n};\n\n/**\n * A Browse button with a hidden file input to allow for a file select dialog and extraction of a path\n *\n * @param {FileInputProps} { acceptTypes, value, onSetValue, shouldUpload=true, uploadFunction = defaultUploadFunction}\n * @return {*}\n */\nexport const FileInput = ({\n\tacceptTypes,\n\tvalue,\n\tonSetValue,\n\tid,\n\tshouldUpload = true,\n\tuploadFunction = defaultUploadFunction,\n\tpresetFile = null,\n\tsuppressDropzone = false,\n\tdisabled = false,\n\tallowClearing = true,\n\ttextEditable = false,\n}: FileInputProps) => {\n\tconst dispatch = useDispatch();\n\tconst fileInputElement = useRef({} as HTMLInputElement);\n\tconst [isUploading, setIsUploading] = useState(false);\n\tconst [uploadProgress, setUploadProgress] = useState(0);\n\tconst [fileInput, setFileInput] = useState({} as HTMLInputElement); // cast to correct type so typescript doesn't complain\n\tconst [path, setPath] = useState(value || \"\");\n\tconst [errorMessage, setErrorMessage] = useState(null as string | null);\n\tconst [handedFile, setHandedFile] = useState<FileWithPath | null>(presetFile);\n\n\tconst isInvalid = validateFilename(acceptTypes, path);\n\n\tconst uploadSuccess = ({ err, path: successPath }: { err: string | null; path: string }) => {\n\t\tif (err) {\n\t\t\tdispatch(SmartDesktopDesignerActions.set_project_error(INVALID_FILE_TYPE_ERROR));\n\n\t\t\tsetErrorMessage(err);\n\t\t\tsetPath(\"\");\n\t\t} else {\n\t\t\tdispatch(SmartDesktopDesignerActions.delete_project_error(INVALID_FILE_TYPE_ERROR));\n\t\t\tsetErrorMessage(null);\n\t\t\tsetPath(successPath);\n\n\t\t\tonSetValue?.(successPath);\n\n\t\t\tfileInput.value = \"\";\n\t\t}\n\t};\n\n\tconst uploadError = (err: string) => {\n\t\tsetErrorMessage(err);\n\t};\n\n\tconst uploadFile = (fileObj: FileWithPath | undefined) => {\n\t\t// If it's not a file, we can't do anything with it\n\t\tif (!(fileObj instanceof File)) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetIsUploading(true);\n\t\tuploadFunction?.(fileObj, (progress: number) => {\n\t\t\tsetUploadProgress(progress);\n\t\t})\n\t\t\t.then(uploadSuccess)\n\t\t\t.catch(uploadError)\n\t\t\t.finally(() => {\n\t\t\t\tsetIsUploading(false);\n\t\t\t\tsetUploadProgress(0);\n\t\t\t});\n\t};\n\n\tconst processFile = (fileObj: FileWithPath) => {\n\t\tif (shouldUpload) {\n\t\t\tuploadFile(fileObj);\n\t\t} else if (fileObj?.path) {\n\t\t\t// If the consumer doesn't want the file actually uploaded, just return the file name\n\t\t\tuploadSuccess({\n\t\t\t\terr: null,\n\t\t\t\tpath: fileObj.path,\n\t\t\t});\n\t\t}\n\t\tsetIsUploading(false);\n\t\tsetUploadProgress(0);\n\t\tsetErrorMessage(null);\n\t};\n\n\tuseEffect(() => {\n\t\tsetPath(value || \"\");\n\t}, [value]);\n\n\tconst onFileChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\tconst fileObj = e.target.files?.[0] as FileWithPath | undefined;\n\n\t\tif (fileObj !== undefined) {\n\t\t\tprocessFile(fileObj);\n\t\t}\n\n\t\tsetFileInput(e.target);\n\t};\n\n\t// Check if props updated\n\tif (handedFile !== presetFile) {\n\t\tsetHandedFile(presetFile);\n\t\tif (presetFile !== null) {\n\t\t\tuploadFile(presetFile);\n\t\t}\n\t}\n\n\treturn (\n\t\t<DropZone processFile={processFile} suppress={suppressDropzone}>\n\t\t\t<div className=\"file-input-container\">\n\t\t\t\t<div className=\"file-input-actions\">\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={fileInputElement}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\ttype=\"file\"\n\t\t\t\t\t\tonChange={onFileChange}\n\t\t\t\t\t\taccept={acceptTypes.join(\", \")}\n\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t/>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tfashion=\"primary\"\n\t\t\t\t\t\ttext=\"Select file\"\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tfileInputElement.current.click();\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t{textEditable ? (\n\t\t\t\t\t<div className=\"file-input-field\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\t\t\tif (onSetValue) {\n\t\t\t\t\t\t\t\t\tonSetValue?.(e.target.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetPath(e.target.value);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-label=\"File name\"\n\t\t\t\t\t\t\tvalue={path}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<div className=\"file-input-value\">\n\t\t\t\t\t\t<span className={`file-input-value-input ${isInvalid && \"invalid\"}`} {...{ id }}>\n\t\t\t\t\t\t\t{path}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{allowClearing && path !== \"\" && (\n\t\t\t\t\t\t\t<ButtonIcon\n\t\t\t\t\t\t\t\ttext=\"Cancel\"\n\t\t\t\t\t\t\t\ticon=\"times\"\n\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\tsetPath(\"\");\n\t\t\t\t\t\t\t\t\tonSetValue?.(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{errorMessage && <div className=\"file-input-error\">{errorMessage}</div>}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div className=\"file-input-status\">\n\t\t\t\t\t{isUploading ? (\n\t\t\t\t\t\t<div className=\"file-input-progress-container\">{uploadProgress}% uploaded</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t!errorMessage && <></>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</DropZone>\n\t);\n};\n"]}
|
|
@@ -7,4 +7,14 @@ export declare type FinsembleIconProps = {
|
|
|
7
7
|
onClick?: (e: React.MouseEvent) => void;
|
|
8
8
|
label?: string;
|
|
9
9
|
};
|
|
10
|
+
/**
|
|
11
|
+
* Wrapper for the SVG-based icons. The wrapper ensures that icons are handled consistently.
|
|
12
|
+
*
|
|
13
|
+
* @param param
|
|
14
|
+
* @param param.icon - The name of the icon to display
|
|
15
|
+
* @param [param.onClick] - The click action for this icon
|
|
16
|
+
* @param [param.className] - Any other classes you want to apply to the icon
|
|
17
|
+
* @param [param.label] - (Accessibility) The label you want to apply for screen reader users. Always include a label UNLESS the icon is decorative.
|
|
18
|
+
* @returns Wrapped icon component
|
|
19
|
+
*/
|
|
10
20
|
export declare const FinsembleIcon: ({ icon, onClick, className, label }: FinsembleIconProps) => JSX.Element;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import uuidv4 from "uuid-random";
|
|
2
3
|
import "./css/icon.css";
|
|
4
|
+
// Import all of the SVG icons
|
|
3
5
|
import { ReactComponent as AlwaysOnTopIcon } from "../../assets/icons/always-on-top.svg";
|
|
4
6
|
import { ReactComponent as Caret } from "../../assets/icons/caret.svg";
|
|
5
7
|
import { ReactComponent as CheckIcon } from "../../assets/icons/check.svg";
|
|
@@ -26,7 +28,7 @@ import { ReactComponent as MaximizeIcon } from "../../assets/icons/maximize.svg"
|
|
|
26
28
|
import { ReactComponent as MinimizeIcon } from "../../assets/icons/minimize.svg";
|
|
27
29
|
import { ReactComponent as MoonIcon } from "../../assets/icons/moon.svg";
|
|
28
30
|
import { ReactComponent as PaintRollerIcon } from "../../assets/icons/paint-roller.svg";
|
|
29
|
-
import { ReactComponent as PencilIcon } from "../../assets/icons/pencil.svg";
|
|
31
|
+
// import { ReactComponent as PencilIcon } from "../../assets/icons/pencil.svg";
|
|
30
32
|
import { ReactComponent as PlusIcon } from "../../assets/icons/plus.svg";
|
|
31
33
|
import { ReactComponent as QuestionCircleIcon } from "../../assets/icons/question-circle.svg";
|
|
32
34
|
import { ReactComponent as SearchIcon } from "../../assets/icons/search.svg";
|
|
@@ -37,9 +39,46 @@ import { ReactComponent as ToggleOffIcon } from "../../assets/icons/toggle-off.s
|
|
|
37
39
|
import { ReactComponent as ToggleOnIcon } from "../../assets/icons/toggle-on.svg";
|
|
38
40
|
import { ReactComponent as ToolbarIcon } from "../../assets/icons/toolbar.svg";
|
|
39
41
|
import { ReactComponent as ToolsIcon } from "../../assets/icons/tools.svg";
|
|
40
|
-
import { ReactComponent as TrashIcon } from "../../assets/icons/trash.svg";
|
|
42
|
+
// import { ReactComponent as TrashIcon } from "../../assets/icons/trash.svg";
|
|
41
43
|
import { ReactComponent as UploadIcon } from "../../assets/icons/upload.svg";
|
|
42
44
|
import { ReactComponent as WindowIcon } from "../../assets/icons/window.svg";
|
|
45
|
+
const TrashIcon = () => {
|
|
46
|
+
/**
|
|
47
|
+
* The clip path is used to generate a mask, which allows us to drive color changes to the SVG with CSS.
|
|
48
|
+
* The SVG is referencing clip paths using an ID. If there are multiple instances of the same SVG,
|
|
49
|
+
* and they were all using the same ID, you have a potential conflict between the clip paths.
|
|
50
|
+
* For a specific example if all the ID's were the same:, if we have 2 trash icons on a page, and the
|
|
51
|
+
* first icon is hidden, the second trash icon would also disappear.
|
|
52
|
+
*
|
|
53
|
+
* In order to protect against this, we generate a unique ID for each clip path.
|
|
54
|
+
*/
|
|
55
|
+
const id = `clip${uuidv4()}`;
|
|
56
|
+
return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
57
|
+
React.createElement("g", { clipPath: `url(#${id})` },
|
|
58
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.08098 5.15763C0.492918 5.15763 0 4.69615 0 4.11318V3.12112C0 2.5493 0.481455 2.07667 1.08098 2.07667H14.9331C15.5453 2.07667 16.0347 2.56825 15.9981 3.12112V4.11318C15.9981 4.68501 15.5166 5.15763 14.9159 5.15763H14.525L13.3524 14.2032C13.2354 15.2331 12.3321 16 11.2592 16H4.73889C3.67969 16 2.78785 15.2309 2.64571 14.2121L1.47302 5.15763H1.08098ZM1.14632 4.04296H2.48408L3.78286 14.0672C3.84706 14.5309 4.25629 14.8843 4.73889 14.8843H11.2592C11.7521 14.8843 12.1613 14.5387 12.2141 14.0717L13.514 4.04184H14.8517V3.19023H1.14632V4.04296Z" }),
|
|
59
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.8397 12.4197C6.8397 12.744 6.56917 13.0049 6.22985 13.0049C5.89169 13.0049 5.62001 12.744 5.62001 12.4197V6.73039C5.62001 6.4049 5.89169 6.14407 6.22985 6.14407C6.56917 6.14407 6.8397 6.4049 6.8397 6.73039V12.4197ZM10.4128 12.4197C10.4128 12.744 10.1422 13.0049 9.80294 13.0049C9.46477 13.0049 9.1931 12.744 9.1931 12.4197V6.73039C9.1931 6.4049 9.46477 6.14407 9.80294 6.14407C10.1422 6.14407 10.4128 6.4049 10.4128 6.73039V12.4197ZM10.3108 0.488226C10.3108 0.211788 10.0735 0 9.80294 0H6.21381C5.92723 0 5.70599 0.227393 5.70599 0.488226V1.64191H10.3291V0.487112H10.3119L10.3108 0.488226Z" })),
|
|
60
|
+
React.createElement("defs", null,
|
|
61
|
+
React.createElement("clipPath", { id: id },
|
|
62
|
+
React.createElement("rect", { width: "16", height: "16", fill: "white" })))));
|
|
63
|
+
};
|
|
64
|
+
const PencilIcon = () => {
|
|
65
|
+
/**
|
|
66
|
+
* The clip path is used to generate a mask, which allows us to drive color changes to the SVG with CSS.
|
|
67
|
+
* The SVG is referencing clip paths using an ID. If there are multiple instances of the same SVG,
|
|
68
|
+
* and they were all using the same ID, you have a potential conflict between the clip paths.
|
|
69
|
+
* For a specific example if all the ID's were the same:, if we have 2 pencil icons on a page, and the
|
|
70
|
+
* first icon is hidden, the second pencil icon would also disappear.
|
|
71
|
+
*
|
|
72
|
+
* In order to protect against this, we generate a unique ID for each clip path.
|
|
73
|
+
*/
|
|
74
|
+
const id = `clip${uuidv4()}`;
|
|
75
|
+
return (React.createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
76
|
+
React.createElement("g", { clipPath: `url(#${id})` },
|
|
77
|
+
React.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.1331 0.865749C16.2897 2.02008 16.2897 3.90016 15.1331 5.05563L5.70073 14.4754C5.64359 14.5737 5.54987 14.6469 5.43672 14.6777L0.548523 15.9852C0.398802 16.0252 0.237654 15.9829 0.127935 15.8721C0.0170738 15.7623 -0.0252147 15.6023 0.0147869 15.4515L1.29941 10.6627C1.3017 10.5541 1.34513 10.4467 1.42627 10.3656L10.9375 0.865749C12.0941 -0.288583 13.9765 -0.288583 15.1331 0.865749ZM2.1623 11.8536L1.43542 14.5646L2.02744 14.4069L4.33039 13.7897L2.1623 11.8536ZM11.7455 1.67492L2.74061 10.6661L5.44358 13.1165L14.3251 4.24646C15.0348 3.53786 15.0348 2.38352 14.3251 1.67492C13.6153 0.965181 12.4564 0.965181 11.7455 1.67492Z" })),
|
|
78
|
+
React.createElement("defs", null,
|
|
79
|
+
React.createElement("clipPath", { id: id },
|
|
80
|
+
React.createElement("rect", { width: "16", height: "16", fill: "white" })))));
|
|
81
|
+
};
|
|
43
82
|
const icons = {
|
|
44
83
|
alwaysOnTop: AlwaysOnTopIcon,
|
|
45
84
|
caret: Caret,
|
|
@@ -82,6 +121,16 @@ const icons = {
|
|
|
82
121
|
upload: UploadIcon,
|
|
83
122
|
window: WindowIcon,
|
|
84
123
|
};
|
|
124
|
+
/**
|
|
125
|
+
* Wrapper for the SVG-based icons. The wrapper ensures that icons are handled consistently.
|
|
126
|
+
*
|
|
127
|
+
* @param param
|
|
128
|
+
* @param param.icon - The name of the icon to display
|
|
129
|
+
* @param [param.onClick] - The click action for this icon
|
|
130
|
+
* @param [param.className] - Any other classes you want to apply to the icon
|
|
131
|
+
* @param [param.label] - (Accessibility) The label you want to apply for screen reader users. Always include a label UNLESS the icon is decorative.
|
|
132
|
+
* @returns Wrapped icon component
|
|
133
|
+
*/
|
|
85
134
|
export const FinsembleIcon = ({ icon, onClick = () => { }, className = "", label = "" }) => {
|
|
86
135
|
const Icon = icons[icon];
|
|
87
136
|
return (React.createElement("span", Object.assign({ className: ["finsemble-icon", `finsemble-icon-${icon}`, className].join(" ") }, (label
|