@webiny/app-admin 0.0.0-unstable.bca7b3e350 → 0.0.0-unstable.c27f4d8a31
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/README.md +7 -17
- 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 +5 -2
- package/base/Admin.js +45 -40
- package/base/Admin.js.map +1 -1
- package/base/Base/LexicalPreset.d.ts +2 -0
- package/base/Base/LexicalPreset.js +67 -0
- package/base/Base/LexicalPreset.js.map +1 -0
- package/base/Base/Menus/SupportMenuItems.d.ts +2 -0
- package/base/Base/Menus/SupportMenuItems.js +18 -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 +124 -0
- package/base/Base/Menus.js.map +1 -0
- package/base/Base/RoutesConfig.d.ts +2 -0
- package/base/Base/RoutesConfig.js +30 -0
- package/base/Base/RoutesConfig.js.map +1 -0
- package/base/Base/Tenant/wby-horizontal.svg +23 -0
- package/base/Base/Tenant/wby-square.svg +3 -0
- package/base/Base/Tenant.d.ts +2 -0
- package/base/Base/Tenant.js +24 -0
- package/base/Base/Tenant.js.map +1 -0
- package/base/Base/UserMenu/ExitTenant.d.ts +20 -0
- package/base/Base/UserMenu/ExitTenant.js +37 -0
- package/base/Base/UserMenu/ExitTenant.js.map +1 -0
- package/base/Base/UserMenu/SignOut.d.ts +2 -0
- package/base/Base/UserMenu/SignOut.js +19 -0
- package/base/Base/UserMenu/SignOut.js.map +1 -0
- package/base/Base/UserMenu/UserInfo.d.ts +6 -0
- package/base/Base/UserMenu/UserInfo.js +43 -0
- package/base/Base/UserMenu/UserInfo.js.map +1 -0
- package/base/Base/UserMenu.d.ts +2 -0
- package/base/Base/UserMenu.js +21 -0
- package/base/Base/UserMenu.js.map +1 -0
- package/base/Base.d.ts +1 -1
- package/base/Base.js +11 -90
- package/base/Base.js.map +1 -1
- package/base/TelemetryAdminAppStart.d.ts +1 -0
- package/base/TelemetryAdminAppStart.js +19 -0
- package/base/TelemetryAdminAppStart.js.map +1 -0
- package/base/WebinyVersion.d.ts +2 -0
- package/base/WebinyVersion.js +24 -0
- package/base/WebinyVersion.js.map +1 -0
- package/base/createRootContainer.d.ts +2 -0
- package/base/createRootContainer.js +55 -0
- package/base/createRootContainer.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 +10 -18
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/UiProviders.d.ts +1 -0
- package/base/providers/UiProviders.js +35 -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/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 +74 -0
- package/base/ui/FileManager.js +66 -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/LoginScreen.d.ts +40 -2
- package/base/ui/LoginScreen.js +22 -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/BulkActions/Worker.d.ts +82 -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 +4 -0
- package/components/Buttons/Buttons.styles.js +17 -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/DeveloperMode/DeveloperMode.d.ts +11 -0
- package/components/DeveloperMode/DeveloperMode.js +17 -0
- package/components/DeveloperMode/DeveloperMode.js.map +1 -0
- package/components/DeveloperMode/index.d.ts +2 -0
- package/components/DeveloperMode/index.js +3 -0
- package/components/DeveloperMode/index.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 +38 -0
- package/components/Dialogs/DialogsContext.js +132 -0
- package/components/Dialogs/DialogsContext.js.map +1 -0
- package/components/Dialogs/useDialogs.d.ts +2 -0
- package/components/Dialogs/useDialogs.js +11 -0
- package/components/Dialogs/useDialogs.js.map +1 -0
- package/components/EmptyView.d.ts +4 -4
- package/components/EmptyView.js +30 -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 +94 -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 +110 -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 +67 -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 +127 -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 +12 -0
- package/components/LexicalEditor/LexicalEditor.js +40 -0
- package/components/LexicalEditor/LexicalEditor.js.map +1 -0
- package/components/LexicalEditor/LexicalLinkForm.d.ts +6 -0
- package/components/LexicalEditor/LexicalLinkForm.js +94 -0
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -0
- package/components/LexicalEditor/index.d.ts +3 -0
- package/components/LexicalEditor/index.js +5 -0
- package/components/LexicalEditor/index.js.map +1 -0
- package/components/LexicalEditor/lexicalValueWithHtml.d.ts +7 -0
- package/components/LexicalEditor/lexicalValueWithHtml.js +36 -0
- package/components/LexicalEditor/lexicalValueWithHtml.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/NavigationPrompt.d.ts +27 -0
- package/components/NavigationPrompt.js +39 -0
- package/components/NavigationPrompt.js.map +1 -0
- package/components/NotAuthorizedError/NotAuthorizedError.d.ts +2 -0
- package/components/NotAuthorizedError/NotAuthorizedError.js +20 -0
- package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -0
- package/components/NotAuthorizedError/SecureRouteError.svg +1 -0
- package/components/NotAuthorizedError/index.d.ts +1 -0
- package/components/NotAuthorizedError/index.js +3 -0
- package/components/NotAuthorizedError/index.js.map +1 -0
- 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 +43 -154
- 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 +22 -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.d.ts +1 -1
- 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 +2 -4
- package/components/Permissions/Permissions.js +46 -50
- 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 +20 -28
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.d.ts +4 -2
- package/components/Permissions/index.js +5 -26
- package/components/Permissions/index.js.map +1 -1
- package/components/RegisterFeature.d.ts +11 -0
- package/components/RegisterFeature.js +26 -0
- package/components/RegisterFeature.js.map +1 -0
- 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/RoleAutocomplete/graphql.d.ts +1 -0
- package/components/RoleAutocomplete/graphql.js +18 -0
- package/components/RoleAutocomplete/graphql.js.map +1 -0
- package/components/RoleAutocomplete/index.d.ts +5 -0
- package/components/RoleAutocomplete/index.js +18 -0
- package/components/RoleAutocomplete/index.js.map +1 -0
- package/components/RolesMultiAutocomplete/graphql.d.ts +1 -0
- package/components/RolesMultiAutocomplete/graphql.js +23 -0
- package/components/RolesMultiAutocomplete/graphql.js.map +1 -0
- package/components/RolesMultiAutocomplete/index.d.ts +5 -0
- package/components/RolesMultiAutocomplete/index.js +19 -0
- package/components/RolesMultiAutocomplete/index.js.map +1 -0
- package/components/SearchUI.d.ts +2 -2
- package/components/SearchUI.js +24 -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.d.ts +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 +55 -85
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +21 -8
- package/components/SingleImageUpload.js +41 -77
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +11 -9
- package/components/SplitView/SplitView.js +61 -71
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.d.ts +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/TeamAutocomplete/graphql.d.ts +1 -0
- package/components/TeamAutocomplete/graphql.js +18 -0
- package/components/TeamAutocomplete/graphql.js.map +1 -0
- package/components/TeamAutocomplete/index.d.ts +5 -0
- package/components/TeamAutocomplete/index.js +18 -0
- package/components/TeamAutocomplete/index.js.map +1 -0
- package/components/TeamsMultiAutocomplete/graphql.d.ts +1 -0
- package/components/TeamsMultiAutocomplete/graphql.js +23 -0
- package/components/TeamsMultiAutocomplete/graphql.js.map +1 -0
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -0
- package/components/TeamsMultiAutocomplete/index.js +19 -0
- package/components/TeamsMultiAutocomplete/index.js.map +1 -0
- package/components/Wcp.d.ts +17 -0
- package/components/Wcp.js +41 -0
- package/components/Wcp.js.map +1 -0
- package/components/index.d.ts +30 -1
- package/components/index.js +30 -11
- package/components/index.js.map +1 -1
- package/config/AdminConfig/Dashboard.d.ts +3 -0
- package/config/AdminConfig/Dashboard.js +6 -0
- package/config/AdminConfig/Dashboard.js.map +1 -0
- package/config/AdminConfig/LexicalTheme/Color.d.ts +11 -0
- package/config/AdminConfig/LexicalTheme/Color.js +45 -0
- package/config/AdminConfig/LexicalTheme/Color.js.map +1 -0
- package/config/AdminConfig/LexicalTheme/Typography.d.ts +30 -0
- package/config/AdminConfig/LexicalTheme/Typography.js +79 -0
- package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -0
- package/config/AdminConfig/LexicalTheme.d.ts +9 -0
- package/config/AdminConfig/LexicalTheme.js +8 -0
- package/config/AdminConfig/LexicalTheme.js.map +1 -0
- package/config/AdminConfig/Logo.d.ts +24 -0
- package/config/AdminConfig/Logo.js +21 -0
- package/config/AdminConfig/Logo.js.map +1 -0
- 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 +24 -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 +40 -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 +40 -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 +352 -0
- package/config/AdminConfig/Menu.js +85 -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/Security.d.ts +3 -0
- package/config/AdminConfig/Security.js +6 -0
- package/config/AdminConfig/Security.js.map +1 -0
- package/config/AdminConfig/SecurityPermissions.d.ts +17 -0
- package/config/AdminConfig/SecurityPermissions.js +31 -0
- package/config/AdminConfig/SecurityPermissions.js.map +1 -0
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +24 -0
- package/config/AdminConfig/Tenant/TenantLogo.js +24 -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 +19 -0
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -0
- package/config/AdminConfig/Tenant.d.ts +49 -0
- package/config/AdminConfig/Tenant.js +14 -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/Title.d.ts +23 -0
- package/config/AdminConfig/Title.js +16 -0
- package/config/AdminConfig/Title.js.map +1 -0
- package/config/AdminConfig/Widget.d.ts +15 -0
- package/config/AdminConfig/Widget.js +36 -0
- package/config/AdminConfig/Widget.js.map +1 -0
- package/config/AdminConfig.d.ts +486 -0
- package/config/AdminConfig.js +73 -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/css/tokens.css +379 -0
- package/css/typography.css +70 -0
- package/domain/Identity.d.ts +59 -0
- package/domain/Identity.js +96 -0
- package/domain/Identity.js.map +1 -0
- package/errors/ErrorOverlayNetworkErrorHandler.d.ts +11 -0
- package/errors/ErrorOverlayNetworkErrorHandler.js +66 -0
- package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -0
- package/errors/TenantIsDisabled.d.ts +2 -0
- package/errors/TenantIsDisabled.js +23 -0
- package/errors/TenantIsDisabled.js.map +1 -0
- package/exports/admin/build-params.d.ts +1 -0
- package/exports/admin/build-params.js +3 -0
- package/exports/admin/build-params.js.map +1 -0
- package/exports/admin/configs.d.ts +1 -0
- package/exports/admin/configs.js +3 -0
- package/exports/admin/configs.js.map +1 -0
- package/exports/admin/form.d.ts +11 -0
- package/exports/admin/form.js +12 -0
- package/exports/admin/form.js.map +1 -0
- package/exports/admin/security.d.ts +8 -0
- package/exports/admin/security.js +10 -0
- package/exports/admin/security.js.map +1 -0
- package/exports/admin/tenancy.d.ts +2 -0
- package/exports/admin/tenancy.js +4 -0
- package/exports/admin/tenancy.js.map +1 -0
- package/exports/admin/ui.d.ts +4 -0
- package/exports/admin/ui.js +6 -0
- package/exports/admin/ui.js.map +1 -0
- package/exports/admin.d.ts +7 -0
- package/exports/admin.js +9 -0
- package/exports/admin.js.map +1 -0
- package/features/apolloClient/abstraction.d.ts +5 -0
- package/features/apolloClient/abstraction.js +4 -0
- package/features/apolloClient/abstraction.js.map +1 -0
- package/features/apolloClient/feature.d.ts +2 -0
- package/features/apolloClient/feature.js +39 -0
- package/features/apolloClient/feature.js.map +1 -0
- package/features/buildParams/BuildParams.d.ts +9 -0
- package/features/buildParams/BuildParams.js +18 -0
- package/features/buildParams/BuildParams.js.map +1 -0
- package/features/buildParams/abstractions.d.ts +15 -0
- package/features/buildParams/abstractions.js +5 -0
- package/features/buildParams/abstractions.js.map +1 -0
- package/features/buildParams/feature.d.ts +1 -0
- package/features/buildParams/feature.js +10 -0
- package/features/buildParams/feature.js.map +1 -0
- package/features/buildParams/index.d.ts +2 -0
- package/features/buildParams/index.js +4 -0
- package/features/buildParams/index.js.map +1 -0
- package/features/security/AuthenticationContext/AuthenticationContext.d.ts +15 -0
- package/features/security/AuthenticationContext/AuthenticationContext.js +31 -0
- package/features/security/AuthenticationContext/AuthenticationContext.js.map +1 -0
- package/features/security/AuthenticationContext/GraphQLClientDecorator.d.ts +12 -0
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js +30 -0
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js.map +1 -0
- package/features/security/AuthenticationContext/InternalIdTokenProvider.d.ts +10 -0
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js +17 -0
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js.map +1 -0
- package/features/security/AuthenticationContext/abstractions.d.ts +26 -0
- package/features/security/AuthenticationContext/abstractions.js +5 -0
- package/features/security/AuthenticationContext/abstractions.js.map +1 -0
- package/features/security/AuthenticationContext/feature.d.ts +3 -0
- package/features/security/AuthenticationContext/feature.js +20 -0
- package/features/security/AuthenticationContext/feature.js.map +1 -0
- package/features/security/AuthenticationContext/index.d.ts +1 -0
- package/features/security/AuthenticationContext/index.js +3 -0
- package/features/security/AuthenticationContext/index.js.map +1 -0
- package/features/security/AuthenticationContext/types.d.ts +11 -0
- package/features/security/AuthenticationContext/types.js +3 -0
- package/features/security/AuthenticationContext/types.js.map +1 -0
- package/features/security/IdentityContext/IdentityContext.d.ts +13 -0
- package/features/security/IdentityContext/IdentityContext.js +24 -0
- package/features/security/IdentityContext/IdentityContext.js.map +1 -0
- package/features/security/IdentityContext/abstractions.d.ts +10 -0
- package/features/security/IdentityContext/abstractions.js +4 -0
- package/features/security/IdentityContext/abstractions.js.map +1 -0
- package/features/security/IdentityContext/feature.d.ts +3 -0
- package/features/security/IdentityContext/feature.js +16 -0
- package/features/security/IdentityContext/feature.js.map +1 -0
- package/features/security/IdentityContext/index.d.ts +2 -0
- package/features/security/IdentityContext/index.js +4 -0
- package/features/security/IdentityContext/index.js.map +1 -0
- package/features/security/LogIn/IdentityMapper.d.ts +9 -0
- package/features/security/LogIn/IdentityMapper.js +13 -0
- package/features/security/LogIn/IdentityMapper.js.map +1 -0
- package/features/security/LogIn/LogInGateway.d.ts +11 -0
- package/features/security/LogIn/LogInGateway.js +27 -0
- package/features/security/LogIn/LogInGateway.js.map +1 -0
- package/features/security/LogIn/LogInRepository.d.ts +14 -0
- package/features/security/LogIn/LogInRepository.js +19 -0
- package/features/security/LogIn/LogInRepository.js.map +1 -0
- package/features/security/LogIn/LogInUseCase.d.ts +15 -0
- package/features/security/LogIn/LogInUseCase.js +40 -0
- package/features/security/LogIn/LogInUseCase.js.map +1 -0
- package/features/security/LogIn/abstractions.d.ts +48 -0
- package/features/security/LogIn/abstractions.js +19 -0
- package/features/security/LogIn/abstractions.js.map +1 -0
- package/features/security/LogIn/createLoginMutation.d.ts +1 -0
- package/features/security/LogIn/createLoginMutation.js +49 -0
- package/features/security/LogIn/createLoginMutation.js.map +1 -0
- package/features/security/LogIn/feature.d.ts +3 -0
- package/features/security/LogIn/feature.js +22 -0
- package/features/security/LogIn/feature.js.map +1 -0
- package/features/security/LogIn/index.d.ts +1 -0
- package/features/security/LogIn/index.js +3 -0
- package/features/security/LogIn/index.js.map +1 -0
- package/features/security/LogOut/LogOutUseCase.d.ts +13 -0
- package/features/security/LogOut/LogOutUseCase.js +23 -0
- package/features/security/LogOut/LogOutUseCase.js.map +1 -0
- package/features/security/LogOut/abstractions.d.ts +7 -0
- package/features/security/LogOut/abstractions.js +4 -0
- package/features/security/LogOut/abstractions.js.map +1 -0
- package/features/security/LogOut/feature.d.ts +3 -0
- package/features/security/LogOut/feature.js +16 -0
- package/features/security/LogOut/feature.js.map +1 -0
- package/features/security/LogOut/index.d.ts +2 -0
- package/features/security/LogOut/index.js +4 -0
- package/features/security/LogOut/index.js.map +1 -0
- package/features/security/SecurityFeature.d.ts +1 -0
- package/features/security/SecurityFeature.js +16 -0
- package/features/security/SecurityFeature.js.map +1 -0
- package/features/telemetry/TelemetryService.d.ts +6 -0
- package/features/telemetry/TelemetryService.js +20 -0
- package/features/telemetry/TelemetryService.js.map +1 -0
- package/features/telemetry/abstractions.d.ts +7 -0
- package/features/telemetry/abstractions.js +4 -0
- package/features/telemetry/abstractions.js.map +1 -0
- package/features/telemetry/feature.d.ts +3 -0
- package/features/telemetry/feature.js +16 -0
- package/features/telemetry/feature.js.map +1 -0
- package/features/telemetry/index.d.ts +2 -0
- package/features/telemetry/index.js +4 -0
- package/features/telemetry/index.js.map +1 -0
- package/features/tenancy/GraphQLClientDecorator.d.ts +12 -0
- package/features/tenancy/GraphQLClientDecorator.js +27 -0
- package/features/tenancy/GraphQLClientDecorator.js.map +1 -0
- package/features/tenancy/TenantContext.d.ts +17 -0
- package/features/tenancy/TenantContext.js +61 -0
- package/features/tenancy/TenantContext.js.map +1 -0
- package/features/tenancy/abstractions.d.ts +14 -0
- package/features/tenancy/abstractions.js +4 -0
- package/features/tenancy/abstractions.js.map +1 -0
- package/features/tenancy/feature.d.ts +5 -0
- package/features/tenancy/feature.js +41 -0
- package/features/tenancy/feature.js.map +1 -0
- package/features/tenancy/types.d.ts +4 -0
- package/features/tenancy/types.js +3 -0
- package/features/tenancy/types.js.map +1 -0
- package/features/wcp/ReactLicense.d.ts +19 -0
- package/features/wcp/ReactLicense.js +46 -0
- package/features/wcp/ReactLicense.js.map +1 -0
- package/features/wcp/WcpGateway.d.ts +10 -0
- package/features/wcp/WcpGateway.js +73 -0
- package/features/wcp/WcpGateway.js.map +1 -0
- package/features/wcp/WcpService.d.ts +20 -0
- package/features/wcp/WcpService.js +84 -0
- package/features/wcp/WcpService.js.map +1 -0
- package/features/wcp/abstractions.d.ts +19 -0
- package/features/wcp/abstractions.js +5 -0
- package/features/wcp/abstractions.js.map +1 -0
- package/features/wcp/feature.d.ts +3 -0
- package/features/wcp/feature.js +18 -0
- package/features/wcp/feature.js.map +1 -0
- package/features/wcp/types.d.ts +21 -0
- package/features/wcp/types.js +3 -0
- package/features/wcp/types.js.map +1 -0
- package/hooks/index.d.ts +11 -0
- package/hooks/index.js +13 -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 +29 -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 +1 -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/hooks/useToggler.d.ts +7 -0
- package/hooks/useToggler.js +15 -0
- package/hooks/useToggler.js.map +1 -0
- package/index.d.ts +34 -33
- package/index.js +45 -324
- package/index.js.map +1 -1
- package/lexical.css +2 -0
- package/package.json +66 -62
- package/permissions/PermissionRenderer.d.ts +6 -0
- package/permissions/PermissionRenderer.js +219 -0
- package/permissions/PermissionRenderer.js.map +1 -0
- package/permissions/PermissionValueContext.d.ts +11 -0
- package/permissions/PermissionValueContext.js +23 -0
- package/permissions/PermissionValueContext.js.map +1 -0
- package/permissions/createHasPermission.d.ts +3 -0
- package/permissions/createHasPermission.js +36 -0
- package/permissions/createHasPermission.js.map +1 -0
- package/permissions/createPermissionSchema.d.ts +2 -0
- package/permissions/createPermissionSchema.js +8 -0
- package/permissions/createPermissionSchema.js.map +1 -0
- package/permissions/index.d.ts +8 -0
- package/permissions/index.js +8 -0
- package/permissions/index.js.map +1 -0
- package/permissions/types.d.ts +242 -0
- package/permissions/types.js +3 -0
- package/permissions/types.js.map +1 -0
- package/permissions/usePermissionForm.d.ts +17 -0
- package/permissions/usePermissionForm.js +256 -0
- package/permissions/usePermissionForm.js.map +1 -0
- package/permissions/usePermissions.d.ts +3 -0
- package/permissions/usePermissions.js +180 -0
- package/permissions/usePermissions.js.map +1 -0
- package/plugins/MenuPlugin.d.ts +1 -1
- package/plugins/MenuPlugin.js +17 -41
- package/plugins/MenuPlugin.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstaller.d.ts +8 -0
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js +70 -0
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.d.ts +2 -0
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js +17 -0
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/index.d.ts +1 -0
- package/presentation/installation/components/SystemInstaller/index.js +3 -0
- package/presentation/installation/components/SystemInstaller/index.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.d.ts +8 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +32 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.d.ts +1 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +15 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.d.ts +7 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +69 -0
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.d.ts +7 -0
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js +95 -0
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/Center.d.ts +4 -0
- package/presentation/installation/components/SystemInstaller/steps/Center.js +10 -0
- package/presentation/installation/components/SystemInstaller/steps/Center.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/Container.d.ts +8 -0
- package/presentation/installation/components/SystemInstaller/steps/Container.js +28 -0
- package/presentation/installation/components/SystemInstaller/steps/Container.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.d.ts +11 -0
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +58 -0
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.d.ts +7 -0
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js +21 -0
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/introduction.svg +154 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.d.ts +1 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js +3 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.d.ts +10 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js +63 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.d.ts +24 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +138 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.d.ts +11 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js +30 -0
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/abstractions.d.ts +59 -0
- package/presentation/installation/presenters/SystemInstaller/abstractions.js +6 -0
- package/presentation/installation/presenters/SystemInstaller/abstractions.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/feature.d.ts +3 -0
- package/presentation/installation/presenters/SystemInstaller/feature.js +20 -0
- package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -0
- package/presentation/installation/presenters/SystemInstaller/index.d.ts +3 -0
- package/presentation/installation/presenters/SystemInstaller/index.js +4 -0
- package/presentation/installation/presenters/SystemInstaller/index.js.map +1 -0
- package/presentation/security/components/HasPermission.d.ts +10 -0
- package/presentation/security/components/HasPermission.js +31 -0
- package/presentation/security/components/HasPermission.js.map +1 -0
- package/presentation/security/components/SecureRoute.d.ts +7 -0
- package/presentation/security/components/SecureRoute.js +16 -0
- package/presentation/security/components/SecureRoute.js.map +1 -0
- package/presentation/security/hooks/useAuthentication.d.ts +9 -0
- package/presentation/security/hooks/useAuthentication.js +24 -0
- package/presentation/security/hooks/useAuthentication.js.map +1 -0
- package/presentation/security/hooks/useIdentity.d.ts +6 -0
- package/presentation/security/hooks/useIdentity.js +25 -0
- package/presentation/security/hooks/useIdentity.js.map +1 -0
- package/presentation/security/hooks/useSecurity.d.ts +10 -0
- package/presentation/security/hooks/useSecurity.js +28 -0
- package/presentation/security/hooks/useSecurity.js.map +1 -0
- package/presentation/tenancy/TenancyProvider.d.ts +6 -0
- package/presentation/tenancy/TenancyProvider.js +43 -0
- package/presentation/tenancy/TenancyProvider.js.map +1 -0
- package/presentation/tenancy/createTenancyProvider.d.ts +1 -0
- package/presentation/tenancy/createTenancyProvider.js +14 -0
- package/presentation/tenancy/createTenancyProvider.js.map +1 -0
- package/presentation/tenancy/useTenantContext.d.ts +5 -0
- package/presentation/tenancy/useTenantContext.js +24 -0
- package/presentation/tenancy/useTenantContext.js.map +1 -0
- package/presentation/wcp/WcpProvider.d.ts +7 -0
- package/presentation/wcp/WcpProvider.js +26 -0
- package/presentation/wcp/WcpProvider.js.map +1 -0
- package/presentation/wcp/useWcp.d.ts +2 -0
- package/presentation/wcp/useWcp.js +18 -0
- package/presentation/wcp/useWcp.js.map +1 -0
- package/routes.d.ts +6 -0
- package/routes.js +17 -0
- package/routes.js.map +1 -0
- package/styles.scss +7 -2
- package/types.d.ts +8 -92
- package/types.js +2 -4
- package/types.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/providers/TelemetryProvider.d.ts +0 -2
- package/base/providers/TelemetryProvider.js +0 -31
- package/base/providers/TelemetryProvider.js.map +0 -1
- package/base/providers/ViewCompositionProvider.d.ts +0 -17
- package/base/providers/ViewCompositionProvider.js +0 -57
- package/base/providers/ViewCompositionProvider.js.map +0 -1
- package/base/ui/LocaleSelector.d.ts +0 -2
- package/base/ui/LocaleSelector.js +0 -15
- package/base/ui/LocaleSelector.js.map +0 -1
- 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/AppInstaller/AppInstaller.d.ts +0 -7
- package/components/AppInstaller/AppInstaller.js +0 -149
- package/components/AppInstaller/AppInstaller.js.map +0 -1
- package/components/AppInstaller/Sidebar.d.ts +0 -9
- package/components/AppInstaller/Sidebar.js +0 -155
- package/components/AppInstaller/Sidebar.js.map +0 -1
- package/components/AppInstaller/assets/sign-in-divider.svg +0 -19
- package/components/AppInstaller/index.d.ts +0 -2
- package/components/AppInstaller/index.js +0 -22
- package/components/AppInstaller/index.js.map +0 -1
- package/components/AppInstaller/styled.d.ts +0 -9
- package/components/AppInstaller/styled.js +0 -87
- package/components/AppInstaller/styled.js.map +0 -1
- package/components/AppInstaller/useInstaller.d.ts +0 -31
- package/components/AppInstaller/useInstaller.js +0 -265
- package/components/AppInstaller/useInstaller.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/components/RichTextEditor/RichTextEditor.d.ts +0 -3
- package/components/RichTextEditor/RichTextEditor.js +0 -23
- package/components/RichTextEditor/RichTextEditor.js.map +0 -1
- package/components/RichTextEditor/index.d.ts +0 -2
- package/components/RichTextEditor/index.js +0 -19
- package/components/RichTextEditor/index.js.map +0 -1
- package/components/RichTextEditor/styles.scss +0 -96
- package/components/RichTextEditor/tools/header/index.d.ts +0 -229
- package/components/RichTextEditor/tools/header/index.js +0 -691
- package/components/RichTextEditor/tools/header/index.js.map +0 -1
- package/components/RichTextEditor/tools/header/styles.scss +0 -48
- package/components/RichTextEditor/tools/image/index.d.ts +0 -124
- package/components/RichTextEditor/tools/image/index.js +0 -244
- package/components/RichTextEditor/tools/image/index.js.map +0 -1
- package/components/RichTextEditor/tools/image/styles.scss +0 -90
- package/components/RichTextEditor/tools/image/svgs.d.ts +0 -6
- package/components/RichTextEditor/tools/image/svgs.js +0 -12
- package/components/RichTextEditor/tools/image/svgs.js.map +0 -1
- package/components/RichTextEditor/tools/image/tunes.d.ts +0 -57
- package/components/RichTextEditor/tools/image/tunes.js +0 -129
- package/components/RichTextEditor/tools/image/tunes.js.map +0 -1
- package/components/RichTextEditor/tools/image/types.d.ts +0 -29
- package/components/RichTextEditor/tools/image/types.js +0 -5
- package/components/RichTextEditor/tools/image/types.js.map +0 -1
- package/components/RichTextEditor/tools/image/ui.d.ts +0 -122
- package/components/RichTextEditor/tools/image/ui.js +0 -278
- package/components/RichTextEditor/tools/image/ui.js.map +0 -1
- package/components/RichTextEditor/tools/paragraph/index.d.ts +0 -209
- package/components/RichTextEditor/tools/paragraph/index.js +0 -488
- package/components/RichTextEditor/tools/paragraph/index.js.map +0 -1
- package/components/RichTextEditor/tools/paragraph/styles.scss +0 -29
- package/components/RichTextEditor/tools/textColor/index.d.ts +0 -64
- package/components/RichTextEditor/tools/textColor/index.js +0 -245
- package/components/RichTextEditor/tools/textColor/index.js.map +0 -1
- package/components/RichTextEditor/tools/textColor/styles.scss +0 -21
- package/components/RichTextEditor/tools/utils.d.ts +0 -19
- package/components/RichTextEditor/tools/utils.js +0 -31
- package/components/RichTextEditor/tools/utils.js.map +0 -1
- package/components/Routes.d.ts +0 -6
- package/components/Routes.js +0 -42
- package/components/Routes.js.map +0 -1
- package/plugins/FileManagerFileTypePlugin.d.ts +0 -33
- package/plugins/FileManagerFileTypePlugin.js +0 -48
- package/plugins/FileManagerFileTypePlugin.js.map +0 -1
- package/plugins/PermissionRendererPlugin.d.ts +0 -22
- package/plugins/PermissionRendererPlugin.js +0 -43
- package/plugins/PermissionRendererPlugin.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/plugins/uiLayoutRenderer/index.d.ts +0 -2
- package/plugins/uiLayoutRenderer/index.js +0 -61
- package/plugins/uiLayoutRenderer/index.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/UIElement.d.ts +0 -2
- package/ui/UIElement.js +0 -18
- package/ui/UIElement.js.map +0 -1
- package/ui/UILayout.d.ts +0 -1
- package/ui/UILayout.js +0 -18
- package/ui/UILayout.js.map +0 -1
- package/ui/UIRenderer.d.ts +0 -2
- package/ui/UIRenderer.js +0 -12
- package/ui/UIRenderer.js.map +0 -1
- package/ui/UIView.d.ts +0 -2
- package/ui/UIView.js +0 -24
- package/ui/UIView.js.map +0 -1
- package/ui/elements/AccordionElement.d.ts +0 -27
- package/ui/elements/AccordionElement.js +0 -84
- package/ui/elements/AccordionElement.js.map +0 -1
- package/ui/elements/ButtonElement.d.ts +0 -24
- package/ui/elements/ButtonElement.js +0 -86
- package/ui/elements/ButtonElement.js.map +0 -1
- package/ui/elements/ButtonGroupElement.d.ts +0 -6
- package/ui/elements/ButtonGroupElement.js +0 -48
- package/ui/elements/ButtonGroupElement.js.map +0 -1
- package/ui/elements/GenericElement.d.ts +0 -1
- package/ui/elements/GenericElement.js +0 -16
- package/ui/elements/GenericElement.js.map +0 -1
- package/ui/elements/LabelElement.d.ts +0 -16
- package/ui/elements/LabelElement.js +0 -46
- package/ui/elements/LabelElement.js.map +0 -1
- package/ui/elements/NavigationMenuElement.d.ts +0 -33
- package/ui/elements/NavigationMenuElement.js +0 -144
- package/ui/elements/NavigationMenuElement.js.map +0 -1
- package/ui/elements/PanelElement.d.ts +0 -3
- package/ui/elements/PanelElement.js +0 -22
- package/ui/elements/PanelElement.js.map +0 -1
- package/ui/elements/PlaceholderElement.d.ts +0 -6
- package/ui/elements/PlaceholderElement.js +0 -33
- package/ui/elements/PlaceholderElement.js.map +0 -1
- package/ui/elements/SmallButtonElement.d.ts +0 -6
- package/ui/elements/SmallButtonElement.js +0 -45
- package/ui/elements/SmallButtonElement.js.map +0 -1
- package/ui/elements/TypographyElement.d.ts +0 -13
- package/ui/elements/TypographyElement.js +0 -48
- package/ui/elements/TypographyElement.js.map +0 -1
- package/ui/elements/ViewElement.d.ts +0 -1
- package/ui/elements/ViewElement.js +0 -16
- package/ui/elements/ViewElement.js.map +0 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +0 -6
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +0 -44
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +0 -1
- package/ui/elements/form/DynamicFieldsetElement.d.ts +0 -43
- package/ui/elements/form/DynamicFieldsetElement.js +0 -135
- package/ui/elements/form/DynamicFieldsetElement.js.map +0 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElement.d.ts +0 -4
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +0 -26
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +0 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +0 -7
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +0 -73
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +0 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +0 -13
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +0 -104
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +0 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +0 -20
- package/ui/elements/form/FileManagerElement/styled.js +0 -115
- package/ui/elements/form/FileManagerElement/styled.js.map +0 -1
- package/ui/elements/form/FileManagerElement.d.ts +0 -24
- package/ui/elements/form/FileManagerElement.js +0 -88
- package/ui/elements/form/FileManagerElement.js.map +0 -1
- package/ui/elements/form/FormElement.d.ts +0 -21
- package/ui/elements/form/FormElement.js +0 -45
- package/ui/elements/form/FormElement.js.map +0 -1
- package/ui/elements/form/FormFieldElement.d.ts +0 -56
- package/ui/elements/form/FormFieldElement.js +0 -173
- package/ui/elements/form/FormFieldElement.js.map +0 -1
- package/ui/elements/form/HiddenElement.d.ts +0 -6
- package/ui/elements/form/HiddenElement.js +0 -47
- package/ui/elements/form/HiddenElement.js.map +0 -1
- package/ui/elements/form/InputElement.d.ts +0 -7
- package/ui/elements/form/InputElement.js +0 -54
- package/ui/elements/form/InputElement.js.map +0 -1
- package/ui/elements/form/PasswordElement.d.ts +0 -6
- package/ui/elements/form/PasswordElement.js +0 -51
- package/ui/elements/form/PasswordElement.js.map +0 -1
- package/ui/elements/form/README.md +0 -2
- package/ui/elements/form/SelectElement.d.ts +0 -15
- package/ui/elements/form/SelectElement.js +0 -69
- package/ui/elements/form/SelectElement.js.map +0 -1
- package/ui/elements/form/TextareaElement.d.ts +0 -15
- package/ui/elements/form/TextareaElement.js +0 -55
- package/ui/elements/form/TextareaElement.js.map +0 -1
- package/ui/views/AdminView/ContentElement.d.ts +0 -4
- package/ui/views/AdminView/ContentElement.js +0 -54
- package/ui/views/AdminView/ContentElement.js.map +0 -1
- package/ui/views/AdminView/HeaderElement.d.ts +0 -13
- package/ui/views/AdminView/HeaderElement.js +0 -104
- package/ui/views/AdminView/HeaderElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +0 -6
- package/ui/views/AdminView/HeaderSectionCenterElement.js +0 -42
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +0 -6
- package/ui/views/AdminView/HeaderSectionLeftElement.js +0 -42
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +0 -6
- package/ui/views/AdminView/HeaderSectionRightElement.js +0 -42
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +0 -1
- package/ui/views/AdminView/components/Dialog.d.ts +0 -2
- package/ui/views/AdminView/components/Dialog.js +0 -46
- package/ui/views/AdminView/components/Dialog.js.map +0 -1
- package/ui/views/AdminView/components/Hamburger.d.ts +0 -3
- package/ui/views/AdminView/components/Hamburger.js +0 -31
- package/ui/views/AdminView/components/Hamburger.js.map +0 -1
- 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
- package/ui/views/FormView/FormContainerElement.d.ts +0 -12
- package/ui/views/FormView/FormContainerElement.js +0 -50
- package/ui/views/FormView/FormContainerElement.js.map +0 -1
- package/ui/views/FormView/FormContentElement.d.ts +0 -3
- package/ui/views/FormView/FormContentElement.js +0 -22
- package/ui/views/FormView/FormContentElement.js.map +0 -1
- package/ui/views/FormView/FormFooterElement.d.ts +0 -6
- package/ui/views/FormView/FormFooterElement.js +0 -49
- package/ui/views/FormView/FormFooterElement.js.map +0 -1
- package/ui/views/FormView/FormHeaderElement.d.ts +0 -14
- package/ui/views/FormView/FormHeaderElement.js +0 -81
- package/ui/views/FormView/FormHeaderElement.js.map +0 -1
- package/ui/views/FormView.d.ts +0 -40
- package/ui/views/FormView.js +0 -167
- package/ui/views/FormView.js.map +0 -1
- package/ui/views/OverlayView/ContentElement.d.ts +0 -6
- package/ui/views/OverlayView/ContentElement.js +0 -42
- package/ui/views/OverlayView/ContentElement.js.map +0 -1
- package/ui/views/OverlayView/HeaderElement.d.ts +0 -24
- package/ui/views/OverlayView/HeaderElement.js +0 -112
- package/ui/views/OverlayView/HeaderElement.js.map +0 -1
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +0 -13
- package/ui/views/OverlayView/HeaderTitleElement.js +0 -51
- package/ui/views/OverlayView/HeaderTitleElement.js.map +0 -1
- package/ui/views/OverlayView/useOverlayView.d.ts +0 -5
- package/ui/views/OverlayView/useOverlayView.js +0 -44
- package/ui/views/OverlayView/useOverlayView.js.map +0 -1
- package/ui/views/OverlayView.d.ts +0 -29
- package/ui/views/OverlayView.js +0 -165
- package/ui/views/OverlayView.js.map +0 -1
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +0 -11
- package/ui/views/SplitView/SplitViewPanelElement.js +0 -71
- package/ui/views/SplitView/SplitViewPanelElement.js.map +0 -1
- package/ui/views/SplitView.d.ts +0 -21
- package/ui/views/SplitView.js +0 -122
- package/ui/views/SplitView.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type React from \"react\";\n\n/**\n * A single permission object from the API.\n */\nexport interface Permission {\n name: string;\n [key: string]: any;\n}\n\n/**\n * An action definition on an entity.\n *\n * Built-in actions:\n * - `{ name: \"rwd\" }` — read/write/delete single-select (serialized as joined string, e.g. \"rw\")\n * - `{ name: \"pw\" }` — publish/unpublish multi-select (serialized as joined string, e.g. \"pu\")\n *\n * Custom actions:\n * - `{ name: \"install\", label: \"Install\" }` — boolean flag (serialized as `install: true`)\n */\nexport interface ActionDefinition {\n /** Key on the permission object (e.g. \"rwd\", \"pw\", \"install\") */\n name: string;\n /** Display label for the UI. Required for custom actions; ignored for built-in \"rwd\"/\"pw\". */\n label?: string;\n}\n\n/**\n * Defines an entity within a permission schema.\n */\nexport interface EntityDefinition {\n /** Unique ID, used for form field naming: ${id}AccessScope, ${id}RWD, etc. */\n id: string;\n /** Display title for the UI renderer (e.g. \"Files\", \"Settings\") */\n title?: string;\n /** Permission name emitted for this entity (e.g. \"fm.file\") */\n permission: string;\n /** Available access scopes */\n scopes: (\"full\" | \"own\")[];\n /** Action definitions for this entity */\n actions?: ActionDefinition[];\n /** Dependency on another entity */\n dependsOn?: {\n /** ID of parent entity */\n entity: string;\n /** Required action character (e.g. \"r\") */\n requires: string;\n };\n}\n\n/**\n * Configuration for creating a permission schema.\n */\nexport interface PermissionSchemaConfig {\n /** Permission prefix — used to filter permissions from the array */\n prefix: string;\n /**\n * Full access configuration.\n * - `true` — emits `{ name: \"${prefix}.*\" }`.\n * - `{ ...extras }` — emits `{ name: \"${prefix}.*\", ...extras }`.\n */\n fullAccess: boolean | { [key: string]: any };\n /**\n * Read-only access configuration. When defined, the schema supports a read-only tier.\n * - `true` — emits `{ name: \"${prefix}.*\", rwd: \"r\" }`.\n * - `Permission[]` — emits the array as-is.\n */\n readOnlyAccess?: boolean | Permission[];\n /** Entity definitions (optional — simple apps have none) */\n entities?: EntityDefinition[];\n}\n\n/**\n * A compiled permission schema returned by `createPermissionSchema`.\n */\nexport interface PermissionSchema {\n prefix: string;\n /**\n * Full access configuration.\n * - `true` — emits `{ name: \"${prefix}.*\" }`.\n * - `{ ...extras }` — emits `{ name: \"${prefix}.*\", ...extras }`.\n */\n fullAccess: boolean | { [key: string]: any };\n /**\n * Read-only access configuration. When defined, the schema supports a read-only tier.\n * - `true` — emits `{ name: \"${prefix}.*\", rwd: \"r\" }`.\n * - `Permission[]` — emits the array as-is.\n */\n readOnlyAccess?: boolean | Permission[];\n entities?: EntityDefinition[];\n}\n\n/**\n * Options passed to the `usePermissionForm` hook.\n */\nexport interface UsePermissionFormOptions {\n value: Permission[];\n onChange: (value: Permission[]) => void;\n /** Merge extra fields into deserialized form data (for CMS endpoints, resource scopes, etc.) */\n deserialize?: (permissions: Permission[]) => Record<string, any>;\n /** Transform or extend the core-serialized permissions (for CMS endpoints, resource scopes, etc.) */\n serialize?: (formData: Record<string, any>, corePermissions: Permission[]) => Permission[];\n}\n\n/**\n * Return value of `usePermissionForm`.\n */\nexport interface UsePermissionFormResult {\n formData: Record<string, any>;\n onFormChange: (data: Record<string, any>) => void;\n}\n\n/**\n * Configuration for a permission renderer registered via AdminConfig.\n *\n * Either `schema` or `element` must be provided:\n * - `schema`: uses the built-in PermissionRenderer for auto-generated UI.\n * - `element`: uses a custom React element for full control.\n */\nexport type PermissionRendererConfig = PermissionRendererConfigBase &\n (\n | { schema: PermissionSchema; element?: never }\n | { schema?: never; element: React.ReactElement }\n );\n\ninterface PermissionRendererConfigBase {\n name: string;\n title: string;\n description?: string;\n icon?: React.ReactElement;\n system?: boolean;\n}\n\n/**\n * Item that may have an owner (used for own-scope permission checks).\n */\nexport interface OwnableItem {\n createdBy?: { id: string } | null;\n}\n\n/**\n * Extract the union of entity definitions from a schema config type.\n */\ntype EntitiesOf<S extends PermissionSchemaConfig> = S extends {\n entities: ReadonlyArray<infer E extends EntityDefinition>;\n}\n ? E\n : never;\n\n/**\n * Extract entity IDs whose actions array contains an action with the given name.\n */\ntype EntityIdWithAction<S extends PermissionSchemaConfig, A extends string> = {\n [K in EntitiesOf<S> as K extends { actions: ReadonlyArray<infer Act> }\n ? Act extends { name: A }\n ? K[\"id\"]\n : never\n : never]: never;\n} extends infer M\n ? keyof M & string\n : never;\n\n/**\n * Entity IDs that have the \"rwd\" action.\n */\nexport type RwdEntityId<S extends PermissionSchemaConfig> = EntityIdWithAction<S, \"rwd\">;\n\n/**\n * Entity IDs that have the \"pw\" action.\n */\nexport type PwEntityId<S extends PermissionSchemaConfig> = EntityIdWithAction<S, \"pw\">;\n\n/**\n * All entity IDs in the schema.\n */\nexport type AllEntityIds<S extends PermissionSchemaConfig> = EntitiesOf<S>[\"id\"];\n\n/**\n * Custom (non-builtin) action names across all entities.\n */\nexport type CustomActionNames<S extends PermissionSchemaConfig> = Exclude<\n EntitiesOf<S> extends { actions: ReadonlyArray<infer Act extends ActionDefinition> }\n ? Act[\"name\"]\n : never,\n \"rwd\" | \"pw\"\n>;\n\n/**\n * The return type of `usePermissions(schema)`.\n *\n * When the schema has literal entity types, methods are narrowed to only accept valid entity IDs.\n * When the schema is dynamically typed, all methods accept `string`.\n */\nexport type UsePermissionsResult<S extends PermissionSchemaConfig> =\n string extends AllEntityIds<S> ? UsePermissionsResultUntyped : UsePermissionsResultTyped<S>;\n\nexport interface UsePermissionsResultUntyped {\n canAccess: (entityId: string) => boolean;\n canRead: (entityId: string) => boolean;\n canCreate: (entityId: string) => boolean;\n canEdit: (entityId: string, item?: OwnableItem) => boolean;\n canDelete: (entityId: string, item?: OwnableItem) => boolean;\n canPublish: (entityId: string) => boolean;\n canUnpublish: (entityId: string) => boolean;\n canAction: (action: string, entityId: string) => boolean;\n}\n\n/**\n * Action values accepted by `HasPermission`.\n *\n * Built-in actions are always available; custom action names from the schema are inferred automatically.\n */\nexport type HasPermissionAction<S extends PermissionSchemaConfig> =\n | \"read\"\n | \"create\"\n | \"edit\"\n | \"delete\"\n | \"publish\"\n | \"unpublish\"\n | CustomActionNames<S>;\n\n/**\n * Props for a schema-bound `HasPermission` component created via `createHasPermission`.\n *\n * Exactly one of `entity`, `any`, or `all` must be provided.\n */\nexport type HasPermissionProps<S extends PermissionSchemaConfig> =\n | SingleEntityProps<S>\n | AnyEntitiesProps<S>\n | AllEntitiesProps<S>;\n\ninterface SingleEntityProps<S extends PermissionSchemaConfig> {\n entity: AllEntityIds<S>;\n any?: never;\n all?: never;\n action?: HasPermissionAction<S>;\n children: React.ReactNode;\n}\n\ninterface AnyEntitiesProps<S extends PermissionSchemaConfig> {\n entity?: never;\n any: AllEntityIds<S>[];\n all?: never;\n action?: HasPermissionAction<S>;\n children: React.ReactNode;\n}\n\ninterface AllEntitiesProps<S extends PermissionSchemaConfig> {\n entity?: never;\n any?: never;\n all: AllEntityIds<S>[];\n action?: HasPermissionAction<S>;\n children: React.ReactNode;\n}\n\ntype UsePermissionsResultTyped<S extends PermissionSchemaConfig> = {\n canAccess: (entityId: AllEntityIds<S>) => boolean;\n canAction: (\n action: CustomActionNames<S> extends never ? string : CustomActionNames<S>,\n entityId: AllEntityIds<S>\n ) => boolean;\n} & ([RwdEntityId<S>] extends [never]\n ? {\n canRead: (entityId: string) => boolean;\n canCreate: (entityId: string) => boolean;\n canEdit: (entityId: string, item?: OwnableItem) => boolean;\n canDelete: (entityId: string, item?: OwnableItem) => boolean;\n }\n : {\n canRead: (entityId: RwdEntityId<S>) => boolean;\n canCreate: (entityId: RwdEntityId<S>) => boolean;\n canEdit: (entityId: RwdEntityId<S>, item?: OwnableItem) => boolean;\n canDelete: (entityId: RwdEntityId<S>, item?: OwnableItem) => boolean;\n }) &\n ([PwEntityId<S>] extends [never]\n ? {\n canPublish: (entityId: string) => boolean;\n canUnpublish: (entityId: string) => boolean;\n }\n : {\n canPublish: (entityId: PwEntityId<S>) => boolean;\n canUnpublish: (entityId: PwEntityId<S>) => boolean;\n });\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Permission, PermissionSchema, UsePermissionFormOptions, UsePermissionFormResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Deserialize Permission[] into form data based on the schema.
|
|
4
|
+
*/
|
|
5
|
+
declare function deserializePermissions(schema: PermissionSchema, value: Permission[]): Record<string, any>;
|
|
6
|
+
/**
|
|
7
|
+
* Serialize form data into Permission[] based on the schema.
|
|
8
|
+
*/
|
|
9
|
+
declare function serializePermissions(schema: PermissionSchema, formData: Record<string, any>, currentValue: Permission[]): Permission[];
|
|
10
|
+
/**
|
|
11
|
+
* Hook that bridges a permission schema with a Form component.
|
|
12
|
+
*
|
|
13
|
+
* Handles bidirectional transformation between Permission[] and form data,
|
|
14
|
+
* with optional custom serialize/deserialize callbacks for app-specific needs.
|
|
15
|
+
*/
|
|
16
|
+
export declare function usePermissionForm(schema: PermissionSchema, options: UsePermissionFormOptions): UsePermissionFormResult;
|
|
17
|
+
export { deserializePermissions, serializePermissions };
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import { useMemo, useCallback } from "react";
|
|
2
|
+
function hasAction(entity, name) {
|
|
3
|
+
return entity.actions?.some(a => a.name === name) ?? false;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/** Resolve fullAccess config into a concrete Permission object. */
|
|
7
|
+
function resolveFullAccess(schema) {
|
|
8
|
+
const name = `${schema.prefix}.*`;
|
|
9
|
+
if (schema.fullAccess === true) {
|
|
10
|
+
return {
|
|
11
|
+
name
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
name,
|
|
16
|
+
...schema.fullAccess
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Resolve readOnlyAccess config into a concrete Permission[]. */
|
|
21
|
+
function resolveReadOnlyAccess(schema) {
|
|
22
|
+
if (!schema.readOnlyAccess) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (schema.readOnlyAccess === true) {
|
|
26
|
+
return [{
|
|
27
|
+
name: `${schema.prefix}.*`,
|
|
28
|
+
rwd: "r"
|
|
29
|
+
}];
|
|
30
|
+
}
|
|
31
|
+
return schema.readOnlyAccess;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Deserialize Permission[] into form data based on the schema.
|
|
36
|
+
*/
|
|
37
|
+
function deserializePermissions(schema, value) {
|
|
38
|
+
if (!Array.isArray(value)) {
|
|
39
|
+
return {
|
|
40
|
+
accessLevel: "no"
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Check for read-only access by looking for the synthetic marker permission.
|
|
45
|
+
if (value.some(p => p.name === `$${schema.prefix}.readonly`)) {
|
|
46
|
+
return {
|
|
47
|
+
accessLevel: "read-only"
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Check for full access: either wildcard or the schema's fullAccess permission.
|
|
52
|
+
const fullAccessName = `${schema.prefix}.*`;
|
|
53
|
+
const hasFullAccess = value.some(p => p.name === "*" || p.name === fullAccessName);
|
|
54
|
+
if (hasFullAccess) {
|
|
55
|
+
return {
|
|
56
|
+
accessLevel: "full"
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Filter permissions that belong to this schema's prefix.
|
|
61
|
+
const ownPermissions = value.filter(p => p.name.startsWith(schema.prefix));
|
|
62
|
+
if (ownPermissions.length === 0) {
|
|
63
|
+
return {
|
|
64
|
+
accessLevel: "no"
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Custom access level — extract per-entity form fields.
|
|
69
|
+
const data = {
|
|
70
|
+
accessLevel: "custom"
|
|
71
|
+
};
|
|
72
|
+
const entities = schema.entities || [];
|
|
73
|
+
for (const entity of entities) {
|
|
74
|
+
const perm = ownPermissions.find(p => p.name === entity.permission);
|
|
75
|
+
if (!perm) {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Access scope: "own" if perm.own === true, else "full".
|
|
80
|
+
if (perm.own === true) {
|
|
81
|
+
data[`${entity.id}AccessScope`] = "own";
|
|
82
|
+
} else {
|
|
83
|
+
data[`${entity.id}AccessScope`] = "full";
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Process actions.
|
|
87
|
+
for (const action of entity.actions ?? []) {
|
|
88
|
+
if (action.name === "rwd") {
|
|
89
|
+
data[`${entity.id}RWD`] = perm.rwd || "r";
|
|
90
|
+
} else if (action.name === "pw") {
|
|
91
|
+
data[`${entity.id}PW`] = perm.pw ? perm.pw.split("") : [];
|
|
92
|
+
} else {
|
|
93
|
+
// Custom boolean action.
|
|
94
|
+
data[`${entity.id}Action_${action.name}`] = perm[action.name] === true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return data;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Serialize form data into Permission[] based on the schema.
|
|
103
|
+
*/
|
|
104
|
+
function serializePermissions(schema, formData, currentValue) {
|
|
105
|
+
// Start by filtering out all permissions belonging to this schema's prefix.
|
|
106
|
+
const filtered = Array.isArray(currentValue) ? currentValue.filter(p => !p.name.startsWith(schema.prefix) && !p.name.startsWith(`$${schema.prefix}`)) : [];
|
|
107
|
+
if (formData.accessLevel === "no" || !formData.accessLevel) {
|
|
108
|
+
return filtered;
|
|
109
|
+
}
|
|
110
|
+
if (formData.accessLevel === "full") {
|
|
111
|
+
return [...filtered, resolveFullAccess(schema)];
|
|
112
|
+
}
|
|
113
|
+
const readOnlyPermissions = resolveReadOnlyAccess(schema);
|
|
114
|
+
if (formData.accessLevel === "read-only" && readOnlyPermissions) {
|
|
115
|
+
return [...filtered, {
|
|
116
|
+
name: `$${schema.prefix}.readonly`
|
|
117
|
+
}, ...readOnlyPermissions];
|
|
118
|
+
}
|
|
119
|
+
const entities = schema.entities || [];
|
|
120
|
+
|
|
121
|
+
// Custom access — build entity permissions.
|
|
122
|
+
// First, build a map of entity definitions by ID for dependency lookups.
|
|
123
|
+
const entityMap = new Map();
|
|
124
|
+
for (const entity of entities) {
|
|
125
|
+
entityMap.set(entity.id, entity);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Resolve cascading "own" scopes: if a parent is "own", children must be "own" too.
|
|
129
|
+
const resolvedScopes = new Map();
|
|
130
|
+
for (const entity of entities) {
|
|
131
|
+
const scope = formData[`${entity.id}AccessScope`];
|
|
132
|
+
if (!scope || scope === "no") {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
let resolvedScope = scope;
|
|
136
|
+
|
|
137
|
+
// If this entity depends on a parent and the parent scope is "own",
|
|
138
|
+
// force this entity's scope to "own" as well.
|
|
139
|
+
if (entity.dependsOn) {
|
|
140
|
+
const parentScope = resolvedScopes.get(entity.dependsOn.entity);
|
|
141
|
+
if (parentScope === "own") {
|
|
142
|
+
resolvedScope = "own";
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
resolvedScopes.set(entity.id, resolvedScope);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Prune resolved scopes based on dependencies (must run before building permissions
|
|
149
|
+
// so that transitive dependencies are properly pruned).
|
|
150
|
+
for (const entity of entities) {
|
|
151
|
+
if (!entity.dependsOn || !resolvedScopes.has(entity.id)) {
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
const parentScope = resolvedScopes.get(entity.dependsOn.entity);
|
|
155
|
+
if (!parentScope) {
|
|
156
|
+
// Parent entity is not enabled — prune child.
|
|
157
|
+
resolvedScopes.delete(entity.id);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const parentEntity = entityMap.get(entity.dependsOn.entity);
|
|
161
|
+
if (parentEntity && hasAction(parentEntity, "rwd")) {
|
|
162
|
+
const parentRwd = parentScope === "own" ? "rwd" : formData[`${entity.dependsOn.entity}RWD`] || "r";
|
|
163
|
+
if (!parentRwd.includes(entity.dependsOn.requires)) {
|
|
164
|
+
// Parent doesn't have the required action — prune child.
|
|
165
|
+
resolvedScopes.delete(entity.id);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// Build permissions from the pruned resolved scopes.
|
|
171
|
+
const permissions = [];
|
|
172
|
+
for (const entity of entities) {
|
|
173
|
+
const scope = resolvedScopes.get(entity.id);
|
|
174
|
+
if (!scope) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const perm = {
|
|
178
|
+
name: entity.permission
|
|
179
|
+
};
|
|
180
|
+
if (scope === "own") {
|
|
181
|
+
perm.own = true;
|
|
182
|
+
if (hasAction(entity, "rwd")) {
|
|
183
|
+
perm.rwd = "rwd";
|
|
184
|
+
}
|
|
185
|
+
} else if (hasAction(entity, "rwd")) {
|
|
186
|
+
perm.rwd = formData[`${entity.id}RWD`] || "r";
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// Process non-rwd actions.
|
|
190
|
+
for (const action of entity.actions ?? []) {
|
|
191
|
+
if (action.name === "rwd") {
|
|
192
|
+
continue; // Already handled above.
|
|
193
|
+
}
|
|
194
|
+
if (action.name === "pw") {
|
|
195
|
+
const pw = formData[`${entity.id}PW`] || [];
|
|
196
|
+
if (pw.length > 0) {
|
|
197
|
+
perm.pw = pw.join("");
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
// Custom boolean action.
|
|
201
|
+
if (formData[`${entity.id}Action_${action.name}`]) {
|
|
202
|
+
perm[action.name] = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
permissions.push(perm);
|
|
207
|
+
}
|
|
208
|
+
return [...filtered, ...permissions];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Hook that bridges a permission schema with a Form component.
|
|
213
|
+
*
|
|
214
|
+
* Handles bidirectional transformation between Permission[] and form data,
|
|
215
|
+
* with optional custom serialize/deserialize callbacks for app-specific needs.
|
|
216
|
+
*/
|
|
217
|
+
export function usePermissionForm(schema, options) {
|
|
218
|
+
const {
|
|
219
|
+
value,
|
|
220
|
+
onChange
|
|
221
|
+
} = options;
|
|
222
|
+
const formData = useMemo(() => {
|
|
223
|
+
let data = deserializePermissions(schema, value);
|
|
224
|
+
|
|
225
|
+
// Merge custom deserialized data if provided.
|
|
226
|
+
if (options.deserialize) {
|
|
227
|
+
const extra = options.deserialize(Array.isArray(value) ? value : []);
|
|
228
|
+
data = {
|
|
229
|
+
...data,
|
|
230
|
+
...extra
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
return data;
|
|
234
|
+
}, []);
|
|
235
|
+
const onFormChange = useCallback(data => {
|
|
236
|
+
let result = serializePermissions(schema, data, value);
|
|
237
|
+
|
|
238
|
+
// Apply custom serializer if provided.
|
|
239
|
+
if (options.serialize) {
|
|
240
|
+
result = options.serialize(data, result.filter(p => p.name.startsWith(schema.prefix)));
|
|
241
|
+
// Re-add non-schema permissions that were filtered out.
|
|
242
|
+
const nonSchemaPermissions = Array.isArray(value) ? value.filter(p => !p.name.startsWith(schema.prefix) && !p.name.startsWith(`$${schema.prefix}`)) : [];
|
|
243
|
+
result = [...nonSchemaPermissions, ...result];
|
|
244
|
+
}
|
|
245
|
+
onChange(result);
|
|
246
|
+
}, [value]);
|
|
247
|
+
return {
|
|
248
|
+
formData,
|
|
249
|
+
onFormChange
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Export the pure functions for unit testing.
|
|
254
|
+
export { deserializePermissions, serializePermissions };
|
|
255
|
+
|
|
256
|
+
//# sourceMappingURL=usePermissionForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useMemo","useCallback","hasAction","entity","name","actions","some","a","resolveFullAccess","schema","prefix","fullAccess","resolveReadOnlyAccess","readOnlyAccess","undefined","rwd","deserializePermissions","value","Array","isArray","accessLevel","p","fullAccessName","hasFullAccess","ownPermissions","filter","startsWith","length","data","entities","perm","find","permission","own","id","action","pw","split","serializePermissions","formData","currentValue","filtered","readOnlyPermissions","entityMap","Map","set","resolvedScopes","scope","resolvedScope","dependsOn","parentScope","get","has","delete","parentEntity","parentRwd","includes","requires","permissions","join","push","usePermissionForm","options","onChange","deserialize","extra","onFormChange","result","serialize","nonSchemaPermissions"],"sources":["usePermissionForm.ts"],"sourcesContent":["import { useMemo, useCallback } from \"react\";\nimport type {\n Permission,\n PermissionSchema,\n EntityDefinition,\n UsePermissionFormOptions,\n UsePermissionFormResult\n} from \"./types.js\";\n\nfunction hasAction(entity: EntityDefinition, name: string): boolean {\n return entity.actions?.some(a => a.name === name) ?? false;\n}\n\n/** Resolve fullAccess config into a concrete Permission object. */\nfunction resolveFullAccess(schema: PermissionSchema): Permission {\n const name = `${schema.prefix}.*`;\n if (schema.fullAccess === true) {\n return { name };\n }\n return { name, ...schema.fullAccess };\n}\n\n/** Resolve readOnlyAccess config into a concrete Permission[]. */\nfunction resolveReadOnlyAccess(schema: PermissionSchema): Permission[] | undefined {\n if (!schema.readOnlyAccess) {\n return undefined;\n }\n if (schema.readOnlyAccess === true) {\n return [{ name: `${schema.prefix}.*`, rwd: \"r\" }];\n }\n return schema.readOnlyAccess;\n}\n\n/**\n * Deserialize Permission[] into form data based on the schema.\n */\nfunction deserializePermissions(\n schema: PermissionSchema,\n value: Permission[]\n): Record<string, any> {\n if (!Array.isArray(value)) {\n return { accessLevel: \"no\" };\n }\n\n // Check for read-only access by looking for the synthetic marker permission.\n if (value.some(p => p.name === `$${schema.prefix}.readonly`)) {\n return { accessLevel: \"read-only\" };\n }\n\n // Check for full access: either wildcard or the schema's fullAccess permission.\n const fullAccessName = `${schema.prefix}.*`;\n const hasFullAccess = value.some(p => p.name === \"*\" || p.name === fullAccessName);\n if (hasFullAccess) {\n return { accessLevel: \"full\" };\n }\n\n // Filter permissions that belong to this schema's prefix.\n const ownPermissions = value.filter(p => p.name.startsWith(schema.prefix));\n if (ownPermissions.length === 0) {\n return { accessLevel: \"no\" };\n }\n\n // Custom access level — extract per-entity form fields.\n const data: Record<string, any> = { accessLevel: \"custom\" };\n const entities = schema.entities || [];\n\n for (const entity of entities) {\n const perm = ownPermissions.find(p => p.name === entity.permission);\n if (!perm) {\n continue;\n }\n\n // Access scope: \"own\" if perm.own === true, else \"full\".\n if (perm.own === true) {\n data[`${entity.id}AccessScope`] = \"own\";\n } else {\n data[`${entity.id}AccessScope`] = \"full\";\n }\n\n // Process actions.\n for (const action of entity.actions ?? []) {\n if (action.name === \"rwd\") {\n data[`${entity.id}RWD`] = perm.rwd || \"r\";\n } else if (action.name === \"pw\") {\n data[`${entity.id}PW`] = perm.pw ? perm.pw.split(\"\") : [];\n } else {\n // Custom boolean action.\n data[`${entity.id}Action_${action.name}`] = perm[action.name] === true;\n }\n }\n }\n\n return data;\n}\n\n/**\n * Serialize form data into Permission[] based on the schema.\n */\nfunction serializePermissions(\n schema: PermissionSchema,\n formData: Record<string, any>,\n currentValue: Permission[]\n): Permission[] {\n // Start by filtering out all permissions belonging to this schema's prefix.\n const filtered = Array.isArray(currentValue)\n ? currentValue.filter(\n p => !p.name.startsWith(schema.prefix) && !p.name.startsWith(`$${schema.prefix}`)\n )\n : [];\n\n if (formData.accessLevel === \"no\" || !formData.accessLevel) {\n return filtered;\n }\n\n if (formData.accessLevel === \"full\") {\n return [...filtered, resolveFullAccess(schema)];\n }\n\n const readOnlyPermissions = resolveReadOnlyAccess(schema);\n if (formData.accessLevel === \"read-only\" && readOnlyPermissions) {\n return [...filtered, { name: `$${schema.prefix}.readonly` }, ...readOnlyPermissions];\n }\n\n const entities = schema.entities || [];\n\n // Custom access — build entity permissions.\n // First, build a map of entity definitions by ID for dependency lookups.\n const entityMap = new Map<string, EntityDefinition>();\n for (const entity of entities) {\n entityMap.set(entity.id, entity);\n }\n\n // Resolve cascading \"own\" scopes: if a parent is \"own\", children must be \"own\" too.\n const resolvedScopes = new Map<string, string>();\n for (const entity of entities) {\n const scope = formData[`${entity.id}AccessScope`];\n if (!scope || scope === \"no\") {\n continue;\n }\n\n let resolvedScope = scope;\n\n // If this entity depends on a parent and the parent scope is \"own\",\n // force this entity's scope to \"own\" as well.\n if (entity.dependsOn) {\n const parentScope = resolvedScopes.get(entity.dependsOn.entity);\n if (parentScope === \"own\") {\n resolvedScope = \"own\";\n }\n }\n\n resolvedScopes.set(entity.id, resolvedScope);\n }\n\n // Prune resolved scopes based on dependencies (must run before building permissions\n // so that transitive dependencies are properly pruned).\n for (const entity of entities) {\n if (!entity.dependsOn || !resolvedScopes.has(entity.id)) {\n continue;\n }\n\n const parentScope = resolvedScopes.get(entity.dependsOn.entity);\n if (!parentScope) {\n // Parent entity is not enabled — prune child.\n resolvedScopes.delete(entity.id);\n continue;\n }\n\n const parentEntity = entityMap.get(entity.dependsOn.entity);\n if (parentEntity && hasAction(parentEntity, \"rwd\")) {\n const parentRwd =\n parentScope === \"own\" ? \"rwd\" : formData[`${entity.dependsOn.entity}RWD`] || \"r\";\n if (!parentRwd.includes(entity.dependsOn.requires)) {\n // Parent doesn't have the required action — prune child.\n resolvedScopes.delete(entity.id);\n }\n }\n }\n\n // Build permissions from the pruned resolved scopes.\n const permissions: Permission[] = [];\n\n for (const entity of entities) {\n const scope = resolvedScopes.get(entity.id);\n if (!scope) {\n continue;\n }\n\n const perm: Permission = {\n name: entity.permission\n };\n\n if (scope === \"own\") {\n perm.own = true;\n if (hasAction(entity, \"rwd\")) {\n perm.rwd = \"rwd\";\n }\n } else if (hasAction(entity, \"rwd\")) {\n perm.rwd = formData[`${entity.id}RWD`] || \"r\";\n }\n\n // Process non-rwd actions.\n for (const action of entity.actions ?? []) {\n if (action.name === \"rwd\") {\n continue; // Already handled above.\n }\n\n if (action.name === \"pw\") {\n const pw: string[] = formData[`${entity.id}PW`] || [];\n if (pw.length > 0) {\n perm.pw = pw.join(\"\");\n }\n } else {\n // Custom boolean action.\n if (formData[`${entity.id}Action_${action.name}`]) {\n perm[action.name] = true;\n }\n }\n }\n\n permissions.push(perm);\n }\n\n return [...filtered, ...permissions];\n}\n\n/**\n * Hook that bridges a permission schema with a Form component.\n *\n * Handles bidirectional transformation between Permission[] and form data,\n * with optional custom serialize/deserialize callbacks for app-specific needs.\n */\nexport function usePermissionForm(\n schema: PermissionSchema,\n options: UsePermissionFormOptions\n): UsePermissionFormResult {\n const { value, onChange } = options;\n\n const formData = useMemo(() => {\n let data = deserializePermissions(schema, value);\n\n // Merge custom deserialized data if provided.\n if (options.deserialize) {\n const extra = options.deserialize(Array.isArray(value) ? value : []);\n data = { ...data, ...extra };\n }\n\n return data;\n }, []);\n\n const onFormChange = useCallback(\n (data: Record<string, any>) => {\n let result = serializePermissions(schema, data, value);\n\n // Apply custom serializer if provided.\n if (options.serialize) {\n result = options.serialize(\n data,\n result.filter(p => p.name.startsWith(schema.prefix))\n );\n // Re-add non-schema permissions that were filtered out.\n const nonSchemaPermissions = Array.isArray(value)\n ? value.filter(\n p =>\n !p.name.startsWith(schema.prefix) &&\n !p.name.startsWith(`$${schema.prefix}`)\n )\n : [];\n result = [...nonSchemaPermissions, ...result];\n }\n\n onChange(result);\n },\n [value]\n );\n\n return { formData, onFormChange };\n}\n\n// Export the pure functions for unit testing.\nexport { deserializePermissions, serializePermissions };\n"],"mappings":"AAAA,SAASA,OAAO,EAAEC,WAAW,QAAQ,OAAO;AAS5C,SAASC,SAASA,CAACC,MAAwB,EAAEC,IAAY,EAAW;EAChE,OAAOD,MAAM,CAACE,OAAO,EAAEC,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACH,IAAI,KAAKA,IAAI,CAAC,IAAI,KAAK;AAC9D;;AAEA;AACA,SAASI,iBAAiBA,CAACC,MAAwB,EAAc;EAC7D,MAAML,IAAI,GAAG,GAAGK,MAAM,CAACC,MAAM,IAAI;EACjC,IAAID,MAAM,CAACE,UAAU,KAAK,IAAI,EAAE;IAC5B,OAAO;MAAEP;IAAK,CAAC;EACnB;EACA,OAAO;IAAEA,IAAI;IAAE,GAAGK,MAAM,CAACE;EAAW,CAAC;AACzC;;AAEA;AACA,SAASC,qBAAqBA,CAACH,MAAwB,EAA4B;EAC/E,IAAI,CAACA,MAAM,CAACI,cAAc,EAAE;IACxB,OAAOC,SAAS;EACpB;EACA,IAAIL,MAAM,CAACI,cAAc,KAAK,IAAI,EAAE;IAChC,OAAO,CAAC;MAAET,IAAI,EAAE,GAAGK,MAAM,CAACC,MAAM,IAAI;MAAEK,GAAG,EA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GAAG,CAAC,GAAGE,oBAAoB,EAAE,GAAGF,MAAM,CAAC;IACjD;IAEAJ,QAAQ,CAACI,MAAM,CAAC;EACpB,CAAC,EACD,CAAClD,KAAK,CACV,CAAC;EAED,OAAO;IAAEsB,QAAQ;IAAE2B;EAAa,CAAC;AACrC;;AAEA;AACA,SAASlD,sBAAsB,EAAEsB,oBAAoB","ignoreList":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { useIdentity } from "../presentation/security/hooks/useIdentity.js";
|
|
2
|
+
// Module-level cache: schema -> identityId -> result.
|
|
3
|
+
const cache = new WeakMap();
|
|
4
|
+
function buildEntityMap(schema) {
|
|
5
|
+
const map = new Map();
|
|
6
|
+
for (const entity of schema.entities ?? []) {
|
|
7
|
+
const actions = new Set();
|
|
8
|
+
for (const action of entity.actions ?? []) {
|
|
9
|
+
actions.add(action.name);
|
|
10
|
+
}
|
|
11
|
+
map.set(entity.id, {
|
|
12
|
+
permission: entity.permission,
|
|
13
|
+
actions,
|
|
14
|
+
hasOwn: entity.scopes.includes("own")
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return map;
|
|
18
|
+
}
|
|
19
|
+
function getEntity(entityMap, entityId) {
|
|
20
|
+
const entity = entityMap.get(entityId);
|
|
21
|
+
if (!entity) {
|
|
22
|
+
throw new Error(`Unknown entity "${entityId}" in permission schema.`);
|
|
23
|
+
}
|
|
24
|
+
return entity;
|
|
25
|
+
}
|
|
26
|
+
function buildResult(schema, identity) {
|
|
27
|
+
const fullAccessName = `${schema.prefix}.*`;
|
|
28
|
+
const hasFullAccess = !!identity.getPermission(fullAccessName);
|
|
29
|
+
const entityMap = buildEntityMap(schema);
|
|
30
|
+
const canAccess = entityId => {
|
|
31
|
+
if (hasFullAccess) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
const entity = getEntity(entityMap, entityId);
|
|
35
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
36
|
+
return permissions.length > 0;
|
|
37
|
+
};
|
|
38
|
+
const canRead = entityId => {
|
|
39
|
+
if (hasFullAccess) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
const entity = getEntity(entityMap, entityId);
|
|
43
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
44
|
+
if (!permissions.length) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return permissions.some(permission => {
|
|
48
|
+
if (typeof permission.rwd !== "string") {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return permission.rwd.includes("r");
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
const canCreate = entityId => {
|
|
55
|
+
if (hasFullAccess) {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
const entity = getEntity(entityMap, entityId);
|
|
59
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
60
|
+
if (!permissions.length) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return permissions.some(permission => {
|
|
64
|
+
if (typeof permission.rwd !== "string") {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return permission.rwd.includes("w");
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
const canEdit = (entityId, item) => {
|
|
71
|
+
if (hasFullAccess) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
const entity = getEntity(entityMap, entityId);
|
|
75
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
76
|
+
if (!permissions.length) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
return permissions.some(permission => {
|
|
80
|
+
if (permission.own) {
|
|
81
|
+
if (!item?.createdBy) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
return item.createdBy.id === identity.id;
|
|
85
|
+
}
|
|
86
|
+
if (typeof permission.rwd !== "string") {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
return permission.rwd.includes("w");
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const canDelete = (entityId, item) => {
|
|
93
|
+
if (hasFullAccess) {
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
const entity = getEntity(entityMap, entityId);
|
|
97
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
98
|
+
if (!permissions.length) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
return permissions.some(permission => {
|
|
102
|
+
if (permission.own) {
|
|
103
|
+
return item?.createdBy?.id === identity.id;
|
|
104
|
+
}
|
|
105
|
+
if (typeof permission.rwd !== "string") {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
return permission.rwd.includes("d");
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
const canPublish = entityId => {
|
|
112
|
+
if (hasFullAccess) {
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
const entity = getEntity(entityMap, entityId);
|
|
116
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
117
|
+
if (!permissions.length) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
return permissions.some(permission => {
|
|
121
|
+
return permission.pw?.includes("p");
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
const canUnpublish = entityId => {
|
|
125
|
+
if (hasFullAccess) {
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
const entity = getEntity(entityMap, entityId);
|
|
129
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
130
|
+
if (!permissions.length) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return permissions.some(permission => {
|
|
134
|
+
return permission.pw?.includes("u");
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
const canAction = (action, entityId) => {
|
|
138
|
+
if (hasFullAccess) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
const entity = getEntity(entityMap, entityId);
|
|
142
|
+
const permissions = identity.getPermissions(entity.permission);
|
|
143
|
+
if (!permissions.length) {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
return permissions.some(permission => {
|
|
147
|
+
return permission[action] === true;
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
return {
|
|
151
|
+
canAccess,
|
|
152
|
+
canRead,
|
|
153
|
+
canCreate,
|
|
154
|
+
canEdit,
|
|
155
|
+
canDelete,
|
|
156
|
+
canPublish,
|
|
157
|
+
canUnpublish,
|
|
158
|
+
canAction
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export function createUsePermissions(schema) {
|
|
162
|
+
return function usePermissions() {
|
|
163
|
+
const {
|
|
164
|
+
identity
|
|
165
|
+
} = useIdentity();
|
|
166
|
+
let byIdentityId = cache.get(schema);
|
|
167
|
+
if (!byIdentityId) {
|
|
168
|
+
byIdentityId = new Map();
|
|
169
|
+
cache.set(schema, byIdentityId);
|
|
170
|
+
}
|
|
171
|
+
let result = byIdentityId.get(identity.id);
|
|
172
|
+
if (!result) {
|
|
173
|
+
result = buildResult(schema, identity);
|
|
174
|
+
byIdentityId.set(identity.id, result);
|
|
175
|
+
}
|
|
176
|
+
return result;
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=usePermissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useIdentity","cache","WeakMap","buildEntityMap","schema","map","Map","entity","entities","actions","Set","action","add","name","set","id","permission","hasOwn","scopes","includes","getEntity","entityMap","entityId","get","Error","buildResult","identity","fullAccessName","prefix","hasFullAccess","getPermission","canAccess","permissions","getPermissions","length","canRead","some","rwd","canCreate","canEdit","item","own","createdBy","canDelete","canPublish","pw","canUnpublish","canAction","createUsePermissions","usePermissions","byIdentityId","result"],"sources":["usePermissions.ts"],"sourcesContent":["import { useIdentity } from \"~/presentation/security/hooks/useIdentity.js\";\nimport type { Identity } from \"~/domain/Identity.js\";\nimport type { PermissionSchemaConfig } from \"./types.js\";\nimport type { OwnableItem } from \"./types.js\";\nimport type { UsePermissionsResult } from \"./types.js\";\n\ninterface EntityLookup {\n permission: string;\n actions: Set<string>;\n hasOwn: boolean;\n}\n\n// Module-level cache: schema -> identityId -> result.\nconst cache = new WeakMap<PermissionSchemaConfig, Map<string, UsePermissionsResult<any>>>();\n\nfunction buildEntityMap(schema: PermissionSchemaConfig): Map<string, EntityLookup> {\n const map = new Map<string, EntityLookup>();\n for (const entity of schema.entities ?? []) {\n const actions = new Set<string>();\n for (const action of entity.actions ?? []) {\n actions.add(action.name);\n }\n map.set(entity.id, {\n permission: entity.permission,\n actions,\n hasOwn: entity.scopes.includes(\"own\")\n });\n }\n return map;\n}\n\nfunction getEntity(entityMap: Map<string, EntityLookup>, entityId: string): EntityLookup {\n const entity = entityMap.get(entityId);\n if (!entity) {\n throw new Error(`Unknown entity \"${entityId}\" in permission schema.`);\n }\n return entity;\n}\n\nfunction buildResult<S extends PermissionSchemaConfig>(\n schema: S,\n identity: Identity\n): UsePermissionsResult<S> {\n const fullAccessName = `${schema.prefix}.*`;\n const hasFullAccess = !!identity.getPermission(fullAccessName);\n const entityMap = buildEntityMap(schema);\n\n const canAccess = (entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n return permissions.length > 0;\n };\n\n const canRead = (entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n if (typeof permission.rwd !== \"string\") {\n return true;\n }\n return permission.rwd.includes(\"r\");\n });\n };\n\n const canCreate = (entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n if (typeof permission.rwd !== \"string\") {\n return true;\n }\n return permission.rwd.includes(\"w\");\n });\n };\n\n const canEdit = (entityId: string, item?: OwnableItem): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n if (permission.own) {\n if (!item?.createdBy) {\n return true;\n }\n return item.createdBy.id === identity.id;\n }\n if (typeof permission.rwd !== \"string\") {\n return true;\n }\n return permission.rwd.includes(\"w\");\n });\n };\n\n const canDelete = (entityId: string, item?: OwnableItem): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n if (permission.own) {\n return item?.createdBy?.id === identity.id;\n }\n if (typeof permission.rwd !== \"string\") {\n return true;\n }\n return permission.rwd.includes(\"d\");\n });\n };\n\n const canPublish = (entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n return permission.pw?.includes(\"p\");\n });\n };\n\n const canUnpublish = (entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n return permission.pw?.includes(\"u\");\n });\n };\n\n const canAction = (action: string, entityId: string): boolean => {\n if (hasFullAccess) {\n return true;\n }\n const entity = getEntity(entityMap, entityId);\n const permissions = identity.getPermissions(entity.permission);\n if (!permissions.length) {\n return false;\n }\n return permissions.some(permission => {\n return permission[action] === true;\n });\n };\n\n return {\n canAccess,\n canRead,\n canCreate,\n canEdit,\n canDelete,\n canPublish,\n canUnpublish,\n canAction\n } as UsePermissionsResult<S>;\n}\n\nexport function createUsePermissions<const S extends PermissionSchemaConfig>(\n schema: S\n): () => UsePermissionsResult<S> {\n return function usePermissions(): UsePermissionsResult<S> {\n const { identity } = useIdentity();\n\n let byIdentityId = cache.get(schema);\n if (!byIdentityId) {\n byIdentityId = new Map();\n cache.set(schema, byIdentityId);\n }\n\n let result = byIdentityId.get(identity.id) as UsePermissionsResult<S> | undefined;\n if (!result) {\n result = buildResult(schema, identity);\n byIdentityId.set(identity.id, result as UsePermissionsResult<any>);\n }\n\n return result;\n };\n}\n"],"mappings":"AAAA,SAASA,WAAW;AAYpB;AACA,MAAMC,KAAK,GAAG,IAAIC,OAAO,CAAiE,CAAC;AAE3F,SAASC,cAAcA,CAACC,MAA8B,EAA6B;EAC/E,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAAuB,CAAC;EAC3C,KAAK,MAAMC,MAAM,IAAIH,MAAM,CAACI,QAAQ,IAAI,EAAE,EAAE;IACxC,MAAMC,OAAO,GAAG,IAAIC,GAAG,CAAS,CAAC;IACjC,KAAK,MAAMC,MAAM,IAAIJ,MAAM,CAACE,OAAO,IAAI,EAAE,EAAE;MACvCA,OAAO,CAACG,GAAG,CAACD,MAAM,CAACE,IAAI,CAAC;IAC5B;IACAR,GAAG,CAACS,GAAG,CAACP,MAAM,CAACQ,EAAE,EAAE;MACfC,UAAU,EAAET,MAAM,CAACS,UAAU;MAC7BP,OAAO;MACPQ,MAAM,EAAEV,MAAM,CAACW,MAAM,CAACC,QAAQ,CAAC,KAAK;IACxC,CAAC,CAAC;EACN;EACA,OAAOd,GAAG;AACd;AAEA,SAASe,SAASA,CAACC,SAAoC,EAAEC,QAAgB,EAAgB;EACrF,MAAMf,MAAM,GAAGc,SAAS,CAACE,GAAG,CAACD,QAAQ,CAAC;EACtC,IAAI,CAACf,MAAM,EAAE;IACT,MAAM,IAAIiB,KAAK,CAAC,mBAAmBF,QAAQ,yBAAyB,CAAC;EACzE;EACA,OAAOf,MAAM;AACjB;AAEA,SAASkB,WAAWA,CAChBrB,MAAS,EACTsB,QAAkB,EACK;EACvB,MAAMC,cAAc,GAAG,GAAGvB,MAAM,CAACwB,MAAM,IAAI;EAC3C,MAAMC,aAAa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AAM;EACjB,CAAC;AACL","ignoreList":[]}
|
package/plugins/MenuPlugin.d.ts
CHANGED
package/plugins/MenuPlugin.js
CHANGED
|
@@ -1,43 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
exports.MenuPlugin = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _plugins = require("@webiny/plugins");
|
|
15
|
-
var MenuPlugin = /*#__PURE__*/function (_Plugin) {
|
|
16
|
-
(0, _inherits2.default)(MenuPlugin, _Plugin);
|
|
17
|
-
var _super = (0, _createSuper2.default)(MenuPlugin);
|
|
18
|
-
function MenuPlugin(config) {
|
|
19
|
-
var _this;
|
|
20
|
-
(0, _classCallCheck2.default)(this, MenuPlugin);
|
|
21
|
-
_this = _super.call(this);
|
|
22
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "_config", void 0);
|
|
23
|
-
_this._config = config || {};
|
|
24
|
-
return _this;
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
export class MenuPlugin extends Plugin {
|
|
3
|
+
static type = "admin-menu";
|
|
4
|
+
constructor(config) {
|
|
5
|
+
super();
|
|
6
|
+
this._config = config || {};
|
|
25
7
|
}
|
|
26
|
-
(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
key: "render",
|
|
33
|
-
value: function render(props) {
|
|
34
|
-
if (!this._config.render) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return this._config.render(props);
|
|
8
|
+
get order() {
|
|
9
|
+
return this._config.order;
|
|
10
|
+
}
|
|
11
|
+
render(props) {
|
|
12
|
+
if (!this._config.render) {
|
|
13
|
+
return null;
|
|
38
14
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
15
|
+
return this._config.render(props);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=MenuPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MenuPlugin","config","_config","order","
|
|
1
|
+
{"version":3,"names":["Plugin","MenuPlugin","type","constructor","config","_config","order","render","props"],"sources":["MenuPlugin.ts"],"sourcesContent":["import type * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins\";\n\nexport interface MenuProps {\n name: string;\n label: React.ReactNode;\n icon: React.ReactElement;\n children: React.ReactNode;\n onClick?: (toggleSection: () => void) => void;\n}\n\nexport interface SectionProps {\n label: React.ReactNode;\n children: React.ReactNode;\n icon?: React.ReactElement;\n}\n\nexport interface ItemProps {\n label: React.ReactNode;\n path: string;\n style?: React.CSSProperties;\n onClick?: () => any;\n}\n\ninterface Props {\n Menu: React.ComponentType<MenuProps>;\n Section: React.ComponentType<SectionProps>;\n Item: React.ComponentType<ItemProps>;\n}\n\ninterface Config {\n render(props: Props): React.ReactNode;\n order?: number;\n}\n\nexport class MenuPlugin extends Plugin {\n public static override readonly type: string = \"admin-menu\";\n private readonly _config: Partial<Config>;\n\n public constructor(config?: Config) {\n super();\n this._config = config || {};\n }\n\n get order() {\n return this._config.order;\n }\n\n public render(props: Props): React.ReactNode {\n if (!this._config.render) {\n return null;\n }\n return this._config.render(props);\n }\n}\n"],"mappings":"AACA,SAASA,MAAM,QAAQ,iBAAiB;AAkCxC,OAAO,MAAMC,UAAU,SAASD,MAAM,CAAC;EACnC,OAAgCE,IAAI,GAAW,YAAY;EAGpDC,WAAWA,CAACC,MAAe,EAAE;IAChC,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,MAAM,IAAI,CAAC,CAAC;EAC/B;EAEA,IAAIE,KAAKA,CAAA,EAAG;IACR,OAAO,IAAI,CAACD,OAAO,CAACC,KAAK;EAC7B;EAEOC,MAAMA,CAACC,KAAY,EAAmB;IACzC,IAAI,CAAC,IAAI,CAACH,OAAO,CAACE,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACF,OAAO,CAACE,MAAM,CAACC,KAAK,CAAC;EACrC;AACJ","ignoreList":[]}
|