@webiny/app-admin 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.f6dc066313
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/base/Admin.d.ts +5 -2
- package/base/Admin.js +34 -16
- 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 -2
- package/base/Base/Menus/SupportMenuItems.js +2 -4
- package/base/Base/Menus/SupportMenuItems.js.map +1 -1
- package/base/Base/Menus/WebinyVersion.js +4 -4
- package/base/Base/Menus/WebinyVersion.js.map +1 -1
- package/base/Base/Menus.js +37 -42
- package/base/Base/Menus.js.map +1 -1
- 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.js +14 -9
- package/base/Base/Tenant.js.map +1 -1
- 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.js +6 -8
- 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.js +4 -4
- package/base/WebinyVersion.js.map +1 -1
- package/base/createRootContainer.d.ts +2 -0
- package/base/createRootContainer.js +55 -0
- package/base/createRootContainer.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.js +1 -1
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.js +1 -1
- package/base/providers/AdminUiStateProvider.js.map +1 -1
- package/base/providers/ApolloProvider.d.ts +1 -1
- package/base/providers/ApolloProvider.js +2 -5
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/UiProviders.js +24 -3
- package/base/providers/UiProviders.js.map +1 -1
- package/base/providers/UiStateProvider.js +1 -1
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/ui/CenteredView.d.ts +1 -1
- package/base/ui/CenteredView.js +2 -2
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/FileManager.d.ts +9 -21
- package/base/ui/FileManager.js +18 -12
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/LoginScreen.d.ts +19 -0
- package/base/ui/LoginScreen.js +2 -1
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Navigation.js +1 -1
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/UserMenu/UserMenuItem.d.ts +5 -5
- package/base/ui/UserMenu/UserMenuItem.js +1 -1
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -1
- package/base/ui/UserMenu/UserMenuLink.d.ts +5 -5
- package/base/ui/UserMenu/UserMenuLink.js +1 -1
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -1
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +8 -8
- package/base/ui/UserMenu/UserMenuSeparator.js +1 -1
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -1
- package/base/ui/UserMenu.d.ts +3 -3
- package/base/ui/UserMenu.js +3 -3
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +1 -1
- package/components/AdminLayout.js.map +1 -1
- package/components/BulkActions/Worker.d.ts +0 -1
- package/components/BulkActions/Worker.js +1 -1
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.d.ts +2 -2
- package/components/BulkActions/index.js +2 -2
- package/components/BulkActions/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/DialogMessage.d.ts +1 -1
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +2 -2
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.d.ts +1 -1
- package/components/BulkActions/useDialogWithReport/index.js +1 -1
- package/components/BulkActions/useDialogWithReport/index.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.d.ts +1 -1
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +2 -2
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/Buttons/Buttons.d.ts +1 -1
- package/components/Buttons/Buttons.js +4 -4
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.d.ts +2 -3
- package/components/Buttons/Buttons.styles.js +1 -2
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.d.ts +2 -2
- package/components/Buttons/index.js +2 -2
- package/components/Buttons/index.js.map +1 -1
- package/components/Buttons/useButtons.d.ts +1 -1
- package/components/Buttons/useButtons.js +1 -1
- package/components/Buttons/useButtons.js.map +1 -1
- 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.js +2 -2
- package/components/Dialogs/Dialog.js.map +1 -1
- package/components/Dialogs/DialogsContext.d.ts +1 -6
- package/components/Dialogs/DialogsContext.js +14 -23
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Dialogs/useDialogs.d.ts +1 -2
- package/components/Dialogs/useDialogs.js +1 -2
- package/components/Dialogs/useDialogs.js.map +1 -1
- package/components/EmptyView.d.ts +1 -2
- package/components/EmptyView.js +6 -7
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.d.ts +1 -1
- package/components/Filters/Filters.js +2 -2
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/index.d.ts +2 -2
- package/components/Filters/index.js +2 -2
- package/components/Filters/index.js.map +1 -1
- package/components/FloatingActionButton.js +1 -1
- package/components/FloatingActionButton.js.map +1 -1
- package/components/FloatingPanel.js +4 -6
- package/components/FloatingPanel.js.map +1 -1
- package/components/IconPicker/IconPicker.d.ts +3 -3
- package/components/IconPicker/IconPicker.js +6 -6
- package/components/IconPicker/IconPicker.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.d.ts +3 -3
- package/components/IconPicker/IconPickerComponent.js +4 -4
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.d.ts +3 -3
- package/components/IconPicker/IconPickerPresenter.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.test.js +3 -2
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.d.ts +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.d.ts +1 -1
- package/components/IconPicker/IconPickerTab.js +10 -10
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.d.ts +1 -1
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/IconRepository.d.ts +2 -2
- package/components/IconPicker/IconRepository.js +2 -2
- package/components/IconPicker/IconRepository.js.map +1 -1
- package/components/IconPicker/IconRepository.test.js +2 -1
- package/components/IconPicker/IconRepository.test.js.map +1 -1
- package/components/IconPicker/IconRepositoryFactory.d.ts +2 -2
- package/components/IconPicker/IconRepositoryFactory.js +1 -1
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
- package/components/IconPicker/components/IconPickerCell.d.ts +2 -2
- package/components/IconPicker/components/IconPickerCell.js +3 -3
- package/components/IconPicker/components/IconPickerCell.js.map +1 -1
- package/components/IconPicker/components/IconPickerContent.d.ts +1 -1
- package/components/IconPicker/components/IconPickerContent.js +4 -4
- package/components/IconPicker/components/IconPickerContent.js.map +1 -1
- package/components/IconPicker/components/IconPickerRow.js +1 -1
- package/components/IconPicker/components/IconPickerRow.js.map +1 -1
- package/components/IconPicker/components/IconPickerTrigger.d.ts +1 -1
- package/components/IconPicker/components/IconPickerTrigger.js +7 -7
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
- package/components/IconPicker/components/index.d.ts +4 -4
- package/components/IconPicker/components/index.js +4 -4
- package/components/IconPicker/components/index.js.map +1 -1
- package/components/IconPicker/config/Emojis.js +1 -1
- package/components/IconPicker/config/Emojis.js.map +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
- package/components/IconPicker/config/IconPackProvider.d.ts +1 -1
- package/components/IconPicker/config/IconPackProvider.js.map +1 -1
- package/components/IconPicker/config/IconType.js +2 -2
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.d.ts +3 -3
- package/components/IconPicker/config/index.js +7 -7
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/index.d.ts +7 -7
- package/components/IconPicker/index.js +6 -6
- package/components/IconPicker/index.js.map +1 -1
- package/components/IconPicker/plugins/customPlugin.js +19 -24
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js +9 -9
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js +4 -4
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.d.ts +9 -5
- package/components/LexicalEditor/LexicalEditor.js +32 -21
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/LexicalLinkForm.d.ts +6 -0
- package/components/LexicalEditor/LexicalLinkForm.js +92 -0
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -0
- package/components/LexicalEditor/index.d.ts +3 -1
- package/components/LexicalEditor/index.js +3 -1
- package/components/LexicalEditor/index.js.map +1 -1
- 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/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.js +1 -1
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/index.d.ts +4 -4
- package/components/OptionsMenu/index.js +4 -4
- package/components/OptionsMenu/index.js.map +1 -1
- package/components/OptionsMenu/useOptionsMenuItem.d.ts +2 -2
- package/components/OptionsMenu/useOptionsMenuItem.js +2 -2
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.d.ts +1 -1
- package/components/OverlayLayout/OverlayLayout.js +8 -11
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.js +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -1
- package/components/OverlayLayout/components/OverlayContent.js +1 -1
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -1
- package/components/OverlayLayout/components/OverlayHeader.js +3 -3
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
- package/components/OverlayLayout/components/OverlayRoot.js +1 -1
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -1
- package/components/OverlayLayout/components/index.d.ts +4 -4
- package/components/OverlayLayout/components/index.js +4 -4
- package/components/OverlayLayout/components/index.js.map +1 -1
- package/components/OverlayLayout/index.d.ts +1 -1
- package/components/OverlayLayout/index.js +1 -1
- package/components/OverlayLayout/index.js.map +1 -1
- package/components/Permissions/Permissions.d.ts +1 -3
- package/components/Permissions/Permissions.js +37 -31
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.js +2 -2
- package/components/Permissions/PermissionsGroup.js.map +1 -1
- package/components/Permissions/StyledComponents.js +1 -1
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.d.ts +4 -4
- package/components/Permissions/index.js +4 -4
- 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 -1
- package/components/ResizablePanels/index.js +1 -1
- package/components/ResizablePanels/index.js.map +1 -1
- 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 +1 -2
- package/components/SearchUI.js +1 -2
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/SimpleForm/SimpleForm.js +10 -10
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.d.ts +1 -1
- package/components/SimpleForm/index.js +1 -1
- package/components/SimpleForm/index.js.map +1 -1
- package/components/SimpleUI/InputField.js +3 -3
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +3 -8
- package/components/SingleImageUpload.js +1 -1
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.d.ts +7 -7
- package/components/SplitView/SplitView.js +20 -12
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.d.ts +1 -1
- package/components/SplitView/index.js +1 -1
- package/components/SplitView/index.js.map +1 -1
- package/components/StateInspector.js +1 -1
- package/components/StateInspector.js.map +1 -1
- 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 +4 -0
- package/components/Wcp.js +16 -2
- package/components/Wcp.js.map +1 -1
- package/components/index.d.ts +30 -3
- package/components/index.js +29 -3
- 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 +10 -10
- package/config/AdminConfig/Menu/MenuGroup.js +1 -1
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -1
- package/config/AdminConfig/Menu/MenuItem.d.ts +9 -9
- package/config/AdminConfig/Menu/MenuItem.js +1 -1
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/MenuLink.d.ts +14 -14
- package/config/AdminConfig/Menu/MenuLink.js +10 -4
- package/config/AdminConfig/Menu/MenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu.d.ts +15 -15
- package/config/AdminConfig/Menu/SupportMenu.js +3 -3
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.d.ts +14 -15
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.d.ts +14 -15
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.d.ts +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu.d.ts +31 -31
- package/config/AdminConfig/Menu/UserMenu.js +4 -4
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -1
- package/config/AdminConfig/Menu.d.ts +105 -103
- package/config/AdminConfig/Menu.js +17 -7
- package/config/AdminConfig/Menu.js.map +1 -1
- package/config/AdminConfig/Route.d.ts +1 -1
- package/config/AdminConfig/Route.js +2 -2
- package/config/AdminConfig/Route.js.map +1 -1
- 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 +8 -7
- package/config/AdminConfig/Tenant/TenantLogo.js +14 -6
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantName.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantName.js +5 -2
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -1
- package/config/AdminConfig/Tenant.d.ts +14 -31
- package/config/AdminConfig/Tenant.js +4 -13
- package/config/AdminConfig/Tenant.js.map +1 -1
- package/config/AdminConfig/Theme/assignColor.d.ts +1 -1
- package/config/AdminConfig/Theme/assignColor.js +1 -1
- package/config/AdminConfig/Theme/assignColor.js.map +1 -1
- package/config/AdminConfig/Theme/types.d.ts +1 -1
- package/config/AdminConfig/Theme/types.js.map +1 -1
- package/config/AdminConfig/Theme.d.ts +1 -1
- package/config/AdminConfig/Theme.js +1 -1
- package/config/AdminConfig/Theme.js.map +1 -1
- 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 +202 -150
- package/config/AdminConfig.js +35 -9
- package/config/AdminConfig.js.map +1 -1
- package/config/createAdminConfig.js.map +1 -1
- 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.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 -10
- package/hooks/index.js +11 -10
- package/hooks/index.js.map +1 -1
- package/hooks/useConfirmationDialog.js +3 -3
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +1 -1
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useKeyHandler.js +1 -1
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js +1 -2
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useShiftKey.js +1 -1
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useStateIfMounted.d.ts +0 -1
- package/hooks/useStateIfMounted.js +1 -1
- package/hooks/useStateIfMounted.js.map +1 -1
- 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 -45
- package/index.js +36 -43
- package/index.js.map +1 -1
- package/lexical.css +2 -0
- package/package.json +42 -47
- 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/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/types.d.ts +3 -76
- package/types.js +1 -5
- package/types.js.map +1 -1
- package/base/Base/Routes.d.ts +0 -2
- package/base/Base/Routes.js +0 -24
- package/base/Base/Routes.js.map +0 -1
- package/base/providers/TelemetryProvider.d.ts +0 -1
- package/base/providers/TelemetryProvider.js +0 -22
- package/base/providers/TelemetryProvider.js.map +0 -1
- package/base/providers/ViewCompositionProvider.d.ts +0 -21
- package/base/providers/ViewCompositionProvider.js +0 -47
- package/base/providers/ViewCompositionProvider.js.map +0 -1
- package/base/ui/LocaleSelector.d.ts +0 -39
- package/base/ui/LocaleSelector.js +0 -8
- package/base/ui/LocaleSelector.js.map +0 -1
- package/components/AppInstaller/AppInstaller.d.ts +0 -11
- package/components/AppInstaller/AppInstaller.js +0 -113
- package/components/AppInstaller/AppInstaller.js.map +0 -1
- package/components/AppInstaller/Sidebar.d.ts +0 -9
- package/components/AppInstaller/Sidebar.js +0 -108
- 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 -17
- package/components/AppInstaller/index.js.map +0 -1
- package/components/AppInstaller/styled.d.ts +0 -19
- package/components/AppInstaller/styled.js +0 -75
- package/components/AppInstaller/styled.js.map +0 -1
- package/components/AppInstaller/useInstaller.d.ts +0 -25
- package/components/AppInstaller/useInstaller.js +0 -169
- package/components/AppInstaller/useInstaller.js.map +0 -1
- package/components/Dialogs/CustomDialog.d.ts +0 -17
- package/components/Dialogs/CustomDialog.js +0 -48
- package/components/Dialogs/CustomDialog.js.map +0 -1
- package/components/RichTextEditor/RichTextEditor.d.ts +0 -3
- package/components/RichTextEditor/RichTextEditor.js +0 -16
- package/components/RichTextEditor/RichTextEditor.js.map +0 -1
- package/components/RichTextEditor/index.d.ts +0 -2
- package/components/RichTextEditor/index.js +0 -4
- package/components/RichTextEditor/index.js.map +0 -1
- package/components/RichTextEditor/styles.scss +0 -96
- package/components/RichTextEditor/tools/header/index.d.ts +0 -228
- package/components/RichTextEditor/tools/header/index.js +0 -615
- 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 -122
- package/components/RichTextEditor/tools/image/index.js +0 -202
- 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 -7
- package/components/RichTextEditor/tools/image/svgs.js.map +0 -1
- package/components/RichTextEditor/tools/image/tunes.d.ts +0 -55
- package/components/RichTextEditor/tools/image/tunes.js +0 -103
- 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.map +0 -1
- package/components/RichTextEditor/tools/image/ui.d.ts +0 -120
- package/components/RichTextEditor/tools/image/ui.js +0 -245
- package/components/RichTextEditor/tools/image/ui.js.map +0 -1
- package/components/RichTextEditor/tools/paragraph/index.d.ts +0 -208
- package/components/RichTextEditor/tools/paragraph/index.js +0 -435
- 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 -61
- package/components/RichTextEditor/tools/textColor/index.js +0 -197
- 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 -24
- package/components/RichTextEditor/tools/utils.js.map +0 -1
- package/components/Routes.d.ts +0 -6
- package/components/Routes.js +0 -34
- package/components/Routes.js.map +0 -1
- package/plugins/PermissionRendererPlugin.d.ts +0 -22
- package/plugins/PermissionRendererPlugin.js +0 -19
- package/plugins/PermissionRendererPlugin.js.map +0 -1
- package/plugins/uiLayoutRenderer/index.d.ts +0 -2
- package/plugins/uiLayoutRenderer/index.js +0 -53
- package/plugins/uiLayoutRenderer/index.js.map +0 -1
- package/ui/UIElement.d.ts +0 -2
- package/ui/UIElement.js +0 -3
- package/ui/UIElement.js.map +0 -1
- package/ui/UILayout.d.ts +0 -1
- package/ui/UILayout.js +0 -3
- package/ui/UILayout.js.map +0 -1
- package/ui/UIRenderer.d.ts +0 -2
- package/ui/UIRenderer.js +0 -3
- package/ui/UIRenderer.js.map +0 -1
- package/ui/UIView.d.ts +0 -2
- package/ui/UIView.js +0 -3
- package/ui/UIView.js.map +0 -1
- package/ui/elements/AccordionElement.d.ts +0 -28
- package/ui/elements/AccordionElement.js +0 -48
- package/ui/elements/AccordionElement.js.map +0 -1
- package/ui/elements/ButtonElement.d.ts +0 -25
- package/ui/elements/ButtonElement.js +0 -52
- package/ui/elements/ButtonElement.js.map +0 -1
- package/ui/elements/ButtonGroupElement.d.ts +0 -7
- package/ui/elements/ButtonGroupElement.js +0 -29
- package/ui/elements/ButtonGroupElement.js.map +0 -1
- package/ui/elements/GenericElement.d.ts +0 -1
- package/ui/elements/GenericElement.js +0 -3
- package/ui/elements/GenericElement.js.map +0 -1
- package/ui/elements/LabelElement.d.ts +0 -17
- package/ui/elements/LabelElement.js +0 -23
- package/ui/elements/LabelElement.js.map +0 -1
- package/ui/elements/NavigationMenuElement.d.ts +0 -34
- package/ui/elements/NavigationMenuElement.js +0 -88
- package/ui/elements/NavigationMenuElement.js.map +0 -1
- package/ui/elements/PanelElement.d.ts +0 -3
- package/ui/elements/PanelElement.js +0 -4
- package/ui/elements/PanelElement.js.map +0 -1
- package/ui/elements/PlaceholderElement.d.ts +0 -6
- package/ui/elements/PlaceholderElement.js +0 -11
- package/ui/elements/PlaceholderElement.js.map +0 -1
- package/ui/elements/SmallButtonElement.d.ts +0 -8
- package/ui/elements/SmallButtonElement.js +0 -24
- package/ui/elements/SmallButtonElement.js.map +0 -1
- package/ui/elements/TypographyElement.d.ts +0 -14
- package/ui/elements/TypographyElement.js +0 -23
- package/ui/elements/TypographyElement.js.map +0 -1
- package/ui/elements/ViewElement.d.ts +0 -1
- package/ui/elements/ViewElement.js +0 -3
- package/ui/elements/ViewElement.js.map +0 -1
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +0 -7
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +0 -26
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +0 -1
- package/ui/elements/form/DynamicFieldsetElement.d.ts +0 -44
- package/ui/elements/form/DynamicFieldsetElement.js +0 -97
- 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 -10
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +0 -1
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +0 -8
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +0 -47
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +0 -1
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +0 -14
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +0 -73
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +0 -1
- package/ui/elements/form/FileManagerElement/styled.d.ts +0 -23
- package/ui/elements/form/FileManagerElement/styled.js +0 -108
- package/ui/elements/form/FileManagerElement/styled.js.map +0 -1
- package/ui/elements/form/FileManagerElement.d.ts +0 -25
- package/ui/elements/form/FileManagerElement.js +0 -46
- package/ui/elements/form/FileManagerElement.js.map +0 -1
- package/ui/elements/form/FormElement.d.ts +0 -22
- package/ui/elements/form/FormElement.js +0 -20
- package/ui/elements/form/FormElement.js.map +0 -1
- package/ui/elements/form/FormFieldElement.d.ts +0 -57
- package/ui/elements/form/FormFieldElement.js +0 -113
- package/ui/elements/form/FormFieldElement.js.map +0 -1
- package/ui/elements/form/HiddenElement.d.ts +0 -7
- package/ui/elements/form/HiddenElement.js +0 -25
- package/ui/elements/form/HiddenElement.js.map +0 -1
- package/ui/elements/form/InputElement.d.ts +0 -8
- package/ui/elements/form/InputElement.js +0 -32
- 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 -29
- 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 -16
- package/ui/elements/form/SelectElement.js +0 -42
- package/ui/elements/form/SelectElement.js.map +0 -1
- package/ui/elements/form/TextareaElement.d.ts +0 -16
- package/ui/elements/form/TextareaElement.js +0 -34
- 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 -37
- 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 -68
- package/ui/views/AdminView/HeaderElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +0 -7
- package/ui/views/AdminView/HeaderSectionCenterElement.js +0 -21
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +0 -7
- package/ui/views/AdminView/HeaderSectionLeftElement.js +0 -21
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +0 -1
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +0 -7
- package/ui/views/AdminView/HeaderSectionRightElement.js +0 -21
- 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 -41
- 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 -23
- package/ui/views/AdminView/components/Hamburger.js.map +0 -1
- package/ui/views/FormView/FormContainerElement.d.ts +0 -13
- package/ui/views/FormView/FormContainerElement.js +0 -19
- package/ui/views/FormView/FormContainerElement.js.map +0 -1
- package/ui/views/FormView/FormContentElement.d.ts +0 -6
- package/ui/views/FormView/FormContentElement.js +0 -10
- package/ui/views/FormView/FormContentElement.js.map +0 -1
- package/ui/views/FormView/FormFooterElement.d.ts +0 -7
- package/ui/views/FormView/FormFooterElement.js +0 -14
- package/ui/views/FormView/FormFooterElement.js.map +0 -1
- package/ui/views/FormView/FormHeaderElement.d.ts +0 -15
- package/ui/views/FormView/FormHeaderElement.js +0 -30
- package/ui/views/FormView/FormHeaderElement.js.map +0 -1
- package/ui/views/FormView.d.ts +0 -40
- package/ui/views/FormView.js +0 -121
- package/ui/views/FormView.js.map +0 -1
- package/ui/views/OverlayView/ContentElement.d.ts +0 -7
- package/ui/views/OverlayView/ContentElement.js +0 -29
- package/ui/views/OverlayView/ContentElement.js.map +0 -1
- package/ui/views/OverlayView/HeaderElement.d.ts +0 -25
- package/ui/views/OverlayView/HeaderElement.js +0 -72
- package/ui/views/OverlayView/HeaderElement.js.map +0 -1
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +0 -15
- package/ui/views/OverlayView/HeaderTitleElement.js +0 -25
- 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 -34
- package/ui/views/OverlayView/useOverlayView.js.map +0 -1
- package/ui/views/OverlayView.d.ts +0 -30
- package/ui/views/OverlayView.js +0 -109
- package/ui/views/OverlayView.js.map +0 -1
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +0 -12
- package/ui/views/SplitView/SplitViewPanelElement.js +0 -32
- package/ui/views/SplitView/SplitViewPanelElement.js.map +0 -1
- package/ui/views/SplitView.d.ts +0 -21
- package/ui/views/SplitView.js +0 -86
- package/ui/views/SplitView.js.map +0 -1
- /package/base/Base/Tenant/{wby-logo.svg → wby-square.svg} +0 -0
- /package/{components/RichTextEditor/tools/image → features/security/AuthenticationContext}/types.js +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
const PermissionValueContext = /*#__PURE__*/React.createContext(null);
|
|
3
|
+
export const PermissionValueProvider = ({
|
|
4
|
+
value,
|
|
5
|
+
onChange,
|
|
6
|
+
children
|
|
7
|
+
}) => {
|
|
8
|
+
return /*#__PURE__*/React.createElement(PermissionValueContext.Provider, {
|
|
9
|
+
value: {
|
|
10
|
+
value,
|
|
11
|
+
onChange
|
|
12
|
+
}
|
|
13
|
+
}, children);
|
|
14
|
+
};
|
|
15
|
+
export function usePermissionValue() {
|
|
16
|
+
const ctx = useContext(PermissionValueContext);
|
|
17
|
+
if (!ctx) {
|
|
18
|
+
throw new Error("usePermissionValue must be used within a PermissionValueProvider");
|
|
19
|
+
}
|
|
20
|
+
return ctx;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=PermissionValueContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useContext","PermissionValueContext","createContext","PermissionValueProvider","value","onChange","children","createElement","Provider","usePermissionValue","ctx","Error"],"sources":["PermissionValueContext.tsx"],"sourcesContent":["import React, { useContext } from \"react\";\nimport type { Permission } from \"./types.js\";\n\ninterface PermissionValueContextValue {\n value: Permission[];\n onChange: (value: Permission[]) => void;\n}\n\nconst PermissionValueContext = React.createContext<PermissionValueContextValue | null>(null);\n\nexport const PermissionValueProvider = ({\n value,\n onChange,\n children\n}: PermissionValueContextValue & { children: React.ReactNode }) => {\n return (\n <PermissionValueContext.Provider value={{ value, onChange }}>\n {children}\n </PermissionValueContext.Provider>\n );\n};\n\nexport function usePermissionValue(): PermissionValueContextValue {\n const ctx = useContext(PermissionValueContext);\n if (!ctx) {\n throw new Error(\"usePermissionValue must be used within a PermissionValueProvider\");\n }\n return ctx;\n}\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAQzC,MAAMC,sBAAsB,gBAAGF,KAAK,CAACG,aAAa,CAAqC,IAAI,CAAC;AAE5F,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EACpCC,KAAK;EACLC,QAAQ;EACRC;AACyD,CAAC,KAAK;EAC/D,oBACIP,KAAA,CAAAQ,aAAA,CAACN,sBAAsB,CAACO,QAAQ;IAACJ,KAAK,EAAE;MAAEA,KAAK;MAAEC;IAAS;EAAE,GACvDC,QAC4B,CAAC;AAE1C,CAAC;AAED,OAAO,SAASG,kBAAkBA,CAAA,EAAgC;EAC9D,MAAMC,GAAG,GAAGV,UAAU,CAACC,sBAAsB,CAAC;EAC9C,IAAI,CAACS,GAAG,EAAE;IACN,MAAM,IAAIC,KAAK,CAAC,kEAAkE,CAAC;EACvF;EACA,OAAOD,GAAG;AACd","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { createUsePermissions } from "./usePermissions.js";
|
|
3
|
+
const BUILT_IN_ACTIONS = {
|
|
4
|
+
read: "canRead",
|
|
5
|
+
create: "canCreate",
|
|
6
|
+
edit: "canEdit",
|
|
7
|
+
delete: "canDelete",
|
|
8
|
+
publish: "canPublish",
|
|
9
|
+
unpublish: "canUnpublish"
|
|
10
|
+
};
|
|
11
|
+
export function createHasPermission(schema) {
|
|
12
|
+
const usePermissions = createUsePermissions(schema);
|
|
13
|
+
return function HasPermission({
|
|
14
|
+
children,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const permissions = usePermissions();
|
|
18
|
+
const action = props.action;
|
|
19
|
+
const entities = props.entity ? [props.entity] : props.any ?? props.all ?? [];
|
|
20
|
+
const requireAll = !!props.all;
|
|
21
|
+
const check = entityId => {
|
|
22
|
+
if (!action) {
|
|
23
|
+
return permissions.canAccess(entityId);
|
|
24
|
+
}
|
|
25
|
+
const method = BUILT_IN_ACTIONS[action];
|
|
26
|
+
if (method) {
|
|
27
|
+
return permissions[method](entityId);
|
|
28
|
+
}
|
|
29
|
+
return permissions.canAction(action, entityId);
|
|
30
|
+
};
|
|
31
|
+
const allowed = requireAll ? entities.every(check) : entities.some(check);
|
|
32
|
+
return allowed ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=createHasPermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createUsePermissions","BUILT_IN_ACTIONS","read","create","edit","delete","publish","unpublish","createHasPermission","schema","usePermissions","HasPermission","children","props","permissions","action","entities","entity","any","all","requireAll","check","entityId","canAccess","method","canAction","allowed","every","some","createElement","Fragment"],"sources":["createHasPermission.tsx"],"sourcesContent":["import React from \"react\";\nimport { createUsePermissions } from \"./usePermissions.js\";\nimport type { PermissionSchemaConfig, HasPermissionProps } from \"./types.js\";\n\nconst BUILT_IN_ACTIONS: Record<string, string> = {\n read: \"canRead\",\n create: \"canCreate\",\n edit: \"canEdit\",\n delete: \"canDelete\",\n publish: \"canPublish\",\n unpublish: \"canUnpublish\"\n};\n\nexport function createHasPermission<const S extends PermissionSchemaConfig>(\n schema: S\n): React.FC<HasPermissionProps<S>> {\n const usePermissions = createUsePermissions(schema);\n\n return function HasPermission({ children, ...props }) {\n const permissions = usePermissions();\n\n const action = props.action as string | undefined;\n const entities: string[] = props.entity ? [props.entity] : (props.any ?? props.all ?? []);\n const requireAll = !!props.all;\n\n const check = (entityId: string): boolean => {\n if (!action) {\n return permissions.canAccess(entityId as any);\n }\n const method = BUILT_IN_ACTIONS[action];\n if (method) {\n return (permissions as any)[method](entityId);\n }\n return permissions.canAction(action as any, entityId as any);\n };\n\n const allowed = requireAll ? entities.every(check) : entities.some(check);\n\n return allowed ? <>{children}</> : null;\n };\n}\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,oBAAoB;AAG7B,MAAMC,gBAAwC,GAAG;EAC7CC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,WAAW;EACnBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,WAAW;EACnBC,OAAO,EAAE,YAAY;EACrBC,SAAS,EAAE;AACf,CAAC;AAED,OAAO,SAASC,mBAAmBA,CAC/BC,MAAS,EACsB;EAC/B,MAAMC,cAAc,GAAGV,oBAAoB,CAACS,MAAM,CAAC;EAEnD,OAAO,SAASE,aAAaA,CAAC;IAAEC,QAAQ;IAAE,GAAGC;EAAM,CAAC,EAAE;IAClD,MAAMC,WAAW,GAAGJ,cAAc,CAAC,CAAC;IAEpC,MAAMK,MAAM,GAAGF,KAAK,CAACE,MAA4B;IACjD,MAAMC,QAAkB,GAAGH,KAAK,CAACI,MAAM,GAAG,CAACJ,KAAK,CAACI,MAAM,CAAC,GAAIJ,KAAK,CAACK,GAAG,IAAIL,KAAK,CAACM,GAAG,IAAI,EAAG;IACzF,MAAMC,UAAU,GAAG,CAAC,CAACP,KAAK,CAACM,GAAG;IAE9B,MAAME,KAAK,GAAIC,QAAgB,IAAc;MACzC,IAAI,CAACP,MAAM,EAAE;QACT,OAAOD,WAAW,CAACS,SAAS,CAACD,QAAe,CAAC;MACjD;MACA,MAAME,MAAM,GAAGvB,gBAAgB,CAACc,MAAM,CAAC;MACvC,IAAIS,MAAM,EAAE;QACR,OAAQV,WAAW,CAASU,MAAM,CAAC,CAACF,QAAQ,CAAC;MACjD;MACA,OAAOR,WAAW,CAACW,SAAS,CAACV,MAAM,EAASO,QAAe,CAAC;IAChE,CAAC;IAED,MAAMI,OAAO,GAAGN,UAAU,GAAGJ,QAAQ,CAACW,KAAK,CAACN,KAAK,CAAC,GAAGL,QAAQ,CAACY,IAAI,CAACP,KAAK,CAAC;IAEzE,OAAOK,OAAO,gBAAG3B,KAAA,CAAA8B,aAAA,CAAA9B,KAAA,CAAA+B,QAAA,QAAGlB,QAAW,CAAC,GAAG,IAAI;EAC3C,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPermissionSchema","config","entities"],"sources":["createPermissionSchema.ts"],"sourcesContent":["import type { PermissionSchemaConfig } from \"./types.js\";\n\nexport function createPermissionSchema<const T extends PermissionSchemaConfig>(config: T): T {\n return {\n ...config,\n entities: config.entities ?? []\n };\n}\n"],"mappings":"AAEA,OAAO,SAASA,sBAAsBA,CAAyCC,MAAS,EAAK;EACzF,OAAO;IACH,GAAGA,MAAM;IACTC,QAAQ,EAAED,MAAM,CAACC,QAAQ,IAAI;EACjC,CAAC;AACL","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createPermissionSchema } from "./createPermissionSchema.js";
|
|
2
|
+
export { createUsePermissions } from "./usePermissions.js";
|
|
3
|
+
export { usePermissionForm, deserializePermissions, serializePermissions } from "./usePermissionForm.js";
|
|
4
|
+
export { PermissionRenderer } from "./PermissionRenderer.js";
|
|
5
|
+
export type { PermissionRendererProps } from "./PermissionRenderer.js";
|
|
6
|
+
export { usePermissionValue, PermissionValueProvider } from "./PermissionValueContext.js";
|
|
7
|
+
export { createHasPermission } from "./createHasPermission.js";
|
|
8
|
+
export type { Permission, ActionDefinition, EntityDefinition, OwnableItem, PermissionSchemaConfig, PermissionSchema, UsePermissionFormOptions, UsePermissionFormResult, UsePermissionsResult, PermissionRendererConfig, HasPermissionAction, HasPermissionProps } from "./types.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createPermissionSchema } from "./createPermissionSchema.js";
|
|
2
|
+
export { createUsePermissions } from "./usePermissions.js";
|
|
3
|
+
export { usePermissionForm, deserializePermissions, serializePermissions } from "./usePermissionForm.js";
|
|
4
|
+
export { PermissionRenderer } from "./PermissionRenderer.js";
|
|
5
|
+
export { usePermissionValue, PermissionValueProvider } from "./PermissionValueContext.js";
|
|
6
|
+
export { createHasPermission } from "./createHasPermission.js";
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPermissionSchema","createUsePermissions","usePermissionForm","deserializePermissions","serializePermissions","PermissionRenderer","usePermissionValue","PermissionValueProvider","createHasPermission"],"sources":["index.ts"],"sourcesContent":["export { createPermissionSchema } from \"./createPermissionSchema.js\";\nexport { createUsePermissions } from \"./usePermissions.js\";\nexport {\n usePermissionForm,\n deserializePermissions,\n serializePermissions\n} from \"./usePermissionForm.js\";\nexport { PermissionRenderer } from \"./PermissionRenderer.js\";\nexport type { PermissionRendererProps } from \"./PermissionRenderer.js\";\nexport { usePermissionValue, PermissionValueProvider } from \"./PermissionValueContext.js\";\nexport { createHasPermission } from \"./createHasPermission.js\";\nexport type {\n Permission,\n ActionDefinition,\n EntityDefinition,\n OwnableItem,\n PermissionSchemaConfig,\n PermissionSchema,\n UsePermissionFormOptions,\n UsePermissionFormResult,\n UsePermissionsResult,\n PermissionRendererConfig,\n HasPermissionAction,\n HasPermissionProps\n} from \"./types.js\";\n"],"mappings":"AAAA,SAASA,sBAAsB;AAC/B,SAASC,oBAAoB;AAC7B,SACIC,iBAAiB,EACjBC,sBAAsB,EACtBC,oBAAoB;AAExB,SAASC,kBAAkB;AAE3B,SAASC,kBAAkB,EAAEC,uBAAuB;AACpD,SAASC,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A single permission object from the API.
|
|
4
|
+
*/
|
|
5
|
+
export interface Permission {
|
|
6
|
+
name: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* An action definition on an entity.
|
|
11
|
+
*
|
|
12
|
+
* Built-in actions:
|
|
13
|
+
* - `{ name: "rwd" }` — read/write/delete single-select (serialized as joined string, e.g. "rw")
|
|
14
|
+
* - `{ name: "pw" }` — publish/unpublish multi-select (serialized as joined string, e.g. "pu")
|
|
15
|
+
*
|
|
16
|
+
* Custom actions:
|
|
17
|
+
* - `{ name: "install", label: "Install" }` — boolean flag (serialized as `install: true`)
|
|
18
|
+
*/
|
|
19
|
+
export interface ActionDefinition {
|
|
20
|
+
/** Key on the permission object (e.g. "rwd", "pw", "install") */
|
|
21
|
+
name: string;
|
|
22
|
+
/** Display label for the UI. Required for custom actions; ignored for built-in "rwd"/"pw". */
|
|
23
|
+
label?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Defines an entity within a permission schema.
|
|
27
|
+
*/
|
|
28
|
+
export interface EntityDefinition {
|
|
29
|
+
/** Unique ID, used for form field naming: ${id}AccessScope, ${id}RWD, etc. */
|
|
30
|
+
id: string;
|
|
31
|
+
/** Display title for the UI renderer (e.g. "Files", "Settings") */
|
|
32
|
+
title?: string;
|
|
33
|
+
/** Permission name emitted for this entity (e.g. "fm.file") */
|
|
34
|
+
permission: string;
|
|
35
|
+
/** Available access scopes */
|
|
36
|
+
scopes: ("full" | "own")[];
|
|
37
|
+
/** Action definitions for this entity */
|
|
38
|
+
actions?: ActionDefinition[];
|
|
39
|
+
/** Dependency on another entity */
|
|
40
|
+
dependsOn?: {
|
|
41
|
+
/** ID of parent entity */
|
|
42
|
+
entity: string;
|
|
43
|
+
/** Required action character (e.g. "r") */
|
|
44
|
+
requires: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Configuration for creating a permission schema.
|
|
49
|
+
*/
|
|
50
|
+
export interface PermissionSchemaConfig {
|
|
51
|
+
/** Permission prefix — used to filter permissions from the array */
|
|
52
|
+
prefix: string;
|
|
53
|
+
/**
|
|
54
|
+
* Full access configuration.
|
|
55
|
+
* - `true` — emits `{ name: "${prefix}.*" }`.
|
|
56
|
+
* - `{ ...extras }` — emits `{ name: "${prefix}.*", ...extras }`.
|
|
57
|
+
*/
|
|
58
|
+
fullAccess: boolean | {
|
|
59
|
+
[key: string]: any;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Read-only access configuration. When defined, the schema supports a read-only tier.
|
|
63
|
+
* - `true` — emits `{ name: "${prefix}.*", rwd: "r" }`.
|
|
64
|
+
* - `Permission[]` — emits the array as-is.
|
|
65
|
+
*/
|
|
66
|
+
readOnlyAccess?: boolean | Permission[];
|
|
67
|
+
/** Entity definitions (optional — simple apps have none) */
|
|
68
|
+
entities?: EntityDefinition[];
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A compiled permission schema returned by `createPermissionSchema`.
|
|
72
|
+
*/
|
|
73
|
+
export interface PermissionSchema {
|
|
74
|
+
prefix: string;
|
|
75
|
+
/**
|
|
76
|
+
* Full access configuration.
|
|
77
|
+
* - `true` — emits `{ name: "${prefix}.*" }`.
|
|
78
|
+
* - `{ ...extras }` — emits `{ name: "${prefix}.*", ...extras }`.
|
|
79
|
+
*/
|
|
80
|
+
fullAccess: boolean | {
|
|
81
|
+
[key: string]: any;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Read-only access configuration. When defined, the schema supports a read-only tier.
|
|
85
|
+
* - `true` — emits `{ name: "${prefix}.*", rwd: "r" }`.
|
|
86
|
+
* - `Permission[]` — emits the array as-is.
|
|
87
|
+
*/
|
|
88
|
+
readOnlyAccess?: boolean | Permission[];
|
|
89
|
+
entities?: EntityDefinition[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Options passed to the `usePermissionForm` hook.
|
|
93
|
+
*/
|
|
94
|
+
export interface UsePermissionFormOptions {
|
|
95
|
+
value: Permission[];
|
|
96
|
+
onChange: (value: Permission[]) => void;
|
|
97
|
+
/** Merge extra fields into deserialized form data (for CMS endpoints, resource scopes, etc.) */
|
|
98
|
+
deserialize?: (permissions: Permission[]) => Record<string, any>;
|
|
99
|
+
/** Transform or extend the core-serialized permissions (for CMS endpoints, resource scopes, etc.) */
|
|
100
|
+
serialize?: (formData: Record<string, any>, corePermissions: Permission[]) => Permission[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Return value of `usePermissionForm`.
|
|
104
|
+
*/
|
|
105
|
+
export interface UsePermissionFormResult {
|
|
106
|
+
formData: Record<string, any>;
|
|
107
|
+
onFormChange: (data: Record<string, any>) => void;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Configuration for a permission renderer registered via AdminConfig.
|
|
111
|
+
*
|
|
112
|
+
* Either `schema` or `element` must be provided:
|
|
113
|
+
* - `schema`: uses the built-in PermissionRenderer for auto-generated UI.
|
|
114
|
+
* - `element`: uses a custom React element for full control.
|
|
115
|
+
*/
|
|
116
|
+
export type PermissionRendererConfig = PermissionRendererConfigBase & ({
|
|
117
|
+
schema: PermissionSchema;
|
|
118
|
+
element?: never;
|
|
119
|
+
} | {
|
|
120
|
+
schema?: never;
|
|
121
|
+
element: React.ReactElement;
|
|
122
|
+
});
|
|
123
|
+
interface PermissionRendererConfigBase {
|
|
124
|
+
name: string;
|
|
125
|
+
title: string;
|
|
126
|
+
description?: string;
|
|
127
|
+
icon?: React.ReactElement;
|
|
128
|
+
system?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Item that may have an owner (used for own-scope permission checks).
|
|
132
|
+
*/
|
|
133
|
+
export interface OwnableItem {
|
|
134
|
+
createdBy?: {
|
|
135
|
+
id: string;
|
|
136
|
+
} | null;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Extract the union of entity definitions from a schema config type.
|
|
140
|
+
*/
|
|
141
|
+
type EntitiesOf<S extends PermissionSchemaConfig> = S extends {
|
|
142
|
+
entities: ReadonlyArray<infer E extends EntityDefinition>;
|
|
143
|
+
} ? E : never;
|
|
144
|
+
/**
|
|
145
|
+
* Extract entity IDs whose actions array contains an action with the given name.
|
|
146
|
+
*/
|
|
147
|
+
type EntityIdWithAction<S extends PermissionSchemaConfig, A extends string> = {
|
|
148
|
+
[K in EntitiesOf<S> as K extends {
|
|
149
|
+
actions: ReadonlyArray<infer Act>;
|
|
150
|
+
} ? Act extends {
|
|
151
|
+
name: A;
|
|
152
|
+
} ? K["id"] : never : never]: never;
|
|
153
|
+
} extends infer M ? keyof M & string : never;
|
|
154
|
+
/**
|
|
155
|
+
* Entity IDs that have the "rwd" action.
|
|
156
|
+
*/
|
|
157
|
+
export type RwdEntityId<S extends PermissionSchemaConfig> = EntityIdWithAction<S, "rwd">;
|
|
158
|
+
/**
|
|
159
|
+
* Entity IDs that have the "pw" action.
|
|
160
|
+
*/
|
|
161
|
+
export type PwEntityId<S extends PermissionSchemaConfig> = EntityIdWithAction<S, "pw">;
|
|
162
|
+
/**
|
|
163
|
+
* All entity IDs in the schema.
|
|
164
|
+
*/
|
|
165
|
+
export type AllEntityIds<S extends PermissionSchemaConfig> = EntitiesOf<S>["id"];
|
|
166
|
+
/**
|
|
167
|
+
* Custom (non-builtin) action names across all entities.
|
|
168
|
+
*/
|
|
169
|
+
export type CustomActionNames<S extends PermissionSchemaConfig> = Exclude<EntitiesOf<S> extends {
|
|
170
|
+
actions: ReadonlyArray<infer Act extends ActionDefinition>;
|
|
171
|
+
} ? Act["name"] : never, "rwd" | "pw">;
|
|
172
|
+
/**
|
|
173
|
+
* The return type of `usePermissions(schema)`.
|
|
174
|
+
*
|
|
175
|
+
* When the schema has literal entity types, methods are narrowed to only accept valid entity IDs.
|
|
176
|
+
* When the schema is dynamically typed, all methods accept `string`.
|
|
177
|
+
*/
|
|
178
|
+
export type UsePermissionsResult<S extends PermissionSchemaConfig> = string extends AllEntityIds<S> ? UsePermissionsResultUntyped : UsePermissionsResultTyped<S>;
|
|
179
|
+
export interface UsePermissionsResultUntyped {
|
|
180
|
+
canAccess: (entityId: string) => boolean;
|
|
181
|
+
canRead: (entityId: string) => boolean;
|
|
182
|
+
canCreate: (entityId: string) => boolean;
|
|
183
|
+
canEdit: (entityId: string, item?: OwnableItem) => boolean;
|
|
184
|
+
canDelete: (entityId: string, item?: OwnableItem) => boolean;
|
|
185
|
+
canPublish: (entityId: string) => boolean;
|
|
186
|
+
canUnpublish: (entityId: string) => boolean;
|
|
187
|
+
canAction: (action: string, entityId: string) => boolean;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Action values accepted by `HasPermission`.
|
|
191
|
+
*
|
|
192
|
+
* Built-in actions are always available; custom action names from the schema are inferred automatically.
|
|
193
|
+
*/
|
|
194
|
+
export type HasPermissionAction<S extends PermissionSchemaConfig> = "read" | "create" | "edit" | "delete" | "publish" | "unpublish" | CustomActionNames<S>;
|
|
195
|
+
/**
|
|
196
|
+
* Props for a schema-bound `HasPermission` component created via `createHasPermission`.
|
|
197
|
+
*
|
|
198
|
+
* Exactly one of `entity`, `any`, or `all` must be provided.
|
|
199
|
+
*/
|
|
200
|
+
export type HasPermissionProps<S extends PermissionSchemaConfig> = SingleEntityProps<S> | AnyEntitiesProps<S> | AllEntitiesProps<S>;
|
|
201
|
+
interface SingleEntityProps<S extends PermissionSchemaConfig> {
|
|
202
|
+
entity: AllEntityIds<S>;
|
|
203
|
+
any?: never;
|
|
204
|
+
all?: never;
|
|
205
|
+
action?: HasPermissionAction<S>;
|
|
206
|
+
children: React.ReactNode;
|
|
207
|
+
}
|
|
208
|
+
interface AnyEntitiesProps<S extends PermissionSchemaConfig> {
|
|
209
|
+
entity?: never;
|
|
210
|
+
any: AllEntityIds<S>[];
|
|
211
|
+
all?: never;
|
|
212
|
+
action?: HasPermissionAction<S>;
|
|
213
|
+
children: React.ReactNode;
|
|
214
|
+
}
|
|
215
|
+
interface AllEntitiesProps<S extends PermissionSchemaConfig> {
|
|
216
|
+
entity?: never;
|
|
217
|
+
any?: never;
|
|
218
|
+
all: AllEntityIds<S>[];
|
|
219
|
+
action?: HasPermissionAction<S>;
|
|
220
|
+
children: React.ReactNode;
|
|
221
|
+
}
|
|
222
|
+
type UsePermissionsResultTyped<S extends PermissionSchemaConfig> = {
|
|
223
|
+
canAccess: (entityId: AllEntityIds<S>) => boolean;
|
|
224
|
+
canAction: (action: CustomActionNames<S> extends never ? string : CustomActionNames<S>, entityId: AllEntityIds<S>) => boolean;
|
|
225
|
+
} & ([RwdEntityId<S>] extends [never] ? {
|
|
226
|
+
canRead: (entityId: string) => boolean;
|
|
227
|
+
canCreate: (entityId: string) => boolean;
|
|
228
|
+
canEdit: (entityId: string, item?: OwnableItem) => boolean;
|
|
229
|
+
canDelete: (entityId: string, item?: OwnableItem) => boolean;
|
|
230
|
+
} : {
|
|
231
|
+
canRead: (entityId: RwdEntityId<S>) => boolean;
|
|
232
|
+
canCreate: (entityId: RwdEntityId<S>) => boolean;
|
|
233
|
+
canEdit: (entityId: RwdEntityId<S>, item?: OwnableItem) => boolean;
|
|
234
|
+
canDelete: (entityId: RwdEntityId<S>, item?: OwnableItem) => boolean;
|
|
235
|
+
}) & ([PwEntityId<S>] extends [never] ? {
|
|
236
|
+
canPublish: (entityId: string) => boolean;
|
|
237
|
+
canUnpublish: (entityId: string) => boolean;
|
|
238
|
+
} : {
|
|
239
|
+
canPublish: (entityId: PwEntityId<S>) => boolean;
|
|
240
|
+
canUnpublish: (entityId: PwEntityId<S>) => boolean;
|
|
241
|
+
});
|
|
242
|
+
export {};
|
|
@@ -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
|