@webiny/app-admin 0.0.0-unstable.e3f4727c56 → 0.0.0-unstable.eb196ccd2f
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/assets/icons/add-18px.svg +1 -1
- package/assets/icons/arrow_drop_down-24px.svg +1 -1
- package/assets/icons/file_download.svg +1 -0
- package/assets/icons/file_upload.svg +1 -0
- package/assets/icons/filter-24px.svg +1 -1
- package/assets/icons/highlight-24px.svg +1 -1
- package/assets/icons/info.svg +1 -1
- package/assets/icons/insert_drive_file-24px.svg +1 -1
- package/assets/icons/insert_photo-24px.svg +1 -1
- package/assets/icons/label-24px.svg +1 -1
- package/assets/icons/round-account_circle-24px.svg +1 -1
- package/assets/icons/round-arrow_drop_down-24px.svg +1 -1
- package/assets/icons/round-help-24px.svg +1 -1
- package/assets/icons/round-settings-24px.svg +1 -1
- package/assets/icons/today-24px.svg +1 -1
- package/assets/icons/touch_app.svg +1 -1
- package/base/Admin.d.ts +2 -2
- package/base/Admin.js +27 -40
- package/base/Admin.js.map +1 -1
- package/base/Base/Menus/SupportMenuItems.d.ts +2 -0
- package/base/Base/Menus/SupportMenuItems.js +20 -0
- package/base/Base/Menus/SupportMenuItems.js.map +1 -0
- package/base/Base/Menus/WebinyVersion.d.ts +2 -0
- package/base/Base/Menus/WebinyVersion.js +24 -0
- package/base/Base/Menus/WebinyVersion.js.map +1 -0
- package/base/Base/Menus.d.ts +2 -0
- package/base/Base/Menus.js +129 -0
- package/base/Base/Menus.js.map +1 -0
- package/base/Base/Routes.d.ts +2 -0
- package/base/Base/Routes.js +24 -0
- package/base/Base/Routes.js.map +1 -0
- package/base/Base/Tenant/wby-logo.svg +3 -0
- package/base/Base/Tenant.d.ts +2 -0
- package/base/Base/Tenant.js +19 -0
- package/base/Base/Tenant.js.map +1 -0
- package/base/Base.d.ts +1 -1
- package/base/Base.js +13 -90
- package/base/Base.js.map +1 -1
- package/base/WebinyVersion.d.ts +2 -0
- package/base/WebinyVersion.js +24 -0
- package/base/WebinyVersion.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.d.ts +2 -3
- package/base/plugins/AddGraphQLQuerySelection.js +13 -18
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.d.ts +1 -0
- package/base/providers/AdminUiStateProvider.js +14 -0
- package/base/providers/AdminUiStateProvider.js.map +1 -0
- package/base/providers/ApolloProvider.d.ts +5 -2
- package/base/providers/ApolloProvider.js +11 -16
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.d.ts +1 -2
- package/base/providers/TelemetryProvider.js +15 -24
- package/base/providers/TelemetryProvider.js.map +1 -1
- package/base/providers/UiProviders.d.ts +1 -0
- package/base/providers/UiProviders.js +14 -0
- package/base/providers/UiProviders.js.map +1 -0
- package/base/providers/UiStateProvider.d.ts +1 -2
- package/base/providers/UiStateProvider.js +12 -16
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.d.ts +5 -1
- package/base/providers/ViewCompositionProvider.js +35 -45
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.d.ts +39 -2
- package/base/ui/Brand.js +7 -14
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +21 -1
- package/base/ui/CenteredView.js +14 -34
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.d.ts +39 -2
- package/base/ui/Dashboard.js +7 -14
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.d.ts +86 -0
- package/base/ui/FileManager.js +60 -0
- package/base/ui/FileManager.js.map +1 -0
- package/base/ui/Layout.d.ts +40 -2
- package/base/ui/Layout.js +10 -18
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.d.ts +39 -2
- package/base/ui/LocaleSelector.js +7 -14
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.d.ts +21 -2
- package/base/ui/LoginScreen.js +21 -17
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.d.ts +38 -7
- package/base/ui/Logo.js +7 -29
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.d.ts +39 -23
- package/base/ui/Navigation.js +14 -146
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.d.ts +39 -2
- package/base/ui/NotFound.js +7 -14
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.d.ts +2 -2
- package/base/ui/Tags.js +16 -18
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/TenantSelector.d.ts +39 -0
- package/base/ui/TenantSelector.js +8 -0
- package/base/ui/TenantSelector.js.map +1 -0
- package/base/ui/UserMenu/UserMenu.d.ts +39 -0
- package/base/ui/UserMenu/UserMenu.js +8 -0
- package/base/ui/UserMenu/UserMenu.js.map +1 -0
- package/base/ui/UserMenu/UserMenuHandle.d.ts +39 -0
- package/base/ui/UserMenu/UserMenuHandle.js +8 -0
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -0
- package/base/ui/UserMenu/UserMenuItem.d.ts +81 -0
- package/base/ui/UserMenu/UserMenuItem.js +19 -0
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -0
- package/base/ui/UserMenu/UserMenuLink.d.ts +81 -0
- package/base/ui/UserMenu/UserMenuLink.js +19 -0
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -0
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +42 -0
- package/base/ui/UserMenu/UserMenuSeparator.js +9 -0
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -0
- package/base/ui/UserMenu.d.ts +79 -29
- package/base/ui/UserMenu.js +16 -110
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.d.ts +2 -1
- package/components/AdminLayout.js +9 -14
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.d.ts +5 -1
- package/components/AppInstaller/AppInstaller.js +63 -67
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.d.ts +2 -2
- package/components/AppInstaller/Sidebar.js +71 -108
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.d.ts +2 -2
- package/components/AppInstaller/index.js +12 -17
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.d.ts +16 -6
- package/components/AppInstaller/styled.js +57 -69
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.d.ts +1 -1
- package/components/AppInstaller/useInstaller.js +97 -138
- package/components/AppInstaller/useInstaller.js.map +1 -1
- package/components/BulkActions/Worker.d.ts +83 -0
- package/components/BulkActions/Worker.js +126 -0
- package/components/BulkActions/Worker.js.map +1 -0
- package/components/BulkActions/index.d.ts +2 -0
- package/components/BulkActions/index.js +4 -0
- package/components/BulkActions/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +5 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +23 -0
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/index.d.ts +1 -0
- package/components/BulkActions/useDialogWithReport/index.js +3 -0
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +19 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +51 -0
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -0
- package/components/Buttons/Buttons.d.ts +24 -0
- package/components/Buttons/Buttons.js +77 -0
- package/components/Buttons/Buttons.js.map +1 -0
- package/components/Buttons/Buttons.styles.d.ts +5 -0
- package/components/Buttons/Buttons.styles.js +18 -0
- package/components/Buttons/Buttons.styles.js.map +1 -0
- package/components/Buttons/index.d.ts +2 -0
- package/components/Buttons/index.js +4 -0
- package/components/Buttons/index.js.map +1 -0
- package/components/Buttons/useButtons.d.ts +14 -0
- package/components/Buttons/useButtons.js +24 -0
- package/components/Buttons/useButtons.js.map +1 -0
- package/components/Dialogs/CustomDialog.d.ts +17 -0
- package/components/Dialogs/CustomDialog.js +48 -0
- package/components/Dialogs/CustomDialog.js.map +1 -0
- package/components/Dialogs/Dialog.d.ts +21 -0
- package/components/Dialogs/Dialog.js +62 -0
- package/components/Dialogs/Dialog.js.map +1 -0
- package/components/Dialogs/DialogsContext.d.ts +43 -0
- package/components/Dialogs/DialogsContext.js +141 -0
- package/components/Dialogs/DialogsContext.js.map +1 -0
- package/components/Dialogs/useDialogs.d.ts +3 -0
- package/components/Dialogs/useDialogs.js +12 -0
- package/components/Dialogs/useDialogs.js.map +1 -0
- package/components/EmptyView.d.ts +4 -3
- package/components/EmptyView.js +31 -58
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.d.ts +16 -0
- package/components/Filters/Filters.js +21 -0
- package/components/Filters/Filters.js.map +1 -0
- package/components/Filters/FiltersToggle.d.ts +7 -0
- package/components/Filters/FiltersToggle.js +26 -0
- package/components/Filters/FiltersToggle.js.map +1 -0
- package/components/Filters/index.d.ts +2 -0
- package/components/Filters/index.js +4 -0
- package/components/Filters/index.js.map +1 -0
- package/components/FloatingActionButton.d.ts +4 -1
- package/components/FloatingActionButton.js +9 -14
- package/components/FloatingActionButton.js.map +1 -1
- package/components/FloatingPanel.d.ts +13 -0
- package/components/FloatingPanel.js +96 -0
- package/components/FloatingPanel.js.map +1 -0
- package/components/IconPicker/IconPicker.d.ts +13 -0
- package/components/IconPicker/IconPicker.js +39 -0
- package/components/IconPicker/IconPicker.js.map +1 -0
- package/components/IconPicker/IconPickerComponent.d.ts +17 -0
- package/components/IconPicker/IconPickerComponent.js +81 -0
- package/components/IconPicker/IconPickerComponent.js.map +1 -0
- package/components/IconPicker/IconPickerPresenter.d.ts +53 -0
- package/components/IconPicker/IconPickerPresenter.js +77 -0
- package/components/IconPicker/IconPickerPresenter.js.map +1 -0
- package/components/IconPicker/IconPickerPresenter.test.d.ts +1 -0
- package/components/IconPicker/IconPickerPresenter.test.js +109 -0
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -0
- package/components/IconPicker/IconPickerPresenterProvider.d.ts +9 -0
- package/components/IconPicker/IconPickerPresenterProvider.js +19 -0
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -0
- package/components/IconPicker/IconPickerTab.d.ts +33 -0
- package/components/IconPicker/IconPickerTab.js +159 -0
- package/components/IconPicker/IconPickerTab.js.map +1 -0
- package/components/IconPicker/IconRenderer.d.ts +34 -0
- package/components/IconPicker/IconRenderer.js +27 -0
- package/components/IconPicker/IconRenderer.js.map +1 -0
- package/components/IconPicker/IconRepository.d.ts +19 -0
- package/components/IconPicker/IconRepository.js +47 -0
- package/components/IconPicker/IconRepository.js.map +1 -0
- package/components/IconPicker/IconRepository.test.d.ts +1 -0
- package/components/IconPicker/IconRepository.test.js +66 -0
- package/components/IconPicker/IconRepository.test.js.map +1 -0
- package/components/IconPicker/IconRepositoryFactory.d.ts +9 -0
- package/components/IconPicker/IconRepositoryFactory.js +17 -0
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -0
- package/components/IconPicker/Loading.d.ts +14 -0
- package/components/IconPicker/Loading.js +50 -0
- package/components/IconPicker/Loading.js.map +1 -0
- package/components/IconPicker/components/IconPickerCell.d.ts +12 -0
- package/components/IconPicker/components/IconPickerCell.js +27 -0
- package/components/IconPicker/components/IconPickerCell.js.map +1 -0
- package/components/IconPicker/components/IconPickerContent.d.ts +11 -0
- package/components/IconPicker/components/IconPickerContent.js +41 -0
- package/components/IconPicker/components/IconPickerContent.js.map +1 -0
- package/components/IconPicker/components/IconPickerRow.d.ts +4 -0
- package/components/IconPicker/components/IconPickerRow.js +14 -0
- package/components/IconPicker/components/IconPickerRow.js.map +1 -0
- package/components/IconPicker/components/IconPickerTrigger.d.ts +13 -0
- package/components/IconPicker/components/IconPickerTrigger.js +52 -0
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -0
- package/components/IconPicker/components/index.d.ts +4 -0
- package/components/IconPicker/components/index.js +6 -0
- package/components/IconPicker/components/index.js.map +1 -0
- package/components/IconPicker/config/Emojis.d.ts +2 -0
- package/components/IconPicker/config/Emojis.js +24 -0
- package/components/IconPicker/config/Emojis.js.map +1 -0
- package/components/IconPicker/config/FontAwesomeIcons.d.ts +2 -0
- package/components/IconPicker/config/FontAwesomeIcons.js +61 -0
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -0
- package/components/IconPicker/config/IconPackProvider.d.ts +7 -0
- package/components/IconPicker/config/IconPackProvider.js +23 -0
- package/components/IconPicker/config/IconPackProvider.js.map +1 -0
- package/components/IconPicker/config/IconType.d.ts +32 -0
- package/components/IconPicker/config/IconType.js +89 -0
- package/components/IconPicker/config/IconType.js.map +1 -0
- package/components/IconPicker/config/index.d.ts +31 -0
- package/components/IconPicker/config/index.js +45 -0
- package/components/IconPicker/config/index.js.map +1 -0
- package/components/IconPicker/defaultIcon.d.ts +6 -0
- package/components/IconPicker/defaultIcon.js +8 -0
- package/components/IconPicker/defaultIcon.js.map +1 -0
- package/components/IconPicker/index.d.ts +7 -0
- package/components/IconPicker/index.js +8 -0
- package/components/IconPicker/index.js.map +1 -0
- package/components/IconPicker/plugins/customPlugin.d.ts +2 -0
- package/components/IconPicker/plugins/customPlugin.js +132 -0
- package/components/IconPicker/plugins/customPlugin.js.map +1 -0
- package/components/IconPicker/plugins/emojisPlugin.d.ts +2 -0
- package/components/IconPicker/plugins/emojisPlugin.js +127 -0
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -0
- package/components/IconPicker/plugins/graphql.d.ts +20 -0
- package/components/IconPicker/plugins/graphql.js +27 -0
- package/components/IconPicker/plugins/graphql.js.map +1 -0
- package/components/IconPicker/plugins/iconsPlugin.d.ts +2 -0
- package/components/IconPicker/plugins/iconsPlugin.js +115 -0
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -0
- package/components/IconPicker/types.d.ts +22 -0
- package/components/IconPicker/types.js +10 -0
- package/components/IconPicker/types.js.map +1 -0
- package/components/LexicalEditor/LexicalEditor.d.ts +8 -0
- package/components/LexicalEditor/LexicalEditor.js +29 -0
- package/components/LexicalEditor/LexicalEditor.js.map +1 -0
- package/components/LexicalEditor/index.d.ts +1 -0
- package/components/LexicalEditor/index.js +3 -0
- package/components/LexicalEditor/index.js.map +1 -0
- package/components/MultiImageUpload.d.ts +1 -1
- package/components/MultiImageUpload.js +14 -32
- package/components/MultiImageUpload.js.map +1 -1
- package/components/OptionsMenu/OptionsMenu.d.ts +10 -0
- package/components/OptionsMenu/OptionsMenu.js +23 -0
- package/components/OptionsMenu/OptionsMenu.js.map +1 -0
- package/components/OptionsMenu/OptionsMenuItem.d.ts +10 -0
- package/components/OptionsMenu/OptionsMenuItem.js +17 -0
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -0
- package/components/OptionsMenu/OptionsMenuLink.d.ts +12 -0
- package/components/OptionsMenu/OptionsMenuLink.js +17 -0
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -0
- package/components/OptionsMenu/index.d.ts +4 -0
- package/components/OptionsMenu/index.js +6 -0
- package/components/OptionsMenu/index.js.map +1 -0
- package/components/OptionsMenu/useOptionsMenuItem.d.ts +13 -0
- package/components/OptionsMenu/useOptionsMenuItem.js +23 -0
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +6 -17
- package/components/OverlayLayout/OverlayLayout.js +45 -153
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.d.ts +7 -0
- package/components/OverlayLayout/components/OverlayBackdrop.js +15 -0
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -0
- package/components/OverlayLayout/components/OverlayContent.d.ts +6 -0
- package/components/OverlayLayout/components/OverlayContent.js +21 -0
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -0
- package/components/OverlayLayout/components/OverlayHeader.d.ts +13 -0
- package/components/OverlayLayout/components/OverlayHeader.js +44 -0
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -0
- package/components/OverlayLayout/components/OverlayRoot.d.ts +9 -0
- package/components/OverlayLayout/components/OverlayRoot.js +19 -0
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -0
- package/components/OverlayLayout/components/index.d.ts +4 -0
- package/components/OverlayLayout/components/index.js +6 -0
- package/components/OverlayLayout/components/index.js.map +1 -0
- package/components/OverlayLayout/index.js +2 -15
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/CannotUseAaclAlert.d.ts +2 -0
- package/components/Permissions/CannotUseAaclAlert.js +14 -0
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -0
- package/components/Permissions/Permissions.d.ts +3 -3
- package/components/Permissions/Permissions.js +39 -49
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.d.ts +6 -0
- package/components/Permissions/PermissionsGroup.js +18 -0
- package/components/Permissions/PermissionsGroup.js.map +1 -0
- package/components/Permissions/StyledComponents.d.ts +2 -3
- package/components/Permissions/StyledComponents.js +14 -28
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.d.ts +2 -0
- package/components/Permissions/index.js +5 -26
- package/components/Permissions/index.js.map +1 -1
- package/components/ResizablePanels/index.d.ts +1 -0
- package/components/ResizablePanels/index.js +3 -0
- package/components/ResizablePanels/index.js.map +1 -0
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/RichTextEditor.js +15 -22
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js +3 -18
- package/components/RichTextEditor/index.js.map +1 -1
- package/components/RichTextEditor/tools/header/index.d.ts +3 -4
- package/components/RichTextEditor/tools/header/index.js +457 -533
- package/components/RichTextEditor/tools/header/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/index.d.ts +2 -4
- package/components/RichTextEditor/tools/image/index.js +149 -191
- package/components/RichTextEditor/tools/image/index.js.map +1 -1
- package/components/RichTextEditor/tools/image/svgs.js +6 -11
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -1
- package/components/RichTextEditor/tools/image/tunes.d.ts +2 -4
- package/components/RichTextEditor/tools/image/tunes.js +77 -103
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -1
- package/components/RichTextEditor/tools/image/types.js +2 -4
- package/components/RichTextEditor/tools/image/types.js.map +1 -1
- package/components/RichTextEditor/tools/image/ui.d.ts +2 -4
- package/components/RichTextEditor/tools/image/ui.js +152 -185
- package/components/RichTextEditor/tools/image/ui.js.map +1 -1
- package/components/RichTextEditor/tools/paragraph/index.d.ts +3 -4
- package/components/RichTextEditor/tools/paragraph/index.js +349 -402
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -1
- package/components/RichTextEditor/tools/textColor/index.d.ts +1 -4
- package/components/RichTextEditor/tools/textColor/index.js +165 -213
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -1
- package/components/RichTextEditor/tools/utils.d.ts +1 -1
- package/components/RichTextEditor/tools/utils.js +7 -14
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.d.ts +1 -1
- package/components/Routes.js +16 -24
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.d.ts +2 -1
- package/components/SearchUI.js +25 -69
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +19 -8
- package/components/SimpleForm/SimpleForm.js +74 -70
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +2 -29
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.d.ts +3 -3
- package/components/SimpleUI/InputField.js +43 -50
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +22 -4
- package/components/SingleImageUpload.js +41 -77
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +10 -8
- package/components/SplitView/SplitView.js +53 -71
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +2 -23
- package/components/SplitView/index.js.map +1 -1
- package/components/StateInspector.d.ts +8 -0
- package/components/StateInspector.js +36 -0
- package/components/StateInspector.js.map +1 -0
- package/components/Wcp.d.ts +13 -0
- package/components/Wcp.js +27 -0
- package/components/Wcp.js.map +1 -0
- package/components/index.d.ts +3 -1
- package/components/index.js +4 -11
- package/components/index.js.map +1 -1
- package/config/AdminConfig/Menu/MenuGroup.d.ts +62 -0
- package/config/AdminConfig/Menu/MenuGroup.js +14 -0
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -0
- package/config/AdminConfig/Menu/MenuItem.d.ts +43 -0
- package/config/AdminConfig/Menu/MenuItem.js +14 -0
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/MenuLink.d.ts +43 -0
- package/config/AdminConfig/Menu/MenuLink.js +18 -0
- package/config/AdminConfig/Menu/MenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +43 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +13 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +24 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +13 -0
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/SupportMenu.d.ts +72 -0
- package/config/AdminConfig/Menu/SupportMenu.js +49 -0
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.d.ts +41 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +7 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.d.ts +41 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +7 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.d.ts +1 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +3 -0
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu/types.d.ts +7 -0
- package/config/AdminConfig/Menu/UserMenu/types.js +3 -0
- package/config/AdminConfig/Menu/UserMenu/types.js.map +1 -0
- package/config/AdminConfig/Menu/UserMenu.d.ts +129 -0
- package/config/AdminConfig/Menu/UserMenu.js +61 -0
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -0
- package/config/AdminConfig/Menu/types.d.ts +7 -0
- package/config/AdminConfig/Menu/types.js +3 -0
- package/config/AdminConfig/Menu/types.js.map +1 -0
- package/config/AdminConfig/Menu.d.ts +350 -0
- package/config/AdminConfig/Menu.js +75 -0
- package/config/AdminConfig/Menu.js.map +1 -0
- package/config/AdminConfig/Route.d.ts +3 -0
- package/config/AdminConfig/Route.js +8 -0
- package/config/AdminConfig/Route.js.map +1 -0
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +23 -0
- package/config/AdminConfig/Tenant/TenantLogo.js +16 -0
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -0
- package/config/AdminConfig/Tenant/TenantName.d.ts +23 -0
- package/config/AdminConfig/Tenant/TenantName.js +16 -0
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -0
- package/config/AdminConfig/Tenant.d.ts +66 -0
- package/config/AdminConfig/Tenant.js +23 -0
- package/config/AdminConfig/Tenant.js.map +1 -0
- package/config/AdminConfig/Theme/assignColor.d.ts +2 -0
- package/config/AdminConfig/Theme/assignColor.js +22 -0
- package/config/AdminConfig/Theme/assignColor.js.map +1 -0
- package/config/AdminConfig/Theme/consts.d.ts +2 -0
- package/config/AdminConfig/Theme/consts.js +4 -0
- package/config/AdminConfig/Theme/consts.js.map +1 -0
- package/config/AdminConfig/Theme/types.d.ts +3 -0
- package/config/AdminConfig/Theme/types.js +3 -0
- package/config/AdminConfig/Theme/types.js.map +1 -0
- package/config/AdminConfig/Theme.d.ts +16 -0
- package/config/AdminConfig/Theme.js +22 -0
- package/config/AdminConfig/Theme.js.map +1 -0
- package/config/AdminConfig.d.ts +434 -0
- package/config/AdminConfig.js +47 -0
- package/config/AdminConfig.js.map +1 -0
- package/config/createAdminConfig.d.ts +57 -0
- package/config/createAdminConfig.js +94 -0
- package/config/createAdminConfig.js.map +1 -0
- package/hooks/index.d.ts +10 -0
- package/hooks/index.js +12 -0
- package/hooks/index.js.map +1 -0
- package/hooks/useConfirmationDialog.d.ts +5 -3
- package/hooks/useConfirmationDialog.js +28 -34
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.d.ts +21 -2
- package/hooks/useDialog.js +18 -22
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useIsMounted.d.ts +3 -0
- package/hooks/useIsMounted.js +15 -0
- package/hooks/useIsMounted.js.map +1 -0
- package/hooks/useKeyHandler.d.ts +8 -0
- package/hooks/useKeyHandler.js +64 -0
- package/hooks/useKeyHandler.js.map +1 -0
- package/hooks/useModKey.d.ts +1 -0
- package/hooks/useModKey.js +30 -0
- package/hooks/useModKey.js.map +1 -0
- package/hooks/useShiftKey.d.ts +1 -0
- package/hooks/useShiftKey.js +33 -0
- package/hooks/useShiftKey.js.map +1 -0
- package/hooks/useSnackbar.d.ts +1 -0
- package/hooks/useSnackbar.js +25 -26
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.d.ts +2 -0
- package/hooks/useStateIfMounted.js +16 -0
- package/hooks/useStateIfMounted.js.map +1 -0
- package/hooks/useStateWithCallback.d.ts +5 -0
- package/hooks/useStateWithCallback.js +18 -0
- package/hooks/useStateWithCallback.js.map +1 -0
- package/index.d.ts +25 -13
- package/index.js +52 -324
- package/index.js.map +1 -1
- package/package.json +64 -54
- package/plugins/MenuPlugin.d.ts +1 -1
- package/plugins/MenuPlugin.js +17 -41
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.d.ts +1 -1
- package/plugins/PermissionRendererPlugin.js +17 -41
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +41 -49
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/styles.scss +7 -2
- package/types.d.ts +58 -63
- package/types.js +6 -4
- package/types.js.map +1 -1
- package/ui/UIElement.js +2 -17
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js +2 -17
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js +2 -11
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js +2 -23
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.d.ts +2 -1
- package/ui/elements/AccordionElement.js +45 -81
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.d.ts +4 -3
- package/ui/elements/ButtonElement.js +48 -82
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.d.ts +2 -1
- package/ui/elements/ButtonGroupElement.js +25 -44
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js +2 -15
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.d.ts +3 -2
- package/ui/elements/LabelElement.js +17 -40
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.d.ts +5 -4
- package/ui/elements/NavigationMenuElement.js +71 -127
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +3 -21
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +10 -32
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.d.ts +4 -2
- package/ui/elements/SmallButtonElement.js +22 -43
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.d.ts +3 -2
- package/ui/elements/TypographyElement.js +22 -47
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js +2 -15
- package/ui/elements/ViewElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +3 -2
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +19 -37
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -1
- package/ui/elements/form/DynamicFieldsetElement.d.ts +3 -2
- package/ui/elements/form/DynamicFieldsetElement.js +92 -130
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +9 -25
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +4 -3
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +42 -68
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +4 -3
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +69 -100
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +22 -19
- package/ui/elements/form/FileManagerElement/styled.js +86 -93
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -1
- package/ui/elements/form/FileManagerElement.d.ts +3 -2
- package/ui/elements/form/FileManagerElement.js +45 -87
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.d.ts +3 -2
- package/ui/elements/form/FormElement.js +19 -44
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.d.ts +6 -5
- package/ui/elements/form/FormFieldElement.js +101 -161
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.d.ts +2 -1
- package/ui/elements/form/HiddenElement.js +23 -45
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.d.ts +3 -2
- package/ui/elements/form/InputElement.js +30 -52
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.d.ts +1 -1
- package/ui/elements/form/PasswordElement.js +28 -50
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.d.ts +2 -1
- package/ui/elements/form/SelectElement.js +40 -67
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.d.ts +3 -2
- package/ui/elements/form/TextareaElement.js +32 -53
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +32 -49
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +62 -98
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +19 -40
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +19 -40
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +19 -40
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -1
- package/ui/views/AdminView/components/Dialog.d.ts +1 -1
- package/ui/views/AdminView/components/Dialog.js +32 -37
- package/ui/views/AdminView/components/Dialog.js.map +1 -1
- package/ui/views/AdminView/components/Hamburger.d.ts +1 -1
- package/ui/views/AdminView/components/Hamburger.js +14 -22
- package/ui/views/AdminView/components/Hamburger.js.map +1 -1
- package/ui/views/FormView/FormContainerElement.d.ts +4 -3
- package/ui/views/FormView/FormContainerElement.js +18 -49
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.d.ts +3 -0
- package/ui/views/FormView/FormContentElement.js +9 -21
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.d.ts +4 -3
- package/ui/views/FormView/FormFooterElement.js +12 -47
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.d.ts +3 -2
- package/ui/views/FormView/FormHeaderElement.js +28 -79
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.d.ts +3 -3
- package/ui/views/FormView.js +106 -152
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.d.ts +2 -1
- package/ui/views/OverlayView/ContentElement.js +25 -38
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.d.ts +2 -1
- package/ui/views/OverlayView/HeaderElement.js +65 -105
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +4 -2
- package/ui/views/OverlayView/HeaderTitleElement.js +23 -49
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +19 -29
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.d.ts +3 -2
- package/ui/views/OverlayView.js +80 -136
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +2 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +29 -68
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.d.ts +1 -1
- package/ui/views/SplitView.js +58 -94
- package/ui/views/SplitView.js.map +1 -1
- package/assets/images/icons.png +0 -0
- package/assets/images/icons_retina.png +0 -0
- package/assets/images/swich.png +0 -0
- package/base/ui/Menu.d.ts +0 -31
- package/base/ui/Menu.js +0 -137
- package/base/ui/Menu.js.map +0 -1
- package/base/ui/Search.d.ts +0 -19
- package/base/ui/Search.js +0 -63
- package/base/ui/Search.js.map +0 -1
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +0 -6
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +0 -41
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js.map +0 -1
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +0 -6
- package/components/FileManager/BottomInfoBar/UploadStatus.js +0 -51
- package/components/FileManager/BottomInfoBar/UploadStatus.js.map +0 -1
- package/components/FileManager/BottomInfoBar.d.ts +0 -5
- package/components/FileManager/BottomInfoBar.js +0 -48
- package/components/FileManager/BottomInfoBar.js.map +0 -1
- package/components/FileManager/DropFilesHere.d.ts +0 -10
- package/components/FileManager/DropFilesHere.js +0 -67
- package/components/FileManager/DropFilesHere.js.map +0 -1
- package/components/FileManager/File.d.ts +0 -17
- package/components/FileManager/File.js +0 -142
- package/components/FileManager/File.js.map +0 -1
- package/components/FileManager/FileDetails/Name.d.ts +0 -8
- package/components/FileManager/FileDetails/Name.js +0 -108
- package/components/FileManager/FileDetails/Name.js.map +0 -1
- package/components/FileManager/FileDetails/Tags.d.ts +0 -10
- package/components/FileManager/FileDetails/Tags.js +0 -286
- package/components/FileManager/FileDetails/Tags.js.map +0 -1
- package/components/FileManager/FileDetails.d.ts +0 -24
- package/components/FileManager/FileDetails.js +0 -407
- package/components/FileManager/FileDetails.js.map +0 -1
- package/components/FileManager/FileManagerContext.d.ts +0 -42
- package/components/FileManager/FileManagerContext.js +0 -191
- package/components/FileManager/FileManagerContext.js.map +0 -1
- package/components/FileManager/FileManagerView.d.ts +0 -18
- package/components/FileManager/FileManagerView.js +0 -611
- package/components/FileManager/FileManagerView.js.map +0 -1
- package/components/FileManager/LeftSidebar.d.ts +0 -10
- package/components/FileManager/LeftSidebar.js +0 -108
- package/components/FileManager/LeftSidebar.js.map +0 -1
- package/components/FileManager/NoPermissionView.d.ts +0 -3
- package/components/FileManager/NoPermissionView.js +0 -74
- package/components/FileManager/NoPermissionView.js.map +0 -1
- package/components/FileManager/NoResults.d.ts +0 -3
- package/components/FileManager/NoResults.js +0 -22
- package/components/FileManager/NoResults.js.map +0 -1
- package/components/FileManager/getFileTypePlugin.d.ts +0 -4
- package/components/FileManager/getFileTypePlugin.js +0 -51
- package/components/FileManager/getFileTypePlugin.js.map +0 -1
- package/components/FileManager/getFileUploader.d.ts +0 -3
- package/components/FileManager/getFileUploader.js +0 -15
- package/components/FileManager/getFileUploader.js.map +0 -1
- package/components/FileManager/graphql.d.ts +0 -96
- package/components/FileManager/graphql.js +0 -47
- package/components/FileManager/graphql.js.map +0 -1
- package/components/FileManager/icons/content_copy-black-24px.svg +0 -1
- package/components/FileManager/icons/delete.svg +0 -12
- package/components/FileManager/icons/privacy_tip-24px.svg +0 -10
- package/components/FileManager/icons/round-check_box-24px.svg +0 -4
- package/components/FileManager/icons/round-check_box_outline_blank-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_download-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_upload-24px.svg +0 -4
- package/components/FileManager/icons/round-description-24px.svg +0 -4
- package/components/FileManager/icons/round-edit-24px.svg +0 -4
- package/components/FileManager/icons/round-info-24px.svg +0 -4
- package/components/FileManager/icons/round-label-24px.svg +0 -4
- package/components/FileManager/icons/round-more_vert-24px.svg +0 -4
- package/components/FileManager/icons/round-search-24px.svg +0 -20
- package/components/FileManager/outputFileSelectionError.d.ts +0 -7
- package/components/FileManager/outputFileSelectionError.js +0 -40
- package/components/FileManager/outputFileSelectionError.js.map +0 -1
- package/components/FileManager/types.d.ts +0 -21
- package/components/FileManager/types.js +0 -5
- package/components/FileManager/types.js.map +0 -1
- package/components/FileManager.d.ts +0 -67
- package/components/FileManager.js +0 -118
- package/components/FileManager.js.map +0 -1
- package/components/OverlayLayout/icons/close.svg +0 -13
- package/components/OverlayLayout/icons/navigate_before.svg +0 -16
- package/plugins/FileManagerFileTypePlugin.d.ts +0 -33
- package/plugins/FileManagerFileTypePlugin.js +0 -48
- package/plugins/FileManagerFileTypePlugin.js.map +0 -1
- package/plugins/fileManager/fileDefault.d.ts +0 -2
- package/plugins/fileManager/fileDefault.js +0 -28
- package/plugins/fileManager/fileDefault.js.map +0 -1
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +0 -7
- package/plugins/fileManager/fileImage/DeleteAction.js +0 -59
- package/plugins/fileManager/fileImage/DeleteAction.js.map +0 -1
- package/plugins/fileManager/fileImage/EditAction.d.ts +0 -10
- package/plugins/fileManager/fileImage/EditAction.js +0 -143
- package/plugins/fileManager/fileImage/EditAction.js.map +0 -1
- package/plugins/fileManager/fileImage/index.d.ts +0 -2
- package/plugins/fileManager/fileImage/index.js +0 -38
- package/plugins/fileManager/fileImage/index.js.map +0 -1
- package/plugins/fileManager/icons/edit.svg +0 -17
- package/plugins/fileManager/icons/round-description-24px.svg +0 -1
- package/plugins/fileManager/index.d.ts +0 -2
- package/plugins/fileManager/index.js +0 -19
- package/plugins/fileManager/index.js.map +0 -1
- package/plugins/globalSearch/SearchBar.d.ts +0 -15
- package/plugins/globalSearch/SearchBar.js +0 -225
- package/plugins/globalSearch/SearchBar.js.map +0 -1
- package/plugins/globalSearch/SearchBarDropdown.d.ts +0 -23
- package/plugins/globalSearch/SearchBarDropdown.js +0 -83
- package/plugins/globalSearch/SearchBarDropdown.js.map +0 -1
- package/plugins/globalSearch/icons/round-search-24px.svg +0 -20
- package/plugins/globalSearch/index.d.ts +0 -7
- package/plugins/globalSearch/index.js +0 -16
- package/plugins/globalSearch/index.js.map +0 -1
- package/plugins/globalSearch/styled.d.ts +0 -11
- package/plugins/globalSearch/styled.js +0 -131
- package/plugins/globalSearch/styled.js.map +0 -1
- package/styles/material-theme-assignments.scss +0 -350
- package/styles/material.scss +0 -43
- package/styles/theme.scss +0 -76
- package/ui/views/AdminView/components/Snackbar.d.ts +0 -3
- package/ui/views/AdminView/components/Snackbar.js +0 -32
- package/ui/views/AdminView/components/Snackbar.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AppContainer","Plugin","Menu","Tenant","Route","Theme","createAdminConfig","base","AdminWithConfig","Object","assign","WithConfig","displayName","AdminConfigProvider","createDecorator","Original","children","createElement","Fragment","ApplyPublicConfig","ApplyProtectedConfig","useAdminConfig","baseConfig","useConfig","menus","userMenus","supportMenus","tenant","Public","PublicConfig","Private","PrivateConfig","AdminConfig"],"sources":["AdminConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { AppContainer, Plugin } from \"@webiny/app\";\nimport { Menu, type MenuConfig } from \"./AdminConfig/Menu\";\nimport type { TenantConfig } from \"./AdminConfig/Tenant\";\nimport { Tenant } from \"./AdminConfig/Tenant\";\nimport type { SupportMenuConfig } from \"./AdminConfig/Menu/SupportMenu\";\nimport type { UserMenuConfig } from \"./AdminConfig/Menu/UserMenu\";\nimport { Route } from \"./AdminConfig/Route\";\nimport { Theme } from \"./AdminConfig/Theme\";\nimport { createAdminConfig } from \"./createAdminConfig\";\n\nconst base = createAdminConfig<AdminConfig>();\n\nexport const AdminWithConfig = Object.assign(base.WithConfig, {\n displayName: \"AdminWithConfig\"\n});\n\ninterface AdminConfig {\n menus: MenuConfig[];\n supportMenus: SupportMenuConfig[];\n userMenus: UserMenuConfig[];\n tenant: TenantConfig;\n}\n\nexport const AdminConfigProvider = AppContainer.createDecorator(Original => {\n return function AdminConfigProvider({ children }) {\n return (\n <>\n {/* Wrap the entire app with an AdminConfig provider, and apply all public configs. */}\n <Original>\n <AdminWithConfig>\n <base.ApplyPublicConfig />\n {children}\n </AdminWithConfig>\n </Original>\n {/* Once the app fully renders (after the LoginScreen), apply protected configs. */}\n <Plugin>\n <base.ApplyProtectedConfig />\n </Plugin>\n </>\n );\n };\n});\n\nexport const useAdminConfig = () => {\n const baseConfig = base.useConfig();\n\n return {\n menus: baseConfig.menus ?? [],\n userMenus: baseConfig.userMenus ?? [],\n supportMenus: baseConfig.supportMenus ?? [],\n tenant: baseConfig.tenant || {}\n };\n};\n\nexport interface PublicProps {\n children: React.ReactNode;\n}\n\nexport const Public = ({ children }: PublicProps) => {\n return <base.PublicConfig>{children}</base.PublicConfig>;\n};\n\nexport interface PrivateProps {\n children: React.ReactNode;\n}\n\nexport const Private = ({ children }: PrivateProps) => {\n return <base.PrivateConfig>{children}</base.PrivateConfig>;\n};\n\nexport const AdminConfig = Object.assign(Private, {\n Public,\n Theme,\n Menu,\n Route,\n Tenant,\n useAdminConfig\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,EAAEC,MAAM,QAAQ,aAAa;AAClD,SAASC,IAAI;AAEb,SAASC,MAAM;AAGf,SAASC,KAAK;AACd,SAASC,KAAK;AACd,SAASC,iBAAiB;AAE1B,MAAMC,IAAI,GAAGD,iBAAiB,CAAc,CAAC;AAE7C,OAAO,MAAME,eAAe,GAAGC,MAAM,CAACC,MAAM,CAACH,IAAI,CAACI,UAAU,EAAE;EAC1DC,WAAW,EAAE;AACjB,CAAC,CAAC;AASF,OAAO,MAAMC,mBAAmB,GAAGb,YAAY,CAACc,eAAe,CAACC,QAAQ,IAAI;EACxE,OAAO,SAASF,mBAAmBA,CAAC;IAAEG;EAAS,CAAC,EAAE;IAC9C,oBACIjB,KAAA,CAAAkB,aAAA,CAAAlB,KAAA,CAAAmB,QAAA,qBAEInB,KAAA,CAAAkB,aAAA,CAACF,QAAQ,qBACLhB,KAAA,CAAAkB,aAAA,CAACT,eAAe,qBACZT,KAAA,CAAAkB,aAAA,CAACV,IAAI,CAACY,iBAAiB,MAAE,CAAC,EACzBH,QACY,CACX,CAAC,eAEXjB,KAAA,CAAAkB,aAAA,CAAChB,MAAM,qBACHF,KAAA,CAAAkB,aAAA,CAACV,IAAI,CAACa,oBAAoB,MAAE,CACxB,CACV,CAAC;EAEX,CAAC;AACL,CAAC,CAAC;AAEF,OAAO,MAAMC,cAAc,GAAGA,CAAA,KAAM;EAChC,MAAMC,UAAU,GAAGf,IAAI,CAACgB,SAAS,CAAC,CAAC;EAEnC,OAAO;IACHC,KAAK,EAAEF,UAAU,CAACE,KAAK,IAAI,EAAE;IAC7BC,SAAS,EAAEH,UAAU,CAACG,SAAS,IAAI,EAAE;IACrCC,YAAY,EAAEJ,UAAU,CAACI,YAAY,IAAI,EAAE;IAC3CC,MAAM,EAAEL,UAAU,CAACK,MAAM,IAAI,CAAC;EAClC,CAAC;AACL,CAAC;AAMD,OAAO,MAAMC,MAAM,GAAGA,CAAC;EAAEZ;AAAsB,CAAC,KAAK;EACjD,oBAAOjB,KAAA,CAAAkB,aAAA,CAACV,IAAI,CAACsB,YAAY,QAAEb,QAA4B,CAAC;AAC5D,CAAC;AAMD,OAAO,MAAMc,OAAO,GAAGA,CAAC;EAAEd;AAAuB,CAAC,KAAK;EACnD,oBAAOjB,KAAA,CAAAkB,aAAA,CAACV,IAAI,CAACwB,aAAa,QAAEf,QAA6B,CAAC;AAC9D,CAAC;AAED,OAAO,MAAMgB,WAAW,GAAGvB,MAAM,CAACC,MAAM,CAACoB,OAAO,EAAE;EAC9CF,MAAM;EACNvB,KAAK;EACLH,IAAI;EACJE,KAAK;EACLD,MAAM;EACNkB;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { Property } from "@webiny/react-properties";
|
|
3
|
+
export interface WithConfigProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
onProperties?(properties: Property[]): void;
|
|
6
|
+
}
|
|
7
|
+
interface ConfigApplyProps {
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface ConfigProps {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare function createAdminConfig<TConfig>(): {
|
|
14
|
+
WithConfig: ({ onProperties, children }: WithConfigProps) => React.JSX.Element;
|
|
15
|
+
PrivateConfig: ({ children }: ConfigProps) => React.JSX.Element;
|
|
16
|
+
PublicConfig: ({ children }: ConfigProps) => React.JSX.Element;
|
|
17
|
+
ApplyPublicConfig: (({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
18
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
19
|
+
originalName: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
} & {
|
|
22
|
+
original: (({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
23
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
24
|
+
originalName: string;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
originalName: string;
|
|
28
|
+
displayName: string;
|
|
29
|
+
} & {
|
|
30
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
31
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
32
|
+
originalName: string;
|
|
33
|
+
displayName: string;
|
|
34
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
35
|
+
};
|
|
36
|
+
ApplyProtectedConfig: (({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
37
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
38
|
+
originalName: string;
|
|
39
|
+
displayName: string;
|
|
40
|
+
} & {
|
|
41
|
+
original: (({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
42
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
43
|
+
originalName: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
46
|
+
originalName: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
} & {
|
|
49
|
+
createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<(({ children }: ConfigApplyProps) => React.JSX.Element) & {
|
|
50
|
+
original: ({ children }: ConfigApplyProps) => React.JSX.Element;
|
|
51
|
+
originalName: string;
|
|
52
|
+
displayName: string;
|
|
53
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
54
|
+
};
|
|
55
|
+
useConfig: <TExtra extends object>() => TConfig & TExtra;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React, { useContext, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { Compose, makeDecoratable } from "@webiny/react-composition";
|
|
3
|
+
import { Properties, toObject, useDebugConfig } from "@webiny/react-properties";
|
|
4
|
+
const createHOC = newChildren => {
|
|
5
|
+
return BaseComponent => {
|
|
6
|
+
return function ConfigHOC({
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
return /*#__PURE__*/React.createElement(BaseComponent, null, newChildren, children);
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const name = "AdminConfig";
|
|
14
|
+
export function createAdminConfig() {
|
|
15
|
+
/**
|
|
16
|
+
* This component is used when we want to mount all composed configs.
|
|
17
|
+
*/
|
|
18
|
+
const ApplyPublicConfig = makeDecoratable(`${name}Apply<Public>`, ({
|
|
19
|
+
children
|
|
20
|
+
}) => {
|
|
21
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
22
|
+
});
|
|
23
|
+
const ApplyProtectedConfig = makeDecoratable(`${name}Apply<Protected>`, ({
|
|
24
|
+
children
|
|
25
|
+
}) => {
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* This component is used to configure the component (it can be mounted many times).
|
|
31
|
+
*/
|
|
32
|
+
const PublicConfig = ({
|
|
33
|
+
children
|
|
34
|
+
}) => {
|
|
35
|
+
return /*#__PURE__*/React.createElement(Compose, {
|
|
36
|
+
component: ApplyPublicConfig,
|
|
37
|
+
with: createHOC(children)
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
const ProtectedConfig = ({
|
|
41
|
+
children
|
|
42
|
+
}) => {
|
|
43
|
+
return /*#__PURE__*/React.createElement(Compose, {
|
|
44
|
+
component: ApplyProtectedConfig,
|
|
45
|
+
with: createHOC(children)
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const defaultContext = {
|
|
49
|
+
name,
|
|
50
|
+
properties: []
|
|
51
|
+
};
|
|
52
|
+
const ViewContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
53
|
+
const WithConfig = ({
|
|
54
|
+
onProperties,
|
|
55
|
+
children
|
|
56
|
+
}) => {
|
|
57
|
+
const [properties, setProperties] = useState([]);
|
|
58
|
+
useDebugConfig(name, properties);
|
|
59
|
+
const context = {
|
|
60
|
+
name,
|
|
61
|
+
properties
|
|
62
|
+
};
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
if (typeof onProperties === "function") {
|
|
65
|
+
onProperties(properties);
|
|
66
|
+
}
|
|
67
|
+
}, [properties]);
|
|
68
|
+
const stateUpdater = properties => {
|
|
69
|
+
setProperties(properties);
|
|
70
|
+
};
|
|
71
|
+
return /*#__PURE__*/React.createElement(ViewContext.Provider, {
|
|
72
|
+
value: context
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Properties, {
|
|
74
|
+
onChange: stateUpdater,
|
|
75
|
+
name: name
|
|
76
|
+
}, children));
|
|
77
|
+
};
|
|
78
|
+
function useConfig() {
|
|
79
|
+
const {
|
|
80
|
+
properties
|
|
81
|
+
} = useContext(ViewContext);
|
|
82
|
+
return useMemo(() => toObject(properties), [properties]);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
WithConfig,
|
|
86
|
+
PrivateConfig: ProtectedConfig,
|
|
87
|
+
PublicConfig,
|
|
88
|
+
ApplyPublicConfig,
|
|
89
|
+
ApplyProtectedConfig,
|
|
90
|
+
useConfig
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=createAdminConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","useEffect","useMemo","useState","Compose","makeDecoratable","Properties","toObject","useDebugConfig","createHOC","newChildren","BaseComponent","ConfigHOC","children","createElement","name","createAdminConfig","ApplyPublicConfig","Fragment","ApplyProtectedConfig","PublicConfig","component","with","ProtectedConfig","defaultContext","properties","ViewContext","createContext","WithConfig","onProperties","setProperties","context","stateUpdater","Provider","value","onChange","useConfig","PrivateConfig"],"sources":["createAdminConfig.tsx"],"sourcesContent":["import React, { useContext, useEffect, useMemo, useState } from \"react\";\nimport type { Decorator } from \"@webiny/react-composition\";\nimport { Compose, makeDecoratable } from \"@webiny/react-composition\";\nimport type { GenericComponent } from \"@webiny/react-composition/types\";\nimport type { Property } from \"@webiny/react-properties\";\nimport { Properties, toObject, useDebugConfig } from \"@webiny/react-properties\";\n\nconst createHOC = (\n newChildren: React.ReactNode\n): Decorator<GenericComponent<{ children?: React.ReactNode }>> => {\n return BaseComponent => {\n return function ConfigHOC({ children }) {\n return (\n <BaseComponent>\n {newChildren}\n {children}\n </BaseComponent>\n );\n };\n };\n};\n\nexport interface WithConfigProps {\n children: React.ReactNode;\n onProperties?(properties: Property[]): void;\n}\n\ninterface ConfigApplyProps {\n children?: React.ReactNode;\n}\n\nexport interface ConfigProps {\n children: React.ReactNode;\n}\n\nconst name = \"AdminConfig\";\n\nexport function createAdminConfig<TConfig>() {\n /**\n * This component is used when we want to mount all composed configs.\n */\n const ApplyPublicConfig = makeDecoratable(\n `${name}Apply<Public>`,\n ({ children }: ConfigApplyProps) => {\n return <>{children}</>;\n }\n );\n\n const ApplyProtectedConfig = makeDecoratable(\n `${name}Apply<Protected>`,\n ({ children }: ConfigApplyProps) => {\n return <>{children}</>;\n }\n );\n\n /**\n * This component is used to configure the component (it can be mounted many times).\n */\n const PublicConfig = ({ children }: ConfigProps) => {\n return <Compose component={ApplyPublicConfig} with={createHOC(children)} />;\n };\n\n const ProtectedConfig = ({ children }: ConfigProps) => {\n return <Compose component={ApplyProtectedConfig} with={createHOC(children)} />;\n };\n\n interface ViewContext {\n name: string;\n properties: Property[];\n }\n\n const defaultContext = { name, properties: [] };\n\n const ViewContext = React.createContext<ViewContext>(defaultContext);\n\n const WithConfig = ({ onProperties, children }: WithConfigProps) => {\n const [properties, setProperties] = useState<Property[]>([]);\n useDebugConfig(name, properties);\n const context = { name, properties };\n\n useEffect(() => {\n if (typeof onProperties === \"function\") {\n onProperties(properties);\n }\n }, [properties]);\n\n const stateUpdater = (properties: Property[]) => {\n setProperties(properties);\n };\n\n return (\n <ViewContext.Provider value={context}>\n <Properties onChange={stateUpdater} name={name}>\n {children}\n </Properties>\n </ViewContext.Provider>\n );\n };\n\n function useConfig<TExtra extends object>(): TConfig & TExtra {\n const { properties } = useContext(ViewContext);\n return useMemo(() => toObject<TConfig & TExtra>(properties), [properties]);\n }\n\n return {\n WithConfig,\n PrivateConfig: ProtectedConfig,\n PublicConfig,\n ApplyPublicConfig,\n ApplyProtectedConfig,\n useConfig\n };\n}\n"],"mappings":"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","ignoreList":[]}
|
package/hooks/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./useConfirmationDialog";
|
|
2
|
+
export * from "./useDialog";
|
|
3
|
+
export * from "../components/Dialogs/useDialogs";
|
|
4
|
+
export * from "./useSnackbar";
|
|
5
|
+
export * from "./useKeyHandler";
|
|
6
|
+
export * from "./useShiftKey";
|
|
7
|
+
export * from "./useStateWithCallback";
|
|
8
|
+
export * from "./useModKey";
|
|
9
|
+
export * from "./useIsMounted";
|
|
10
|
+
export * from "./useStateIfMounted";
|
package/hooks/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./useConfirmationDialog";
|
|
2
|
+
export * from "./useDialog";
|
|
3
|
+
export * from "../components/Dialogs/useDialogs";
|
|
4
|
+
export * from "./useSnackbar";
|
|
5
|
+
export * from "./useKeyHandler";
|
|
6
|
+
export * from "./useShiftKey";
|
|
7
|
+
export * from "./useStateWithCallback";
|
|
8
|
+
export * from "./useModKey";
|
|
9
|
+
export * from "./useIsMounted";
|
|
10
|
+
export * from "./useStateIfMounted";
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useConfirmationDialog\";\nexport * from \"./useDialog\";\nexport * from \"../components/Dialogs/useDialogs\";\nexport * from \"./useSnackbar\";\nexport * from \"./useKeyHandler\";\nexport * from \"./useShiftKey\";\nexport * from \"./useStateWithCallback\";\nexport * from \"./useModKey\";\nexport * from \"./useIsMounted\";\nexport * from \"./useStateIfMounted\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -4,10 +4,12 @@ interface Params {
|
|
|
4
4
|
message?: React.ReactNode;
|
|
5
5
|
acceptLabel?: React.ReactNode;
|
|
6
6
|
cancelLabel?: React.ReactNode;
|
|
7
|
+
loading?: React.ReactNode;
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
}
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
export type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);
|
|
11
|
+
export interface UseConfirmationDialogResponse {
|
|
12
|
+
showConfirmation: (onAccept: ShowConfirmationOnAccept, onCancel?: () => void) => void;
|
|
11
13
|
}
|
|
12
|
-
declare const useConfirmationDialog: ({ title, message, acceptLabel, cancelLabel, ...options }?: Params) => UseConfirmationDialogResponse;
|
|
14
|
+
declare const useConfirmationDialog: ({ title, message, acceptLabel, cancelLabel, loading, ...options }?: Params) => UseConfirmationDialogResponse;
|
|
13
15
|
export { useConfirmationDialog };
|
|
@@ -1,36 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var t = _i18n.i18n.ns("app-admin/hooks/use-confirmation-dialog");
|
|
16
|
-
var useConfirmationDialog = function useConfirmationDialog() {
|
|
17
|
-
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
-
var title = _ref.title,
|
|
19
|
-
message = _ref.message,
|
|
20
|
-
_ref$acceptLabel = _ref.acceptLabel,
|
|
21
|
-
acceptLabel = _ref$acceptLabel === void 0 ? t(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["Confirm"]))) : _ref$acceptLabel,
|
|
22
|
-
_ref$cancelLabel = _ref.cancelLabel,
|
|
23
|
-
cancelLabel = _ref$cancelLabel === void 0 ? t(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["Cancel"]))) : _ref$cancelLabel,
|
|
24
|
-
options = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
25
|
-
var ui = (0, _useUi.useUi)();
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { useUi } from "@webiny/app/hooks/useUi";
|
|
3
|
+
import { i18n } from "@webiny/app/i18n";
|
|
4
|
+
import { CircularProgress } from "@webiny/ui/Progress";
|
|
5
|
+
const t = i18n.ns("app-admin/hooks/use-confirmation-dialog");
|
|
6
|
+
const useConfirmationDialog = ({
|
|
7
|
+
title = t`Confirmation`,
|
|
8
|
+
message,
|
|
9
|
+
acceptLabel = t`Confirm`,
|
|
10
|
+
cancelLabel = t`Cancel`,
|
|
11
|
+
loading = /*#__PURE__*/React.createElement(CircularProgress, null),
|
|
12
|
+
...options
|
|
13
|
+
} = {}) => {
|
|
14
|
+
const ui = useUi();
|
|
26
15
|
return {
|
|
27
|
-
showConfirmation:
|
|
28
|
-
ui.setState(
|
|
29
|
-
return
|
|
16
|
+
showConfirmation: (onAccept, onCancel) => {
|
|
17
|
+
ui.setState(ui => {
|
|
18
|
+
return {
|
|
19
|
+
...ui,
|
|
30
20
|
dialog: {
|
|
31
|
-
message: message || t
|
|
32
|
-
options:
|
|
33
|
-
|
|
21
|
+
message: message || t`Are you sure you want to continue?`,
|
|
22
|
+
options: {
|
|
23
|
+
...options,
|
|
24
|
+
title,
|
|
25
|
+
loading,
|
|
34
26
|
actions: {
|
|
35
27
|
accept: {
|
|
36
28
|
label: acceptLabel,
|
|
@@ -41,11 +33,13 @@ var useConfirmationDialog = function useConfirmationDialog() {
|
|
|
41
33
|
onClick: onCancel
|
|
42
34
|
}
|
|
43
35
|
}
|
|
44
|
-
}
|
|
36
|
+
}
|
|
45
37
|
}
|
|
46
|
-
}
|
|
38
|
+
};
|
|
47
39
|
});
|
|
48
40
|
}
|
|
49
41
|
};
|
|
50
42
|
};
|
|
51
|
-
|
|
43
|
+
export { useConfirmationDialog };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=useConfirmationDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["React","useUi","i18n","CircularProgress","t","ns","useConfirmationDialog","title","message","acceptLabel","cancelLabel","loading","createElement","options","ui","showConfirmation","onAccept","onCancel","setState","dialog","actions","accept","label","onClick","cancel"],"sources":["useConfirmationDialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\n\nconst t = i18n.ns(\"app-admin/hooks/use-confirmation-dialog\");\n\ninterface Params {\n title?: React.ReactNode;\n message?: React.ReactNode;\n acceptLabel?: React.ReactNode;\n cancelLabel?: React.ReactNode;\n loading?: React.ReactNode;\n [key: string]: any;\n}\n\nexport type ShowConfirmationOnAccept = (() => void) | (() => Promise<void>);\n\nexport interface UseConfirmationDialogResponse {\n showConfirmation: (onAccept: ShowConfirmationOnAccept, onCancel?: () => void) => void;\n}\n\nconst useConfirmationDialog = ({\n title = t`Confirmation`,\n message,\n acceptLabel = t`Confirm`,\n cancelLabel = t`Cancel`,\n loading = <CircularProgress />,\n ...options\n}: Params = {}): UseConfirmationDialogResponse => {\n const ui = useUi();\n\n return {\n showConfirmation: (onAccept, onCancel) => {\n ui.setState(ui => {\n return {\n ...ui,\n dialog: {\n message: message || t`Are you sure you want to continue?`,\n options: {\n ...options,\n title,\n loading,\n actions: {\n accept: {\n label: acceptLabel,\n onClick: onAccept\n },\n cancel: {\n label: cancelLabel,\n onClick: onCancel\n }\n }\n }\n }\n };\n });\n }\n };\n};\n\nexport { useConfirmationDialog };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,yBAAyB;AAC/C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,gBAAgB,QAAQ,qBAAqB;AAEtD,MAAMC,CAAC,GAAGF,IAAI,CAACG,EAAE,CAAC,yCAAyC,CAAC;AAiB5D,MAAMC,qBAAqB,GAAGA,CAAC;EAC3BC,KAAK,GAAGH,CAAC,cAAc;EACvBI,OAAO;EACPC,WAAW,GAAGL,CAAC,SAAS;EACxBM,WAAW,GAAGN,CAAC,QAAQ;EACvBO,OAAO,gBAAGX,KAAA,CAAAY,aAAA,CAACT,gBAAgB,MAAE,CAAC;EAC9B,GAAGU;AACC,CAAC,GAAG,CAAC,CAAC,KAAoC;EAC9C,MAAMC,EAAE,GAAGb,KAAK,CAAC,CAAC;EAElB,OAAO;IACHc,gBAAgB,EAAEA,CAACC,QAAQ,EAAEC,QAAQ,KAAK;MACtCH,EAAE,CAACI,QAAQ,CAACJ,EAAE,IAAI;QACd,OAAO;UACH,GAAGA,EAAE;UACLK,MAAM,EAAE;YACJX,OAAO,EAAEA,OAAO,IAAIJ,CAAC,oCAAoC;YACzDS,OAAO,EAAE;cACL,GAAGA,OAAO;cACVN,KAAK;cACLI,OAAO;cACPS,OAAO,EAAE;gBACLC,MAAM,EAAE;kBACJC,KAAK,EAAEb,WAAW;kBAClBc,OAAO,EAAEP;gBACb,CAAC;gBACDQ,MAAM,EAAE;kBACJF,KAAK,EAAEZ,WAAW;kBAClBa,OAAO,EAAEN;gBACb;cACJ;YACJ;UACJ;QACJ,CAAC;MACL,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAED,SAASX,qBAAqB","ignoreList":[]}
|
package/hooks/useDialog.d.ts
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
interface
|
|
1
|
+
import type React from "react";
|
|
2
|
+
interface AcceptAction {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
}
|
|
6
|
+
interface CancelAction {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface UseDialogResponseShowDialogOptions {
|
|
11
|
+
dataTestId?: string;
|
|
12
|
+
title: string;
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
actions?: {
|
|
15
|
+
accept?: AcceptAction;
|
|
16
|
+
cancel?: CancelAction;
|
|
17
|
+
};
|
|
18
|
+
style?: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
onClose?: () => void;
|
|
3
22
|
[key: string]: any;
|
|
4
23
|
}
|
|
5
24
|
interface UseDialogResponse {
|
package/hooks/useDialog.js
CHANGED
|
@@ -1,32 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.useDialog = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _useUi = require("@webiny/app/hooks/useUi");
|
|
10
|
-
var useDialog = function useDialog() {
|
|
11
|
-
var ui = (0, _useUi.useUi)();
|
|
1
|
+
import { useUi } from "@webiny/app/hooks/useUi";
|
|
2
|
+
const useDialog = () => {
|
|
3
|
+
const ui = useUi();
|
|
12
4
|
return {
|
|
13
|
-
showDialog:
|
|
14
|
-
ui.setState(
|
|
15
|
-
return
|
|
5
|
+
showDialog: (message, options) => {
|
|
6
|
+
ui.setState(ui => {
|
|
7
|
+
return {
|
|
8
|
+
...ui,
|
|
16
9
|
dialog: {
|
|
17
|
-
message
|
|
18
|
-
options
|
|
10
|
+
message,
|
|
11
|
+
options
|
|
19
12
|
}
|
|
20
|
-
}
|
|
13
|
+
};
|
|
21
14
|
});
|
|
22
15
|
},
|
|
23
|
-
hideDialog:
|
|
24
|
-
ui.setState(
|
|
25
|
-
return
|
|
16
|
+
hideDialog: () => {
|
|
17
|
+
ui.setState(ui => {
|
|
18
|
+
return {
|
|
19
|
+
...ui,
|
|
26
20
|
dialog: null
|
|
27
|
-
}
|
|
21
|
+
};
|
|
28
22
|
});
|
|
29
23
|
}
|
|
30
24
|
};
|
|
31
25
|
};
|
|
32
|
-
|
|
26
|
+
export { useDialog };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=useDialog.js.map
|
package/hooks/useDialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["useUi","useDialog","ui","showDialog","message","options","setState","dialog","hideDialog"],"sources":["useDialog.ts"],"sourcesContent":["import type React from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi\";\n\ninterface AcceptAction {\n label: string;\n onClick?: () => void;\n}\ninterface CancelAction {\n label: string;\n onClick?: () => void;\n}\n\nexport interface UseDialogResponseShowDialogOptions {\n dataTestId?: string;\n title: string;\n loading?: boolean;\n actions?: {\n accept?: AcceptAction;\n cancel?: CancelAction;\n };\n style?: {\n [key: string]: any;\n };\n onClose?: () => void;\n [key: string]: any;\n}\ninterface UseDialogResponse {\n showDialog: (message: React.ReactNode, options?: UseDialogResponseShowDialogOptions) => void;\n hideDialog: () => void;\n}\nconst useDialog = (): UseDialogResponse => {\n const ui = useUi();\n return {\n showDialog: (message, options) => {\n ui.setState(ui => {\n return { ...ui, dialog: { message, options } };\n });\n },\n hideDialog: () => {\n ui.setState(ui => {\n return { ...ui, dialog: null };\n });\n }\n };\n};\n\nexport { useDialog };\n"],"mappings":"AACA,SAASA,KAAK,QAAQ,yBAAyB;AA6B/C,MAAMC,SAAS,GAAGA,CAAA,KAAyB;EACvC,MAAMC,EAAE,GAAGF,KAAK,CAAC,CAAC;EAClB,OAAO;IACHG,UAAU,EAAEA,CAACC,OAAO,EAAEC,OAAO,KAAK;MAC9BH,EAAE,CAACI,QAAQ,CAACJ,EAAE,IAAI;QACd,OAAO;UAAE,GAAGA,EAAE;UAAEK,MAAM,EAAE;YAAEH,OAAO;YAAEC;UAAQ;QAAE,CAAC;MAClD,CAAC,CAAC;IACN,CAAC;IACDG,UAAU,EAAEA,CAAA,KAAM;MACdN,EAAE,CAACI,QAAQ,CAACJ,EAAE,IAAI;QACd,OAAO;UAAE,GAAGA,EAAE;UAAEK,MAAM,EAAE;QAAK,CAAC;MAClC,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAED,SAASN,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
export const useIsMounted = () => {
|
|
3
|
+
const isMountedRef = useRef(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
isMountedRef.current = true;
|
|
6
|
+
return () => {
|
|
7
|
+
isMountedRef.current = false;
|
|
8
|
+
};
|
|
9
|
+
}, []);
|
|
10
|
+
return {
|
|
11
|
+
isMounted: () => isMountedRef.current
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=useIsMounted.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useRef","useEffect","useIsMounted","isMountedRef","current","isMounted"],"sources":["useIsMounted.ts"],"sourcesContent":["import { useRef, useEffect } from \"react\";\n\nexport const useIsMounted = () => {\n const isMountedRef = useRef(false);\n\n useEffect(() => {\n isMountedRef.current = true;\n\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n return {\n isMounted: () => isMountedRef.current\n };\n};\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAEzC,OAAO,MAAMC,YAAY,GAAGA,CAAA,KAAM;EAC9B,MAAMC,YAAY,GAAGH,MAAM,CAAC,KAAK,CAAC;EAElCC,SAAS,CAAC,MAAM;IACZE,YAAY,CAACC,OAAO,GAAG,IAAI;IAE3B,OAAO,MAAM;MACTD,YAAY,CAACC,OAAO,GAAG,KAAK;IAChC,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACHC,SAAS,EAAEA,CAAA,KAAMF,YAAY,CAACC;EAClC,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SyntheticEvent } from "react";
|
|
2
|
+
type AddKeyHandlerType = (key: string, handler: (e: SyntheticEvent<HTMLElement>) => void) => void;
|
|
3
|
+
type RemoveKeyHandlerType = (key: string) => void;
|
|
4
|
+
export declare function useKeyHandler(): {
|
|
5
|
+
addKeyHandler: AddKeyHandlerType;
|
|
6
|
+
removeKeyHandler: RemoveKeyHandlerType;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import isHotkey from "is-hotkey";
|
|
3
|
+
import { generateId } from "@webiny/utils";
|
|
4
|
+
const keyStack = {};
|
|
5
|
+
let listener = false;
|
|
6
|
+
const filter = ["TEXTAREA", "INPUT"];
|
|
7
|
+
const isContentEditable = value => {
|
|
8
|
+
return ["true", true].includes(value);
|
|
9
|
+
};
|
|
10
|
+
const setupListener = () => {
|
|
11
|
+
if (listener || !document.body) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const eventListener = ev => {
|
|
15
|
+
if (!ev.target) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const target = ev.target;
|
|
19
|
+
// We ignore all keyboard events coming from within contentEditable element and inputs.
|
|
20
|
+
if (filter.includes(target.nodeName) || isContentEditable(target.contentEditable)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const matchedKey = Object.keys(keyStack).find(key => isHotkey(key, ev));
|
|
24
|
+
if (matchedKey && keyStack[matchedKey].length > 0) {
|
|
25
|
+
const item = keyStack[matchedKey][0];
|
|
26
|
+
item.handler(ev);
|
|
27
|
+
ev.stopPropagation();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
document.body.addEventListener("keydown", eventListener);
|
|
31
|
+
listener = true;
|
|
32
|
+
};
|
|
33
|
+
const addKeyHandler = (id, key, handler) => {
|
|
34
|
+
setupListener();
|
|
35
|
+
keyStack[key] = keyStack[key] || [];
|
|
36
|
+
if (!keyStack[key].find(item => item.id === id)) {
|
|
37
|
+
keyStack[key].unshift({
|
|
38
|
+
id,
|
|
39
|
+
handler
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const removeKeyHandler = (id, key) => {
|
|
44
|
+
if (!keyStack[key]) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const index = keyStack[key].findIndex(item => item.id === id);
|
|
48
|
+
if (index >= 0) {
|
|
49
|
+
keyStack[key].splice(index, 1);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
export function useKeyHandler() {
|
|
53
|
+
const [id] = React.useState(generateId());
|
|
54
|
+
return React.useMemo(() => ({
|
|
55
|
+
addKeyHandler(key, handler) {
|
|
56
|
+
addKeyHandler(id, key, handler);
|
|
57
|
+
},
|
|
58
|
+
removeKeyHandler(key) {
|
|
59
|
+
removeKeyHandler(id, key);
|
|
60
|
+
}
|
|
61
|
+
}), []);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=useKeyHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","isHotkey","generateId","keyStack","listener","filter","isContentEditable","value","includes","setupListener","document","body","eventListener","ev","target","nodeName","contentEditable","matchedKey","Object","keys","find","key","length","item","handler","stopPropagation","addEventListener","addKeyHandler","id","unshift","removeKeyHandler","index","findIndex","splice","useKeyHandler","useState","useMemo"],"sources":["useKeyHandler.ts"],"sourcesContent":["import type { SyntheticEvent } from \"react\";\nimport React from \"react\";\nimport isHotkey from \"is-hotkey\";\nimport { generateId } from \"@webiny/utils\";\n\ninterface KeyHandler {\n id: string;\n handler: any;\n}\nconst keyStack: Record<string, KeyHandler[]> = {};\n\nlet listener = false;\nconst filter = [\"TEXTAREA\", \"INPUT\"];\n\nconst isContentEditable = (value: any) => {\n return [\"true\", true].includes(value);\n};\n\nconst setupListener = (): void => {\n if (listener || !document.body) {\n return;\n }\n\n const eventListener = (ev: KeyboardEvent) => {\n if (!ev.target) {\n return;\n }\n const target = ev.target as HTMLElement;\n // We ignore all keyboard events coming from within contentEditable element and inputs.\n if (filter.includes(target.nodeName) || isContentEditable(target.contentEditable)) {\n return;\n }\n\n const matchedKey = Object.keys(keyStack).find(key => isHotkey(key, ev));\n\n if (matchedKey && keyStack[matchedKey].length > 0) {\n const item = keyStack[matchedKey][0];\n item.handler(ev);\n ev.stopPropagation();\n }\n };\n\n document.body.addEventListener(\"keydown\", eventListener);\n\n listener = true;\n};\n\nconst addKeyHandler = (\n id: string,\n key: string,\n handler: (e: SyntheticEvent<HTMLElement>) => void\n) => {\n setupListener();\n keyStack[key] = keyStack[key] || [];\n if (!keyStack[key].find(item => item.id === id)) {\n keyStack[key].unshift({ id, handler });\n }\n};\n\nconst removeKeyHandler = (id: string, key: string): void => {\n if (!keyStack[key]) {\n return;\n }\n\n const index = keyStack[key].findIndex(item => item.id === id);\n if (index >= 0) {\n keyStack[key].splice(index, 1);\n }\n};\n\ntype AddKeyHandlerType = (key: string, handler: (e: SyntheticEvent<HTMLElement>) => void) => void;\n\ntype RemoveKeyHandlerType = (key: string) => void;\n\nexport function useKeyHandler(): {\n addKeyHandler: AddKeyHandlerType;\n removeKeyHandler: RemoveKeyHandlerType;\n} {\n const [id] = React.useState(generateId());\n\n return React.useMemo(\n () => ({\n addKeyHandler(key, handler) {\n addKeyHandler(id, key, handler);\n },\n removeKeyHandler(key) {\n removeKeyHandler(id, key);\n }\n }),\n []\n );\n}\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useModKey(): boolean;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback } from "react";
|
|
2
|
+
import isHotkey from "is-hotkey";
|
|
3
|
+
export function useModKey() {
|
|
4
|
+
const [pressed, setPressed] = useState(false);
|
|
5
|
+
const onKeyDown = useCallback(event => {
|
|
6
|
+
if (isHotkey("Control", event) || isHotkey("Meta", event)) {
|
|
7
|
+
setPressed(true);
|
|
8
|
+
}
|
|
9
|
+
}, []);
|
|
10
|
+
const onKeyUp = useCallback(event => {
|
|
11
|
+
if (event.key === "Control" && event.ctrlKey === false) {
|
|
12
|
+
setPressed(false);
|
|
13
|
+
}
|
|
14
|
+
if (event.key === "Meta" && event.metaKey === false) {
|
|
15
|
+
setPressed(false);
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
document.addEventListener("keydown", onKeyDown);
|
|
20
|
+
document.addEventListener("keyup", onKeyUp);
|
|
21
|
+
return () => {
|
|
22
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
23
|
+
document.removeEventListener("keyup", onKeyUp);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
console.log("pressed", pressed);
|
|
27
|
+
return pressed;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=useModKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useCallback","isHotkey","useModKey","pressed","setPressed","onKeyDown","event","onKeyUp","key","ctrlKey","metaKey","document","addEventListener","removeEventListener","console","log"],"sources":["useModKey.ts"],"sourcesContent":["import { useState, useEffect, useCallback } from \"react\";\nimport isHotkey from \"is-hotkey\";\n\nexport function useModKey() {\n const [pressed, setPressed] = useState(false);\n\n const onKeyDown = useCallback((event: KeyboardEvent) => {\n if (isHotkey(\"Control\", event) || isHotkey(\"Meta\", event)) {\n setPressed(true);\n }\n }, []);\n\n const onKeyUp = useCallback((event: KeyboardEvent) => {\n if (event.key === \"Control\" && event.ctrlKey === false) {\n setPressed(false);\n }\n\n if (event.key === \"Meta\" && event.metaKey === false) {\n setPressed(false);\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"keyup\", onKeyUp);\n\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"keyup\", onKeyUp);\n };\n }, []);\n\n console.log(\"pressed\", pressed);\n\n return pressed;\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AACxD,OAAOC,QAAQ,MAAM,WAAW;AAEhC,OAAO,SAASC,SAASA,CAAA,EAAG;EACxB,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGN,QAAQ,CAAC,KAAK,CAAC;EAE7C,MAAMO,SAAS,GAAGL,WAAW,CAAEM,KAAoB,IAAK;IACpD,IAAIL,QAAQ,CAAC,SAAS,EAAEK,KAAK,CAAC,IAAIL,QAAQ,CAAC,MAAM,EAAEK,KAAK,CAAC,EAAE;MACvDF,UAAU,CAAC,IAAI,CAAC;IACpB;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMG,OAAO,GAAGP,WAAW,CAAEM,KAAoB,IAAK;IAClD,IAAIA,KAAK,CAACE,GAAG,KAAK,SAAS,IAAIF,KAAK,CAACG,OAAO,KAAK,KAAK,EAAE;MACpDL,UAAU,CAAC,KAAK,CAAC;IACrB;IAEA,IAAIE,KAAK,CAACE,GAAG,KAAK,MAAM,IAAIF,KAAK,CAACI,OAAO,KAAK,KAAK,EAAE;MACjDN,UAAU,CAAC,KAAK,CAAC;IACrB;EACJ,CAAC,EAAE,EAAE,CAAC;EAENL,SAAS,CAAC,MAAM;IACZY,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,SAAS,CAAC;IAC/CM,QAAQ,CAACC,gBAAgB,CAAC,OAAO,EAAEL,OAAO,CAAC;IAE3C,OAAO,MAAM;MACTI,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,SAAS,CAAC;MAClDM,QAAQ,CAACE,mBAAmB,CAAC,OAAO,EAAEN,OAAO,CAAC;IAClD,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAENO,OAAO,CAACC,GAAG,CAAC,SAAS,EAAEZ,OAAO,CAAC;EAE/B,OAAOA,OAAO;AAClB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useShiftKey(): boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState, useEffect, useCallback, useRef } from "react";
|
|
2
|
+
import isHotkey from "is-hotkey";
|
|
3
|
+
export function useShiftKey() {
|
|
4
|
+
const [pressed, setPressed] = useState(false);
|
|
5
|
+
const onselectstartRef = useRef(document.onselectstart);
|
|
6
|
+
const onKeyDown = useCallback(event => {
|
|
7
|
+
if (isHotkey("shift", event)) {
|
|
8
|
+
setPressed(true);
|
|
9
|
+
}
|
|
10
|
+
}, []);
|
|
11
|
+
const onKeyUp = useCallback(event => {
|
|
12
|
+
if (event.key === "Shift" && event.shiftKey === false) {
|
|
13
|
+
setPressed(false);
|
|
14
|
+
}
|
|
15
|
+
}, []);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
document.onselectstart = () => !pressed;
|
|
18
|
+
return () => {
|
|
19
|
+
document.onselectstart = onselectstartRef.current;
|
|
20
|
+
};
|
|
21
|
+
}, [pressed]);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
document.addEventListener("keydown", onKeyDown);
|
|
24
|
+
document.addEventListener("keyup", onKeyUp);
|
|
25
|
+
return () => {
|
|
26
|
+
document.removeEventListener("keydown", onKeyDown);
|
|
27
|
+
document.removeEventListener("keyup", onKeyUp);
|
|
28
|
+
};
|
|
29
|
+
}, []);
|
|
30
|
+
return pressed;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=useShiftKey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useState","useEffect","useCallback","useRef","isHotkey","useShiftKey","pressed","setPressed","onselectstartRef","document","onselectstart","onKeyDown","event","onKeyUp","key","shiftKey","current","addEventListener","removeEventListener"],"sources":["useShiftKey.ts"],"sourcesContent":["import { useState, useEffect, useCallback, useRef } from \"react\";\nimport isHotkey from \"is-hotkey\";\n\nexport function useShiftKey() {\n const [pressed, setPressed] = useState(false);\n const onselectstartRef = useRef(document.onselectstart);\n\n const onKeyDown = useCallback((event: KeyboardEvent) => {\n if (isHotkey(\"shift\", event)) {\n setPressed(true);\n }\n }, []);\n\n const onKeyUp = useCallback((event: KeyboardEvent) => {\n if (event.key === \"Shift\" && event.shiftKey === false) {\n setPressed(false);\n }\n }, []);\n\n useEffect(() => {\n document.onselectstart = () => !pressed;\n\n return () => {\n document.onselectstart = onselectstartRef.current;\n };\n }, [pressed]);\n\n useEffect(() => {\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"keyup\", onKeyUp);\n\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"keyup\", onKeyUp);\n };\n }, []);\n\n return pressed;\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAChE,OAAOC,QAAQ,MAAM,WAAW;AAEhC,OAAO,SAASC,WAAWA,CAAA,EAAG;EAC1B,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGP,QAAQ,CAAC,KAAK,CAAC;EAC7C,MAAMQ,gBAAgB,GAAGL,MAAM,CAACM,QAAQ,CAACC,aAAa,CAAC;EAEvD,MAAMC,SAAS,GAAGT,WAAW,CAAEU,KAAoB,IAAK;IACpD,IAAIR,QAAQ,CAAC,OAAO,EAAEQ,KAAK,CAAC,EAAE;MAC1BL,UAAU,CAAC,IAAI,CAAC;IACpB;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMM,OAAO,GAAGX,WAAW,CAAEU,KAAoB,IAAK;IAClD,IAAIA,KAAK,CAACE,GAAG,KAAK,OAAO,IAAIF,KAAK,CAACG,QAAQ,KAAK,KAAK,EAAE;MACnDR,UAAU,CAAC,KAAK,CAAC;IACrB;EACJ,CAAC,EAAE,EAAE,CAAC;EAENN,SAAS,CAAC,MAAM;IACZQ,QAAQ,CAACC,aAAa,GAAG,MAAM,CAACJ,OAAO;IAEvC,OAAO,MAAM;MACTG,QAAQ,CAACC,aAAa,GAAGF,gBAAgB,CAACQ,OAAO;IACrD,CAAC;EACL,CAAC,EAAE,CAACV,OAAO,CAAC,CAAC;EAEbL,SAAS,CAAC,MAAM;IACZQ,QAAQ,CAACQ,gBAAgB,CAAC,SAAS,EAAEN,SAAS,CAAC;IAC/CF,QAAQ,CAACQ,gBAAgB,CAAC,OAAO,EAAEJ,OAAO,CAAC;IAE3C,OAAO,MAAM;MACTJ,QAAQ,CAACS,mBAAmB,CAAC,SAAS,EAAEP,SAAS,CAAC;MAClDF,QAAQ,CAACS,mBAAmB,CAAC,OAAO,EAAEL,OAAO,CAAC;IAClD,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOP,OAAO;AAClB","ignoreList":[]}
|
package/hooks/useSnackbar.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface UseSnackbarResponse {
|
|
3
3
|
showSnackbar: (message: React.ReactNode, options?: Record<string, React.ReactNode>) => void;
|
|
4
|
+
showErrorSnackbar: (message: React.ReactNode, options?: Record<string, React.ReactNode>) => void;
|
|
4
5
|
hideSnackbar: () => void;
|
|
5
6
|
}
|
|
6
7
|
export declare const useSnackbar: () => UseSnackbarResponse;
|