@webiny/app-admin 6.3.0 → 6.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons/add-18px.js +20 -0
- package/assets/icons/add-18px.js.map +1 -0
- package/assets/icons/arrow_drop_down-24px.js +20 -0
- package/assets/icons/arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/attach_file_black_24dp.js +20 -0
- package/assets/icons/attach_file_black_24dp.js.map +1 -0
- package/assets/icons/baseline-menu-24px.js +20 -0
- package/assets/icons/baseline-menu-24px.js.map +1 -0
- package/assets/icons/baseline-notification_important-24px.js +19 -0
- package/assets/icons/baseline-notification_important-24px.js.map +1 -0
- package/assets/icons/baseline-security-24px.js +19 -0
- package/assets/icons/baseline-security-24px.js.map +1 -0
- package/assets/icons/file_download.js +19 -0
- package/assets/icons/file_download.js.map +1 -0
- package/assets/icons/file_upload.js +19 -0
- package/assets/icons/file_upload.js.map +1 -0
- package/assets/icons/filter-24px.js +23 -0
- package/assets/icons/filter-24px.js.map +1 -0
- package/assets/icons/github-brands.js +19 -0
- package/assets/icons/github-brands.js.map +1 -0
- package/assets/icons/highlight-24px.js +19 -0
- package/assets/icons/highlight-24px.js.map +1 -0
- package/assets/icons/icon-community.js +18 -0
- package/assets/icons/icon-community.js.map +1 -0
- package/assets/icons/icon-documentation.js +18 -0
- package/assets/icons/icon-documentation.js.map +1 -0
- package/assets/icons/info.js +19 -0
- package/assets/icons/info.js.map +1 -0
- package/assets/icons/insert_drive_file-24px.js +19 -0
- package/assets/icons/insert_drive_file-24px.js.map +1 -0
- package/assets/icons/insert_photo-24px.js +19 -0
- package/assets/icons/insert_photo-24px.js.map +1 -0
- package/assets/icons/label-24px.js +19 -0
- package/assets/icons/label-24px.js.map +1 -0
- package/assets/icons/round-account_circle-24px.js +19 -0
- package/assets/icons/round-account_circle-24px.js.map +1 -0
- package/assets/icons/round-add-24px.js +20 -0
- package/assets/icons/round-add-24px.js.map +1 -0
- package/assets/icons/round-arrow_drop_down-24px.js +19 -0
- package/assets/icons/round-arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/round-chevron_right-24px.js +20 -0
- package/assets/icons/round-chevron_right-24px.js.map +1 -0
- package/assets/icons/round-feedback-24px.js +20 -0
- package/assets/icons/round-feedback-24px.js.map +1 -0
- package/assets/icons/round-help-24px.js +19 -0
- package/assets/icons/round-help-24px.js.map +1 -0
- package/assets/icons/round-invert_colors-24px.js +20 -0
- package/assets/icons/round-invert_colors-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js.map +1 -0
- package/assets/icons/round-lock_open-24px.js +22 -0
- package/assets/icons/round-lock_open-24px.js.map +1 -0
- package/assets/icons/round-more_vert-24px.js +20 -0
- package/assets/icons/round-more_vert-24px.js.map +1 -0
- package/assets/icons/round-open_in_new-24px.js +20 -0
- package/assets/icons/round-open_in_new-24px.js.map +1 -0
- package/assets/icons/round-settings-24px.js +20 -0
- package/assets/icons/round-settings-24px.js.map +1 -0
- package/assets/icons/search-24px.js +21 -0
- package/assets/icons/search-24px.js.map +1 -0
- package/assets/icons/slack-logo.js +14 -0
- package/assets/icons/slack-logo.js.map +1 -0
- package/assets/icons/today-24px.js +19 -0
- package/assets/icons/today-24px.js.map +1 -0
- package/assets/icons/touch_app.js +20 -0
- package/assets/icons/touch_app.js.map +1 -0
- package/assets/images/webiny-logo.js +34 -0
- package/assets/images/webiny-logo.js.map +1 -0
- package/assets/images/webiny-orange-logo.js +34 -0
- package/assets/images/webiny-orange-logo.js.map +1 -0
- package/base/Admin.js +37 -28
- package/base/Admin.js.map +1 -1
- package/base/Base/DefaultFieldRenderers.js +73 -70
- package/base/Base/DefaultFieldRenderers.js.map +1 -1
- package/base/Base/DefaultLayoutRenderers.js +9 -10
- package/base/Base/DefaultLayoutRenderers.js.map +1 -1
- package/base/Base/FieldRenderers/CheckboxesRenderer.js +22 -23
- package/base/Base/FieldRenderers/CheckboxesRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/CodeEditorRenderer.js +10 -13
- package/base/Base/FieldRenderers/CodeEditorRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js +60 -60
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeRenderer.js +38 -39
- package/base/Base/FieldRenderers/DateTimeRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.d.ts +2 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.js +37 -40
- package/base/Base/FieldRenderers/FilePickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js +15 -20
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HiddenRenderer.js +3 -3
- package/base/Base/FieldRenderers/HiddenRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js +20 -21
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/InputRenderer.js +16 -20
- package/base/Base/FieldRenderers/InputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.d.ts +13 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js +70 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js.map +1 -0
- package/base/Base/FieldRenderers/NumberInputRenderer.js +16 -19
- package/base/Base/FieldRenderers/NumberInputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/NumberInputsRenderer.js +45 -44
- package/base/Base/FieldRenderers/NumberInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js +10 -13
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js +50 -56
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js +87 -99
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js +41 -48
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +1 -2
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +62 -78
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +12 -15
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +48 -54
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +62 -79
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +14 -17
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
- package/base/Base/FieldRenderers/PassthroughRenderer.js +8 -11
- package/base/Base/FieldRenderers/PassthroughRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js +21 -22
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SelectRenderer.js +23 -24
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SwitchRenderer.js +12 -15
- package/base/Base/FieldRenderers/SwitchRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TagsRenderer.js +15 -16
- package/base/Base/FieldRenderers/TagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextInputsRenderer.js +44 -43
- package/base/Base/FieldRenderers/TextInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareaRenderer.js +17 -21
- package/base/Base/FieldRenderers/TextareaRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareasRenderer.js +47 -46
- package/base/Base/FieldRenderers/TextareasRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js +35 -36
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js.map +1 -1
- package/base/Base/LexicalPreset.js +56 -60
- package/base/Base/LexicalPreset.js.map +1 -1
- package/base/Base/Menus/SupportMenuItems.js +9 -13
- package/base/Base/Menus/SupportMenuItems.js.map +1 -1
- package/base/Base/Menus/WebinyVersion.js +19 -20
- package/base/Base/Menus/WebinyVersion.js.map +1 -1
- package/base/Base/Menus.js +52 -66
- package/base/Base/Menus.js.map +1 -1
- package/base/Base/RoutesConfig.js +21 -29
- package/base/Base/RoutesConfig.js.map +1 -1
- package/base/Base/Tenant/wby-horizontal.js +33 -0
- package/base/Base/Tenant/wby-horizontal.js.map +1 -0
- package/base/Base/Tenant/wby-square.js +20 -0
- package/base/Base/Tenant/wby-square.js.map +1 -0
- package/base/Base/Tenant.js +17 -19
- package/base/Base/Tenant.js.map +1 -1
- package/base/Base/UserMenu/ExitTenant.js +18 -29
- package/base/Base/UserMenu/ExitTenant.js.map +1 -1
- package/base/Base/UserMenu/SignOut.js +13 -14
- package/base/Base/UserMenu/SignOut.js.map +1 -1
- package/base/Base/UserMenu/UserInfo.js +23 -36
- package/base/Base/UserMenu/UserInfo.js.map +1 -1
- package/base/Base/UserMenu.js +12 -13
- package/base/Base/UserMenu.js.map +1 -1
- package/base/Base.js +4 -5
- package/base/Base.js.map +1 -1
- package/base/TelemetryAdminAppStart.js +9 -12
- package/base/TelemetryAdminAppStart.js.map +1 -1
- package/base/WebinyVersion.js +19 -20
- package/base/WebinyVersion.js.map +1 -1
- package/base/createRootContainer.js +42 -40
- package/base/createRootContainer.js.map +1 -1
- package/base/plugins/AddGraphQLQuerySelection.js +12 -11
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.js +5 -10
- package/base/providers/AdminUiStateProvider.js.map +1 -1
- package/base/providers/ApolloProvider.js +8 -11
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/UiProviders.js +18 -27
- package/base/providers/UiProviders.js.map +1 -1
- package/base/providers/UiStateProvider.js +5 -10
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/ui/Brand.js +4 -5
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +1 -1
- package/base/ui/CenteredView.js +9 -13
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.js +4 -5
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.js +38 -60
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.js +4 -8
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LoginScreen.js +16 -21
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.js +4 -5
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.js +11 -14
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js +4 -5
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.js +12 -16
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/TenantSelector.js +4 -5
- package/base/ui/TenantSelector.js.map +1 -1
- package/base/ui/UserMenu/UserMenu.js +4 -5
- package/base/ui/UserMenu/UserMenu.js.map +1 -1
- package/base/ui/UserMenu/UserMenuHandle.js +4 -5
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
- package/base/ui/UserMenu/UserMenuItem.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuItem.js +5 -15
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -1
- package/base/ui/UserMenu/UserMenuLink.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuLink.js +5 -15
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -1
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +2 -2
- package/base/ui/UserMenu/UserMenuSeparator.js +3 -5
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -1
- package/base/ui/UserMenu.js +6 -13
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +6 -10
- package/components/AdminLayout.js.map +1 -1
- package/components/BulkActions/Worker.js +57 -120
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +17 -21
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +33 -44
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/Buttons/Buttons.js +44 -71
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.js +9 -15
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.js +1 -3
- package/components/Buttons/useButtons.js +15 -20
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/DeveloperMode/DeveloperMode.js +5 -14
- package/components/DeveloperMode/DeveloperMode.js.map +1 -1
- package/components/DeveloperMode/index.js +0 -2
- package/components/Dialogs/Dialog.d.ts +2 -2
- package/components/Dialogs/Dialog.js +46 -59
- package/components/Dialogs/Dialog.js.map +1 -1
- package/components/Dialogs/DialogParamsContext.js +6 -7
- package/components/Dialogs/DialogParamsContext.js.map +1 -1
- package/components/Dialogs/DialogsContext.d.ts +2 -2
- package/components/Dialogs/DialogsContext.js +129 -149
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Dialogs/useDialogs.js +5 -6
- package/components/Dialogs/useDialogs.js.map +1 -1
- package/components/EmptyView.js +26 -31
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.js +15 -16
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/FiltersToggle.js +18 -23
- package/components/Filters/FiltersToggle.js.map +1 -1
- package/components/Filters/index.js +0 -2
- package/components/FloatingActionButton.js +13 -15
- package/components/FloatingActionButton.js.map +1 -1
- package/components/IconPicker/IconPicker.js +24 -26
- package/components/IconPicker/IconPicker.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.js +56 -72
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.js +64 -70
- package/components/IconPicker/IconPickerPresenter.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.test.js +79 -105
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js +10 -16
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.js +97 -140
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.js +15 -23
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/IconRepository.js +41 -40
- package/components/IconPicker/IconRepository.js.map +1 -1
- package/components/IconPicker/IconRepository.test.js +56 -63
- package/components/IconPicker/IconRepository.test.js.map +1 -1
- package/components/IconPicker/IconRepositoryFactory.js +15 -11
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
- package/components/IconPicker/Loading.js +47 -46
- package/components/IconPicker/Loading.js.map +1 -1
- package/components/IconPicker/components/IconPickerCell.js +18 -20
- package/components/IconPicker/components/IconPickerCell.js.map +1 -1
- package/components/IconPicker/components/IconPickerContent.js +27 -35
- package/components/IconPicker/components/IconPickerContent.js.map +1 -1
- package/components/IconPicker/components/IconPickerRow.js +5 -10
- package/components/IconPicker/components/IconPickerRow.js.map +1 -1
- package/components/IconPicker/components/IconPickerTrigger.js +42 -44
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
- package/components/IconPicker/components/index.js +0 -2
- package/components/IconPicker/config/Emojis.js +19 -21
- package/components/IconPicker/config/Emojis.js.map +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js +54 -58
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
- package/components/IconPicker/config/IconPackProvider.js +17 -19
- package/components/IconPicker/config/IconPackProvider.js.map +1 -1
- package/components/IconPicker/config/IconType.js +48 -80
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.js +28 -31
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/defaultIcon.js +6 -5
- package/components/IconPicker/defaultIcon.js.map +1 -1
- package/components/IconPicker/index.js +0 -2
- package/components/IconPicker/plugins/customPlugin.js +87 -110
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js +90 -115
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/graphql.js +3 -8
- package/components/IconPicker/plugins/graphql.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js +73 -104
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.js +4 -7
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.js +40 -38
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/LexicalLinkForm.js +80 -86
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
- package/components/LexicalEditor/index.js +0 -2
- package/components/LexicalEditor/lexicalValueFromHtml.js +21 -28
- package/components/LexicalEditor/lexicalValueFromHtml.js.map +1 -1
- package/components/LexicalEditor/lexicalValueWithHtml.js +24 -30
- package/components/LexicalEditor/lexicalValueWithHtml.js.map +1 -1
- package/components/MultiImageUpload.js +4 -13
- package/components/MultiImageUpload.js.map +1 -1
- package/components/NotAuthorizedError/NotAuthorizedError.js +16 -17
- package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
- package/components/NotAuthorizedError/SecureRouteError.js +297 -0
- package/components/NotAuthorizedError/SecureRouteError.js.map +1 -0
- package/components/NotAuthorizedError/index.js +0 -2
- package/components/OptionsMenu/OptionsMenu.js +20 -19
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuItem.js +15 -14
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuLink.js +13 -14
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
- package/components/OptionsMenu/index.js +0 -2
- package/components/OptionsMenu/useOptionsMenuItem.js +13 -18
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.js +35 -38
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.js +6 -11
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -1
- package/components/OverlayLayout/components/OverlayContent.js +18 -17
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -1
- package/components/OverlayLayout/components/OverlayHeader.js +30 -37
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
- package/components/OverlayLayout/components/OverlayRoot.js +13 -17
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -1
- package/components/OverlayLayout/components/index.js +0 -2
- package/components/OverlayLayout/index.js +0 -2
- package/components/Permissions/CannotUseAaclAlert.js +10 -11
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.js +32 -41
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.js +9 -15
- package/components/Permissions/PermissionsGroup.js.map +1 -1
- package/components/Permissions/StyledComponents.js +9 -16
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js +1 -3
- package/components/RegisterFeature.js +14 -21
- package/components/RegisterFeature.js.map +1 -1
- package/components/ResizablePanels/index.js +0 -2
- package/components/RoleAutocomplete/graphql.js +3 -2
- package/components/RoleAutocomplete/graphql.js.map +1 -1
- package/components/RoleAutocomplete/index.d.ts +5 -3
- package/components/RoleAutocomplete/index.js +21 -13
- package/components/RoleAutocomplete/index.js.map +1 -1
- package/components/RolesMultiAutocomplete/graphql.js +3 -2
- package/components/RolesMultiAutocomplete/graphql.js.map +1 -1
- package/components/RolesMultiAutocomplete/index.d.ts +5 -3
- package/components/RolesMultiAutocomplete/index.js +21 -14
- package/components/RolesMultiAutocomplete/index.js.map +1 -1
- package/components/SearchUI.js +18 -25
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/SimpleForm/SimpleForm.js +54 -73
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +1 -3
- package/components/SimpleUI/InputField.js +71 -64
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +2 -2
- package/components/SingleImageUpload.js +37 -58
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.js +47 -57
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +1 -3
- package/components/TeamAutocomplete/graphql.js +3 -2
- package/components/TeamAutocomplete/graphql.js.map +1 -1
- package/components/TeamAutocomplete/index.d.ts +5 -3
- package/components/TeamAutocomplete/index.js +21 -13
- package/components/TeamAutocomplete/index.js.map +1 -1
- package/components/TeamsMultiAutocomplete/graphql.js +3 -2
- package/components/TeamsMultiAutocomplete/graphql.js.map +1 -1
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -3
- package/components/TeamsMultiAutocomplete/index.js +21 -14
- package/components/TeamsMultiAutocomplete/index.js.map +1 -1
- package/components/Wcp.js +27 -38
- package/components/Wcp.js.map +1 -1
- package/components/index.js +10 -13
- package/config/AdminConfig/Dashboard.js +3 -2
- package/config/AdminConfig/Dashboard.js.map +1 -1
- package/config/AdminConfig/Dialog.js +15 -17
- package/config/AdminConfig/Dialog.js.map +1 -1
- package/config/AdminConfig/FieldRenderer.js +15 -17
- package/config/AdminConfig/FieldRenderer.js.map +1 -1
- package/config/AdminConfig/Form.js +4 -3
- package/config/AdminConfig/Form.js.map +1 -1
- package/config/AdminConfig/LayoutRenderer.js +15 -17
- package/config/AdminConfig/LayoutRenderer.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Color.js +34 -41
- package/config/AdminConfig/LexicalTheme/Color.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Typography.js +61 -74
- package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
- package/config/AdminConfig/LexicalTheme.js +4 -3
- package/config/AdminConfig/LexicalTheme.js.map +1 -1
- package/config/AdminConfig/Logo.d.ts +1 -1
- package/config/AdminConfig/Logo.js +15 -17
- package/config/AdminConfig/Logo.js.map +1 -1
- package/config/AdminConfig/Menu/MenuGroup.d.ts +3 -3
- package/config/AdminConfig/Menu/MenuGroup.js +7 -9
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -1
- package/config/AdminConfig/Menu/MenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuItem.js +5 -7
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/MenuLink.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuLink.js +12 -15
- 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 +6 -8
- 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 +4 -6
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu.d.ts +3 -3
- package/config/AdminConfig/Menu/SupportMenu.js +30 -41
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +0 -2
- package/config/AdminConfig/Menu/UserMenu/types.js +0 -3
- package/config/AdminConfig/Menu/UserMenu.d.ts +31 -31
- package/config/AdminConfig/Menu/UserMenu.js +39 -52
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -1
- package/config/AdminConfig/Menu/types.js +0 -3
- package/config/AdminConfig/Menu.d.ts +42 -42
- package/config/AdminConfig/Menu.js +57 -73
- package/config/AdminConfig/Menu.js.map +1 -1
- package/config/AdminConfig/Route.js +4 -5
- package/config/AdminConfig/Route.js.map +1 -1
- package/config/AdminConfig/Security.js +3 -2
- package/config/AdminConfig/Security.js.map +1 -1
- package/config/AdminConfig/SecurityPermissions.js +20 -27
- package/config/AdminConfig/SecurityPermissions.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.js +18 -20
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantName.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantName.js +14 -15
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -1
- package/config/AdminConfig/Tenant.js +6 -9
- package/config/AdminConfig/Tenant.js.map +1 -1
- package/config/AdminConfig/Theme/assignColor.js +51 -18
- package/config/AdminConfig/Theme/assignColor.js.map +1 -1
- package/config/AdminConfig/Theme/consts.js +20 -2
- package/config/AdminConfig/Theme/consts.js.map +1 -1
- package/config/AdminConfig/Theme/types.js +0 -3
- package/config/AdminConfig/Theme.js +8 -15
- package/config/AdminConfig/Theme.js.map +1 -1
- package/config/AdminConfig/Title.d.ts +1 -1
- package/config/AdminConfig/Title.js +11 -12
- package/config/AdminConfig/Title.js.map +1 -1
- package/config/AdminConfig/Widget.js +24 -31
- package/config/AdminConfig/Widget.js.map +1 -1
- package/config/AdminConfig.js +47 -59
- package/config/AdminConfig.js.map +1 -1
- package/config/createAdminConfig.js +55 -86
- package/config/createAdminConfig.js.map +1 -1
- package/domain/Identity.js +78 -88
- package/domain/Identity.js.map +1 -1
- package/errors/ErrorOverlayNetworkErrorHandler.js +37 -52
- package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -1
- package/errors/TenantIsDisabled.js +19 -20
- package/errors/TenantIsDisabled.js.map +1 -1
- package/exports/admin/build-params.js +0 -5
- package/exports/admin/configs.js +0 -2
- package/exports/admin/form.js +3 -18
- package/exports/admin/security.js +1 -7
- package/exports/admin/tenancy.js +0 -2
- package/exports/admin/ui.js +1 -4
- package/exports/admin.js +1 -4
- package/features/apolloClient/abstraction.js +2 -1
- package/features/apolloClient/abstraction.js.map +1 -1
- package/features/apolloClient/feature.js +22 -30
- package/features/apolloClient/feature.js.map +1 -1
- package/features/buildParams/BuildParams.js +20 -14
- package/features/buildParams/BuildParams.js.map +1 -1
- package/features/buildParams/abstractions.js +3 -2
- package/features/buildParams/abstractions.js.map +1 -1
- package/features/buildParams/feature.js +11 -10
- package/features/buildParams/feature.js.map +1 -1
- package/features/buildParams/index.js +0 -2
- package/features/formModel/ConditionRuleEvaluator.js +39 -46
- package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
- package/features/formModel/Field.d.ts +1 -0
- package/features/formModel/Field.js +334 -411
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.d.ts +2 -1
- package/features/formModel/FieldBuilder.js +148 -171
- package/features/formModel/FieldBuilder.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +217 -201
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FieldBuilderRegistry.js +23 -25
- package/features/formModel/FieldBuilderRegistry.js.map +1 -1
- package/features/formModel/FocusManager.js +69 -95
- package/features/formModel/FocusManager.js.map +1 -1
- package/features/formModel/FormErrors.d.ts +9 -0
- package/features/formModel/FormErrors.js +35 -0
- package/features/formModel/FormErrors.js.map +1 -0
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +391 -396
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +3791 -3354
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/FormModelFactory.js +27 -17
- package/features/formModel/FormModelFactory.js.map +1 -1
- package/features/formModel/FormView.d.ts +2 -1
- package/features/formModel/FormView.js +168 -156
- package/features/formModel/FormView.js.map +1 -1
- package/features/formModel/LayoutBuilderFactory.js +300 -370
- package/features/formModel/LayoutBuilderFactory.js.map +1 -1
- package/features/formModel/LayoutMutator.js +118 -125
- package/features/formModel/LayoutMutator.js.map +1 -1
- package/features/formModel/LayoutResolver.js +174 -214
- package/features/formModel/LayoutResolver.js.map +1 -1
- package/features/formModel/ObjectField.js +524 -724
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/PresenterErrors.d.ts +9 -0
- package/features/formModel/PresenterErrors.js +32 -0
- package/features/formModel/PresenterErrors.js.map +1 -0
- package/features/formModel/Rules.test.js +311 -276
- package/features/formModel/Rules.test.js.map +1 -1
- package/features/formModel/abstractions.d.ts +10 -0
- package/features/formModel/abstractions.js +5 -114
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.js +33 -10
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FieldRenderersDemoPresenter.js +289 -220
- package/features/formModel/demo/FieldRenderersDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.js +191 -215
- package/features/formModel/demo/FormModelDemo.js.map +1 -1
- package/features/formModel/demo/FormModelDemoPresenter.js +132 -113
- package/features/formModel/demo/FormModelDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase11Presenter.js +101 -98
- package/features/formModel/demo/FormModelPhase11Presenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase8c1Presenter.js +64 -57
- package/features/formModel/demo/FormModelPhase8c1Presenter.js.map +1 -1
- package/features/formModel/feature.js +23 -22
- package/features/formModel/feature.js.map +1 -1
- package/features/formModel/fieldTypes/BooleanFieldType.js +18 -15
- package/features/formModel/fieldTypes/BooleanFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/DateTimeFieldType.js +218 -341
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileFieldType.d.ts +12 -1
- package/features/formModel/fieldTypes/FileFieldType.js +48 -12
- package/features/formModel/fieldTypes/FileFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileUrlFieldType.js +15 -12
- package/features/formModel/fieldTypes/FileUrlFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/NumberFieldType.js +19 -18
- package/features/formModel/fieldTypes/NumberFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +80 -94
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/TextFieldType.js +15 -12
- package/features/formModel/fieldTypes/TextFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/index.js +7 -9
- package/features/formModel/index.d.ts +2 -0
- package/features/formModel/index.js +11 -29
- package/features/formModel/renderers.js +0 -4
- package/features/formModel/useFieldRenderers.js +10 -14
- package/features/formModel/useFieldRenderers.js.map +1 -1
- package/features/formModel/useLayoutRenderers.js +10 -14
- package/features/formModel/useLayoutRenderers.js.map +1 -1
- package/features/listCache/ListCache.d.ts +28 -0
- package/features/listCache/ListCache.js +48 -0
- package/features/listCache/ListCache.js.map +1 -0
- package/features/listCache/index.d.ts +2 -0
- package/features/listCache/index.js +1 -0
- package/features/security/AuthenticationContext/AuthenticationContext.js +27 -26
- package/features/security/AuthenticationContext/AuthenticationContext.js.map +1 -1
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js +23 -22
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js.map +1 -1
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js +15 -12
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js.map +1 -1
- package/features/security/AuthenticationContext/abstractions.js +3 -2
- package/features/security/AuthenticationContext/abstractions.js.map +1 -1
- package/features/security/AuthenticationContext/feature.js +15 -14
- package/features/security/AuthenticationContext/feature.js.map +1 -1
- package/features/security/AuthenticationContext/index.js +0 -2
- package/features/security/AuthenticationContext/types.js +0 -3
- package/features/security/IdentityContext/IdentityContext.js +18 -17
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.js +2 -1
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/IdentityContext/feature.js +13 -12
- package/features/security/IdentityContext/feature.js.map +1 -1
- package/features/security/IdentityContext/index.js +0 -2
- package/features/security/LogIn/IdentityMapper.js +8 -7
- package/features/security/LogIn/IdentityMapper.js.map +1 -1
- package/features/security/LogIn/LogInGateway.js +17 -19
- package/features/security/LogIn/LogInGateway.js.map +1 -1
- package/features/security/LogIn/LogInRepository.js +16 -14
- package/features/security/LogIn/LogInRepository.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.js +23 -31
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/abstractions.js +5 -16
- package/features/security/LogIn/abstractions.js.map +1 -1
- package/features/security/LogIn/createLoginMutation.js +2 -3
- package/features/security/LogIn/createLoginMutation.js.map +1 -1
- package/features/security/LogIn/feature.js +16 -15
- package/features/security/LogIn/feature.js.map +1 -1
- package/features/security/LogIn/index.js +0 -2
- package/features/security/LogOut/LogOutUseCase.js +18 -16
- package/features/security/LogOut/LogOutUseCase.js.map +1 -1
- package/features/security/LogOut/abstractions.js +2 -1
- package/features/security/LogOut/abstractions.js.map +1 -1
- package/features/security/LogOut/feature.js +12 -11
- package/features/security/LogOut/feature.js.map +1 -1
- package/features/security/LogOut/index.js +0 -2
- package/features/security/SecurityFeature.js +9 -8
- package/features/security/SecurityFeature.js.map +1 -1
- package/features/telemetry/TelemetryService.js +11 -12
- package/features/telemetry/TelemetryService.js.map +1 -1
- package/features/telemetry/abstractions.js +2 -1
- package/features/telemetry/abstractions.js.map +1 -1
- package/features/telemetry/feature.js +13 -12
- package/features/telemetry/feature.js.map +1 -1
- package/features/telemetry/index.js +0 -2
- package/features/tenancy/GraphQLClientDecorator.js +23 -20
- package/features/tenancy/GraphQLClientDecorator.js.map +1 -1
- package/features/tenancy/TenantContext.js +46 -50
- package/features/tenancy/TenantContext.js.map +1 -1
- package/features/tenancy/abstractions.js +2 -1
- package/features/tenancy/abstractions.js.map +1 -1
- package/features/tenancy/feature.js +25 -35
- package/features/tenancy/feature.js.map +1 -1
- package/features/tenancy/types.js +0 -3
- package/features/tools/LexicalContext/LexicalContext.js +20 -17
- package/features/tools/LexicalContext/LexicalContext.js.map +1 -1
- package/features/tools/LexicalContext/abstractions.js +2 -1
- package/features/tools/LexicalContext/abstractions.js.map +1 -1
- package/features/tools/LexicalContext/index.js +0 -2
- package/features/tools/ToolPipelineRunner.js +26 -24
- package/features/tools/ToolPipelineRunner.js.map +1 -1
- package/features/tools/ToolRegistry.js +32 -23
- package/features/tools/ToolRegistry.js.map +1 -1
- package/features/tools/abstractions.js +4 -3
- package/features/tools/abstractions.js.map +1 -1
- package/features/tools/feature.js +17 -16
- package/features/tools/feature.js.map +1 -1
- package/features/tools/index.js +1 -3
- package/features/wcp/ReactLicense.js +53 -52
- package/features/wcp/ReactLicense.js.map +1 -1
- package/features/wcp/WcpGateway.js +21 -20
- package/features/wcp/WcpGateway.js.map +1 -1
- package/features/wcp/WcpService.js +57 -67
- package/features/wcp/WcpService.js.map +1 -1
- package/features/wcp/abstractions.js +3 -2
- package/features/wcp/abstractions.js.map +1 -1
- package/features/wcp/feature.js +14 -13
- package/features/wcp/feature.js.map +1 -1
- package/features/wcp/types.js +0 -3
- package/features/webinySdk/WebinySdk.js +19 -18
- package/features/webinySdk/WebinySdk.js.map +1 -1
- package/features/webinySdk/abstractions.js +2 -5
- package/features/webinySdk/abstractions.js.map +1 -1
- package/features/webinySdk/feature.js +13 -12
- package/features/webinySdk/feature.js.map +1 -1
- package/features/webinySdk/index.js +0 -2
- package/hooks/index.js +0 -2
- package/hooks/useConfirmationDialog.d.ts +1 -1
- package/hooks/useConfirmationDialog.js +31 -38
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +14 -15
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useHotkeys.js +52 -85
- package/hooks/useHotkeys.js.map +1 -1
- package/hooks/useIsMounted.js +12 -11
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useKeyHandler.js +45 -53
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js +20 -25
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useOpenDialog.js +13 -13
- package/hooks/useOpenDialog.js.map +1 -1
- package/hooks/useShiftKey.d.ts +5 -1
- package/hooks/useShiftKey.js +38 -29
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useSnackbar.d.ts +3 -0
- package/hooks/useSnackbar.js +26 -28
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.js +14 -12
- package/hooks/useStateIfMounted.js.map +1 -1
- package/hooks/useStateWithCallback.js +18 -14
- package/hooks/useStateWithCallback.js.map +1 -1
- package/hooks/useToggler.js +12 -11
- package/hooks/useToggler.js.map +1 -1
- package/index.d.ts +4 -1
- package/index.js +15 -31
- package/package.json +26 -28
- package/permissions/PermissionRenderer.js +179 -193
- package/permissions/PermissionRenderer.js.map +1 -1
- package/permissions/PermissionValueContext.js +13 -20
- package/permissions/PermissionValueContext.js.map +1 -1
- package/permissions/createHasPermission.js +32 -40
- package/permissions/createHasPermission.js.map +1 -1
- package/permissions/createPermissionSchema.js +6 -5
- package/permissions/createPermissionSchema.js.map +1 -1
- package/permissions/createPermissions.js +125 -185
- package/permissions/createPermissions.js.map +1 -1
- package/permissions/createPermissions.test.js +190 -158
- package/permissions/createPermissions.test.js.map +1 -1
- package/permissions/index.js +2 -4
- package/permissions/types.js +0 -3
- package/permissions/usePermissionForm.js +133 -232
- package/permissions/usePermissionForm.js.map +1 -1
- package/permissions/usePermissions.js +6 -5
- package/permissions/usePermissions.js.map +1 -1
- package/plugins/MenuPlugin.js +15 -14
- package/plugins/MenuPlugin.js.map +1 -1
- package/presentation/buildParams/useBuildParams.js +2 -3
- package/presentation/buildParams/useBuildParams.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js +46 -53
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js +9 -14
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/index.js +0 -2
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +14 -29
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +11 -10
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +60 -60
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js +75 -85
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Center.js +5 -8
- package/presentation/installation/components/SystemInstaller/steps/Center.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Container.js +18 -24
- package/presentation/installation/components/SystemInstaller/steps/Container.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +48 -53
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js +13 -16
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/introduction.js +723 -0
- package/presentation/installation/components/SystemInstaller/steps/introduction.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js +14 -1
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js +27 -28
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +117 -124
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js +23 -21
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/abstractions.js +4 -3
- package/presentation/installation/presenters/SystemInstaller/abstractions.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/feature.js +15 -14
- package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/index.js +0 -2
- package/presentation/lexicalContext/useLexicalContext.js +11 -8
- package/presentation/lexicalContext/useLexicalContext.js.map +1 -1
- package/presentation/listPresenter/ListPresenter.d.ts +30 -0
- package/presentation/listPresenter/ListPresenter.js +216 -0
- package/presentation/listPresenter/ListPresenter.js.map +1 -0
- package/presentation/listPresenter/ListPresenter.test.d.ts +1 -0
- package/presentation/listPresenter/ListPresenter.test.js +816 -0
- package/presentation/listPresenter/ListPresenter.test.js.map +1 -0
- package/presentation/listPresenter/SelectionController.d.ts +21 -0
- package/presentation/listPresenter/SelectionController.js +74 -0
- package/presentation/listPresenter/SelectionController.js.map +1 -0
- package/presentation/listPresenter/abstractions.d.ts +107 -0
- package/presentation/listPresenter/abstractions.js +5 -0
- package/presentation/listPresenter/abstractions.js.map +1 -0
- package/presentation/listPresenter/feature.d.ts +3 -0
- package/presentation/listPresenter/feature.js +17 -0
- package/presentation/listPresenter/feature.js.map +1 -0
- package/presentation/listPresenter/index.d.ts +3 -0
- package/presentation/listPresenter/index.js +2 -0
- package/presentation/security/components/HasPermission.js +15 -25
- package/presentation/security/components/HasPermission.js.map +1 -1
- package/presentation/security/components/SecureRoute.js +6 -12
- package/presentation/security/components/SecureRoute.js.map +1 -1
- package/presentation/security/hooks/useAuthentication.js +11 -17
- package/presentation/security/hooks/useAuthentication.js.map +1 -1
- package/presentation/security/hooks/useIdentity.js +19 -18
- package/presentation/security/hooks/useIdentity.js.map +1 -1
- package/presentation/security/hooks/useSecurity.js +14 -24
- package/presentation/security/hooks/useSecurity.js.map +1 -1
- package/presentation/tenancy/TenancyProvider.js +23 -36
- package/presentation/tenancy/TenancyProvider.js.map +1 -1
- package/presentation/tenancy/createTenancyProvider.js +6 -11
- package/presentation/tenancy/createTenancyProvider.js.map +1 -1
- package/presentation/tenancy/useTenantContext.js +17 -18
- package/presentation/tenancy/useTenantContext.js.map +1 -1
- package/presentation/textToLexicalTool/TextToLexicalTool.js +20 -18
- package/presentation/textToLexicalTool/TextToLexicalTool.js.map +1 -1
- package/presentation/textToLexicalTool/feature.js +6 -5
- package/presentation/textToLexicalTool/feature.js.map +1 -1
- package/presentation/textToLexicalTool/textToLexicalState.js +28 -28
- package/presentation/textToLexicalTool/textToLexicalState.js.map +1 -1
- package/presentation/wcp/WcpProvider.js +16 -26
- package/presentation/wcp/WcpProvider.js.map +1 -1
- package/presentation/wcp/useWcp.js +11 -12
- package/presentation/wcp/useWcp.js.map +1 -1
- package/routes.d.ts +0 -1
- package/routes.js +14 -17
- package/routes.js.map +1 -1
- package/static/svg/SecureRouteError.e8b15981.svg +1 -0
- package/static/svg/add-18px.b3062af6.svg +3 -0
- package/static/svg/arrow_drop_down-24px.da74d713.svg +4 -0
- package/static/svg/attach_file_black_24dp.7fb13a7e.svg +1 -0
- package/static/svg/baseline-menu-24px.071b179d.svg +4 -0
- package/static/svg/baseline-notification_important-24px.29277e73.svg +4 -0
- package/static/svg/baseline-security-24px.12e519cc.svg +4 -0
- package/static/svg/file_download.afe3fbec.svg +1 -0
- package/static/svg/file_upload.6865d820.svg +1 -0
- package/static/svg/filter-24px.886d9ff0.svg +8 -0
- package/static/svg/github-brands.6311f0fa.svg +1 -0
- package/static/svg/highlight-24px.959a97f7.svg +1 -0
- package/static/svg/icon-community.cd087355.svg +16 -0
- package/static/svg/icon-documentation.a189d24c.svg +16 -0
- package/static/svg/info.fe810b72.svg +1 -0
- package/static/svg/insert_drive_file-24px.39d490eb.svg +1 -0
- package/static/svg/insert_photo-24px.81a5f945.svg +1 -0
- package/static/svg/introduction.108720aa.svg +154 -0
- package/static/svg/label-24px.9deafa4f.svg +1 -0
- package/static/svg/round-account_circle-24px.f0b48cb7.svg +1 -0
- package/static/svg/round-add-24px.4a5219b4.svg +16 -0
- package/static/svg/round-arrow_drop_down-24px.5fdf92d1.svg +1 -0
- package/static/svg/round-chevron_right-24px.34936511.svg +12 -0
- package/static/svg/round-feedback-24px.4dae7231.svg +54 -0
- package/static/svg/round-help-24px.a61b1d66.svg +1 -0
- package/static/svg/round-invert_colors-24px.a229a1dd.svg +52 -0
- package/static/svg/round-keyboard_arrow_down-24px.6febe804.svg +16 -0
- package/static/svg/round-keyboard_arrow_up-24px.b1f7db34.svg +16 -0
- package/static/svg/round-lock_open-24px.d527f6a5.svg +60 -0
- package/static/svg/round-more_vert-24px.68d41b07.svg +12 -0
- package/static/svg/round-open_in_new-24px.be5b4ddd.svg +44 -0
- package/static/svg/round-settings-24px.c0b3056f.svg +4 -0
- package/static/svg/search-24px.3c0f88dd.svg +20 -0
- package/static/svg/slack-logo.7ee35e7f.svg +1 -0
- package/static/svg/today-24px.df206362.svg +1 -0
- package/static/svg/touch_app.debf3744.svg +1 -0
- package/static/svg/wby-horizontal.03327bf6.svg +23 -0
- package/static/svg/wby-square.ff8f47c3.svg +3 -0
- package/static/svg/webiny-logo.ef56725c.svg +20 -0
- package/static/svg/webiny-orange-logo.4eccf0f2.svg +20 -0
- package/types.js +0 -3
- package/components/BulkActions/index.js.map +0 -1
- package/components/BulkActions/useDialogWithReport/index.js.map +0 -1
- package/components/Buttons/index.js.map +0 -1
- package/components/DeveloperMode/index.js.map +0 -1
- package/components/Filters/index.js.map +0 -1
- package/components/IconPicker/components/index.js.map +0 -1
- package/components/IconPicker/index.js.map +0 -1
- package/components/LexicalEditor/index.js.map +0 -1
- package/components/NotAuthorizedError/index.js.map +0 -1
- package/components/OptionsMenu/index.js.map +0 -1
- package/components/OverlayLayout/components/index.js.map +0 -1
- package/components/OverlayLayout/index.js.map +0 -1
- package/components/Permissions/index.js.map +0 -1
- package/components/ResizablePanels/index.js.map +0 -1
- package/components/SimpleForm/index.js.map +0 -1
- package/components/SplitView/index.js.map +0 -1
- package/components/index.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/types.js.map +0 -1
- package/config/AdminConfig/Menu/types.js.map +0 -1
- package/config/AdminConfig/Theme/types.js.map +0 -1
- package/exports/admin/build-params.js.map +0 -1
- package/exports/admin/configs.js.map +0 -1
- package/exports/admin/form.js.map +0 -1
- package/exports/admin/security.js.map +0 -1
- package/exports/admin/tenancy.js.map +0 -1
- package/exports/admin/ui.js.map +0 -1
- package/exports/admin.js.map +0 -1
- package/features/buildParams/index.js.map +0 -1
- package/features/formModel/fieldTypes/index.js.map +0 -1
- package/features/formModel/index.js.map +0 -1
- package/features/formModel/renderers.js.map +0 -1
- package/features/security/AuthenticationContext/index.js.map +0 -1
- package/features/security/AuthenticationContext/types.js.map +0 -1
- package/features/security/IdentityContext/index.js.map +0 -1
- package/features/security/LogIn/index.js.map +0 -1
- package/features/security/LogOut/index.js.map +0 -1
- package/features/telemetry/index.js.map +0 -1
- package/features/tenancy/types.js.map +0 -1
- package/features/tools/LexicalContext/index.js.map +0 -1
- package/features/tools/index.js.map +0 -1
- package/features/wcp/types.js.map +0 -1
- package/features/webinySdk/index.js.map +0 -1
- package/hooks/index.js.map +0 -1
- package/index.js.map +0 -1
- package/permissions/index.js.map +0 -1
- package/permissions/types.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/index.js.map +0 -1
- package/presentation/installation/presenters/SystemInstaller/index.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Fragment","useCallback","useMemo","CheckboxGroup","Grid","Select","Form","CannotUseAaclAlert","PermissionInfo","PermissionsGroup","usePermissionForm","usePermissionValue","useAuthentication","NO_ACCESS","FULL_ACCESS","READ_ONLY_ACCESS","CUSTOM_ACCESS","RWD_OPTIONS","value","label","PW_OPTIONS","hasAction","entity","name","actions","some","a","buildScopeOptions","options","scopes","includes","push","BUILTIN_ACTIONS","Set","getCustomActions","filter","has","EntitySection","data","cannotUseAAcl","Bind","setValue","scopeField","id","currentScope","scopeDisabled","customActions","customActionsValue","map","onCustomActionsChange","selected","selectedSet","action","columns","createElement","Column","span","key","beforeChange","cb","disabled","description","items","opt","length","onChange","title","PermissionRenderer","schema","identity","getPermission","formData","onFormChange","entities","hasEntities","accessLevelOptions","readOnlyAccess","className","accessLevel"],"sources":["PermissionRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { CheckboxGroup, Grid, Select } from \"@webiny/admin-ui\";\nimport { Form } from \"@webiny/form\";\nimport type { BindComponent } from \"@webiny/form\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n PermissionsGroup\n} from \"../components/Permissions/index.js\";\nimport { usePermissionForm } from \"./usePermissionForm.js\";\nimport type { AaclPermission } from \"../features/wcp/types.js\";\nimport type { ActionDefinition, PermissionSchema, EntityDefinition } from \"./types.js\";\nimport { usePermissionValue } from \"./PermissionValueContext.js\";\nimport { useAuthentication } from \"~/exports/admin/security.js\";\n\nexport interface PermissionRendererProps {\n schema: PermissionSchema;\n}\n\nconst NO_ACCESS = \"no\";\nconst FULL_ACCESS = \"full\";\nconst READ_ONLY_ACCESS = \"read-only\";\nconst CUSTOM_ACCESS = \"custom\";\n\nconst RWD_OPTIONS = [\n { value: \"r\", label: \"Read\" },\n { value: \"rw\", label: \"Read, write\" },\n { value: \"rwd\", label: \"Read, write, delete\" }\n];\n\nconst PW_OPTIONS = [\n { value: \"p\", label: \"Publish\" },\n { value: \"u\", label: \"Unpublish\" }\n];\n\nfunction hasAction(entity: EntityDefinition, name: string): boolean {\n return entity.actions?.some(a => a.name === name) ?? false;\n}\n\nfunction buildScopeOptions(entity: EntityDefinition) {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (entity.scopes.includes(\"full\")) {\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n }\n\n if (entity.scopes.includes(\"own\")) {\n options.push({ value: \"own\", label: \"Only entries created by the user\" });\n }\n\n return options;\n}\n\nconst BUILTIN_ACTIONS = new Set([\"rwd\", \"pw\"]);\n\nfunction getCustomActions(entity: EntityDefinition): ActionDefinition[] {\n return (entity.actions ?? []).filter(a => !BUILTIN_ACTIONS.has(a.name));\n}\n\ninterface EntitySectionProps {\n entity: EntityDefinition;\n data: Record<string, any>;\n cannotUseAAcl: boolean;\n Bind: BindComponent;\n setValue: (name: string, value: any) => void;\n}\n\nfunction EntitySection({ entity, data, cannotUseAAcl, Bind, setValue }: EntitySectionProps) {\n const scopeField = `${entity.id}AccessScope`;\n const currentScope = data[scopeField];\n const scopeDisabled = cannotUseAAcl || !currentScope || currentScope === NO_ACCESS;\n const customActions = useMemo(() => getCustomActions(entity), [entity]);\n\n // Derive the selected values array from individual boolean form fields.\n const customActionsValue = useMemo(() => {\n return customActions.filter(a => data[`${entity.id}Action_${a.name}`]).map(a => a.name);\n }, [data, customActions, entity.id]);\n\n const onCustomActionsChange = useCallback(\n (selected: string[]) => {\n const selectedSet = new Set(selected);\n for (const action of customActions) {\n setValue(`${entity.id}Action_${action.name}`, selectedSet.has(action.name));\n }\n },\n [customActions, entity.id, setValue]\n );\n\n const columns = [\n <Grid.Column span={12} key={\"access\"}>\n <Bind\n name={scopeField}\n beforeChange={(value: string, cb: (v: string) => void) => {\n if (value === \"own\" && hasAction(entity, \"rwd\")) {\n setValue(`${entity.id}RWD`, \"rwd\");\n }\n cb(value);\n }}\n >\n <Select\n label={\"Access Scope\"}\n disabled={cannotUseAAcl}\n options={buildScopeOptions(entity)}\n />\n </Bind>\n </Grid.Column>\n ];\n\n if (hasAction(entity, \"rwd\")) {\n columns.push(\n <Grid.Column span={12} key={\"rwd\"}>\n <Bind name={`${entity.id}RWD`}>\n <Select\n label={\"Primary Actions\"}\n disabled={scopeDisabled || currentScope === \"own\"}\n options={RWD_OPTIONS}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (hasAction(entity, \"pw\")) {\n columns.push(\n <Grid.Column span={12} key={\"pw\"}>\n <Bind name={`${entity.id}PW`}>\n <CheckboxGroup\n label={\"Publishing actions\"}\n description={\"Publishing-related actions that can be performed on entries.\"}\n items={PW_OPTIONS.map(opt => ({\n ...opt,\n disabled: scopeDisabled\n }))}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (customActions.length > 0) {\n columns.push(\n <Grid.Column span={12} key={\"other\"}>\n <CheckboxGroup\n label={\"Other Actions\"}\n value={customActionsValue}\n onChange={onCustomActionsChange}\n items={customActions.map(action => ({\n value: action.name,\n label: action.label || action.name,\n disabled: scopeDisabled\n }))}\n />\n </Grid.Column>\n );\n }\n\n return (\n <PermissionsGroup title={entity.title || entity.id}>\n <Grid>{columns}</Grid>\n </PermissionsGroup>\n );\n}\n\nexport const PermissionRenderer = ({ schema }: PermissionRendererProps) => {\n const { value, onChange } = usePermissionValue();\n const { identity } = useAuthentication();\n\n const cannotUseAAcl = useMemo(() => {\n return !identity.getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const { formData, onFormChange } = usePermissionForm(schema, { value, onChange });\n\n const entities = schema.entities || [];\n const hasEntities = entities.length > 0;\n\n const accessLevelOptions = useMemo(() => {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (schema.readOnlyAccess) {\n options.push({ value: READ_ONLY_ACCESS, label: \"Read-only access\" });\n }\n\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n\n if (hasEntities) {\n options.push({ value: CUSTOM_ACCESS, label: \"Custom access\" });\n }\n\n return options;\n }, [schema, hasEntities]);\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind, setValue }) => (\n <Fragment>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={12}>\n {data.accessLevel === CUSTOM_ACCESS && cannotUseAAcl && (\n <CannotUseAaclAlert />\n )}\n </Grid.Column>\n </Grid>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={6}>\n <PermissionInfo title={\"Access Level\"} />\n </Grid.Column>\n <Grid.Column span={6}>\n <Bind name={\"accessLevel\"}>\n <Select options={accessLevelOptions} />\n </Bind>\n </Grid.Column>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && hasEntities && (\n <div className={\"mt-lg\"}>\n {entities.map(entity => (\n <EntitySection\n key={entity.id}\n entity={entity}\n data={data}\n cannotUseAAcl={cannotUseAAcl}\n Bind={Bind}\n setValue={setValue}\n />\n ))}\n </div>\n )}\n </Fragment>\n )}\n </Form>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,aAAa,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AAC9D,SAASC,IAAI,QAAQ,cAAc;AAEnC,SACIC,kBAAkB,EAClBC,cAAc,EACdC,gBAAgB;AAEpB,SAASC,iBAAiB;AAG1B,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAM1B,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,MAAM;AAC1B,MAAMC,gBAAgB,GAAG,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AAEA;EAAS,CACtB,CACJ,CACA,CAEH,CAEZ,CAAC;AAEf,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"permissions/PermissionRenderer.js","sources":["../../src/permissions/PermissionRenderer.tsx"],"sourcesContent":["import React, { Fragment, useCallback, useMemo } from \"react\";\nimport { CheckboxGroup, Grid, Select } from \"@webiny/admin-ui\";\nimport { Form } from \"@webiny/form\";\nimport type { BindComponent } from \"@webiny/form\";\nimport {\n CannotUseAaclAlert,\n PermissionInfo,\n PermissionsGroup\n} from \"../components/Permissions/index.js\";\nimport { usePermissionForm } from \"./usePermissionForm.js\";\nimport type { AaclPermission } from \"../features/wcp/types.js\";\nimport type { ActionDefinition, PermissionSchema, EntityDefinition } from \"./types.js\";\nimport { usePermissionValue } from \"./PermissionValueContext.js\";\nimport { useAuthentication } from \"~/exports/admin/security.js\";\n\nexport interface PermissionRendererProps {\n schema: PermissionSchema;\n}\n\nconst NO_ACCESS = \"no\";\nconst FULL_ACCESS = \"full\";\nconst READ_ONLY_ACCESS = \"read-only\";\nconst CUSTOM_ACCESS = \"custom\";\n\nconst RWD_OPTIONS = [\n { value: \"r\", label: \"Read\" },\n { value: \"rw\", label: \"Read, write\" },\n { value: \"rwd\", label: \"Read, write, delete\" }\n];\n\nconst PW_OPTIONS = [\n { value: \"p\", label: \"Publish\" },\n { value: \"u\", label: \"Unpublish\" }\n];\n\nfunction hasAction(entity: EntityDefinition, name: string): boolean {\n return entity.actions?.some(a => a.name === name) ?? false;\n}\n\nfunction buildScopeOptions(entity: EntityDefinition) {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (entity.scopes.includes(\"full\")) {\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n }\n\n if (entity.scopes.includes(\"own\")) {\n options.push({ value: \"own\", label: \"Only entries created by the user\" });\n }\n\n return options;\n}\n\nconst BUILTIN_ACTIONS = new Set([\"rwd\", \"pw\"]);\n\nfunction getCustomActions(entity: EntityDefinition): ActionDefinition[] {\n return (entity.actions ?? []).filter(a => !BUILTIN_ACTIONS.has(a.name));\n}\n\ninterface EntitySectionProps {\n entity: EntityDefinition;\n data: Record<string, any>;\n cannotUseAAcl: boolean;\n Bind: BindComponent;\n setValue: (name: string, value: any) => void;\n}\n\nfunction EntitySection({ entity, data, cannotUseAAcl, Bind, setValue }: EntitySectionProps) {\n const scopeField = `${entity.id}AccessScope`;\n const currentScope = data[scopeField];\n const scopeDisabled = cannotUseAAcl || !currentScope || currentScope === NO_ACCESS;\n const customActions = useMemo(() => getCustomActions(entity), [entity]);\n\n // Derive the selected values array from individual boolean form fields.\n const customActionsValue = useMemo(() => {\n return customActions.filter(a => data[`${entity.id}Action_${a.name}`]).map(a => a.name);\n }, [data, customActions, entity.id]);\n\n const onCustomActionsChange = useCallback(\n (selected: string[]) => {\n const selectedSet = new Set(selected);\n for (const action of customActions) {\n setValue(`${entity.id}Action_${action.name}`, selectedSet.has(action.name));\n }\n },\n [customActions, entity.id, setValue]\n );\n\n const columns = [\n <Grid.Column span={12} key={\"access\"}>\n <Bind\n name={scopeField}\n beforeChange={(value: string, cb: (v: string) => void) => {\n if (value === \"own\" && hasAction(entity, \"rwd\")) {\n setValue(`${entity.id}RWD`, \"rwd\");\n }\n cb(value);\n }}\n >\n <Select\n label={\"Access Scope\"}\n disabled={cannotUseAAcl}\n options={buildScopeOptions(entity)}\n />\n </Bind>\n </Grid.Column>\n ];\n\n if (hasAction(entity, \"rwd\")) {\n columns.push(\n <Grid.Column span={12} key={\"rwd\"}>\n <Bind name={`${entity.id}RWD`}>\n <Select\n label={\"Primary Actions\"}\n disabled={scopeDisabled || currentScope === \"own\"}\n options={RWD_OPTIONS}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (hasAction(entity, \"pw\")) {\n columns.push(\n <Grid.Column span={12} key={\"pw\"}>\n <Bind name={`${entity.id}PW`}>\n <CheckboxGroup\n label={\"Publishing actions\"}\n description={\"Publishing-related actions that can be performed on entries.\"}\n items={PW_OPTIONS.map(opt => ({\n ...opt,\n disabled: scopeDisabled\n }))}\n />\n </Bind>\n </Grid.Column>\n );\n }\n\n if (customActions.length > 0) {\n columns.push(\n <Grid.Column span={12} key={\"other\"}>\n <CheckboxGroup\n label={\"Other Actions\"}\n value={customActionsValue}\n onChange={onCustomActionsChange}\n items={customActions.map(action => ({\n value: action.name,\n label: action.label || action.name,\n disabled: scopeDisabled\n }))}\n />\n </Grid.Column>\n );\n }\n\n return (\n <PermissionsGroup title={entity.title || entity.id}>\n <Grid>{columns}</Grid>\n </PermissionsGroup>\n );\n}\n\nexport const PermissionRenderer = ({ schema }: PermissionRendererProps) => {\n const { value, onChange } = usePermissionValue();\n const { identity } = useAuthentication();\n\n const cannotUseAAcl = useMemo(() => {\n return !identity.getPermission<AaclPermission>(\"aacl\", true);\n }, []);\n\n const { formData, onFormChange } = usePermissionForm(schema, { value, onChange });\n\n const entities = schema.entities || [];\n const hasEntities = entities.length > 0;\n\n const accessLevelOptions = useMemo(() => {\n const options = [{ value: NO_ACCESS, label: \"No access\" }];\n\n if (schema.readOnlyAccess) {\n options.push({ value: READ_ONLY_ACCESS, label: \"Read-only access\" });\n }\n\n options.push({ value: FULL_ACCESS, label: \"Full access\" });\n\n if (hasEntities) {\n options.push({ value: CUSTOM_ACCESS, label: \"Custom access\" });\n }\n\n return options;\n }, [schema, hasEntities]);\n\n return (\n <Form data={formData} onChange={onFormChange}>\n {({ data, Bind, setValue }) => (\n <Fragment>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={12}>\n {data.accessLevel === CUSTOM_ACCESS && cannotUseAAcl && (\n <CannotUseAaclAlert />\n )}\n </Grid.Column>\n </Grid>\n <Grid className={\"pt-md\"}>\n <Grid.Column span={6}>\n <PermissionInfo title={\"Access Level\"} />\n </Grid.Column>\n <Grid.Column span={6}>\n <Bind name={\"accessLevel\"}>\n <Select options={accessLevelOptions} />\n </Bind>\n </Grid.Column>\n </Grid>\n {data.accessLevel === CUSTOM_ACCESS && hasEntities && (\n <div className={\"mt-lg\"}>\n {entities.map(entity => (\n <EntitySection\n key={entity.id}\n entity={entity}\n data={data}\n cannotUseAAcl={cannotUseAAcl}\n Bind={Bind}\n setValue={setValue}\n />\n ))}\n </div>\n )}\n </Fragment>\n )}\n </Form>\n );\n};\n"],"names":["NO_ACCESS","FULL_ACCESS","READ_ONLY_ACCESS","CUSTOM_ACCESS","RWD_OPTIONS","PW_OPTIONS","hasAction","entity","name","a","buildScopeOptions","options","BUILTIN_ACTIONS","Set","getCustomActions","EntitySection","data","cannotUseAAcl","Bind","setValue","scopeField","currentScope","scopeDisabled","customActions","useMemo","customActionsValue","onCustomActionsChange","useCallback","selected","selectedSet","action","columns","Grid","value","cb","Select","CheckboxGroup","opt","PermissionsGroup","PermissionRenderer","schema","onChange","usePermissionValue","identity","useAuthentication","formData","onFormChange","usePermissionForm","entities","hasEntities","accessLevelOptions","Form","Fragment","CannotUseAaclAlert","PermissionInfo"],"mappings":";;;;;;;AAmBA,MAAMA,YAAY;AAClB,MAAMC,cAAc;AACpB,MAAMC,mBAAmB;AACzB,MAAMC,gBAAgB;AAEtB,MAAMC,cAAc;IAChB;QAAE,OAAO;QAAK,OAAO;IAAO;IAC5B;QAAE,OAAO;QAAM,OAAO;IAAc;IACpC;QAAE,OAAO;QAAO,OAAO;IAAsB;CAChD;AAED,MAAMC,aAAa;IACf;QAAE,OAAO;QAAK,OAAO;IAAU;IAC/B;QAAE,OAAO;QAAK,OAAO;IAAY;CACpC;AAED,SAASC,UAAUC,MAAwB,EAAEC,IAAY;IACrD,OAAOD,OAAO,OAAO,EAAE,KAAKE,CAAAA,IAAKA,EAAE,IAAI,KAAKD,SAAS;AACzD;AAEA,SAASE,kBAAkBH,MAAwB;IAC/C,MAAMI,UAAU;QAAC;YAAE,OAAOX;YAAW,OAAO;QAAY;KAAE;IAE1D,IAAIO,OAAO,MAAM,CAAC,QAAQ,CAAC,SACvBI,QAAQ,IAAI,CAAC;QAAE,OAAOV;QAAa,OAAO;IAAc;IAG5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B,KAAK,MAAM;YAAC,MAAM;yBACf,oBAACd,MAAAA;YAAK,MAAM;yBACR,oBAACiB,QAAMA;YAAC,SAASe;eAI5BlC,KAAK,WAAW,KAAKb,iBAAiB8C,eAAe,WAAfA,GACnC,oBAAC;YAAI,WAAW;WACXD,SAAS,GAAG,CAACzC,CAAAA,SAAAA,WAAAA,GACV,oBAACQ,eAAaA;gBACV,KAAKR,OAAO,EAAE;gBACd,QAAQA;gBACR,MAAMS;gBACN,eAAeC;gBACf,MAAMC;gBACN,UAAUC;;AAS9C"}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
const PermissionValueContext = /*#__PURE__*/
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;
|
|
1
|
+
import react, { useContext } from "react";
|
|
2
|
+
const PermissionValueContext = /*#__PURE__*/ react.createContext(null);
|
|
3
|
+
const PermissionValueProvider = ({ value, onChange, children })=>/*#__PURE__*/ react.createElement(PermissionValueContext.Provider, {
|
|
4
|
+
value: {
|
|
5
|
+
value,
|
|
6
|
+
onChange
|
|
7
|
+
}
|
|
8
|
+
}, children);
|
|
9
|
+
function usePermissionValue() {
|
|
10
|
+
const ctx = useContext(PermissionValueContext);
|
|
11
|
+
if (!ctx) throw new Error("usePermissionValue must be used within a PermissionValueProvider");
|
|
12
|
+
return ctx;
|
|
21
13
|
}
|
|
14
|
+
export { PermissionValueProvider, usePermissionValue };
|
|
22
15
|
|
|
23
16
|
//# sourceMappingURL=PermissionValueContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"permissions/PermissionValueContext.js","sources":["../../src/permissions/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"],"names":["PermissionValueContext","React","PermissionValueProvider","value","onChange","children","usePermissionValue","ctx","useContext","Error"],"mappings":";AAQA,MAAMA,yBAAyB,WAAHA,GAAGC,MAAAA,aAAmB,CAAqC;AAEhF,MAAMC,0BAA0B,CAAC,EACpCC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACkD,GACnD,WAAP,GACI,oBAACL,uBAAuB,QAAQ;QAAC,OAAO;YAAEG;YAAOC;QAAS;OACrDC;AAKN,SAASC;IACZ,MAAMC,MAAMC,WAAWR;IACvB,IAAI,CAACO,KACD,MAAM,IAAIE,MAAM;IAEpB,OAAOF;AACX"}
|
|
@@ -1,47 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import react from "react";
|
|
2
2
|
import { useContainer } from "@webiny/app";
|
|
3
3
|
const BUILT_IN_ACTIONS = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
read: "canRead",
|
|
5
|
+
create: "canCreate",
|
|
6
|
+
edit: "canEdit",
|
|
7
|
+
delete: "canDelete",
|
|
8
|
+
publish: "canPublish",
|
|
9
|
+
unpublish: "canUnpublish"
|
|
10
10
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
function createHasPermission(abstraction) {
|
|
12
|
+
return function({ children, ...props }) {
|
|
13
|
+
const container = useContainer();
|
|
14
|
+
const permissions = container.resolve(abstraction);
|
|
15
|
+
const action = props.action;
|
|
16
|
+
const someActions = props.someActions;
|
|
17
|
+
const allActions = props.allActions;
|
|
18
|
+
const entities = props.entity ? [
|
|
19
|
+
props.entity
|
|
20
|
+
] : props.any ?? props.all ?? [];
|
|
21
|
+
const requireAll = !!props.all;
|
|
22
|
+
const checkAction = (entityId, singleAction)=>{
|
|
23
|
+
if (!singleAction) return permissions.canAccess(entityId);
|
|
24
|
+
const method = BUILT_IN_ACTIONS[singleAction];
|
|
25
|
+
if (method && "function" == typeof permissions[method]) return permissions[method](entityId);
|
|
26
|
+
return permissions.canAction(singleAction, entityId);
|
|
27
|
+
};
|
|
28
|
+
const check = (entityId)=>{
|
|
29
|
+
if (allActions) return allActions.every((act)=>checkAction(entityId, act));
|
|
30
|
+
if (someActions) return someActions.some((act)=>checkAction(entityId, act));
|
|
31
|
+
return checkAction(entityId, action);
|
|
32
|
+
};
|
|
33
|
+
const allowed = requireAll ? entities.every(check) : entities.some(check);
|
|
34
|
+
return allowed ? /*#__PURE__*/ react.createElement(react.Fragment, null, children) : null;
|
|
32
35
|
};
|
|
33
|
-
const check = entityId => {
|
|
34
|
-
if (allActions) {
|
|
35
|
-
return allActions.every(act => checkAction(entityId, act));
|
|
36
|
-
}
|
|
37
|
-
if (someActions) {
|
|
38
|
-
return someActions.some(act => checkAction(entityId, act));
|
|
39
|
-
}
|
|
40
|
-
return checkAction(entityId, action);
|
|
41
|
-
};
|
|
42
|
-
const allowed = requireAll ? entities.every(check) : entities.some(check);
|
|
43
|
-
return allowed ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;
|
|
44
|
-
};
|
|
45
36
|
}
|
|
37
|
+
export { createHasPermission };
|
|
46
38
|
|
|
47
39
|
//# sourceMappingURL=createHasPermission.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"permissions/createHasPermission.js","sources":["../../src/permissions/createHasPermission.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Abstraction } from \"@webiny/di\";\nimport type { HasPermissionProps, PermissionSchemaConfig, UsePermissionsResult } from \"./types.js\";\nimport { useContainer } from \"@webiny/app\";\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 abstraction: Abstraction<UsePermissionsResult<S>>\n): React.FC<HasPermissionProps<S>> {\n return function HasPermission({ children, ...props }) {\n const container = useContainer();\n const permissions = container.resolve(abstraction);\n\n const action = props.action as string | undefined;\n const someActions = props.someActions as string[] | undefined;\n const allActions = props.allActions as string[] | undefined;\n const entities: string[] = props.entity ? [props.entity] : (props.any ?? props.all ?? []);\n const requireAll = !!props.all;\n\n const checkAction = (entityId: string, singleAction: string | undefined): boolean => {\n if (!singleAction) {\n return permissions.canAccess(entityId);\n }\n const method = BUILT_IN_ACTIONS[singleAction] as keyof typeof permissions;\n if (method && typeof permissions[method] === \"function\") {\n return (permissions[method] as (entityId: string) => boolean)(entityId);\n }\n return (permissions.canAction as (action: string, entityId: string) => boolean)(\n singleAction,\n entityId\n );\n };\n\n const check = (entityId: string): boolean => {\n if (allActions) {\n return allActions.every(act => checkAction(entityId, act));\n }\n if (someActions) {\n return someActions.some(act => checkAction(entityId, act));\n }\n return checkAction(entityId, action);\n };\n\n const allowed = requireAll ? entities.every(check) : entities.some(check);\n\n return allowed ? <>{children}</> : null;\n };\n}\n"],"names":["BUILT_IN_ACTIONS","createHasPermission","abstraction","children","props","container","useContainer","permissions","action","someActions","allActions","entities","requireAll","checkAction","entityId","singleAction","method","check","act","allowed"],"mappings":";;AAKA,MAAMA,mBAA2C;IAC7C,MAAM;IACN,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,SAAS;IACT,WAAW;AACf;AAEO,SAASC,oBACZC,WAAiD;IAEjD,OAAO,SAAuB,EAAEC,QAAQ,EAAE,GAAGC,OAAO;QAChD,MAAMC,YAAYC;QAClB,MAAMC,cAAcF,UAAU,OAAO,CAACH;QAEtC,MAAMM,SAASJ,MAAM,MAAM;QAC3B,MAAMK,cAAcL,MAAM,WAAW;QACrC,MAAMM,aAAaN,MAAM,UAAU;QACnC,MAAMO,WAAqBP,MAAM,MAAM,GAAG;YAACA,MAAM,MAAM;SAAC,GAAIA,MAAM,GAAG,IAAIA,MAAM,GAAG,IAAI,EAAE;QACxF,MAAMQ,aAAa,CAAC,CAACR,MAAM,GAAG;QAE9B,MAAMS,cAAc,CAACC,UAAkBC;YACnC,IAAI,CAACA,cACD,OAAOR,YAAY,SAAS,CAACO;YAEjC,MAAME,SAAShB,gBAAgB,CAACe,aAAa;YAC7C,IAAIC,UAAU,AAA+B,cAA/B,OAAOT,WAAW,CAACS,OAAO,EACpC,OAAQT,WAAW,CAACS,OAAO,CAAmCF;YAElE,OAAQP,YAAY,SAAS,CACzBQ,cACAD;QAER;QAEA,MAAMG,QAAQ,CAACH;YACX,IAAIJ,YACA,OAAOA,WAAW,KAAK,CAACQ,CAAAA,MAAOL,YAAYC,UAAUI;YAEzD,IAAIT,aACA,OAAOA,YAAY,IAAI,CAACS,CAAAA,MAAOL,YAAYC,UAAUI;YAEzD,OAAOL,YAAYC,UAAUN;QACjC;QAEA,MAAMW,UAAUP,aAAaD,SAAS,KAAK,CAACM,SAASN,SAAS,IAAI,CAACM;QAEnE,OAAOE,UAAU,WAAVA,GAAU,0CAAGhB,YAAe;IACvC;AACJ"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function createPermissionSchema(config) {
|
|
2
|
+
return {
|
|
3
|
+
...config,
|
|
4
|
+
entities: config.entities ?? []
|
|
5
|
+
};
|
|
6
6
|
}
|
|
7
|
+
export { createPermissionSchema };
|
|
7
8
|
|
|
8
9
|
//# sourceMappingURL=createPermissionSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"permissions/createPermissionSchema.js","sources":["../../src/permissions/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"],"names":["createPermissionSchema","config"],"mappings":"AAEO,SAASA,uBAA+DC,MAAS;IACpF,OAAO;QACH,GAAGA,MAAM;QACT,UAAUA,OAAO,QAAQ,IAAI,EAAE;IACnC;AACJ"}
|
|
@@ -1,201 +1,141 @@
|
|
|
1
|
-
import { createAbstraction } from "@webiny/feature/admin";
|
|
2
|
-
import { createFeature } from "@webiny/feature/admin";
|
|
1
|
+
import { createAbstraction, createFeature } from "@webiny/feature/admin";
|
|
3
2
|
import { IdentityContext } from "../features/security/IdentityContext/abstractions.js";
|
|
4
3
|
function buildEntityMap(schema) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return map;
|
|
4
|
+
const map = new Map();
|
|
5
|
+
for (const entity of schema.entities ?? []){
|
|
6
|
+
const actions = new Set();
|
|
7
|
+
for (const action of entity.actions ?? [])actions.add(action.name);
|
|
8
|
+
map.set(entity.id, {
|
|
9
|
+
permission: entity.permission,
|
|
10
|
+
actions,
|
|
11
|
+
hasOwn: entity.scopes.includes("own")
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return map;
|
|
18
15
|
}
|
|
19
16
|
function getEntity(entityMap, entityId) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return entity;
|
|
17
|
+
const entity = entityMap.get(entityId);
|
|
18
|
+
if (!entity) throw new Error(`Unknown entity "${entityId}" in permission schema.`);
|
|
19
|
+
return entity;
|
|
25
20
|
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Check whether the identity has unrestricted full access for the given schema prefix.
|
|
29
|
-
* Stricter than the legacy check: `{ name: "wb.*", rwd: "r" }` is NOT full access.
|
|
30
|
-
*/
|
|
31
21
|
function hasFullSchemaAccess(identity, prefix) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return false;
|
|
36
|
-
|
|
37
|
-
// If any restricting keys are present, this is not full access.
|
|
38
|
-
if (typeof permission.rwd === "string" || typeof permission.pw === "string") {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
return true;
|
|
22
|
+
const fullAccessName = `${prefix}.*`;
|
|
23
|
+
const permission = identity.getPermission(fullAccessName);
|
|
24
|
+
if (!permission) return false;
|
|
25
|
+
if ("string" == typeof permission.rwd || "string" == typeof permission.pw) return false;
|
|
26
|
+
return true;
|
|
42
27
|
}
|
|
43
28
|
class SchemaPermissions {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
29
|
+
constructor(schema, identityContext){
|
|
30
|
+
this.canAccess = (entityId)=>{
|
|
31
|
+
if (this.fullAccess) return true;
|
|
32
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
33
|
+
return this.identity.getPermissions(entity.permission).length > 0;
|
|
34
|
+
};
|
|
35
|
+
this.canRead = (entityId)=>{
|
|
36
|
+
if (this.fullAccess) return true;
|
|
37
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
38
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
39
|
+
if (!permissions.length) return false;
|
|
40
|
+
return permissions.some((permission)=>{
|
|
41
|
+
if ("string" != typeof permission.rwd) return true;
|
|
42
|
+
return permission.rwd.includes("r");
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
this.canCreate = (entityId)=>{
|
|
46
|
+
if (this.fullAccess) return true;
|
|
47
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
48
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
49
|
+
if (!permissions.length) return false;
|
|
50
|
+
return permissions.some((permission)=>{
|
|
51
|
+
if ("string" != typeof permission.rwd) return true;
|
|
52
|
+
return permission.rwd.includes("w");
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
this.canEdit = (entityId, item)=>{
|
|
56
|
+
if (this.fullAccess) return true;
|
|
57
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
58
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
59
|
+
if (!permissions.length) return false;
|
|
60
|
+
return permissions.some((permission)=>{
|
|
61
|
+
if (permission.own) {
|
|
62
|
+
if (!item?.createdBy) return true;
|
|
63
|
+
return item.createdBy.id === this.identity.id;
|
|
64
|
+
}
|
|
65
|
+
if ("string" != typeof permission.rwd) return true;
|
|
66
|
+
return permission.rwd.includes("w");
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
this.canDelete = (entityId, item)=>{
|
|
70
|
+
if (this.fullAccess) return true;
|
|
71
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
72
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
73
|
+
if (!permissions.length) return false;
|
|
74
|
+
return permissions.some((permission)=>{
|
|
75
|
+
if (permission.own) return item?.createdBy?.id === this.identity.id;
|
|
76
|
+
if ("string" != typeof permission.rwd) return true;
|
|
77
|
+
return permission.rwd.includes("d");
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
this.canPublish = (entityId)=>{
|
|
81
|
+
if (this.fullAccess) return true;
|
|
82
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
83
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
84
|
+
if (!permissions.length) return false;
|
|
85
|
+
return permissions.some((permission)=>permission.pw?.includes("p"));
|
|
86
|
+
};
|
|
87
|
+
this.canUnpublish = (entityId)=>{
|
|
88
|
+
if (this.fullAccess) return true;
|
|
89
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
90
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
91
|
+
if (!permissions.length) return false;
|
|
92
|
+
return permissions.some((permission)=>permission.pw?.includes("u"));
|
|
93
|
+
};
|
|
94
|
+
this.canAction = (action, entityId)=>{
|
|
95
|
+
if (this.fullAccess) return true;
|
|
96
|
+
const entity = getEntity(this.entityMap, entityId);
|
|
97
|
+
const permissions = this.identity.getPermissions(entity.permission);
|
|
98
|
+
if (!permissions.length) return false;
|
|
99
|
+
return permissions.some((permission)=>true === permission[action]);
|
|
100
|
+
};
|
|
101
|
+
this.schema = schema;
|
|
102
|
+
this.entityMap = buildEntityMap(schema);
|
|
103
|
+
this.identityContext = identityContext;
|
|
104
|
+
}
|
|
105
|
+
get identity() {
|
|
106
|
+
return this.identityContext.getIdentity();
|
|
107
|
+
}
|
|
108
|
+
get fullAccess() {
|
|
109
|
+
return hasFullSchemaAccess(this.identity, this.schema.prefix);
|
|
81
110
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
return permission.rwd.includes("w");
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
canEdit = (entityId, item) => {
|
|
95
|
-
if (this.fullAccess) {
|
|
96
|
-
return true;
|
|
97
|
-
}
|
|
98
|
-
const entity = getEntity(this.entityMap, entityId);
|
|
99
|
-
const permissions = this.identity.getPermissions(entity.permission);
|
|
100
|
-
if (!permissions.length) {
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
return permissions.some(permission => {
|
|
104
|
-
if (permission.own) {
|
|
105
|
-
if (!item?.createdBy) {
|
|
106
|
-
return true;
|
|
111
|
+
}
|
|
112
|
+
function createPermissionsAbstraction(schema) {
|
|
113
|
+
return createAbstraction(`${schema.prefix}:Permissions`);
|
|
114
|
+
}
|
|
115
|
+
function createPermissionsFeature(schema, abstraction) {
|
|
116
|
+
class PermissionsImpl extends SchemaPermissions {
|
|
117
|
+
constructor(identityContext){
|
|
118
|
+
super(schema, identityContext);
|
|
107
119
|
}
|
|
108
|
-
return item.createdBy.id === this.identity.id;
|
|
109
|
-
}
|
|
110
|
-
if (typeof permission.rwd !== "string") {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
return permission.rwd.includes("w");
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
canDelete = (entityId, item) => {
|
|
117
|
-
if (this.fullAccess) {
|
|
118
|
-
return true;
|
|
119
120
|
}
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return permissions.some(permission => {
|
|
126
|
-
if (permission.own) {
|
|
127
|
-
return item?.createdBy?.id === this.identity.id;
|
|
128
|
-
}
|
|
129
|
-
if (typeof permission.rwd !== "string") {
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
return permission.rwd.includes("d");
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
canPublish = entityId => {
|
|
136
|
-
if (this.fullAccess) {
|
|
137
|
-
return true;
|
|
138
|
-
}
|
|
139
|
-
const entity = getEntity(this.entityMap, entityId);
|
|
140
|
-
const permissions = this.identity.getPermissions(entity.permission);
|
|
141
|
-
if (!permissions.length) {
|
|
142
|
-
return false;
|
|
143
|
-
}
|
|
144
|
-
return permissions.some(permission => {
|
|
145
|
-
return permission.pw?.includes("p");
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
canUnpublish = entityId => {
|
|
149
|
-
if (this.fullAccess) {
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
const entity = getEntity(this.entityMap, entityId);
|
|
153
|
-
const permissions = this.identity.getPermissions(entity.permission);
|
|
154
|
-
if (!permissions.length) {
|
|
155
|
-
return false;
|
|
156
|
-
}
|
|
157
|
-
return permissions.some(permission => {
|
|
158
|
-
return permission.pw?.includes("u");
|
|
121
|
+
const Implementation = abstraction.createImplementation({
|
|
122
|
+
implementation: PermissionsImpl,
|
|
123
|
+
dependencies: [
|
|
124
|
+
IdentityContext
|
|
125
|
+
]
|
|
159
126
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return permissions.some(permission => {
|
|
171
|
-
return permission[action] === true;
|
|
127
|
+
return createFeature({
|
|
128
|
+
name: `${schema.prefix}:Permissions`,
|
|
129
|
+
register (container) {
|
|
130
|
+
container.register(Implementation).inSingletonScope();
|
|
131
|
+
},
|
|
132
|
+
resolve (container) {
|
|
133
|
+
return {
|
|
134
|
+
permissions: container.resolve(abstraction)
|
|
135
|
+
};
|
|
136
|
+
}
|
|
172
137
|
});
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
export function createPermissionsAbstraction(schema) {
|
|
176
|
-
return createAbstraction(`${schema.prefix}:Permissions`);
|
|
177
|
-
}
|
|
178
|
-
export function createPermissionsFeature(schema, abstraction) {
|
|
179
|
-
class PermissionsImpl extends SchemaPermissions {
|
|
180
|
-
constructor(identityContext) {
|
|
181
|
-
super(schema, identityContext);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
const Implementation = abstraction.createImplementation({
|
|
185
|
-
implementation: PermissionsImpl,
|
|
186
|
-
dependencies: [IdentityContext]
|
|
187
|
-
});
|
|
188
|
-
return createFeature({
|
|
189
|
-
name: `${schema.prefix}:Permissions`,
|
|
190
|
-
register(container) {
|
|
191
|
-
container.register(Implementation).inSingletonScope();
|
|
192
|
-
},
|
|
193
|
-
resolve(container) {
|
|
194
|
-
return {
|
|
195
|
-
permissions: container.resolve(abstraction)
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
138
|
}
|
|
139
|
+
export { createPermissionsAbstraction, createPermissionsFeature };
|
|
200
140
|
|
|
201
141
|
//# sourceMappingURL=createPermissions.js.map
|