@webiny/app-admin 0.0.0-unstable.fcdad0bc61 → 0.0.0-unstable.fdd9228b5d
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 +26 -53
- 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 +12 -108
- 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 +12 -25
- 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 +10 -20
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/TelemetryProvider.d.ts +1 -2
- package/base/providers/TelemetryProvider.js +14 -29
- 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 +11 -20
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/providers/ViewCompositionProvider.d.ts +5 -1
- package/base/providers/ViewCompositionProvider.js +34 -57
- package/base/providers/ViewCompositionProvider.js.map +1 -1
- package/base/ui/Brand.d.ts +39 -2
- package/base/ui/Brand.js +6 -17
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +21 -1
- package/base/ui/CenteredView.js +15 -40
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.d.ts +39 -2
- package/base/ui/Dashboard.js +6 -17
- 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 +38 -2
- package/base/ui/Layout.js +9 -22
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LocaleSelector.d.ts +39 -2
- package/base/ui/LocaleSelector.js +6 -17
- package/base/ui/LocaleSelector.js.map +1 -1
- package/base/ui/LoginScreen.d.ts +20 -2
- package/base/ui/LoginScreen.js +10 -22
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.d.ts +38 -7
- package/base/ui/Logo.js +6 -34
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.d.ts +38 -23
- package/base/ui/Navigation.js +6 -182
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.d.ts +39 -2
- package/base/ui/NotFound.js +6 -17
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.d.ts +2 -2
- package/base/ui/Tags.js +15 -24
- 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 +15 -133
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.d.ts +2 -1
- package/components/AdminLayout.js +8 -18
- package/components/AdminLayout.js.map +1 -1
- package/components/AppInstaller/AppInstaller.d.ts +5 -1
- package/components/AppInstaller/AppInstaller.js +66 -136
- package/components/AppInstaller/AppInstaller.js.map +1 -1
- package/components/AppInstaller/Sidebar.d.ts +2 -2
- package/components/AppInstaller/Sidebar.js +71 -141
- package/components/AppInstaller/Sidebar.js.map +1 -1
- package/components/AppInstaller/index.d.ts +2 -2
- package/components/AppInstaller/index.js +11 -23
- package/components/AppInstaller/index.js.map +1 -1
- package/components/AppInstaller/styled.d.ts +16 -6
- package/components/AppInstaller/styled.js +57 -73
- package/components/AppInstaller/styled.js.map +1 -1
- package/components/AppInstaller/useInstaller.d.ts +2 -8
- package/components/AppInstaller/useInstaller.js +95 -247
- 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 +30 -65
- 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 +8 -19
- 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 -41
- 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 +44 -181
- 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 -17
- 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 +4 -2
- package/components/Permissions/Permissions.js +29 -41
- 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 -35
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.d.ts +2 -0
- package/components/Permissions/index.js +5 -29
- 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 +14 -28
- package/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/components/RichTextEditor/index.js +3 -20
- 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 -573
- 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 +150 -213
- 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 +75 -118
- 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 +150 -206
- 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 +341 -420
- 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 +164 -238
- 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 -16
- package/components/RichTextEditor/tools/utils.js.map +1 -1
- package/components/Routes.d.ts +1 -1
- package/components/Routes.js +21 -36
- package/components/Routes.js.map +1 -1
- package/components/SearchUI.d.ts +3 -1
- package/components/SearchUI.js +24 -68
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +19 -8
- package/components/SimpleForm/SimpleForm.js +74 -99
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +2 -30
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.d.ts +3 -1
- package/components/SimpleUI/InputField.js +42 -63
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +22 -4
- package/components/SingleImageUpload.js +40 -92
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +10 -8
- package/components/SplitView/SplitView.js +52 -90
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +2 -24
- 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 -12
- 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 +7 -3
- package/hooks/useConfirmationDialog.js +29 -43
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.d.ts +21 -2
- package/hooks/useDialog.js +17 -26
- 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 +24 -30
- 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 +27 -15
- package/index.js +53 -373
- package/index.js.map +1 -1
- package/package.json +66 -58
- package/plugins/MenuPlugin.d.ts +1 -1
- package/plugins/MenuPlugin.js +16 -55
- package/plugins/MenuPlugin.js.map +1 -1
- package/plugins/PermissionRendererPlugin.d.ts +1 -1
- package/plugins/PermissionRendererPlugin.js +16 -55
- package/plugins/PermissionRendererPlugin.js.map +1 -1
- package/plugins/uiLayoutRenderer/index.js +41 -63
- package/plugins/uiLayoutRenderer/index.js.map +1 -1
- package/styles.scss +7 -2
- package/types.d.ts +58 -69
- package/types.js +6 -4
- package/types.js.map +1 -1
- package/ui/UIElement.js +2 -18
- package/ui/UIElement.js.map +1 -1
- package/ui/UILayout.js +2 -18
- package/ui/UILayout.js.map +1 -1
- package/ui/UIRenderer.js +2 -12
- package/ui/UIRenderer.js.map +1 -1
- package/ui/UIView.js +2 -24
- package/ui/UIView.js.map +1 -1
- package/ui/elements/AccordionElement.d.ts +2 -1
- package/ui/elements/AccordionElement.js +44 -106
- package/ui/elements/AccordionElement.js.map +1 -1
- package/ui/elements/ButtonElement.d.ts +4 -3
- package/ui/elements/ButtonElement.js +47 -100
- package/ui/elements/ButtonElement.js.map +1 -1
- package/ui/elements/ButtonGroupElement.d.ts +2 -1
- package/ui/elements/ButtonGroupElement.js +24 -62
- package/ui/elements/ButtonGroupElement.js.map +1 -1
- package/ui/elements/GenericElement.js +2 -17
- package/ui/elements/GenericElement.js.map +1 -1
- package/ui/elements/LabelElement.d.ts +3 -2
- package/ui/elements/LabelElement.js +16 -53
- package/ui/elements/LabelElement.js.map +1 -1
- package/ui/elements/NavigationMenuElement.d.ts +5 -4
- package/ui/elements/NavigationMenuElement.js +72 -161
- package/ui/elements/NavigationMenuElement.js.map +1 -1
- package/ui/elements/PanelElement.js +3 -32
- package/ui/elements/PanelElement.js.map +1 -1
- package/ui/elements/PlaceholderElement.js +9 -42
- package/ui/elements/PlaceholderElement.js.map +1 -1
- package/ui/elements/SmallButtonElement.d.ts +4 -2
- package/ui/elements/SmallButtonElement.js +21 -61
- package/ui/elements/SmallButtonElement.js.map +1 -1
- package/ui/elements/TypographyElement.d.ts +3 -2
- package/ui/elements/TypographyElement.js +21 -65
- package/ui/elements/TypographyElement.js.map +1 -1
- package/ui/elements/ViewElement.js +2 -17
- 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 +17 -51
- 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 +93 -154
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +8 -39
- 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 +41 -89
- 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 +68 -108
- 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 -98
- 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 +44 -106
- package/ui/elements/form/FileManagerElement.js.map +1 -1
- package/ui/elements/form/FormElement.d.ts +3 -2
- package/ui/elements/form/FormElement.js +18 -64
- package/ui/elements/form/FormElement.js.map +1 -1
- package/ui/elements/form/FormFieldElement.d.ts +6 -5
- package/ui/elements/form/FormFieldElement.js +100 -193
- package/ui/elements/form/FormFieldElement.js.map +1 -1
- package/ui/elements/form/HiddenElement.d.ts +2 -1
- package/ui/elements/form/HiddenElement.js +22 -61
- package/ui/elements/form/HiddenElement.js.map +1 -1
- package/ui/elements/form/InputElement.d.ts +3 -2
- package/ui/elements/form/InputElement.js +29 -69
- package/ui/elements/form/InputElement.js.map +1 -1
- package/ui/elements/form/PasswordElement.d.ts +1 -1
- package/ui/elements/form/PasswordElement.js +27 -64
- package/ui/elements/form/PasswordElement.js.map +1 -1
- package/ui/elements/form/SelectElement.d.ts +2 -1
- package/ui/elements/form/SelectElement.js +39 -84
- package/ui/elements/form/SelectElement.js.map +1 -1
- package/ui/elements/form/TextareaElement.d.ts +3 -2
- package/ui/elements/form/TextareaElement.js +31 -69
- package/ui/elements/form/TextareaElement.js.map +1 -1
- package/ui/views/AdminView/ContentElement.js +31 -72
- package/ui/views/AdminView/ContentElement.js.map +1 -1
- package/ui/views/AdminView/HeaderElement.js +61 -137
- package/ui/views/AdminView/HeaderElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.js +18 -59
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.js +18 -59
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -1
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -1
- package/ui/views/AdminView/HeaderSectionRightElement.js +18 -59
- 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 +35 -51
- 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 +13 -29
- 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 +17 -69
- package/ui/views/FormView/FormContainerElement.js.map +1 -1
- package/ui/views/FormView/FormContentElement.d.ts +3 -0
- package/ui/views/FormView/FormContentElement.js +8 -31
- package/ui/views/FormView/FormContentElement.js.map +1 -1
- package/ui/views/FormView/FormFooterElement.d.ts +4 -3
- package/ui/views/FormView/FormFooterElement.js +11 -65
- package/ui/views/FormView/FormFooterElement.js.map +1 -1
- package/ui/views/FormView/FormHeaderElement.d.ts +3 -2
- package/ui/views/FormView/FormHeaderElement.js +27 -100
- package/ui/views/FormView/FormHeaderElement.js.map +1 -1
- package/ui/views/FormView.d.ts +3 -3
- package/ui/views/FormView.js +105 -192
- package/ui/views/FormView.js.map +1 -1
- package/ui/views/OverlayView/ContentElement.d.ts +2 -1
- package/ui/views/OverlayView/ContentElement.js +24 -56
- package/ui/views/OverlayView/ContentElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderElement.d.ts +2 -1
- package/ui/views/OverlayView/HeaderElement.js +64 -126
- package/ui/views/OverlayView/HeaderElement.js.map +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +4 -2
- package/ui/views/OverlayView/HeaderTitleElement.js +22 -70
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -1
- package/ui/views/OverlayView/useOverlayView.js +18 -38
- package/ui/views/OverlayView/useOverlayView.js.map +1 -1
- package/ui/views/OverlayView.d.ts +3 -2
- package/ui/views/OverlayView.js +80 -170
- package/ui/views/OverlayView.js.map +1 -1
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +2 -1
- package/ui/views/SplitView/SplitViewPanelElement.js +29 -88
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -1
- package/ui/views/SplitView.d.ts +1 -1
- package/ui/views/SplitView.js +57 -133
- 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 -166
- package/base/ui/Menu.js.map +0 -1
- package/base/ui/Search.d.ts +0 -19
- package/base/ui/Search.js +0 -81
- package/base/ui/Search.js.map +0 -1
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +0 -6
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +0 -55
- 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 -60
- package/components/FileManager/BottomInfoBar/UploadStatus.js.map +0 -1
- package/components/FileManager/BottomInfoBar.d.ts +0 -5
- package/components/FileManager/BottomInfoBar.js +0 -60
- package/components/FileManager/BottomInfoBar.js.map +0 -1
- package/components/FileManager/DropFilesHere.d.ts +0 -10
- package/components/FileManager/DropFilesHere.js +0 -76
- package/components/FileManager/DropFilesHere.js.map +0 -1
- package/components/FileManager/File.d.ts +0 -17
- package/components/FileManager/File.js +0 -155
- package/components/FileManager/File.js.map +0 -1
- package/components/FileManager/FileDetails/Name.d.ts +0 -8
- package/components/FileManager/FileDetails/Name.js +0 -138
- 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 -339
- package/components/FileManager/FileDetails/Tags.js.map +0 -1
- package/components/FileManager/FileDetails.d.ts +0 -24
- package/components/FileManager/FileDetails.js +0 -474
- package/components/FileManager/FileDetails.js.map +0 -1
- package/components/FileManager/FileManagerContext.d.ts +0 -42
- package/components/FileManager/FileManagerContext.js +0 -224
- package/components/FileManager/FileManagerContext.js.map +0 -1
- package/components/FileManager/FileManagerView.d.ts +0 -18
- package/components/FileManager/FileManagerView.js +0 -728
- package/components/FileManager/FileManagerView.js.map +0 -1
- package/components/FileManager/LeftSidebar.d.ts +0 -10
- package/components/FileManager/LeftSidebar.js +0 -127
- package/components/FileManager/LeftSidebar.js.map +0 -1
- package/components/FileManager/NoPermissionView.d.ts +0 -3
- package/components/FileManager/NoPermissionView.js +0 -87
- package/components/FileManager/NoPermissionView.js.map +0 -1
- package/components/FileManager/NoResults.d.ts +0 -3
- package/components/FileManager/NoResults.js +0 -28
- package/components/FileManager/NoResults.js.map +0 -1
- package/components/FileManager/getFileTypePlugin.d.ts +0 -4
- package/components/FileManager/getFileTypePlugin.js +0 -57
- package/components/FileManager/getFileTypePlugin.js.map +0 -1
- package/components/FileManager/getFileUploader.d.ts +0 -3
- package/components/FileManager/getFileUploader.js +0 -20
- package/components/FileManager/getFileUploader.js.map +0 -1
- package/components/FileManager/graphql.d.ts +0 -96
- package/components/FileManager/graphql.js +0 -58
- 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 -54
- 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 -144
- 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 -63
- package/plugins/FileManagerFileTypePlugin.js.map +0 -1
- package/plugins/fileManager/fileDefault.d.ts +0 -2
- package/plugins/fileManager/fileDefault.js +0 -34
- package/plugins/fileManager/fileDefault.js.map +0 -1
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +0 -7
- package/plugins/fileManager/fileImage/DeleteAction.js +0 -83
- 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 -179
- 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 -46
- 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 -21
- package/plugins/fileManager/index.js.map +0 -1
- package/plugins/globalSearch/SearchBar.d.ts +0 -15
- package/plugins/globalSearch/SearchBar.js +0 -273
- package/plugins/globalSearch/SearchBar.js.map +0 -1
- package/plugins/globalSearch/SearchBarDropdown.d.ts +0 -23
- package/plugins/globalSearch/SearchBarDropdown.js +0 -101
- 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 -135
- package/plugins/globalSearch/styled.js.map +0 -1
- package/styles/material-theme-assignments.scss +0 -346
- package/styles/material.scss +0 -43
- package/styles/theme.scss +0 -46
- package/ui/views/AdminView/components/Snackbar.d.ts +0 -3
- package/ui/views/AdminView/components/Snackbar.js +0 -41
- package/ui/views/AdminView/components/Snackbar.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defaultGetFileSrc","file","src","defaultOnSelectFile","ImageTool","data","config","api","readOnly","getFileSrc","onSelectFile","actions","context","ui","Ui","showFileManager","image","tunes","Tunes","onChange","tuneName","tuneToggled","_data","render","caption","nodes","innerHTML","fillCaption","forEach","name","tune","initialValue","value","setTune","fillImage","applyTune","Promise","resolve","then","blockId","blocks","getCurrentBlockIndex","stretchBlock","catch","err","console","error","icon","svgs","toolbox","title"],"sources":["index.ts"],"sourcesContent":["import { API } from \"@editorjs/editorjs\";\nimport Ui from \"./ui\";\nimport Tunes from \"./tunes\";\nimport svgs from \"./svgs\";\nimport { Tune } from \"./types\";\n\ninterface File {\n src: string;\n}\ninterface GetFileSourceCallable {\n (file: File | string): string;\n}\nconst defaultGetFileSrc: GetFileSourceCallable = file => {\n if (typeof file === \"string\") {\n return file;\n }\n\n return file.src;\n};\ninterface OnSelectFileCallable {\n (file: File): string;\n}\nconst defaultOnSelectFile: OnSelectFileCallable = file => {\n return file.src;\n};\n\ninterface ImageToolData {\n caption: string;\n file: string;\n}\ninterface ImageToolParams {\n data: ImageToolData;\n config: Config;\n api: API;\n readOnly: boolean;\n}\ninterface Config {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n actions: Tune[];\n context: {\n showFileManager: (cb: (file: File) => void) => void;\n };\n}\nexport default class ImageTool {\n private readonly api: API;\n private readonly readOnly: boolean;\n private readonly config: Config;\n private readonly tunes: Tunes;\n private readonly ui: Ui;\n private readonly _data: any;\n\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return true;\n }\n\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: svgs.toolbox,\n title: \"Image\"\n };\n }\n\n constructor({ data, config, api, readOnly }: ImageToolParams) {\n this.api = api;\n this.readOnly = readOnly;\n\n this.config = {\n getFileSrc: config.getFileSrc || defaultGetFileSrc,\n onSelectFile: config.onSelectFile || defaultOnSelectFile,\n actions: config.actions || [],\n context: config.context\n };\n\n /**\n * Module for working with UI\n */\n this.ui = new Ui({\n api,\n config: this.config,\n onSelectFile: () => {\n this.config.context.showFileManager((file: File) => {\n this.image = this.config.onSelectFile(file);\n });\n },\n readOnly\n });\n\n /**\n * Module for working with tunes\n */\n this.tunes = new Tunes({\n api,\n actions: this.config.actions,\n onChange: (tuneName: string) => this.tuneToggled(tuneName)\n });\n\n /**\n * Set saved state\n */\n this._data = {};\n this.data = data;\n }\n\n /**\n * Renders Block content\n *\n * @public\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this.ui.render(this.data);\n }\n\n /**\n * Return Block data\n *\n * @public\n *\n * @returns {ImageToolData}\n */\n save() {\n const caption = this.ui.nodes.caption;\n\n this._data.caption = caption.innerHTML;\n\n return this.data;\n }\n\n /**\n * Makes buttons with tunes: stretch image\n *\n * @public\n *\n * @returns {Element}\n */\n renderSettings() {\n return this.tunes.render(this.data);\n }\n\n /**\n * Stores all Tool's data\n *\n * @private\n *\n * @param {ImageToolData} data - data in Image Tool format\n */\n set data(data) {\n this.image = data.file;\n\n this._data.caption = data.caption || \"\";\n this.ui.fillCaption(this._data.caption);\n\n Tunes.tunes.forEach(({ name }) => {\n const tune = name as keyof ImageToolData;\n\n const initialValue = data[tune] as unknown as string | boolean;\n\n const value = initialValue === true || initialValue === \"true\";\n\n this.setTune(tune, value);\n });\n }\n\n /**\n * Return Tool data\n *\n * @private\n *\n * @returns {ImageToolData}\n */\n get data(): ImageToolData {\n return this._data;\n }\n\n /**\n * Set new image file\n *\n * @private\n *\n * @param {object} file - uploaded file data\n */\n set image(file: File | string) {\n this._data.file = file || {};\n\n if (file) {\n this.ui.fillImage(this.config.getFileSrc(file));\n }\n }\n\n /**\n * Callback fired when Block Tune is activated\n *\n * @private\n *\n * @param {string} tuneName - tune that has been clicked\n * @returns {void}\n */\n public tuneToggled(tuneName: string): void {\n // inverse tune state\n this.setTune(tuneName, !this._data[tuneName]);\n }\n\n /**\n * Set one tune\n *\n * @param {string} tuneName - {@link Tunes.tunes}\n * @param {boolean} value - tune state\n * @returns {void}\n */\n public setTune(tuneName: string, value: boolean): void {\n this._data[tuneName] = value;\n\n this.ui.applyTune(tuneName, value);\n\n if (tuneName === \"stretched\") {\n /**\n * Wait until the API is ready\n */\n Promise.resolve()\n .then(() => {\n const blockId = this.api.blocks.getCurrentBlockIndex();\n\n this.api.blocks.stretchBlock(blockId, value);\n })\n .catch(err => {\n console.error(err);\n });\n }\n }\n\n public isReadOnly(): boolean {\n return this.readOnly;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AASA,IAAMA,iBAAwC,GAAG,SAA3CA,iBAA2C,CAAAC,IAAI,EAAI;EACrD,IAAI,OAAOA,IAAP,KAAgB,QAApB,EAA8B;IAC1B,OAAOA,IAAP;EACH;;EAED,OAAOA,IAAI,CAACC,GAAZ;AACH,CAND;;AAUA,IAAMC,mBAAyC,GAAG,SAA5CA,mBAA4C,CAAAF,IAAI,EAAI;EACtD,OAAOA,IAAI,CAACC,GAAZ;AACH,CAFD;;IAsBqBE,S;EA+BjB,yBAA8D;IAAA;;IAAA,IAAhDC,IAAgD,QAAhDA,IAAgD;IAAA,IAA1CC,MAA0C,QAA1CA,MAA0C;IAAA,IAAlCC,GAAkC,QAAlCA,GAAkC;IAAA,IAA7BC,QAA6B,QAA7BA,QAA6B;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAC1D,KAAKD,GAAL,GAAWA,GAAX;IACA,KAAKC,QAAL,GAAgBA,QAAhB;IAEA,KAAKF,MAAL,GAAc;MACVG,UAAU,EAAEH,MAAM,CAACG,UAAP,IAAqBT,iBADvB;MAEVU,YAAY,EAAEJ,MAAM,CAACI,YAAP,IAAuBP,mBAF3B;MAGVQ,OAAO,EAAEL,MAAM,CAACK,OAAP,IAAkB,EAHjB;MAIVC,OAAO,EAAEN,MAAM,CAACM;IAJN,CA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QAAQ,KAAK,WAAjB,EAA8B;QAC1B;AACZ;AACA;QACYgB,OAAO,CAACC,OAAR,GACKC,IADL,CACU,YAAM;UACR,IAAMC,OAAO,GAAG,MAAI,CAAChC,GAAL,CAASiC,MAAT,CAAgBC,oBAAhB,EAAhB;;UAEA,MAAI,CAAClC,GAAL,CAASiC,MAAT,CAAgBE,YAAhB,CAA6BH,OAA7B,EAAsCP,KAAtC;QACH,CALL,EAMKW,KANL,CAMW,UAAAC,GAAG,EAAI;UACVC,OAAO,CAACC,KAAR,CAAcF,GAAd;QACH,CARL;MASH;IACJ;;;WAED,sBAA6B;MACzB,OAAO,KAAKpC,QAAZ;IACH;;;;IAlMD;AACJ;AACA;AACA;AACA;IACI,eAAiC;MAC7B,OAAO,IAAP;IACH;IAED;AACJ;AACA;AACA;AACA;AACA;AACA;;;;SACI,eAAqB;MACjB,OAAO;QACHuC,IAAI,EAAEC,aAAA,CAAKC,OADR;QAEHC,KAAK,EAAE;MAFJ,CAAP;IAIH"}
|
|
1
|
+
{"version":3,"names":["Ui","Tunes","svgs","defaultGetFileSrc","file","src","defaultOnSelectFile","ImageTool","isReadOnlySupported","toolbox","icon","title","constructor","data","config","api","readOnly","getFileSrc","onSelectFile","actions","context","ui","showFileManager","image","tunes","onChange","tuneName","tuneToggled","_data","render","save","caption","nodes","innerHTML","renderSettings","fillCaption","forEach","name","tune","initialValue","value","setTune","fillImage","applyTune","Promise","resolve","then","blockId","blocks","getCurrentBlockIndex","stretchBlock","catch","err","console","error","isReadOnly"],"sources":["index.ts"],"sourcesContent":["import type { API } from \"@editorjs/editorjs\";\nimport Ui from \"./ui\";\nimport Tunes from \"./tunes\";\nimport svgs from \"./svgs\";\nimport type { Tune } from \"./types\";\n\ninterface File {\n src: string;\n}\ninterface GetFileSourceCallable {\n (file: File | string): string;\n}\nconst defaultGetFileSrc: GetFileSourceCallable = file => {\n if (typeof file === \"string\") {\n return file;\n }\n\n return file.src;\n};\ninterface OnSelectFileCallable {\n (file: File): string;\n}\nconst defaultOnSelectFile: OnSelectFileCallable = file => {\n return file.src;\n};\n\ninterface ImageToolData {\n caption: string;\n file: string;\n}\ninterface ImageToolParams {\n data: ImageToolData;\n config: Config;\n api: API;\n readOnly: boolean;\n}\ninterface Config {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n actions: Tune[];\n context: {\n showFileManager: (cb: (file: File) => void) => void;\n };\n}\nexport default class ImageTool {\n private readonly api: API;\n private readonly readOnly: boolean;\n private readonly config: Config;\n private readonly tunes: Tunes;\n private readonly ui: Ui;\n private readonly _data: any;\n\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return true;\n }\n\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: svgs.toolbox,\n title: \"Image\"\n };\n }\n\n constructor({ data, config, api, readOnly }: ImageToolParams) {\n this.api = api;\n this.readOnly = readOnly;\n\n this.config = {\n getFileSrc: config.getFileSrc || defaultGetFileSrc,\n onSelectFile: config.onSelectFile || defaultOnSelectFile,\n actions: config.actions || [],\n context: config.context\n };\n\n /**\n * Module for working with UI\n */\n this.ui = new Ui({\n api,\n config: this.config,\n onSelectFile: () => {\n this.config.context.showFileManager((file: File) => {\n this.image = this.config.onSelectFile(file);\n });\n },\n readOnly\n });\n\n /**\n * Module for working with tunes\n */\n this.tunes = new Tunes({\n api,\n actions: this.config.actions,\n onChange: (tuneName: string) => this.tuneToggled(tuneName)\n });\n\n /**\n * Set saved state\n */\n this._data = {};\n this.data = data;\n }\n\n /**\n * Renders Block content\n *\n * @public\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this.ui.render(this.data);\n }\n\n /**\n * Return Block data\n *\n * @public\n *\n * @returns {ImageToolData}\n */\n save() {\n const caption = this.ui.nodes.caption;\n\n this._data.caption = caption.innerHTML;\n\n return this.data;\n }\n\n /**\n * Makes buttons with tunes: stretch image\n *\n * @public\n *\n * @returns {Element}\n */\n renderSettings() {\n return this.tunes.render(this.data);\n }\n\n /**\n * Stores all Tool's data\n *\n * @private\n *\n * @param {ImageToolData} data - data in Image Tool format\n */\n set data(data) {\n this.image = data.file;\n\n this._data.caption = data.caption || \"\";\n this.ui.fillCaption(this._data.caption);\n\n Tunes.tunes.forEach(({ name }) => {\n const tune = name as keyof ImageToolData;\n\n const initialValue = data[tune] as unknown as string | boolean;\n\n const value = initialValue === true || initialValue === \"true\";\n\n this.setTune(tune, value);\n });\n }\n\n /**\n * Return Tool data\n *\n * @private\n *\n * @returns {ImageToolData}\n */\n get data(): ImageToolData {\n return this._data;\n }\n\n /**\n * Set new image file\n *\n * @private\n *\n * @param {object} file - uploaded file data\n */\n set image(file: File | string) {\n this._data.file = file || {};\n\n if (file) {\n this.ui.fillImage(this.config.getFileSrc(file));\n }\n }\n\n /**\n * Callback fired when Block Tune is activated\n *\n * @private\n *\n * @param {string} tuneName - tune that has been clicked\n * @returns {void}\n */\n public tuneToggled(tuneName: string): void {\n // inverse tune state\n this.setTune(tuneName, !this._data[tuneName]);\n }\n\n /**\n * Set one tune\n *\n * @param {string} tuneName - {@link Tunes.tunes}\n * @param {boolean} value - tune state\n * @returns {void}\n */\n public setTune(tuneName: string, value: boolean): void {\n this._data[tuneName] = value;\n\n this.ui.applyTune(tuneName, value);\n\n if (tuneName === \"stretched\") {\n /**\n * Wait until the API is ready\n */\n Promise.resolve()\n .then(() => {\n const blockId = this.api.blocks.getCurrentBlockIndex();\n\n this.api.blocks.stretchBlock(blockId, value);\n })\n .catch(err => {\n console.error(err);\n });\n }\n }\n\n public isReadOnly(): boolean {\n return this.readOnly;\n }\n}\n"],"mappings":"AACA,OAAOA,EAAE;AACT,OAAOC,KAAK;AACZ,OAAOC,IAAI;AASX,MAAMC,iBAAwC,GAAGC,IAAI,IAAI;EACrD,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOA,IAAI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;QACVC,OAAO,CAACC,KAAK,CAACF,GAAG,CAAC;MACtB,CAAC,CAAC;IACV;EACJ;EAEOG,UAAUA,CAAA,EAAY;IACzB,OAAO,IAAI,CAACvC,QAAQ;EACxB;AACJ","ignoreList":[]}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
8
|
-
buttonIcon: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z\"/>",
|
|
9
|
-
stretched: "<svg width=\"17\" height=\"10\" viewBox=\"0 0 17 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z\"/></svg>",
|
|
10
|
-
toolbox: "<svg width=\"17\" height=\"15\" viewBox=\"0 0 336 276\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z\"/></svg>"
|
|
1
|
+
export default {
|
|
2
|
+
buttonIcon: `<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z"/>`,
|
|
3
|
+
stretched: `<svg width="17" height="10" viewBox="0 0 17 10" xmlns="http://www.w3.org/2000/svg"><path d="M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z"/></svg>`,
|
|
4
|
+
toolbox: `<svg width="17" height="15" viewBox="0 0 336 276" xmlns="http://www.w3.org/2000/svg"><path d="M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z"/></svg>`
|
|
11
5
|
};
|
|
12
|
-
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=svgs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["buttonIcon","stretched","toolbox"],"sources":["svgs.ts"],"sourcesContent":["export default {\n buttonIcon: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z\"/>`,\n stretched: `<svg width=\"17\" height=\"10\" viewBox=\"0 0 17 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z\"/></svg>`,\n toolbox: `<svg width=\"17\" height=\"15\" viewBox=\"0 0 336 276\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z\"/></svg>`\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["buttonIcon","stretched","toolbox"],"sources":["svgs.ts"],"sourcesContent":["export default {\n buttonIcon: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z\"/>`,\n stretched: `<svg width=\"17\" height=\"10\" viewBox=\"0 0 17 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z\"/></svg>`,\n toolbox: `<svg width=\"17\" height=\"15\" viewBox=\"0 0 336 276\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z\"/></svg>`\n};\n"],"mappings":"AAAA,eAAe;EACXA,UAAU,EAAE,kZAAkZ;EAC9ZC,SAAS,EAAE,0YAA0Y;EACrZC,OAAO,EAAE;AACb,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { API } from "@editorjs/editorjs";
|
|
4
|
-
import { ImageToolData, Tune, TuneOnChangeCallable } from "./types";
|
|
1
|
+
import type { API } from "@editorjs/editorjs";
|
|
2
|
+
import type { ImageToolData, Tune, TuneOnChangeCallable } from "./types";
|
|
5
3
|
interface TunesParams {
|
|
6
4
|
api: API;
|
|
7
5
|
actions: Tune[];
|
|
@@ -1,146 +1,103 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
|
|
16
|
-
var _ui = require("./ui");
|
|
17
|
-
|
|
18
|
-
var _svgs = _interopRequireDefault(require("./svgs"));
|
|
19
|
-
|
|
1
|
+
import { make } from "./ui";
|
|
2
|
+
import svgs from "./svgs";
|
|
20
3
|
/**
|
|
21
4
|
* Working with Block Tunes
|
|
22
5
|
*/
|
|
23
|
-
|
|
6
|
+
export default class Tunes {
|
|
24
7
|
/**
|
|
25
8
|
* @param {object} tune - image tool Tunes managers
|
|
26
9
|
* @param {object} tune.api - Editor API
|
|
27
10
|
* @param {object} tune.actions - list of user defined tunes
|
|
28
11
|
* @param {Function} tune.onChange - tune toggling callback
|
|
29
12
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
(0, _defineProperty2.default)(this, "api", void 0);
|
|
36
|
-
(0, _defineProperty2.default)(this, "actions", void 0);
|
|
37
|
-
(0, _defineProperty2.default)(this, "onChange", void 0);
|
|
38
|
-
(0, _defineProperty2.default)(this, "buttons", void 0);
|
|
13
|
+
constructor({
|
|
14
|
+
api,
|
|
15
|
+
actions,
|
|
16
|
+
onChange
|
|
17
|
+
}) {
|
|
39
18
|
this.api = api;
|
|
40
19
|
this.actions = actions;
|
|
41
20
|
this.onChange = onChange;
|
|
42
21
|
this.buttons = [];
|
|
43
22
|
}
|
|
23
|
+
|
|
44
24
|
/**
|
|
45
25
|
* Available Image tunes
|
|
46
26
|
*
|
|
47
27
|
* @returns {{name: string, icon: string, title: string}[]}
|
|
48
28
|
*/
|
|
29
|
+
static get tunes() {
|
|
30
|
+
return [{
|
|
31
|
+
name: "stretched",
|
|
32
|
+
icon: svgs.stretched,
|
|
33
|
+
title: "Stretch image"
|
|
34
|
+
}];
|
|
35
|
+
}
|
|
49
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Styles
|
|
39
|
+
*
|
|
40
|
+
* @returns {{wrapper: string, buttonBase: *, button: string, buttonActive: *}}
|
|
41
|
+
*/
|
|
42
|
+
get CSS() {
|
|
43
|
+
return {
|
|
44
|
+
wrapper: "",
|
|
45
|
+
buttonBase: this.api.styles.settingsButton,
|
|
46
|
+
button: "image-tool__tune",
|
|
47
|
+
buttonActive: this.api.styles.settingsButtonActive
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Makes buttons with tunes: stretch image
|
|
69
|
-
*
|
|
70
|
-
* @param {ImageToolData} toolData - generate Elements of tunes
|
|
71
|
-
* @returns {Element}
|
|
72
|
-
*/
|
|
73
|
-
|
|
74
|
-
}, {
|
|
75
|
-
key: "render",
|
|
76
|
-
value: function render(toolData) {
|
|
77
|
-
var _this = this;
|
|
78
|
-
|
|
79
|
-
var wrapper = (0, _ui.make)("div", this.CSS.wrapper);
|
|
80
|
-
this.buttons = [];
|
|
81
|
-
var tunes = Tunes.tunes.concat(this.actions);
|
|
82
|
-
tunes.forEach(function (tune) {
|
|
83
|
-
var title = _this.api.i18n.t(tune.title);
|
|
84
|
-
|
|
85
|
-
var el = (0, _ui.make)("div", [_this.CSS.buttonBase, _this.CSS.button], {
|
|
86
|
-
innerHTML: tune.icon,
|
|
87
|
-
title: title
|
|
88
|
-
});
|
|
89
|
-
el.addEventListener("click", function () {
|
|
90
|
-
_this.tuneClicked(tune.name, tune.action);
|
|
91
|
-
});
|
|
92
|
-
el.dataset["tune"] = tune.name;
|
|
93
|
-
var name = tune.name;
|
|
94
|
-
el.classList.toggle(_this.CSS.buttonActive, !!toolData[name]);
|
|
95
|
-
|
|
96
|
-
_this.buttons.push(el);
|
|
97
|
-
|
|
98
|
-
_this.api.tooltip.onHover(el, title, {
|
|
99
|
-
placement: "top"
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
wrapper.appendChild(el);
|
|
51
|
+
/**
|
|
52
|
+
* Makes buttons with tunes: stretch image
|
|
53
|
+
*
|
|
54
|
+
* @param {ImageToolData} toolData - generate Elements of tunes
|
|
55
|
+
* @returns {Element}
|
|
56
|
+
*/
|
|
57
|
+
render(toolData) {
|
|
58
|
+
const wrapper = make("div", this.CSS.wrapper);
|
|
59
|
+
this.buttons = [];
|
|
60
|
+
const tunes = Tunes.tunes.concat(this.actions);
|
|
61
|
+
tunes.forEach(tune => {
|
|
62
|
+
const title = this.api.i18n.t(tune.title);
|
|
63
|
+
const el = make("div", [this.CSS.buttonBase, this.CSS.button], {
|
|
64
|
+
innerHTML: tune.icon,
|
|
65
|
+
title
|
|
103
66
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}, {
|
|
114
|
-
key: "tuneClicked",
|
|
115
|
-
value: function tuneClicked(tuneName, customFunction) {
|
|
116
|
-
if (typeof customFunction === "function") {
|
|
117
|
-
if (!customFunction(tuneName)) {
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
var button = this.buttons.find(function (el) {
|
|
123
|
-
return el.dataset["tune"] === tuneName;
|
|
67
|
+
el.addEventListener("click", () => {
|
|
68
|
+
this.tuneClicked(tune.name, tune.action);
|
|
69
|
+
});
|
|
70
|
+
el.dataset["tune"] = tune.name;
|
|
71
|
+
const name = tune.name;
|
|
72
|
+
el.classList.toggle(this.CSS.buttonActive, !!toolData[name]);
|
|
73
|
+
this.buttons.push(el);
|
|
74
|
+
this.api.tooltip.onHover(el, title, {
|
|
75
|
+
placement: "top"
|
|
124
76
|
});
|
|
77
|
+
wrapper.appendChild(el);
|
|
78
|
+
});
|
|
79
|
+
return wrapper;
|
|
80
|
+
}
|
|
125
81
|
|
|
126
|
-
|
|
127
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Clicks to one of the tunes
|
|
84
|
+
*
|
|
85
|
+
* @param {string} tuneName - clicked tune name
|
|
86
|
+
* @param {Function} customFunction - function to execute on click
|
|
87
|
+
*/
|
|
88
|
+
tuneClicked(tuneName, customFunction) {
|
|
89
|
+
if (typeof customFunction === "function") {
|
|
90
|
+
if (!customFunction(tuneName)) {
|
|
91
|
+
return false;
|
|
128
92
|
}
|
|
129
|
-
|
|
130
|
-
this.onChange(tuneName);
|
|
131
|
-
return true;
|
|
132
93
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
return [{
|
|
137
|
-
name: "stretched",
|
|
138
|
-
icon: _svgs.default.stretched,
|
|
139
|
-
title: "Stretch image"
|
|
140
|
-
}];
|
|
94
|
+
const button = this.buttons.find(el => el.dataset["tune"] === tuneName);
|
|
95
|
+
if (button) {
|
|
96
|
+
button.classList.toggle(this.CSS.buttonActive, !button.classList.contains(this.CSS.buttonActive));
|
|
141
97
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
98
|
+
this.onChange(tuneName);
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
145
102
|
|
|
146
|
-
|
|
103
|
+
//# sourceMappingURL=tunes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Tunes","api","actions","onChange","buttons","wrapper","buttonBase","styles","settingsButton","button","buttonActive","settingsButtonActive","
|
|
1
|
+
{"version":3,"names":["make","svgs","Tunes","constructor","api","actions","onChange","buttons","tunes","name","icon","stretched","title","CSS","wrapper","buttonBase","styles","settingsButton","button","buttonActive","settingsButtonActive","render","toolData","concat","forEach","tune","i18n","t","el","innerHTML","addEventListener","tuneClicked","action","dataset","classList","toggle","push","tooltip","onHover","placement","appendChild","tuneName","customFunction","find","contains"],"sources":["tunes.ts"],"sourcesContent":["import type { API } from \"@editorjs/editorjs\";\nimport { make } from \"./ui\";\nimport svgs from \"./svgs\";\nimport type { ImageToolData, Tune, TuneOnChangeCallable } from \"./types\";\n\ninterface TunesParams {\n api: API;\n actions: Tune[];\n onChange: TuneOnChangeCallable;\n}\n/**\n * Working with Block Tunes\n */\nexport default class Tunes {\n private api: API;\n private readonly actions: Tune[];\n private readonly onChange: TuneOnChangeCallable;\n private buttons: Array<HTMLElement>;\n /**\n * @param {object} tune - image tool Tunes managers\n * @param {object} tune.api - Editor API\n * @param {object} tune.actions - list of user defined tunes\n * @param {Function} tune.onChange - tune toggling callback\n */\n constructor({ api, actions, onChange }: TunesParams) {\n this.api = api;\n this.actions = actions;\n this.onChange = onChange;\n this.buttons = [];\n }\n\n /**\n * Available Image tunes\n *\n * @returns {{name: string, icon: string, title: string}[]}\n */\n static get tunes(): Tune[] {\n return [\n {\n name: \"stretched\",\n icon: svgs.stretched,\n title: \"Stretch image\"\n }\n ];\n }\n\n /**\n * Styles\n *\n * @returns {{wrapper: string, buttonBase: *, button: string, buttonActive: *}}\n */\n get CSS() {\n return {\n wrapper: \"\",\n buttonBase: this.api.styles.settingsButton,\n button: \"image-tool__tune\",\n buttonActive: this.api.styles.settingsButtonActive\n };\n }\n\n /**\n * Makes buttons with tunes: stretch image\n *\n * @param {ImageToolData} toolData - generate Elements of tunes\n * @returns {Element}\n */\n render(toolData: ImageToolData): HTMLElement {\n const wrapper = make(\"div\", this.CSS.wrapper);\n\n this.buttons = [];\n\n const tunes = Tunes.tunes.concat(this.actions);\n\n tunes.forEach(tune => {\n const title = this.api.i18n.t(tune.title);\n const el = make(\"div\", [this.CSS.buttonBase, this.CSS.button], {\n innerHTML: tune.icon,\n title\n });\n\n el.addEventListener(\"click\", () => {\n this.tuneClicked(tune.name, tune.action);\n });\n\n el.dataset[\"tune\"] = tune.name;\n const name = tune.name as keyof ImageToolData;\n el.classList.toggle(this.CSS.buttonActive, !!toolData[name]);\n\n this.buttons.push(el);\n\n this.api.tooltip.onHover(el, title, {\n placement: \"top\"\n });\n\n wrapper.appendChild(el);\n });\n\n return wrapper;\n }\n\n /**\n * Clicks to one of the tunes\n *\n * @param {string} tuneName - clicked tune name\n * @param {Function} customFunction - function to execute on click\n */\n tuneClicked(tuneName: string, customFunction?: TuneOnChangeCallable): boolean {\n if (typeof customFunction === \"function\") {\n if (!customFunction(tuneName)) {\n return false;\n }\n }\n\n const button = this.buttons.find(el => el.dataset[\"tune\"] === tuneName);\n\n if (button) {\n button.classList.toggle(\n this.CSS.buttonActive,\n !button.classList.contains(this.CSS.buttonActive)\n );\n }\n\n this.onChange(tuneName);\n return true;\n }\n}\n"],"mappings":"AACA,SAASA,IAAI;AACb,OAAOC,IAAI;AA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G,CAACM,YAAY,EACrB,CAACD,MAAM,CAACgB,SAAS,CAACU,QAAQ,CAAC,IAAI,CAAC/B,GAAG,CAACM,YAAY,CACpD,CAAC;IACL;IAEA,IAAI,CAACb,QAAQ,CAACmC,QAAQ,CAAC;IACvB,OAAO,IAAI;EACf;AACJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface TuneOnChangeCallable {\n (tune: string): boolean | void;\n}\nexport interface Tune {\n name: string;\n icon: string;\n title: string;\n action?: TuneOnChangeCallable;\n}\n\nexport interface ImageToolData {\n caption: string;\n file: string;\n}\nexport interface ImageToolFile {\n src: string;\n}\nexport interface GetFileSourceCallable {\n (file: ImageToolFile | string): string;\n}\nexport interface OnSelectFileCallable {\n (file: ImageToolFile): string;\n}\nexport interface ImageToolConfig {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n captionPlaceholder?: string;\n actions: Tune[];\n context: Record<string, any>;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface TuneOnChangeCallable {\n (tune: string): boolean | void;\n}\nexport interface Tune {\n name: string;\n icon: string;\n title: string;\n action?: TuneOnChangeCallable;\n}\n\nexport interface ImageToolData {\n caption: string;\n file: string;\n}\nexport interface ImageToolFile {\n src: string;\n}\nexport interface GetFileSourceCallable {\n (file: ImageToolFile | string): string;\n}\nexport interface OnSelectFileCallable {\n (file: ImageToolFile): string;\n}\nexport interface ImageToolConfig {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n captionPlaceholder?: string;\n actions: Tune[];\n context: Record<string, any>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { API } from "@editorjs/editorjs";
|
|
4
|
-
import { ImageToolConfig, ImageToolData } from "./types";
|
|
1
|
+
import type { API } from "@editorjs/editorjs";
|
|
2
|
+
import type { ImageToolConfig, ImageToolData } from "./types";
|
|
5
3
|
interface OnSelectFileCallable {
|
|
6
4
|
(): void;
|
|
7
5
|
}
|