@webiny/app-admin 6.3.0 → 6.4.0-beta.1
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 +29 -29
- 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/browserFilePicker/BrowserFilePicker.d.ts +3 -0
- package/presentation/browserFilePicker/BrowserFilePicker.js +88 -0
- package/presentation/browserFilePicker/BrowserFilePicker.js.map +1 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.d.ts +10 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.js +84 -0
- package/presentation/browserFilePicker/BrowserFilePickerPresenter.js.map +1 -0
- package/presentation/browserFilePicker/index.d.ts +3 -0
- package/presentation/browserFilePicker/index.js +2 -0
- package/presentation/browserFilePicker/types.d.ts +53 -0
- package/presentation/browserFilePicker/types.js +0 -0
- package/presentation/browserFilePicker/utils.d.ts +2 -0
- package/presentation/browserFilePicker/utils.js +16 -0
- package/presentation/browserFilePicker/utils.js.map +1 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/listPresenter/ListPresenter.test.js","sources":["../../../src/presentation/listPresenter/ListPresenter.test.ts"],"sourcesContent":["import { describe, it, expect, vi, beforeEach, afterEach } from \"vitest\";\nimport { makeAutoObservable, runInAction } from \"mobx\";\nimport { Container } from \"@webiny/di\";\nimport { ListPresenterFeature } from \"./feature.js\";\nimport {\n ListPresenter as Abstraction,\n type IDataSource,\n type IDataSourceQuery,\n type IDataSourceMeta,\n type IListPresenter\n} from \"./abstractions.js\";\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\ninterface TestRow {\n id: string;\n name: string;\n size: number;\n}\n\nfunction createRows(count: number, startIndex = 0): TestRow[] {\n return Array.from({ length: count }, (_, i) => ({\n id: `file-${startIndex + i}`,\n name: `File ${startIndex + i}`,\n size: (startIndex + i) * 100\n }));\n}\n\nclass MockDataSource implements IDataSource<TestRow> {\n private _rows: TestRow[] = [];\n private _meta: IDataSourceMeta = { cursor: null, hasMoreItems: false, totalCount: 0 };\n private _loading = false;\n\n query = vi.fn<(params: IDataSourceQuery) => Promise<void>>();\n loadMore = vi.fn<(params: IDataSourceQuery) => Promise<void>>();\n\n private defaultRows: TestRow[];\n private defaultMeta: IDataSourceMeta;\n\n constructor(\n rows: TestRow[] = createRows(3),\n meta: IDataSourceMeta = { cursor: null, hasMoreItems: false, totalCount: rows.length }\n ) {\n this.defaultRows = rows;\n this.defaultMeta = meta;\n\n makeAutoObservable(this, { query: false, loadMore: false });\n\n this.query.mockImplementation(async () => {\n runInAction(() => {\n this._loading = true;\n this._rows = [];\n });\n await Promise.resolve();\n runInAction(() => {\n this._rows = this.defaultRows;\n this._meta = this.defaultMeta;\n this._loading = false;\n });\n });\n\n this.loadMore.mockImplementation(async () => {\n runInAction(() => {\n this._loading = true;\n });\n await Promise.resolve();\n runInAction(() => {\n this._rows = [...this._rows, ...this.defaultRows];\n this._meta = this.defaultMeta;\n this._loading = false;\n });\n });\n }\n\n get rows(): TestRow[] {\n return this._rows;\n }\n\n get meta(): IDataSourceMeta {\n return this._meta;\n }\n\n get loading(): boolean {\n return this._loading;\n }\n\n mockNextQuery(rows: TestRow[], meta: IDataSourceMeta) {\n this.query.mockImplementationOnce(async () => {\n runInAction(() => {\n this._loading = true;\n this._rows = [];\n });\n await Promise.resolve();\n runInAction(() => {\n this._rows = rows;\n this._meta = meta;\n this._loading = false;\n });\n });\n }\n\n mockNextLoadMore(rows: TestRow[], meta: IDataSourceMeta) {\n this.loadMore.mockImplementationOnce(async () => {\n runInAction(() => {\n this._loading = true;\n });\n await Promise.resolve();\n runInAction(() => {\n this._rows = [...this._rows, ...rows];\n this._meta = meta;\n this._loading = false;\n });\n });\n }\n}\n\nfunction createMockDataSource(rows?: TestRow[], meta?: IDataSourceMeta): MockDataSource {\n return new MockDataSource(rows, meta);\n}\n\nfunction createPresenter(): IListPresenter<TestRow> {\n const container = new Container();\n ListPresenterFeature.register(container);\n return container.resolve(Abstraction);\n}\n\nasync function createInitializedPresenter(\n dsOverride?: MockDataSource\n): Promise<{ presenter: IListPresenter<TestRow>; dataSource: MockDataSource }> {\n const dataSource = dsOverride ?? createMockDataSource();\n const presenter = createPresenter();\n presenter.init({ dataSource });\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n return { presenter, dataSource };\n}\n\n// ---------------------------------------------------------------------------\n// Tests\n// ---------------------------------------------------------------------------\n\ndescribe(\"ListPresenter\", () => {\n beforeEach(() => {\n vi.useFakeTimers();\n });\n\n afterEach(() => {\n vi.useRealTimers();\n });\n\n // -----------------------------------------------------------------------\n // Init & initial data load\n // -----------------------------------------------------------------------\n\n describe(\"init\", () => {\n it(\"should be in empty/uninitialized state before init\", () => {\n const presenter = createPresenter();\n const { vm } = presenter;\n\n expect(vm.rows).toEqual([]);\n expect(vm.sort).toBeNull();\n expect(vm.filters).toEqual({});\n expect(vm.search).toBe(\"\");\n expect(vm.appliedQuery).toBeNull();\n expect(vm.pagination.loading).toBe(false);\n expect(vm.pagination.totalCount).toBe(0);\n expect(vm.empty).toBe(true);\n expect(vm.error).toBeNull();\n });\n\n it(\"should trigger initial data load from DataSource\", async () => {\n const rows = createRows(3);\n const dataSource = createMockDataSource(rows, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 3\n });\n\n const presenter = createPresenter();\n presenter.init({ dataSource });\n\n // Loading should be true immediately after init.\n expect(presenter.vm.pagination.loading).toBe(true);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.rows).toEqual(rows);\n expect(presenter.vm.pagination.totalCount).toBe(3);\n expect(presenter.vm.pagination.currentCount).toBe(3);\n expect(presenter.vm.empty).toBe(false);\n expect(dataSource.query).toHaveBeenCalledTimes(1);\n });\n\n it(\"should apply initialSort from config\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialSort: { field: \"name\", direction: \"ASC\" }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.sort).toEqual({ field: \"name\", direction: \"ASC\" });\n expect(dataSource.query).toHaveBeenCalledWith(\n expect.objectContaining({\n sort: { field: \"name\", direction: \"ASC\" }\n })\n );\n });\n\n it(\"should apply initialFilters from config\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialFilters: { type: \"image\" }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.filters).toEqual({ type: \"image\" });\n expect(dataSource.query).toHaveBeenCalledWith(\n expect.objectContaining({\n filters: { type: \"image\" }\n })\n );\n });\n\n it(\"should not query DataSource if init is never called\", () => {\n const presenter = createPresenter();\n // Access vm — no query should have been made.\n expect(presenter.vm.rows).toEqual([]);\n });\n });\n\n // -----------------------------------------------------------------------\n // Sort actions\n // -----------------------------------------------------------------------\n\n describe(\"sort\", () => {\n it(\"should set sort and re-query DataSource\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n\n presenter.actions.sort.set(\"size\", \"DESC\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.sort).toEqual({ field: \"size\", direction: \"DESC\" });\n // Initial query + sort query.\n expect(dataSource.query).toHaveBeenCalledTimes(2);\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n sort: { field: \"size\", direction: \"DESC\" }\n })\n );\n });\n\n it(\"should toggle direction for the same field\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialSort: { field: \"name\", direction: \"ASC\" }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n presenter.actions.sort.toggle(\"name\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.sort).toEqual({ field: \"name\", direction: \"DESC\" });\n });\n\n it(\"should set ASC when toggling a new field\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialSort: { field: \"name\", direction: \"DESC\" }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n presenter.actions.sort.toggle(\"size\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.sort).toEqual({ field: \"size\", direction: \"ASC\" });\n });\n\n it(\"should reset selection on sort change\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedCount).toBe(1);\n\n presenter.actions.sort.set(\"name\", \"ASC\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.selection.selectedCount).toBe(0);\n });\n });\n\n // -----------------------------------------------------------------------\n // Filter actions\n // -----------------------------------------------------------------------\n\n describe(\"filter\", () => {\n it(\"should set a filter and re-query DataSource\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n\n presenter.actions.filter.set(\"type\", \"image\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.filters).toEqual({ type: \"image\" });\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n filters: { type: \"image\" }\n })\n );\n });\n\n it(\"should clear a single filter and re-query\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialFilters: { type: \"image\", tags: [\"photo\"] }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n presenter.actions.filter.clear(\"type\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.filters).toEqual({ tags: [\"photo\"] });\n });\n\n it(\"should clear all filters and re-query\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialFilters: { type: \"image\", tags: [\"photo\"] }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n presenter.actions.filter.clearAll();\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.filters).toEqual({});\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n filters: undefined\n })\n );\n });\n\n it(\"should reset selection on filter change\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedCount).toBe(1);\n\n presenter.actions.filter.set(\"type\", \"image\");\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.selection.selectedCount).toBe(0);\n });\n });\n\n // -----------------------------------------------------------------------\n // Search actions\n // -----------------------------------------------------------------------\n\n describe(\"search\", () => {\n it(\"should set search and re-query with debounce\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n const initialCallCount = dataSource.query.mock.calls.length;\n\n presenter.actions.search.set(\"hello\");\n\n expect(presenter.vm.search).toBe(\"hello\");\n // Should NOT have queried yet (debounce pending).\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount);\n\n // Advance past the default 300ms debounce.\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n search: \"hello\"\n })\n );\n });\n\n it(\"should debounce rapid search changes\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n const initialCallCount = dataSource.query.mock.calls.length;\n\n presenter.actions.search.set(\"h\");\n vi.advanceTimersByTime(100);\n presenter.actions.search.set(\"he\");\n vi.advanceTimersByTime(100);\n presenter.actions.search.set(\"hel\");\n vi.advanceTimersByTime(100);\n presenter.actions.search.set(\"hello\");\n\n // None of the intermediate searches should have triggered a query.\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount);\n\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n // Only one additional query for the final search term.\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount + 1);\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n search: \"hello\"\n })\n );\n });\n\n it(\"should respect custom debounceMs\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({ dataSource, debounceMs: 500 });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n const initialCallCount = dataSource.query.mock.calls.length;\n\n presenter.actions.search.set(\"test\");\n\n // At 300ms — should NOT have queried yet.\n vi.advanceTimersByTime(300);\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount);\n\n // At 500ms — should query.\n vi.advanceTimersByTime(200);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount + 1);\n });\n\n it(\"should clear search immediately (no debounce) and re-query\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n\n // Set search first.\n presenter.actions.search.set(\"hello\");\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n const callCountAfterSearch = dataSource.query.mock.calls.length;\n\n presenter.actions.search.clear();\n\n // Clear triggers immediate requery (no debounce).\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.search).toBe(\"\");\n expect(dataSource.query.mock.calls.length).toBe(callCountAfterSearch + 1);\n expect(dataSource.query).toHaveBeenLastCalledWith(\n expect.objectContaining({\n search: undefined\n })\n );\n });\n\n it(\"should reset selection on search change\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedCount).toBe(1);\n\n presenter.actions.search.set(\"test\");\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.selection.selectedCount).toBe(0);\n });\n });\n\n // -----------------------------------------------------------------------\n // Pagination: loadMore & refresh\n // -----------------------------------------------------------------------\n\n describe(\"pagination\", () => {\n it(\"should append rows on loadMore\", async () => {\n const firstPage = createRows(3, 0);\n const secondPage = createRows(2, 3);\n\n const dataSource = createMockDataSource(firstPage, {\n cursor: \"cursor-1\",\n hasMoreItems: true,\n totalCount: 5\n });\n\n const presenter = createPresenter();\n presenter.init({ dataSource });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.rows).toHaveLength(3);\n expect(presenter.vm.pagination.hasMore).toBe(true);\n\n dataSource.mockNextLoadMore(secondPage, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 5\n });\n\n await presenter.actions.loadMore();\n\n expect(presenter.vm.rows).toHaveLength(5);\n expect(presenter.vm.rows[3].id).toBe(\"file-3\");\n expect(presenter.vm.pagination.hasMore).toBe(false);\n expect(presenter.vm.pagination.totalCount).toBe(5);\n expect(dataSource.loadMore).toHaveBeenLastCalledWith(\n expect.objectContaining({\n cursor: \"cursor-1\"\n })\n );\n });\n\n it(\"should not loadMore when hasMoreItems is false\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n\n expect(presenter.vm.pagination.hasMore).toBe(false);\n\n await presenter.actions.loadMore();\n\n expect(dataSource.loadMore).not.toHaveBeenCalled();\n });\n\n it(\"should replace rows on refresh\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n\n const freshRows = createRows(2, 10);\n dataSource.mockNextQuery(freshRows, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 2\n });\n\n await presenter.actions.refresh();\n\n expect(presenter.vm.rows).toEqual(freshRows);\n expect(presenter.vm.pagination.totalCount).toBe(2);\n expect(presenter.vm.pagination.currentCount).toBe(2);\n });\n });\n\n // -----------------------------------------------------------------------\n // Selection\n // -----------------------------------------------------------------------\n\n describe(\"selection\", () => {\n it(\"should toggle a single row\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedIds.has(\"file-0\")).toBe(true);\n expect(presenter.vm.selection.selectedCount).toBe(1);\n\n // Toggle off.\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedIds.has(\"file-0\")).toBe(false);\n expect(presenter.vm.selection.selectedCount).toBe(0);\n });\n\n it(\"should select all rows\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.selectAll();\n expect(presenter.vm.selection.selectedCount).toBe(3);\n expect(presenter.vm.selection.allSelected).toBe(true);\n });\n\n it(\"should deselect all rows\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.selectAll();\n presenter.actions.selection.deselectAll();\n expect(presenter.vm.selection.selectedCount).toBe(0);\n expect(presenter.vm.selection.allSelected).toBe(false);\n });\n\n it(\"should select specific rows by ids\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.selectRows([\"file-0\", \"file-2\"]);\n expect(presenter.vm.selection.selectedCount).toBe(2);\n expect(presenter.vm.selection.selectedIds.has(\"file-0\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-1\")).toBe(false);\n expect(presenter.vm.selection.selectedIds.has(\"file-2\")).toBe(true);\n });\n\n it(\"should check if a row is selected via isSelected\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-1\");\n expect(presenter.actions.selection.isSelected(\"file-1\")).toBe(true);\n expect(presenter.actions.selection.isSelected(\"file-0\")).toBe(false);\n });\n\n it(\"should support shift-click range selection\", async () => {\n const rows = createRows(5);\n const dataSource = createMockDataSource(rows, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 5\n });\n const { presenter } = await createInitializedPresenter(dataSource);\n\n // Select first row (no shift).\n presenter.actions.selection.toggle(\"file-0\");\n expect(presenter.vm.selection.selectedCount).toBe(1);\n\n // Range select to row 3 — should select 0, 1, 2, 3.\n presenter.actions.selection.selectRangeTo(\"file-3\");\n expect(presenter.vm.selection.selectedCount).toBe(4);\n expect(presenter.vm.selection.selectedIds.has(\"file-0\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-1\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-2\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-3\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-4\")).toBe(false);\n });\n\n it(\"should support reverse shift-click range selection\", async () => {\n const rows = createRows(5);\n const dataSource = createMockDataSource(rows, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 5\n });\n const { presenter } = await createInitializedPresenter(dataSource);\n\n // Select row 4 first.\n presenter.actions.selection.toggle(\"file-4\");\n\n // Range select to row 1 — should select 1, 2, 3, 4.\n presenter.actions.selection.selectRangeTo(\"file-1\");\n expect(presenter.vm.selection.selectedCount).toBe(4);\n expect(presenter.vm.selection.selectedIds.has(\"file-1\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-2\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-3\")).toBe(true);\n expect(presenter.vm.selection.selectedIds.has(\"file-4\")).toBe(true);\n });\n\n it(\"should report allSelected correctly\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.selection.toggle(\"file-0\");\n presenter.actions.selection.toggle(\"file-1\");\n expect(presenter.vm.selection.allSelected).toBe(false);\n\n presenter.actions.selection.toggle(\"file-2\");\n expect(presenter.vm.selection.allSelected).toBe(true);\n });\n\n it(\"should report allSelected as false when rows are empty\", () => {\n const presenter = createPresenter();\n expect(presenter.vm.selection.allSelected).toBe(false);\n });\n });\n\n // -----------------------------------------------------------------------\n // ViewModel computed properties\n // -----------------------------------------------------------------------\n\n describe(\"vm computed properties\", () => {\n it(\"should report empty=true when no rows and not loading\", async () => {\n const dataSource = createMockDataSource([], {\n cursor: null,\n hasMoreItems: false,\n totalCount: 0\n });\n\n const { presenter } = await createInitializedPresenter(dataSource);\n\n expect(presenter.vm.empty).toBe(true);\n expect(presenter.vm.emptyWithFilters).toBe(false);\n });\n\n it(\"should report empty=false while loading\", () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({ dataSource });\n\n // During loading, empty should be false.\n expect(presenter.vm.pagination.loading).toBe(true);\n expect(presenter.vm.empty).toBe(false);\n });\n\n it(\"should report emptyWithFilters when no rows but filters active\", async () => {\n const dataSource = createMockDataSource(createRows(3));\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.mockNextQuery([], {\n cursor: null,\n hasMoreItems: false,\n totalCount: 0\n });\n\n presenter.actions.filter.set(\"type\", \"video\");\n\n await vi.waitFor(() => {\n expect(dataSource.query).toHaveBeenCalledTimes(2);\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.empty).toBe(true);\n expect(presenter.vm.emptyWithFilters).toBe(true);\n });\n\n it(\"should report emptyWithFilters when no rows but search active\", async () => {\n const dataSource = createMockDataSource(createRows(3));\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.mockNextQuery([], {\n cursor: null,\n hasMoreItems: false,\n totalCount: 0\n });\n\n presenter.actions.search.set(\"nonexistent\");\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.emptyWithFilters).toBe(true);\n });\n\n it(\"should expose error when DataSource query fails\", async () => {\n const dataSource = createMockDataSource();\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.query.mockRejectedValueOnce(new Error(\"Network error\"));\n\n await presenter.actions.refresh();\n\n expect(presenter.vm.error).toEqual({\n code: \"UNKNOWN\",\n message: \"Network error\",\n retryable: true\n });\n });\n\n it(\"should clear error on successful query\", async () => {\n const dataSource = createMockDataSource();\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.query.mockRejectedValueOnce(new Error(\"fail\"));\n await presenter.actions.refresh();\n expect(presenter.vm.error).not.toBeNull();\n\n await presenter.actions.refresh();\n expect(presenter.vm.error).toBeNull();\n });\n\n it(\"should expose error on loadMore failure\", async () => {\n const dataSource = createMockDataSource(createRows(3), {\n cursor: \"cursor-1\",\n hasMoreItems: true,\n totalCount: 6\n });\n\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.loadMore.mockRejectedValueOnce(new Error(\"Load more failed\"));\n\n await presenter.actions.loadMore();\n\n expect(presenter.vm.error).toEqual({\n code: \"UNKNOWN\",\n message: \"Load more failed\",\n retryable: true\n });\n });\n\n it(\"should handle non-Error thrown values\", async () => {\n const dataSource = createMockDataSource();\n const { presenter } = await createInitializedPresenter(dataSource);\n\n dataSource.query.mockRejectedValueOnce(\"string error\");\n await presenter.actions.refresh();\n\n expect(presenter.vm.error).toEqual({\n code: \"UNKNOWN\",\n message: \"string error\",\n retryable: true\n });\n });\n\n it(\"should expose currentCount matching rows length\", async () => {\n const rows = createRows(5);\n const dataSource = createMockDataSource(rows, {\n cursor: null,\n hasMoreItems: false,\n totalCount: 5\n });\n\n const { presenter } = await createInitializedPresenter(dataSource);\n\n expect(presenter.vm.pagination.currentCount).toBe(5);\n expect(presenter.vm.pagination.totalCount).toBe(5);\n });\n });\n\n // -----------------------------------------------------------------------\n // DataSource query params\n // -----------------------------------------------------------------------\n\n describe(\"DataSource query params\", () => {\n it(\"should omit undefined search/filters/sort from query\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({ dataSource });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n // Initial query should not include search, filters, sort, or cursor.\n expect(dataSource.query).toHaveBeenCalledWith({\n search: undefined,\n filters: undefined,\n sort: undefined,\n cursor: undefined\n });\n });\n\n it(\"should include all active params in query\", async () => {\n const dataSource = createMockDataSource();\n const presenter = createPresenter();\n presenter.init({\n dataSource,\n initialSort: { field: \"name\", direction: \"ASC\" },\n initialFilters: { type: \"image\" }\n });\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(dataSource.query).toHaveBeenCalledWith({\n search: undefined,\n filters: { type: \"image\" },\n sort: { field: \"name\", direction: \"ASC\" },\n cursor: undefined\n });\n });\n });\n\n // -----------------------------------------------------------------------\n // appliedQuery\n // -----------------------------------------------------------------------\n\n describe(\"appliedQuery\", () => {\n it(\"should be null before init\", () => {\n const presenter = createPresenter();\n expect(presenter.vm.appliedQuery).toBeNull();\n });\n\n it(\"should be set after initial query completes\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n expect(presenter.vm.appliedQuery).toEqual({\n search: undefined,\n filters: undefined,\n sort: undefined,\n cursor: undefined\n });\n });\n\n it(\"should not include search while user is typing (before debounce)\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.search.set(\"hello\");\n\n expect(presenter.vm.search).toBe(\"hello\");\n expect(presenter.vm.appliedQuery?.search).toBeUndefined();\n });\n\n it(\"should include search after debounced query completes\", async () => {\n const { presenter } = await createInitializedPresenter();\n\n presenter.actions.search.set(\"hello\");\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.appliedQuery?.search).toBe(\"hello\");\n });\n\n it(\"should update when filters change and query completes\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n const initialCallCount = dataSource.query.mock.calls.length;\n\n presenter.actions.filter.set(\"type\", \"image\");\n\n await vi.waitFor(() => {\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount + 1);\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.appliedQuery?.filters).toEqual({ type: \"image\" });\n });\n\n it(\"should not update when query fails\", async () => {\n const dataSource = createMockDataSource();\n const { presenter } = await createInitializedPresenter(dataSource);\n const queryBeforeFailure = presenter.vm.appliedQuery;\n\n dataSource.query.mockRejectedValueOnce(new Error(\"fail\"));\n await presenter.actions.refresh();\n\n expect(presenter.vm.error).not.toBeNull();\n expect(presenter.vm.appliedQuery).toBe(queryBeforeFailure);\n });\n\n it(\"should clear search after search.clear() query completes\", async () => {\n const { presenter, dataSource } = await createInitializedPresenter();\n const initialCallCount = dataSource.query.mock.calls.length;\n\n presenter.actions.search.set(\"hello\");\n vi.advanceTimersByTime(300);\n\n await vi.waitFor(() => {\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount + 1);\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.appliedQuery?.search).toBe(\"hello\");\n\n presenter.actions.search.clear();\n\n await vi.waitFor(() => {\n expect(dataSource.query.mock.calls.length).toBe(initialCallCount + 2);\n expect(presenter.vm.pagination.loading).toBe(false);\n });\n\n expect(presenter.vm.appliedQuery?.search).toBeUndefined();\n });\n });\n});\n"],"names":["createRows","count","startIndex","Array","_","i","MockDataSource","rows","meta","vi","makeAutoObservable","runInAction","Promise","createMockDataSource","createPresenter","container","Container","ListPresenterFeature","Abstraction","createInitializedPresenter","dsOverride","dataSource","presenter","expect","describe","beforeEach","afterEach","it","vm","undefined","initialCallCount","callCountAfterSearch","firstPage","secondPage","freshRows","Error","queryBeforeFailure"],"mappings":";;;;;AAsBA,SAASA,WAAWC,KAAa,EAAEC,aAAa,CAAC;IAC7C,OAAOC,MAAM,IAAI,CAAC;QAAE,QAAQF;IAAM,GAAG,CAACG,GAAGC,IAAO;YAC5C,IAAI,CAAC,KAAK,EAAEH,aAAaG,GAAG;YAC5B,MAAM,CAAC,KAAK,EAAEH,aAAaG,GAAG;YAC9B,MAAOH,AAAAA,CAAAA,aAAaG,CAAAA,IAAK;QAC7B;AACJ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AAmB,CAAC;YAEvB,MAAMA,GAAG,OAAO,CAAC;gBACbc,OAAOF,WAAW,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAACS,mBAAmB;gBACnEP,OAAOD,UAAU,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC;YACjD;YAEAC,OAAOD,UAAU,EAAE,CAAC,YAAY,EAAE,QAAQ,IAAI,CAAC;YAE/CA,UAAU,OAAO,CAAC,MAAM,CAAC,KAAK;YAE9B,MAAMb,GAAG,OAAO,CAAC;gBACbc,OAAOF,WAAW,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAACS,mBAAmB;gBACnEP,OAAOD,UAAU,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC;YACjD;YAEAC,OAAOD,UAAU,EAAE,CAAC,YAAY,EAAE,QAAQ,aAAa;QAC3D;IACJ;AACJ"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type GetRowId<TRow> = (row: TRow) => string;
|
|
2
|
+
type GetRows<TRow> = () => TRow[];
|
|
3
|
+
export declare class SelectionController<TRow> {
|
|
4
|
+
private getRows;
|
|
5
|
+
private getRowId;
|
|
6
|
+
private _selectedIds;
|
|
7
|
+
private _anchor;
|
|
8
|
+
private _focus;
|
|
9
|
+
constructor(getRows: GetRows<TRow>, getRowId: GetRowId<TRow>);
|
|
10
|
+
get selectedIds(): Set<string>;
|
|
11
|
+
get selectedCount(): number;
|
|
12
|
+
get allSelected(): boolean;
|
|
13
|
+
toggle(id: string): void;
|
|
14
|
+
selectRangeTo(id: string): void;
|
|
15
|
+
selectAll(): void;
|
|
16
|
+
deselectAll(): void;
|
|
17
|
+
selectRows(ids: string[]): void;
|
|
18
|
+
isSelected(id: string): boolean;
|
|
19
|
+
reset(): void;
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { makeAutoObservable } from "mobx";
|
|
2
|
+
class SelectionController {
|
|
3
|
+
constructor(getRows, getRowId){
|
|
4
|
+
this.getRows = getRows;
|
|
5
|
+
this.getRowId = getRowId;
|
|
6
|
+
this._selectedIds = new Set();
|
|
7
|
+
this._anchor = -1;
|
|
8
|
+
this._focus = void 0;
|
|
9
|
+
makeAutoObservable(this);
|
|
10
|
+
}
|
|
11
|
+
get selectedIds() {
|
|
12
|
+
return this._selectedIds;
|
|
13
|
+
}
|
|
14
|
+
get selectedCount() {
|
|
15
|
+
return this._selectedIds.size;
|
|
16
|
+
}
|
|
17
|
+
get allSelected() {
|
|
18
|
+
const rows = this.getRows();
|
|
19
|
+
return rows.length > 0 && this._selectedIds.size === rows.length;
|
|
20
|
+
}
|
|
21
|
+
toggle(id) {
|
|
22
|
+
const rows = this.getRows();
|
|
23
|
+
const currentIndex = rows.findIndex((row)=>this.getRowId(row) === id);
|
|
24
|
+
const newSelected = new Set(this._selectedIds);
|
|
25
|
+
if (newSelected.has(id)) {
|
|
26
|
+
newSelected.delete(id);
|
|
27
|
+
const lastSelected = Array.from(newSelected).pop();
|
|
28
|
+
this._anchor = lastSelected ? rows.findIndex((row)=>this.getRowId(row) === lastSelected) : -1;
|
|
29
|
+
} else {
|
|
30
|
+
newSelected.add(id);
|
|
31
|
+
this._anchor = currentIndex;
|
|
32
|
+
}
|
|
33
|
+
this._focus = void 0;
|
|
34
|
+
this._selectedIds = newSelected;
|
|
35
|
+
}
|
|
36
|
+
selectRangeTo(id) {
|
|
37
|
+
const rows = this.getRows();
|
|
38
|
+
const currentIndex = rows.findIndex((row)=>this.getRowId(row) === id);
|
|
39
|
+
if (this._anchor < 0 || currentIndex < 0) return void this.toggle(id);
|
|
40
|
+
const prevFocus = this._focus;
|
|
41
|
+
this._focus = currentIndex;
|
|
42
|
+
const newStart = Math.min(this._anchor, currentIndex);
|
|
43
|
+
const newEnd = Math.max(this._anchor, currentIndex);
|
|
44
|
+
const newSelected = new Set(this._selectedIds);
|
|
45
|
+
if (void 0 !== prevFocus) {
|
|
46
|
+
const oldStart = Math.min(this._anchor, prevFocus);
|
|
47
|
+
const oldEnd = Math.max(this._anchor, prevFocus);
|
|
48
|
+
for(let i = oldStart; i <= oldEnd; i++)if (i < newStart || i > newEnd) newSelected.delete(this.getRowId(rows[i]));
|
|
49
|
+
}
|
|
50
|
+
for(let i = newStart; i <= newEnd; i++)newSelected.add(this.getRowId(rows[i]));
|
|
51
|
+
this._selectedIds = newSelected;
|
|
52
|
+
}
|
|
53
|
+
selectAll() {
|
|
54
|
+
const rows = this.getRows();
|
|
55
|
+
this._selectedIds = new Set(rows.map((row)=>this.getRowId(row)));
|
|
56
|
+
}
|
|
57
|
+
deselectAll() {
|
|
58
|
+
this._selectedIds = new Set();
|
|
59
|
+
this._anchor = -1;
|
|
60
|
+
this._focus = void 0;
|
|
61
|
+
}
|
|
62
|
+
selectRows(ids) {
|
|
63
|
+
this._selectedIds = new Set(ids);
|
|
64
|
+
}
|
|
65
|
+
isSelected(id) {
|
|
66
|
+
return this._selectedIds.has(id);
|
|
67
|
+
}
|
|
68
|
+
reset() {
|
|
69
|
+
this.deselectAll();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
export { SelectionController };
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=SelectionController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/listPresenter/SelectionController.js","sources":["../../../src/presentation/listPresenter/SelectionController.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\ntype GetRowId<TRow> = (row: TRow) => string;\ntype GetRows<TRow> = () => TRow[];\n\nexport class SelectionController<TRow> {\n private _selectedIds: Set<string> = new Set();\n private _anchor = -1;\n private _focus: number | undefined = undefined;\n\n constructor(\n private getRows: GetRows<TRow>,\n private getRowId: GetRowId<TRow>\n ) {\n makeAutoObservable(this);\n }\n\n get selectedIds(): Set<string> {\n return this._selectedIds;\n }\n\n get selectedCount(): number {\n return this._selectedIds.size;\n }\n\n get allSelected(): boolean {\n const rows = this.getRows();\n return rows.length > 0 && this._selectedIds.size === rows.length;\n }\n\n toggle(id: string): void {\n const rows = this.getRows();\n const currentIndex = rows.findIndex(row => this.getRowId(row) === id);\n\n const newSelected = new Set(this._selectedIds);\n if (newSelected.has(id)) {\n newSelected.delete(id);\n const lastSelected = Array.from(newSelected).pop();\n this._anchor = lastSelected\n ? rows.findIndex(row => this.getRowId(row) === lastSelected)\n : -1;\n } else {\n newSelected.add(id);\n this._anchor = currentIndex;\n }\n this._focus = undefined;\n this._selectedIds = newSelected;\n }\n\n // Select the range from the current anchor to the given id.\n // Deselects items that were in the previous range but fall outside the new one.\n selectRangeTo(id: string): void {\n const rows = this.getRows();\n const currentIndex = rows.findIndex(row => this.getRowId(row) === id);\n\n if (this._anchor < 0 || currentIndex < 0) {\n this.toggle(id);\n return;\n }\n\n const prevFocus = this._focus;\n this._focus = currentIndex;\n\n const newStart = Math.min(this._anchor, currentIndex);\n const newEnd = Math.max(this._anchor, currentIndex);\n\n const newSelected = new Set(this._selectedIds);\n\n if (prevFocus !== undefined) {\n const oldStart = Math.min(this._anchor, prevFocus);\n const oldEnd = Math.max(this._anchor, prevFocus);\n for (let i = oldStart; i <= oldEnd; i++) {\n if (i < newStart || i > newEnd) {\n newSelected.delete(this.getRowId(rows[i]));\n }\n }\n }\n\n for (let i = newStart; i <= newEnd; i++) {\n newSelected.add(this.getRowId(rows[i]));\n }\n\n this._selectedIds = newSelected;\n }\n\n selectAll(): void {\n const rows = this.getRows();\n this._selectedIds = new Set(rows.map(row => this.getRowId(row)));\n }\n\n deselectAll(): void {\n this._selectedIds = new Set();\n this._anchor = -1;\n this._focus = undefined;\n }\n\n selectRows(ids: string[]): void {\n this._selectedIds = new Set(ids);\n }\n\n isSelected(id: string): boolean {\n return this._selectedIds.has(id);\n }\n\n reset(): void {\n this.deselectAll();\n }\n}\n"],"names":["SelectionController","getRows","getRowId","Set","undefined","makeAutoObservable","rows","id","currentIndex","row","newSelected","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G,CAACA;IACjC;IAEA,QAAc;QACV,IAAI,CAAC,WAAW;IACpB;AACJ"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export interface IDataSourceQuery {
|
|
2
|
+
search?: string;
|
|
3
|
+
filters?: Record<string, unknown>;
|
|
4
|
+
sort?: {
|
|
5
|
+
field: string;
|
|
6
|
+
direction: "ASC" | "DESC";
|
|
7
|
+
};
|
|
8
|
+
cursor?: string;
|
|
9
|
+
limit?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface IDataSourceMeta {
|
|
12
|
+
cursor: string | null;
|
|
13
|
+
hasMoreItems: boolean;
|
|
14
|
+
totalCount: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IDataSourceResult<TRow> {
|
|
17
|
+
rows: TRow[];
|
|
18
|
+
meta: IDataSourceMeta;
|
|
19
|
+
}
|
|
20
|
+
export interface IDataSource<TRow> {
|
|
21
|
+
readonly rows: TRow[];
|
|
22
|
+
readonly meta: IDataSourceMeta;
|
|
23
|
+
readonly loading: boolean;
|
|
24
|
+
query(params: IDataSourceQuery): Promise<void>;
|
|
25
|
+
loadMore(params: IDataSourceQuery): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export interface IListPresenterConfig<TRow> {
|
|
28
|
+
dataSource: IDataSource<TRow>;
|
|
29
|
+
initialSort?: {
|
|
30
|
+
field: string;
|
|
31
|
+
direction: "ASC" | "DESC";
|
|
32
|
+
};
|
|
33
|
+
initialFilters?: Record<string, unknown>;
|
|
34
|
+
debounceMs?: number;
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface IListError {
|
|
38
|
+
code: string;
|
|
39
|
+
message: string;
|
|
40
|
+
retryable: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface IListViewModel<TRow> {
|
|
43
|
+
rows: TRow[];
|
|
44
|
+
sort: {
|
|
45
|
+
field: string;
|
|
46
|
+
direction: "ASC" | "DESC";
|
|
47
|
+
} | null;
|
|
48
|
+
filters: Record<string, unknown>;
|
|
49
|
+
search: string;
|
|
50
|
+
appliedQuery: IDataSourceQuery | null;
|
|
51
|
+
pagination: {
|
|
52
|
+
hasMore: boolean;
|
|
53
|
+
loading: boolean;
|
|
54
|
+
loadingMore: boolean;
|
|
55
|
+
totalCount: number;
|
|
56
|
+
currentCount: number;
|
|
57
|
+
};
|
|
58
|
+
selection: {
|
|
59
|
+
selectedIds: Set<string>;
|
|
60
|
+
selectedCount: number;
|
|
61
|
+
allSelected: boolean;
|
|
62
|
+
};
|
|
63
|
+
empty: boolean;
|
|
64
|
+
emptyWithFilters: boolean;
|
|
65
|
+
error: IListError | null;
|
|
66
|
+
}
|
|
67
|
+
export interface IListActions {
|
|
68
|
+
search: {
|
|
69
|
+
set(query: string): void;
|
|
70
|
+
clear(): void;
|
|
71
|
+
};
|
|
72
|
+
sort: {
|
|
73
|
+
set(field: string, direction: "ASC" | "DESC"): void;
|
|
74
|
+
toggle(field: string): void;
|
|
75
|
+
};
|
|
76
|
+
filter: {
|
|
77
|
+
set(key: string, value: unknown): void;
|
|
78
|
+
clear(key: string): void;
|
|
79
|
+
clearAll(): void;
|
|
80
|
+
};
|
|
81
|
+
selection: {
|
|
82
|
+
toggle(id: string): void;
|
|
83
|
+
selectRangeTo(id: string): void;
|
|
84
|
+
selectAll(): void;
|
|
85
|
+
deselectAll(): void;
|
|
86
|
+
selectRows(ids: string[]): void;
|
|
87
|
+
isSelected(id: string): boolean;
|
|
88
|
+
};
|
|
89
|
+
loadMore(): Promise<void>;
|
|
90
|
+
refresh(): Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
export interface IListPresenter<TRow> {
|
|
93
|
+
vm: IListViewModel<TRow>;
|
|
94
|
+
actions: IListActions;
|
|
95
|
+
init(config: IListPresenterConfig<TRow>): void;
|
|
96
|
+
}
|
|
97
|
+
export declare const ListPresenter: import("@webiny/di").Abstraction<IListPresenter<any>>;
|
|
98
|
+
export declare namespace ListPresenter {
|
|
99
|
+
type Interface<TRow = any> = IListPresenter<TRow>;
|
|
100
|
+
type ViewModel<TRow = any> = IListViewModel<TRow>;
|
|
101
|
+
type Actions = IListActions;
|
|
102
|
+
type Config<TRow = any> = IListPresenterConfig<TRow>;
|
|
103
|
+
type Error = IListError;
|
|
104
|
+
type DataSource<TRow = any> = IDataSource<TRow>;
|
|
105
|
+
type DataSourceQuery = IDataSourceQuery;
|
|
106
|
+
type DataSourceResult<TRow = any> = IDataSourceResult<TRow>;
|
|
107
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/listPresenter/abstractions.js","sources":["../../../src/presentation/listPresenter/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\n\n// ---------------------------------------------------------------------------\n// DataSource interfaces\n// ---------------------------------------------------------------------------\n\nexport interface IDataSourceQuery {\n search?: string;\n filters?: Record<string, unknown>;\n sort?: { field: string; direction: \"ASC\" | \"DESC\" };\n cursor?: string;\n limit?: number;\n}\n\nexport interface IDataSourceMeta {\n cursor: string | null;\n hasMoreItems: boolean;\n totalCount: number;\n}\n\nexport interface IDataSourceResult<TRow> {\n rows: TRow[];\n meta: IDataSourceMeta;\n}\n\nexport interface IDataSource<TRow> {\n readonly rows: TRow[];\n readonly meta: IDataSourceMeta;\n readonly loading: boolean;\n query(params: IDataSourceQuery): Promise<void>;\n loadMore(params: IDataSourceQuery): Promise<void>;\n}\n\n// ---------------------------------------------------------------------------\n// ListPresenter config\n// ---------------------------------------------------------------------------\n\nexport interface IListPresenterConfig<TRow> {\n dataSource: IDataSource<TRow>;\n initialSort?: { field: string; direction: \"ASC\" | \"DESC\" };\n initialFilters?: Record<string, unknown>;\n debounceMs?: number;\n limit?: number;\n}\n\n// ---------------------------------------------------------------------------\n// ListError\n// ---------------------------------------------------------------------------\n\nexport interface IListError {\n code: string;\n message: string;\n retryable: boolean;\n}\n\n// ---------------------------------------------------------------------------\n// ListViewModel\n// ---------------------------------------------------------------------------\n\nexport interface IListViewModel<TRow> {\n rows: TRow[];\n sort: { field: string; direction: \"ASC\" | \"DESC\" } | null;\n filters: Record<string, unknown>;\n search: string;\n appliedQuery: IDataSourceQuery | null;\n pagination: {\n hasMore: boolean;\n loading: boolean;\n loadingMore: boolean;\n totalCount: number;\n currentCount: number;\n };\n selection: {\n selectedIds: Set<string>;\n selectedCount: number;\n allSelected: boolean;\n };\n empty: boolean;\n emptyWithFilters: boolean;\n error: IListError | null;\n}\n\n// ---------------------------------------------------------------------------\n// ListActions\n// ---------------------------------------------------------------------------\n\nexport interface IListActions {\n search: {\n set(query: string): void;\n clear(): void;\n };\n sort: {\n set(field: string, direction: \"ASC\" | \"DESC\"): void;\n toggle(field: string): void;\n };\n filter: {\n set(key: string, value: unknown): void;\n clear(key: string): void;\n clearAll(): void;\n };\n selection: {\n toggle(id: string): void;\n selectRangeTo(id: string): void;\n selectAll(): void;\n deselectAll(): void;\n selectRows(ids: string[]): void;\n isSelected(id: string): boolean;\n };\n loadMore(): Promise<void>;\n refresh(): Promise<void>;\n}\n\n// ---------------------------------------------------------------------------\n// ListPresenter abstraction\n// ---------------------------------------------------------------------------\n\nexport interface IListPresenter<TRow> {\n vm: IListViewModel<TRow>;\n actions: IListActions;\n init(config: IListPresenterConfig<TRow>): void;\n}\n\nexport const ListPresenter = createAbstraction<IListPresenter<any>>(\"ListPresenter\");\n\nexport namespace ListPresenter {\n export type Interface<TRow = any> = IListPresenter<TRow>;\n export type ViewModel<TRow = any> = IListViewModel<TRow>;\n export type Actions = IListActions;\n export type Config<TRow = any> = IListPresenterConfig<TRow>;\n export type Error = IListError;\n export type DataSource<TRow = any> = IDataSource<TRow>;\n export type DataSourceQuery = IDataSourceQuery;\n export type DataSourceResult<TRow = any> = IDataSourceResult<TRow>;\n}\n"],"names":["ListPresenter","createAbstraction"],"mappings":";AA0HO,MAAMA,gBAAgBC,kBAAuC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/admin";
|
|
2
|
+
import { ListPresenter } from "./abstractions.js";
|
|
3
|
+
import { ListPresenter as external_ListPresenter_js_ListPresenter } from "./ListPresenter.js";
|
|
4
|
+
const ListPresenterFeature = createFeature({
|
|
5
|
+
name: "ListPresenter",
|
|
6
|
+
register (container) {
|
|
7
|
+
container.register(external_ListPresenter_js_ListPresenter).inSingletonScope();
|
|
8
|
+
},
|
|
9
|
+
resolve (container) {
|
|
10
|
+
return {
|
|
11
|
+
presenter: container.resolve(ListPresenter)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
export { ListPresenterFeature };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"presentation/listPresenter/feature.js","sources":["../../../src/presentation/listPresenter/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { ListPresenter as Abstraction } from \"./abstractions.js\";\nimport { ListPresenter } from \"./ListPresenter.js\";\n\nexport const ListPresenterFeature = createFeature({\n name: \"ListPresenter\",\n register(container) {\n container.register(ListPresenter).inSingletonScope();\n },\n resolve(container) {\n return {\n presenter: container.resolve(Abstraction)\n };\n }\n});\n"],"names":["ListPresenterFeature","createFeature","container","ListPresenter","Abstraction"],"mappings":";;;AAIO,MAAMA,uBAAuBC,cAAc;IAC9C,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,yCAAe,gBAAgB;IACtD;IACA,SAAQD,SAAS;QACb,OAAO;YACH,WAAWA,UAAU,OAAO,CAACE;QACjC;IACJ;AACJ"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ListPresenterFeature } from "./feature.js";
|
|
2
|
+
export { ListPresenter } from "./abstractions.js";
|
|
3
|
+
export type { IListPresenter, IListPresenterConfig, IListViewModel, IListActions, IListError, IDataSource, IDataSourceQuery, IDataSourceResult } from "./abstractions.js";
|
|
@@ -1,31 +1,21 @@
|
|
|
1
|
-
import
|
|
1
|
+
import react, { Fragment } from "react";
|
|
2
2
|
import { useAuthentication } from "../hooks/useAuthentication.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (props.name) {
|
|
11
|
-
const permissionsCollections = identity.getPermissions(props.name);
|
|
12
|
-
const hasPermission = permissionsCollections.length > 0;
|
|
13
|
-
if (hasPermission) {
|
|
14
|
-
return /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
3
|
+
const HasPermission = ({ children, ...props })=>{
|
|
4
|
+
const { identity } = useAuthentication();
|
|
5
|
+
if (props.name) {
|
|
6
|
+
const permissionsCollections = identity.getPermissions(props.name);
|
|
7
|
+
const hasPermission = permissionsCollections.length > 0;
|
|
8
|
+
if (hasPermission) return /*#__PURE__*/ react.createElement(Fragment, null, children);
|
|
9
|
+
return null;
|
|
15
10
|
}
|
|
11
|
+
if (props.any && props.all) throw new Error('You can use either "any" or "all", but not both at the same time.');
|
|
12
|
+
const anyAllPermissions = props.any || props.all || [];
|
|
13
|
+
const permissionsCollections = anyAllPermissions.map((name)=>identity.getPermissions(name));
|
|
14
|
+
const hasPermission = props.any ? permissionsCollections.some((collection)=>collection.length > 0) : permissionsCollections.every((collection)=>collection.length > 0);
|
|
15
|
+
if (hasPermission) return /*#__PURE__*/ react.createElement(Fragment, null, children);
|
|
16
16
|
return null;
|
|
17
|
-
}
|
|
18
|
-
if (props.any && props.all) {
|
|
19
|
-
throw new Error(`You can use either "any" or "all", but not both at the same time.`);
|
|
20
|
-
}
|
|
21
|
-
const anyAllPermissions = props.any || props.all || [];
|
|
22
|
-
const permissionsCollections = anyAllPermissions.map(name => identity.getPermissions(name));
|
|
23
|
-
const hasPermission = props.any ? permissionsCollections.some(collection => collection.length > 0) : permissionsCollections.every(collection => collection.length > 0);
|
|
24
|
-
if (hasPermission) {
|
|
25
|
-
return /*#__PURE__*/React.createElement(Fragment, null, children);
|
|
26
|
-
}
|
|
27
|
-
return null;
|
|
28
17
|
};
|
|
29
|
-
|
|
18
|
+
const HasPermissionComponent = HasPermission;
|
|
19
|
+
export { HasPermission, HasPermissionComponent };
|
|
30
20
|
|
|
31
21
|
//# sourceMappingURL=HasPermission.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/security/components/HasPermission.js","sources":["../../../../src/presentation/security/components/HasPermission.tsx"],"sourcesContent":["import React, { Fragment } from \"react\";\nimport { useAuthentication } from \"~/presentation/security/hooks/useAuthentication.js\";\n\ninterface HasPermissionProps {\n any?: string[];\n all?: string[];\n name?: string;\n children: React.ReactNode;\n}\n\nexport const HasPermission = ({ children, ...props }: HasPermissionProps) => {\n const { identity } = useAuthentication();\n\n if (props.name) {\n const permissionsCollections = identity.getPermissions(props.name);\n const hasPermission = permissionsCollections.length > 0;\n if (hasPermission) {\n return <Fragment>{children}</Fragment>;\n }\n\n return null;\n }\n\n if (props.any && props.all) {\n throw new Error(`You can use either \"any\" or \"all\", but not both at the same time.`);\n }\n\n const anyAllPermissions = props.any || props.all || [];\n\n const permissionsCollections = anyAllPermissions.map(name => identity.getPermissions(name));\n\n const hasPermission = props.any\n ? permissionsCollections.some(collection => collection.length > 0)\n : permissionsCollections.every(collection => collection.length > 0);\n\n if (hasPermission) {\n return <Fragment>{children}</Fragment>;\n }\n\n return null;\n};\n\nexport const HasPermissionComponent = HasPermission;\n"],"names":["HasPermission","children","props","identity","useAuthentication","permissionsCollections","hasPermission","Fragment","Error","anyAllPermissions","name","collection","HasPermissionComponent"],"mappings":";;AAUO,MAAMA,gBAAgB,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAA2B;IACpE,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IAErB,IAAIF,MAAM,IAAI,EAAE;QACZ,MAAMG,yBAAyBF,SAAS,cAAc,CAACD,MAAM,IAAI;QACjE,MAAMI,gBAAgBD,uBAAuB,MAAM,GAAG;QACtD,IAAIC,eACA,OAAO,WAAP,GAAO,oBAACC,UAAQA,MAAEN;QAGtB,OAAO;IACX;IAEA,IAAIC,MAAM,GAAG,IAAIA,MAAM,GAAG,EACtB,MAAM,IAAIM,MAAM;IAGpB,MAAMC,oBAAoBP,MAAM,GAAG,IAAIA,MAAM,GAAG,IAAI,EAAE;IAEtD,MAAMG,yBAAyBI,kBAAkB,GAAG,CAACC,CAAAA,OAAQP,SAAS,cAAc,CAACO;IAErF,MAAMJ,gBAAgBJ,MAAM,GAAG,GACzBG,uBAAuB,IAAI,CAACM,CAAAA,aAAcA,WAAW,MAAM,GAAG,KAC9DN,uBAAuB,KAAK,CAACM,CAAAA,aAAcA,WAAW,MAAM,GAAG;IAErE,IAAIL,eACA,OAAO,WAAP,GAAO,oBAACC,UAAQA,MAAEN;IAGtB,OAAO;AACX;AAEO,MAAMW,yBAAyBZ"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
import { useIdentity } from "../hooks/useIdentity.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
identity
|
|
8
|
-
} = useIdentity();
|
|
9
|
-
const hasPermission = permission ? Boolean(identity.getPermission(permission)) : true;
|
|
10
|
-
if (hasPermission) {
|
|
11
|
-
return children;
|
|
12
|
-
}
|
|
13
|
-
return null;
|
|
2
|
+
const SecureRoute = ({ children, permission })=>{
|
|
3
|
+
const { identity } = useIdentity();
|
|
4
|
+
const hasPermission = permission ? Boolean(identity.getPermission(permission)) : true;
|
|
5
|
+
if (hasPermission) return children;
|
|
6
|
+
return null;
|
|
14
7
|
};
|
|
8
|
+
export { SecureRoute };
|
|
15
9
|
|
|
16
10
|
//# sourceMappingURL=SecureRoute.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/security/components/SecureRoute.js","sources":["../../../../src/presentation/security/components/SecureRoute.tsx"],"sourcesContent":["import type React from \"react\";\nimport { useIdentity } from \"~/presentation/security/hooks/useIdentity.js\";\n\ninterface SecureRouteProps {\n children: React.ReactNode;\n permission?: string;\n}\nexport const SecureRoute = ({\n children,\n permission\n}: SecureRouteProps): React.ReactElement | null => {\n const { identity } = useIdentity();\n\n const hasPermission = permission ? Boolean(identity.getPermission(permission)) : true;\n\n if (hasPermission) {\n return children as unknown as React.ReactElement;\n }\n\n return null;\n};\n"],"names":["SecureRoute","children","permission","identity","useIdentity","hasPermission","Boolean"],"mappings":";AAOO,MAAMA,cAAc,CAAC,EACxBC,QAAQ,EACRC,UAAU,EACK;IACf,MAAM,EAAEC,QAAQ,EAAE,GAAGC;IAErB,MAAMC,gBAAgBH,aAAaI,QAAQH,SAAS,aAAa,CAACD,eAAe;IAEjF,IAAIG,eACA,OAAOJ;IAGX,OAAO;AACX"}
|
|
@@ -2,23 +2,17 @@ import { useFeature } from "@webiny/app";
|
|
|
2
2
|
import { LogInFeature } from "../../../features/security/LogIn/feature.js";
|
|
3
3
|
import { LogOutFeature } from "../../../features/security/LogOut/index.js";
|
|
4
4
|
import { useIdentity } from "./useIdentity.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
useCase:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} = useIdentity();
|
|
16
|
-
return {
|
|
17
|
-
login: logInUseCase.execute.bind(logInUseCase),
|
|
18
|
-
logout: logOutUseCase.execute.bind(logOutUseCase),
|
|
19
|
-
identity,
|
|
20
|
-
isAuthenticated
|
|
21
|
-
};
|
|
5
|
+
function useAuthentication() {
|
|
6
|
+
const { useCase: logInUseCase } = useFeature(LogInFeature);
|
|
7
|
+
const { useCase: logOutUseCase } = useFeature(LogOutFeature);
|
|
8
|
+
const { identity, isAuthenticated } = useIdentity();
|
|
9
|
+
return {
|
|
10
|
+
login: logInUseCase.execute.bind(logInUseCase),
|
|
11
|
+
logout: logOutUseCase.execute.bind(logOutUseCase),
|
|
12
|
+
identity,
|
|
13
|
+
isAuthenticated
|
|
14
|
+
};
|
|
22
15
|
}
|
|
16
|
+
export { useAuthentication };
|
|
23
17
|
|
|
24
18
|
//# sourceMappingURL=useAuthentication.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"presentation/security/hooks/useAuthentication.js","sources":["../../../../src/presentation/security/hooks/useAuthentication.ts"],"sourcesContent":["import { useFeature } from \"@webiny/app\";\nimport { LogInFeature } from \"~/features/security/LogIn/feature.js\";\nimport { LogOutFeature } from \"~/features/security/LogOut/index.js\";\nimport type { ILoginParams } from \"~/features/security/LogIn/abstractions.js\";\nimport { useIdentity } from \"./useIdentity.js\";\nimport type { Identity } from \"~/domain/Identity.js\";\n\nexport interface IUseAuthenticationReturn {\n identity: Identity;\n isAuthenticated: boolean;\n login: (params: ILoginParams) => Promise<void>;\n logout: () => Promise<void>;\n}\n\nexport function useAuthentication(): IUseAuthenticationReturn {\n const { useCase: logInUseCase } = useFeature(LogInFeature);\n const { useCase: logOutUseCase } = useFeature(LogOutFeature);\n const { identity, isAuthenticated } = useIdentity();\n\n return {\n login: logInUseCase.execute.bind(logInUseCase),\n logout: logOutUseCase.execute.bind(logOutUseCase),\n identity,\n isAuthenticated\n };\n}\n"],"names":["useAuthentication","logInUseCase","useFeature","LogInFeature","logOutUseCase","LogOutFeature","identity","isAuthenticated","useIdentity"],"mappings":";;;;AAcO,SAASA;IACZ,MAAM,EAAE,SAASC,YAAY,EAAE,GAAGC,WAAWC;IAC7C,MAAM,EAAE,SAASC,aAAa,EAAE,GAAGF,WAAWG;IAC9C,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAE,GAAGC;IAEtC,OAAO;QACH,OAAOP,aAAa,OAAO,CAAC,IAAI,CAACA;QACjC,QAAQG,cAAc,OAAO,CAAC,IAAI,CAACA;QACnCE;QACAC;IACJ;AACJ"}
|
|
@@ -2,24 +2,25 @@ import { useEffect, useState } from "react";
|
|
|
2
2
|
import { autorun } from "mobx";
|
|
3
3
|
import { useFeature } from "@webiny/app";
|
|
4
4
|
import { IdentityContextFeature } from "../../../features/security/IdentityContext/feature.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
identityContext
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
5
|
+
function useIdentity() {
|
|
6
|
+
const { identityContext } = useFeature(IdentityContextFeature);
|
|
7
|
+
const [identity, setIdentity] = useState(identityContext.getIdentity());
|
|
8
|
+
const [isAuthenticated, setIsAuthenticated] = useState(identity.isAuthenticated);
|
|
9
|
+
useEffect(()=>{
|
|
10
|
+
const dispose = autorun(()=>{
|
|
11
|
+
const identity = identityContext.getIdentity();
|
|
12
|
+
setIdentity(identity);
|
|
13
|
+
setIsAuthenticated(identity.isAuthenticated);
|
|
14
|
+
});
|
|
15
|
+
return ()=>dispose();
|
|
16
|
+
}, [
|
|
17
|
+
identityContext
|
|
18
|
+
]);
|
|
19
|
+
return {
|
|
20
|
+
identity,
|
|
21
|
+
isAuthenticated
|
|
22
|
+
};
|
|
23
23
|
}
|
|
24
|
+
export { useIdentity };
|
|
24
25
|
|
|
25
26
|
//# sourceMappingURL=useIdentity.js.map
|