@webiny/app-admin 6.3.0 → 6.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/icons/add-18px.js +20 -0
- package/assets/icons/add-18px.js.map +1 -0
- package/assets/icons/arrow_drop_down-24px.js +20 -0
- package/assets/icons/arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/attach_file_black_24dp.js +20 -0
- package/assets/icons/attach_file_black_24dp.js.map +1 -0
- package/assets/icons/baseline-menu-24px.js +20 -0
- package/assets/icons/baseline-menu-24px.js.map +1 -0
- package/assets/icons/baseline-notification_important-24px.js +19 -0
- package/assets/icons/baseline-notification_important-24px.js.map +1 -0
- package/assets/icons/baseline-security-24px.js +19 -0
- package/assets/icons/baseline-security-24px.js.map +1 -0
- package/assets/icons/file_download.js +19 -0
- package/assets/icons/file_download.js.map +1 -0
- package/assets/icons/file_upload.js +19 -0
- package/assets/icons/file_upload.js.map +1 -0
- package/assets/icons/filter-24px.js +23 -0
- package/assets/icons/filter-24px.js.map +1 -0
- package/assets/icons/github-brands.js +19 -0
- package/assets/icons/github-brands.js.map +1 -0
- package/assets/icons/highlight-24px.js +19 -0
- package/assets/icons/highlight-24px.js.map +1 -0
- package/assets/icons/icon-community.js +18 -0
- package/assets/icons/icon-community.js.map +1 -0
- package/assets/icons/icon-documentation.js +18 -0
- package/assets/icons/icon-documentation.js.map +1 -0
- package/assets/icons/info.js +19 -0
- package/assets/icons/info.js.map +1 -0
- package/assets/icons/insert_drive_file-24px.js +19 -0
- package/assets/icons/insert_drive_file-24px.js.map +1 -0
- package/assets/icons/insert_photo-24px.js +19 -0
- package/assets/icons/insert_photo-24px.js.map +1 -0
- package/assets/icons/label-24px.js +19 -0
- package/assets/icons/label-24px.js.map +1 -0
- package/assets/icons/round-account_circle-24px.js +19 -0
- package/assets/icons/round-account_circle-24px.js.map +1 -0
- package/assets/icons/round-add-24px.js +20 -0
- package/assets/icons/round-add-24px.js.map +1 -0
- package/assets/icons/round-arrow_drop_down-24px.js +19 -0
- package/assets/icons/round-arrow_drop_down-24px.js.map +1 -0
- package/assets/icons/round-chevron_right-24px.js +20 -0
- package/assets/icons/round-chevron_right-24px.js.map +1 -0
- package/assets/icons/round-feedback-24px.js +20 -0
- package/assets/icons/round-feedback-24px.js.map +1 -0
- package/assets/icons/round-help-24px.js +19 -0
- package/assets/icons/round-help-24px.js.map +1 -0
- package/assets/icons/round-invert_colors-24px.js +20 -0
- package/assets/icons/round-invert_colors-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_down-24px.js.map +1 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js +17 -0
- package/assets/icons/round-keyboard_arrow_up-24px.js.map +1 -0
- package/assets/icons/round-lock_open-24px.js +22 -0
- package/assets/icons/round-lock_open-24px.js.map +1 -0
- package/assets/icons/round-more_vert-24px.js +20 -0
- package/assets/icons/round-more_vert-24px.js.map +1 -0
- package/assets/icons/round-open_in_new-24px.js +20 -0
- package/assets/icons/round-open_in_new-24px.js.map +1 -0
- package/assets/icons/round-settings-24px.js +20 -0
- package/assets/icons/round-settings-24px.js.map +1 -0
- package/assets/icons/search-24px.js +21 -0
- package/assets/icons/search-24px.js.map +1 -0
- package/assets/icons/slack-logo.js +14 -0
- package/assets/icons/slack-logo.js.map +1 -0
- package/assets/icons/today-24px.js +19 -0
- package/assets/icons/today-24px.js.map +1 -0
- package/assets/icons/touch_app.js +20 -0
- package/assets/icons/touch_app.js.map +1 -0
- package/assets/images/webiny-logo.js +34 -0
- package/assets/images/webiny-logo.js.map +1 -0
- package/assets/images/webiny-orange-logo.js +34 -0
- package/assets/images/webiny-orange-logo.js.map +1 -0
- package/base/Admin.js +37 -28
- package/base/Admin.js.map +1 -1
- package/base/Base/DefaultFieldRenderers.js +73 -70
- package/base/Base/DefaultFieldRenderers.js.map +1 -1
- package/base/Base/DefaultLayoutRenderers.js +9 -10
- package/base/Base/DefaultLayoutRenderers.js.map +1 -1
- package/base/Base/FieldRenderers/CheckboxesRenderer.js +22 -23
- package/base/Base/FieldRenderers/CheckboxesRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/CodeEditorRenderer.js +10 -13
- package/base/Base/FieldRenderers/CodeEditorRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js +60 -60
- package/base/Base/FieldRenderers/DateTimeInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/DateTimeRenderer.js +38 -39
- package/base/Base/FieldRenderers/DateTimeRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.d.ts +2 -1
- package/base/Base/FieldRenderers/FilePickerRenderer.js +37 -40
- package/base/Base/FieldRenderers/FilePickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js +15 -20
- package/base/Base/FieldRenderers/FileUrlPickerRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HiddenRenderer.js +3 -3
- package/base/Base/FieldRenderers/HiddenRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js +20 -21
- package/base/Base/FieldRenderers/HorizontalTabsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/InputRenderer.js +16 -20
- package/base/Base/FieldRenderers/InputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.d.ts +13 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js +70 -0
- package/base/Base/FieldRenderers/MultiFilePickerRenderer.js.map +1 -0
- package/base/Base/FieldRenderers/NumberInputRenderer.js +16 -19
- package/base/Base/FieldRenderers/NumberInputRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/NumberInputsRenderer.js +45 -44
- package/base/Base/FieldRenderers/NumberInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js +10 -13
- package/base/Base/FieldRenderers/ObjectRenderer/DynamicZoneRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js +50 -56
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js +87 -99
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js +41 -48
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.d.ts +1 -2
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js +62 -78
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js +12 -15
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js +48 -54
- package/base/Base/FieldRenderers/ObjectRenderer/SingleValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js +62 -79
- package/base/Base/FieldRenderers/ObjectRenderer/TemplatePicker.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js +14 -17
- package/base/Base/FieldRenderers/ObjectRenderer/resolveItemTitle.js.map +1 -1
- package/base/Base/FieldRenderers/PassthroughRenderer.js +8 -11
- package/base/Base/FieldRenderers/PassthroughRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js +21 -22
- package/base/Base/FieldRenderers/RadioButtonsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SelectRenderer.js +23 -24
- package/base/Base/FieldRenderers/SelectRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/SwitchRenderer.js +12 -15
- package/base/Base/FieldRenderers/SwitchRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TagsRenderer.js +15 -16
- package/base/Base/FieldRenderers/TagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextInputsRenderer.js +44 -43
- package/base/Base/FieldRenderers/TextInputsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareaRenderer.js +17 -21
- package/base/Base/FieldRenderers/TextareaRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/TextareasRenderer.js +47 -46
- package/base/Base/FieldRenderers/TextareasRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js +35 -36
- package/base/Base/FieldRenderers/VerticalTabsRenderer.js.map +1 -1
- package/base/Base/LexicalPreset.js +56 -60
- package/base/Base/LexicalPreset.js.map +1 -1
- package/base/Base/Menus/SupportMenuItems.js +9 -13
- package/base/Base/Menus/SupportMenuItems.js.map +1 -1
- package/base/Base/Menus/WebinyVersion.js +19 -20
- package/base/Base/Menus/WebinyVersion.js.map +1 -1
- package/base/Base/Menus.js +52 -66
- package/base/Base/Menus.js.map +1 -1
- package/base/Base/RoutesConfig.js +21 -29
- package/base/Base/RoutesConfig.js.map +1 -1
- package/base/Base/Tenant/wby-horizontal.js +33 -0
- package/base/Base/Tenant/wby-horizontal.js.map +1 -0
- package/base/Base/Tenant/wby-square.js +20 -0
- package/base/Base/Tenant/wby-square.js.map +1 -0
- package/base/Base/Tenant.js +17 -19
- package/base/Base/Tenant.js.map +1 -1
- package/base/Base/UserMenu/ExitTenant.js +18 -29
- package/base/Base/UserMenu/ExitTenant.js.map +1 -1
- package/base/Base/UserMenu/SignOut.js +13 -14
- package/base/Base/UserMenu/SignOut.js.map +1 -1
- package/base/Base/UserMenu/UserInfo.js +23 -36
- package/base/Base/UserMenu/UserInfo.js.map +1 -1
- package/base/Base/UserMenu.js +12 -13
- package/base/Base/UserMenu.js.map +1 -1
- package/base/Base.js +4 -5
- package/base/Base.js.map +1 -1
- package/base/TelemetryAdminAppStart.js +9 -12
- package/base/TelemetryAdminAppStart.js.map +1 -1
- package/base/WebinyVersion.js +19 -20
- package/base/WebinyVersion.js.map +1 -1
- package/base/createRootContainer.js +42 -40
- package/base/createRootContainer.js.map +1 -1
- package/base/plugins/AddGraphQLQuerySelection.js +12 -11
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -1
- package/base/providers/AdminUiStateProvider.js +5 -10
- package/base/providers/AdminUiStateProvider.js.map +1 -1
- package/base/providers/ApolloProvider.js +8 -11
- package/base/providers/ApolloProvider.js.map +1 -1
- package/base/providers/UiProviders.js +18 -27
- package/base/providers/UiProviders.js.map +1 -1
- package/base/providers/UiStateProvider.js +5 -10
- package/base/providers/UiStateProvider.js.map +1 -1
- package/base/ui/Brand.js +4 -5
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/CenteredView.d.ts +1 -1
- package/base/ui/CenteredView.js +9 -13
- package/base/ui/CenteredView.js.map +1 -1
- package/base/ui/Dashboard.js +4 -5
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.js +38 -60
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/Layout.js +4 -8
- package/base/ui/Layout.js.map +1 -1
- package/base/ui/LoginScreen.js +16 -21
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.js +4 -5
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.js +11 -14
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js +4 -5
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.js +12 -16
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/TenantSelector.js +4 -5
- package/base/ui/TenantSelector.js.map +1 -1
- package/base/ui/UserMenu/UserMenu.js +4 -5
- package/base/ui/UserMenu/UserMenu.js.map +1 -1
- package/base/ui/UserMenu/UserMenuHandle.js +4 -5
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
- package/base/ui/UserMenu/UserMenuItem.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuItem.js +5 -15
- package/base/ui/UserMenu/UserMenuItem.js.map +1 -1
- package/base/ui/UserMenu/UserMenuLink.d.ts +4 -4
- package/base/ui/UserMenu/UserMenuLink.js +5 -15
- package/base/ui/UserMenu/UserMenuLink.js.map +1 -1
- package/base/ui/UserMenu/UserMenuSeparator.d.ts +2 -2
- package/base/ui/UserMenu/UserMenuSeparator.js +3 -5
- package/base/ui/UserMenu/UserMenuSeparator.js.map +1 -1
- package/base/ui/UserMenu.js +6 -13
- package/base/ui/UserMenu.js.map +1 -1
- package/components/AdminLayout.js +6 -10
- package/components/AdminLayout.js.map +1 -1
- package/components/BulkActions/Worker.js +57 -120
- package/components/BulkActions/Worker.js.map +1 -1
- package/components/BulkActions/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/DialogMessage.js +17 -21
- package/components/BulkActions/useDialogWithReport/DialogMessage.js.map +1 -1
- package/components/BulkActions/useDialogWithReport/index.js +0 -2
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js +33 -44
- package/components/BulkActions/useDialogWithReport/useDialogWithReport.js.map +1 -1
- package/components/Buttons/Buttons.js +44 -71
- package/components/Buttons/Buttons.js.map +1 -1
- package/components/Buttons/Buttons.styles.js +9 -15
- package/components/Buttons/Buttons.styles.js.map +1 -1
- package/components/Buttons/index.js +1 -3
- package/components/Buttons/useButtons.js +15 -20
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/DeveloperMode/DeveloperMode.js +5 -14
- package/components/DeveloperMode/DeveloperMode.js.map +1 -1
- package/components/DeveloperMode/index.js +0 -2
- package/components/Dialogs/Dialog.d.ts +2 -2
- package/components/Dialogs/Dialog.js +46 -59
- package/components/Dialogs/Dialog.js.map +1 -1
- package/components/Dialogs/DialogParamsContext.js +6 -7
- package/components/Dialogs/DialogParamsContext.js.map +1 -1
- package/components/Dialogs/DialogsContext.d.ts +2 -2
- package/components/Dialogs/DialogsContext.js +129 -149
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Dialogs/useDialogs.js +5 -6
- package/components/Dialogs/useDialogs.js.map +1 -1
- package/components/EmptyView.js +26 -31
- package/components/EmptyView.js.map +1 -1
- package/components/Filters/Filters.js +15 -16
- package/components/Filters/Filters.js.map +1 -1
- package/components/Filters/FiltersToggle.js +18 -23
- package/components/Filters/FiltersToggle.js.map +1 -1
- package/components/Filters/index.js +0 -2
- package/components/FloatingActionButton.js +13 -15
- package/components/FloatingActionButton.js.map +1 -1
- package/components/IconPicker/IconPicker.js +24 -26
- package/components/IconPicker/IconPicker.js.map +1 -1
- package/components/IconPicker/IconPickerComponent.js +56 -72
- package/components/IconPicker/IconPickerComponent.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.js +64 -70
- package/components/IconPicker/IconPickerPresenter.js.map +1 -1
- package/components/IconPicker/IconPickerPresenter.test.js +79 -105
- package/components/IconPicker/IconPickerPresenter.test.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js +10 -16
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.js +97 -140
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.js +15 -23
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/IconRepository.js +41 -40
- package/components/IconPicker/IconRepository.js.map +1 -1
- package/components/IconPicker/IconRepository.test.js +56 -63
- package/components/IconPicker/IconRepository.test.js.map +1 -1
- package/components/IconPicker/IconRepositoryFactory.js +15 -11
- package/components/IconPicker/IconRepositoryFactory.js.map +1 -1
- package/components/IconPicker/Loading.js +47 -46
- package/components/IconPicker/Loading.js.map +1 -1
- package/components/IconPicker/components/IconPickerCell.js +18 -20
- package/components/IconPicker/components/IconPickerCell.js.map +1 -1
- package/components/IconPicker/components/IconPickerContent.js +27 -35
- package/components/IconPicker/components/IconPickerContent.js.map +1 -1
- package/components/IconPicker/components/IconPickerRow.js +5 -10
- package/components/IconPicker/components/IconPickerRow.js.map +1 -1
- package/components/IconPicker/components/IconPickerTrigger.js +42 -44
- package/components/IconPicker/components/IconPickerTrigger.js.map +1 -1
- package/components/IconPicker/components/index.js +0 -2
- package/components/IconPicker/config/Emojis.js +19 -21
- package/components/IconPicker/config/Emojis.js.map +1 -1
- package/components/IconPicker/config/FontAwesomeIcons.js +54 -58
- package/components/IconPicker/config/FontAwesomeIcons.js.map +1 -1
- package/components/IconPicker/config/IconPackProvider.js +17 -19
- package/components/IconPicker/config/IconPackProvider.js.map +1 -1
- package/components/IconPicker/config/IconType.js +48 -80
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.js +28 -31
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/defaultIcon.js +6 -5
- package/components/IconPicker/defaultIcon.js.map +1 -1
- package/components/IconPicker/index.js +0 -2
- package/components/IconPicker/plugins/customPlugin.js +87 -110
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js +90 -115
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/graphql.js +3 -8
- package/components/IconPicker/plugins/graphql.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js +73 -104
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.js +4 -7
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.js +40 -38
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/LexicalLinkForm.js +80 -86
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
- package/components/LexicalEditor/index.js +0 -2
- package/components/LexicalEditor/lexicalValueFromHtml.js +21 -28
- package/components/LexicalEditor/lexicalValueFromHtml.js.map +1 -1
- package/components/LexicalEditor/lexicalValueWithHtml.js +24 -30
- package/components/LexicalEditor/lexicalValueWithHtml.js.map +1 -1
- package/components/MultiImageUpload.js +4 -13
- package/components/MultiImageUpload.js.map +1 -1
- package/components/NotAuthorizedError/NotAuthorizedError.js +16 -17
- package/components/NotAuthorizedError/NotAuthorizedError.js.map +1 -1
- package/components/NotAuthorizedError/SecureRouteError.js +297 -0
- package/components/NotAuthorizedError/SecureRouteError.js.map +1 -0
- package/components/NotAuthorizedError/index.js +0 -2
- package/components/OptionsMenu/OptionsMenu.js +20 -19
- package/components/OptionsMenu/OptionsMenu.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuItem.js +15 -14
- package/components/OptionsMenu/OptionsMenuItem.js.map +1 -1
- package/components/OptionsMenu/OptionsMenuLink.js +13 -14
- package/components/OptionsMenu/OptionsMenuLink.js.map +1 -1
- package/components/OptionsMenu/index.js +0 -2
- package/components/OptionsMenu/useOptionsMenuItem.js +13 -18
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/OverlayLayout/OverlayLayout.js +35 -38
- package/components/OverlayLayout/OverlayLayout.js.map +1 -1
- package/components/OverlayLayout/components/OverlayBackdrop.js +6 -11
- package/components/OverlayLayout/components/OverlayBackdrop.js.map +1 -1
- package/components/OverlayLayout/components/OverlayContent.js +18 -17
- package/components/OverlayLayout/components/OverlayContent.js.map +1 -1
- package/components/OverlayLayout/components/OverlayHeader.js +30 -37
- package/components/OverlayLayout/components/OverlayHeader.js.map +1 -1
- package/components/OverlayLayout/components/OverlayRoot.js +13 -17
- package/components/OverlayLayout/components/OverlayRoot.js.map +1 -1
- package/components/OverlayLayout/components/index.js +0 -2
- package/components/OverlayLayout/index.js +0 -2
- package/components/Permissions/CannotUseAaclAlert.js +10 -11
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -1
- package/components/Permissions/Permissions.js +32 -41
- package/components/Permissions/Permissions.js.map +1 -1
- package/components/Permissions/PermissionsGroup.js +9 -15
- package/components/Permissions/PermissionsGroup.js.map +1 -1
- package/components/Permissions/StyledComponents.js +9 -16
- package/components/Permissions/StyledComponents.js.map +1 -1
- package/components/Permissions/index.js +1 -3
- package/components/RegisterFeature.js +14 -21
- package/components/RegisterFeature.js.map +1 -1
- package/components/ResizablePanels/index.js +0 -2
- package/components/RoleAutocomplete/graphql.js +3 -2
- package/components/RoleAutocomplete/graphql.js.map +1 -1
- package/components/RoleAutocomplete/index.d.ts +5 -3
- package/components/RoleAutocomplete/index.js +21 -13
- package/components/RoleAutocomplete/index.js.map +1 -1
- package/components/RolesMultiAutocomplete/graphql.js +3 -2
- package/components/RolesMultiAutocomplete/graphql.js.map +1 -1
- package/components/RolesMultiAutocomplete/index.d.ts +5 -3
- package/components/RolesMultiAutocomplete/index.js +21 -14
- package/components/RolesMultiAutocomplete/index.js.map +1 -1
- package/components/SearchUI.js +18 -25
- package/components/SearchUI.js.map +1 -1
- package/components/SimpleForm/SimpleForm.d.ts +1 -1
- package/components/SimpleForm/SimpleForm.js +54 -73
- package/components/SimpleForm/SimpleForm.js.map +1 -1
- package/components/SimpleForm/index.js +1 -3
- package/components/SimpleUI/InputField.js +71 -64
- package/components/SimpleUI/InputField.js.map +1 -1
- package/components/SingleImageUpload.d.ts +2 -2
- package/components/SingleImageUpload.js +37 -58
- package/components/SingleImageUpload.js.map +1 -1
- package/components/SplitView/SplitView.js +47 -57
- package/components/SplitView/SplitView.js.map +1 -1
- package/components/SplitView/index.js +1 -3
- package/components/TeamAutocomplete/graphql.js +3 -2
- package/components/TeamAutocomplete/graphql.js.map +1 -1
- package/components/TeamAutocomplete/index.d.ts +5 -3
- package/components/TeamAutocomplete/index.js +21 -13
- package/components/TeamAutocomplete/index.js.map +1 -1
- package/components/TeamsMultiAutocomplete/graphql.js +3 -2
- package/components/TeamsMultiAutocomplete/graphql.js.map +1 -1
- package/components/TeamsMultiAutocomplete/index.d.ts +5 -3
- package/components/TeamsMultiAutocomplete/index.js +21 -14
- package/components/TeamsMultiAutocomplete/index.js.map +1 -1
- package/components/Wcp.js +27 -38
- package/components/Wcp.js.map +1 -1
- package/components/index.js +10 -13
- package/config/AdminConfig/Dashboard.js +3 -2
- package/config/AdminConfig/Dashboard.js.map +1 -1
- package/config/AdminConfig/Dialog.js +15 -17
- package/config/AdminConfig/Dialog.js.map +1 -1
- package/config/AdminConfig/FieldRenderer.js +15 -17
- package/config/AdminConfig/FieldRenderer.js.map +1 -1
- package/config/AdminConfig/Form.js +4 -3
- package/config/AdminConfig/Form.js.map +1 -1
- package/config/AdminConfig/LayoutRenderer.js +15 -17
- package/config/AdminConfig/LayoutRenderer.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Color.js +34 -41
- package/config/AdminConfig/LexicalTheme/Color.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Typography.js +61 -74
- package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
- package/config/AdminConfig/LexicalTheme.js +4 -3
- package/config/AdminConfig/LexicalTheme.js.map +1 -1
- package/config/AdminConfig/Logo.d.ts +1 -1
- package/config/AdminConfig/Logo.js +15 -17
- package/config/AdminConfig/Logo.js.map +1 -1
- package/config/AdminConfig/Menu/MenuGroup.d.ts +3 -3
- package/config/AdminConfig/Menu/MenuGroup.js +7 -9
- package/config/AdminConfig/Menu/MenuGroup.js.map +1 -1
- package/config/AdminConfig/Menu/MenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuItem.js +5 -7
- package/config/AdminConfig/Menu/MenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/MenuLink.d.ts +2 -2
- package/config/AdminConfig/Menu/MenuLink.js +12 -15
- package/config/AdminConfig/Menu/MenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.d.ts +2 -2
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js +6 -8
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.d.ts +1 -1
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js +4 -6
- package/config/AdminConfig/Menu/SupportMenu/SupportMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/SupportMenu.d.ts +3 -3
- package/config/AdminConfig/Menu/SupportMenu.js +30 -41
- package/config/AdminConfig/Menu/SupportMenu.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuItem.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js +4 -4
- package/config/AdminConfig/Menu/UserMenu/UserMenuLink.js.map +1 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js +0 -2
- package/config/AdminConfig/Menu/UserMenu/types.js +0 -3
- package/config/AdminConfig/Menu/UserMenu.d.ts +31 -31
- package/config/AdminConfig/Menu/UserMenu.js +39 -52
- package/config/AdminConfig/Menu/UserMenu.js.map +1 -1
- package/config/AdminConfig/Menu/types.js +0 -3
- package/config/AdminConfig/Menu.d.ts +42 -42
- package/config/AdminConfig/Menu.js +57 -73
- package/config/AdminConfig/Menu.js.map +1 -1
- package/config/AdminConfig/Route.js +4 -5
- package/config/AdminConfig/Route.js.map +1 -1
- package/config/AdminConfig/Security.js +3 -2
- package/config/AdminConfig/Security.js.map +1 -1
- package/config/AdminConfig/SecurityPermissions.js +20 -27
- package/config/AdminConfig/SecurityPermissions.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantLogo.js +18 -20
- package/config/AdminConfig/Tenant/TenantLogo.js.map +1 -1
- package/config/AdminConfig/Tenant/TenantName.d.ts +1 -1
- package/config/AdminConfig/Tenant/TenantName.js +14 -15
- package/config/AdminConfig/Tenant/TenantName.js.map +1 -1
- package/config/AdminConfig/Tenant.js +6 -9
- package/config/AdminConfig/Tenant.js.map +1 -1
- package/config/AdminConfig/Theme/assignColor.js +51 -18
- package/config/AdminConfig/Theme/assignColor.js.map +1 -1
- package/config/AdminConfig/Theme/consts.js +20 -2
- package/config/AdminConfig/Theme/consts.js.map +1 -1
- package/config/AdminConfig/Theme/types.js +0 -3
- package/config/AdminConfig/Theme.js +8 -15
- package/config/AdminConfig/Theme.js.map +1 -1
- package/config/AdminConfig/Title.d.ts +1 -1
- package/config/AdminConfig/Title.js +11 -12
- package/config/AdminConfig/Title.js.map +1 -1
- package/config/AdminConfig/Widget.js +24 -31
- package/config/AdminConfig/Widget.js.map +1 -1
- package/config/AdminConfig.js +47 -59
- package/config/AdminConfig.js.map +1 -1
- package/config/createAdminConfig.js +55 -86
- package/config/createAdminConfig.js.map +1 -1
- package/domain/Identity.js +78 -88
- package/domain/Identity.js.map +1 -1
- package/errors/ErrorOverlayNetworkErrorHandler.js +37 -52
- package/errors/ErrorOverlayNetworkErrorHandler.js.map +1 -1
- package/errors/TenantIsDisabled.js +19 -20
- package/errors/TenantIsDisabled.js.map +1 -1
- package/exports/admin/build-params.js +0 -5
- package/exports/admin/configs.js +0 -2
- package/exports/admin/form.js +3 -18
- package/exports/admin/security.js +1 -7
- package/exports/admin/tenancy.js +0 -2
- package/exports/admin/ui.js +1 -4
- package/exports/admin.js +1 -4
- package/features/apolloClient/abstraction.js +2 -1
- package/features/apolloClient/abstraction.js.map +1 -1
- package/features/apolloClient/feature.js +22 -30
- package/features/apolloClient/feature.js.map +1 -1
- package/features/buildParams/BuildParams.js +20 -14
- package/features/buildParams/BuildParams.js.map +1 -1
- package/features/buildParams/abstractions.js +3 -2
- package/features/buildParams/abstractions.js.map +1 -1
- package/features/buildParams/feature.js +11 -10
- package/features/buildParams/feature.js.map +1 -1
- package/features/buildParams/index.js +0 -2
- package/features/formModel/ConditionRuleEvaluator.js +39 -46
- package/features/formModel/ConditionRuleEvaluator.js.map +1 -1
- package/features/formModel/Field.d.ts +1 -0
- package/features/formModel/Field.js +334 -411
- package/features/formModel/Field.js.map +1 -1
- package/features/formModel/FieldBuilder.d.ts +2 -1
- package/features/formModel/FieldBuilder.js +148 -171
- package/features/formModel/FieldBuilder.js.map +1 -1
- package/features/formModel/FieldBuilder.test.js +217 -201
- package/features/formModel/FieldBuilder.test.js.map +1 -1
- package/features/formModel/FieldBuilderRegistry.js +23 -25
- package/features/formModel/FieldBuilderRegistry.js.map +1 -1
- package/features/formModel/FocusManager.js +69 -95
- package/features/formModel/FocusManager.js.map +1 -1
- package/features/formModel/FormErrors.d.ts +9 -0
- package/features/formModel/FormErrors.js +35 -0
- package/features/formModel/FormErrors.js.map +1 -0
- package/features/formModel/FormModel.d.ts +2 -0
- package/features/formModel/FormModel.js +391 -396
- package/features/formModel/FormModel.js.map +1 -1
- package/features/formModel/FormModel.test.js +3791 -3354
- package/features/formModel/FormModel.test.js.map +1 -1
- package/features/formModel/FormModelFactory.js +27 -17
- package/features/formModel/FormModelFactory.js.map +1 -1
- package/features/formModel/FormView.d.ts +2 -1
- package/features/formModel/FormView.js +168 -156
- package/features/formModel/FormView.js.map +1 -1
- package/features/formModel/LayoutBuilderFactory.js +300 -370
- package/features/formModel/LayoutBuilderFactory.js.map +1 -1
- package/features/formModel/LayoutMutator.js +118 -125
- package/features/formModel/LayoutMutator.js.map +1 -1
- package/features/formModel/LayoutResolver.js +174 -214
- package/features/formModel/LayoutResolver.js.map +1 -1
- package/features/formModel/ObjectField.js +524 -724
- package/features/formModel/ObjectField.js.map +1 -1
- package/features/formModel/PresenterErrors.d.ts +9 -0
- package/features/formModel/PresenterErrors.js +32 -0
- package/features/formModel/PresenterErrors.js.map +1 -0
- package/features/formModel/Rules.test.js +311 -276
- package/features/formModel/Rules.test.js.map +1 -1
- package/features/formModel/abstractions.d.ts +10 -0
- package/features/formModel/abstractions.js +5 -114
- package/features/formModel/abstractions.js.map +1 -1
- package/features/formModel/createFieldRenderer.js +33 -10
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FieldRenderersDemoPresenter.js +289 -220
- package/features/formModel/demo/FieldRenderersDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.js +191 -215
- package/features/formModel/demo/FormModelDemo.js.map +1 -1
- package/features/formModel/demo/FormModelDemoPresenter.js +132 -113
- package/features/formModel/demo/FormModelDemoPresenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase11Presenter.js +101 -98
- package/features/formModel/demo/FormModelPhase11Presenter.js.map +1 -1
- package/features/formModel/demo/FormModelPhase8c1Presenter.js +64 -57
- package/features/formModel/demo/FormModelPhase8c1Presenter.js.map +1 -1
- package/features/formModel/feature.js +23 -22
- package/features/formModel/feature.js.map +1 -1
- package/features/formModel/fieldTypes/BooleanFieldType.js +18 -15
- package/features/formModel/fieldTypes/BooleanFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/DateTimeFieldType.js +218 -341
- package/features/formModel/fieldTypes/DateTimeFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileFieldType.d.ts +12 -1
- package/features/formModel/fieldTypes/FileFieldType.js +48 -12
- package/features/formModel/fieldTypes/FileFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/FileUrlFieldType.js +15 -12
- package/features/formModel/fieldTypes/FileUrlFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/NumberFieldType.js +19 -18
- package/features/formModel/fieldTypes/NumberFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/ObjectFieldType.js +80 -94
- package/features/formModel/fieldTypes/ObjectFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/TextFieldType.js +15 -12
- package/features/formModel/fieldTypes/TextFieldType.js.map +1 -1
- package/features/formModel/fieldTypes/index.js +7 -9
- package/features/formModel/index.d.ts +2 -0
- package/features/formModel/index.js +11 -29
- package/features/formModel/renderers.js +0 -4
- package/features/formModel/useFieldRenderers.js +10 -14
- package/features/formModel/useFieldRenderers.js.map +1 -1
- package/features/formModel/useLayoutRenderers.js +10 -14
- package/features/formModel/useLayoutRenderers.js.map +1 -1
- package/features/listCache/ListCache.d.ts +28 -0
- package/features/listCache/ListCache.js +48 -0
- package/features/listCache/ListCache.js.map +1 -0
- package/features/listCache/index.d.ts +2 -0
- package/features/listCache/index.js +1 -0
- package/features/security/AuthenticationContext/AuthenticationContext.js +27 -26
- package/features/security/AuthenticationContext/AuthenticationContext.js.map +1 -1
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js +23 -22
- package/features/security/AuthenticationContext/GraphQLClientDecorator.js.map +1 -1
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js +15 -12
- package/features/security/AuthenticationContext/InternalIdTokenProvider.js.map +1 -1
- package/features/security/AuthenticationContext/abstractions.js +3 -2
- package/features/security/AuthenticationContext/abstractions.js.map +1 -1
- package/features/security/AuthenticationContext/feature.js +15 -14
- package/features/security/AuthenticationContext/feature.js.map +1 -1
- package/features/security/AuthenticationContext/index.js +0 -2
- package/features/security/AuthenticationContext/types.js +0 -3
- package/features/security/IdentityContext/IdentityContext.js +18 -17
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.js +2 -1
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/IdentityContext/feature.js +13 -12
- package/features/security/IdentityContext/feature.js.map +1 -1
- package/features/security/IdentityContext/index.js +0 -2
- package/features/security/LogIn/IdentityMapper.js +8 -7
- package/features/security/LogIn/IdentityMapper.js.map +1 -1
- package/features/security/LogIn/LogInGateway.js +17 -19
- package/features/security/LogIn/LogInGateway.js.map +1 -1
- package/features/security/LogIn/LogInRepository.js +16 -14
- package/features/security/LogIn/LogInRepository.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.js +23 -31
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/abstractions.js +5 -16
- package/features/security/LogIn/abstractions.js.map +1 -1
- package/features/security/LogIn/createLoginMutation.js +2 -3
- package/features/security/LogIn/createLoginMutation.js.map +1 -1
- package/features/security/LogIn/feature.js +16 -15
- package/features/security/LogIn/feature.js.map +1 -1
- package/features/security/LogIn/index.js +0 -2
- package/features/security/LogOut/LogOutUseCase.js +18 -16
- package/features/security/LogOut/LogOutUseCase.js.map +1 -1
- package/features/security/LogOut/abstractions.js +2 -1
- package/features/security/LogOut/abstractions.js.map +1 -1
- package/features/security/LogOut/feature.js +12 -11
- package/features/security/LogOut/feature.js.map +1 -1
- package/features/security/LogOut/index.js +0 -2
- package/features/security/SecurityFeature.js +9 -8
- package/features/security/SecurityFeature.js.map +1 -1
- package/features/telemetry/TelemetryService.js +11 -12
- package/features/telemetry/TelemetryService.js.map +1 -1
- package/features/telemetry/abstractions.js +2 -1
- package/features/telemetry/abstractions.js.map +1 -1
- package/features/telemetry/feature.js +13 -12
- package/features/telemetry/feature.js.map +1 -1
- package/features/telemetry/index.js +0 -2
- package/features/tenancy/GraphQLClientDecorator.js +23 -20
- package/features/tenancy/GraphQLClientDecorator.js.map +1 -1
- package/features/tenancy/TenantContext.js +46 -50
- package/features/tenancy/TenantContext.js.map +1 -1
- package/features/tenancy/abstractions.js +2 -1
- package/features/tenancy/abstractions.js.map +1 -1
- package/features/tenancy/feature.js +25 -35
- package/features/tenancy/feature.js.map +1 -1
- package/features/tenancy/types.js +0 -3
- package/features/tools/LexicalContext/LexicalContext.js +20 -17
- package/features/tools/LexicalContext/LexicalContext.js.map +1 -1
- package/features/tools/LexicalContext/abstractions.js +2 -1
- package/features/tools/LexicalContext/abstractions.js.map +1 -1
- package/features/tools/LexicalContext/index.js +0 -2
- package/features/tools/ToolPipelineRunner.js +26 -24
- package/features/tools/ToolPipelineRunner.js.map +1 -1
- package/features/tools/ToolRegistry.js +32 -23
- package/features/tools/ToolRegistry.js.map +1 -1
- package/features/tools/abstractions.js +4 -3
- package/features/tools/abstractions.js.map +1 -1
- package/features/tools/feature.js +17 -16
- package/features/tools/feature.js.map +1 -1
- package/features/tools/index.js +1 -3
- package/features/wcp/ReactLicense.js +53 -52
- package/features/wcp/ReactLicense.js.map +1 -1
- package/features/wcp/WcpGateway.js +21 -20
- package/features/wcp/WcpGateway.js.map +1 -1
- package/features/wcp/WcpService.js +57 -67
- package/features/wcp/WcpService.js.map +1 -1
- package/features/wcp/abstractions.js +3 -2
- package/features/wcp/abstractions.js.map +1 -1
- package/features/wcp/feature.js +14 -13
- package/features/wcp/feature.js.map +1 -1
- package/features/wcp/types.js +0 -3
- package/features/webinySdk/WebinySdk.js +19 -18
- package/features/webinySdk/WebinySdk.js.map +1 -1
- package/features/webinySdk/abstractions.js +2 -5
- package/features/webinySdk/abstractions.js.map +1 -1
- package/features/webinySdk/feature.js +13 -12
- package/features/webinySdk/feature.js.map +1 -1
- package/features/webinySdk/index.js +0 -2
- package/hooks/index.js +0 -2
- package/hooks/useConfirmationDialog.d.ts +1 -1
- package/hooks/useConfirmationDialog.js +31 -38
- package/hooks/useConfirmationDialog.js.map +1 -1
- package/hooks/useDialog.js +14 -15
- package/hooks/useDialog.js.map +1 -1
- package/hooks/useHotkeys.js +52 -85
- package/hooks/useHotkeys.js.map +1 -1
- package/hooks/useIsMounted.js +12 -11
- package/hooks/useIsMounted.js.map +1 -1
- package/hooks/useKeyHandler.js +45 -53
- package/hooks/useKeyHandler.js.map +1 -1
- package/hooks/useModKey.js +20 -25
- package/hooks/useModKey.js.map +1 -1
- package/hooks/useOpenDialog.js +13 -13
- package/hooks/useOpenDialog.js.map +1 -1
- package/hooks/useShiftKey.d.ts +5 -1
- package/hooks/useShiftKey.js +38 -29
- package/hooks/useShiftKey.js.map +1 -1
- package/hooks/useSnackbar.d.ts +3 -0
- package/hooks/useSnackbar.js +26 -28
- package/hooks/useSnackbar.js.map +1 -1
- package/hooks/useStateIfMounted.js +14 -12
- package/hooks/useStateIfMounted.js.map +1 -1
- package/hooks/useStateWithCallback.js +18 -14
- package/hooks/useStateWithCallback.js.map +1 -1
- package/hooks/useToggler.js +12 -11
- package/hooks/useToggler.js.map +1 -1
- package/index.d.ts +4 -1
- package/index.js +15 -31
- package/package.json +26 -28
- package/permissions/PermissionRenderer.js +179 -193
- package/permissions/PermissionRenderer.js.map +1 -1
- package/permissions/PermissionValueContext.js +13 -20
- package/permissions/PermissionValueContext.js.map +1 -1
- package/permissions/createHasPermission.js +32 -40
- package/permissions/createHasPermission.js.map +1 -1
- package/permissions/createPermissionSchema.js +6 -5
- package/permissions/createPermissionSchema.js.map +1 -1
- package/permissions/createPermissions.js +125 -185
- package/permissions/createPermissions.js.map +1 -1
- package/permissions/createPermissions.test.js +190 -158
- package/permissions/createPermissions.test.js.map +1 -1
- package/permissions/index.js +2 -4
- package/permissions/types.js +0 -3
- package/permissions/usePermissionForm.js +133 -232
- package/permissions/usePermissionForm.js.map +1 -1
- package/permissions/usePermissions.js +6 -5
- package/permissions/usePermissions.js.map +1 -1
- package/plugins/MenuPlugin.js +15 -14
- package/plugins/MenuPlugin.js.map +1 -1
- package/presentation/buildParams/useBuildParams.js +2 -3
- package/presentation/buildParams/useBuildParams.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js +46 -53
- package/presentation/installation/components/SystemInstaller/SystemInstaller.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js +9 -14
- package/presentation/installation/components/SystemInstaller/SystemInstallerProvider.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/index.js +0 -2
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js +14 -29
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/createPasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js +11 -10
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep/usePasswordValidator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js +60 -60
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js +75 -85
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Center.js +5 -8
- package/presentation/installation/components/SystemInstaller/steps/Center.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/Container.js +18 -24
- package/presentation/installation/components/SystemInstaller/steps/Container.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js +48 -53
- package/presentation/installation/components/SystemInstaller/steps/FinishSetup.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js +13 -16
- package/presentation/installation/components/SystemInstaller/steps/IntroductionStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/introduction.js +723 -0
- package/presentation/installation/components/SystemInstaller/steps/introduction.js.map +1 -0
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js +14 -1
- package/presentation/installation/components/SystemInstaller/steps/referralSources.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js +27 -28
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerGateway.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js +117 -124
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerPresenter.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js +23 -21
- package/presentation/installation/presenters/SystemInstaller/SystemInstallerRepository.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/abstractions.js +4 -3
- package/presentation/installation/presenters/SystemInstaller/abstractions.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/feature.js +15 -14
- package/presentation/installation/presenters/SystemInstaller/feature.js.map +1 -1
- package/presentation/installation/presenters/SystemInstaller/index.js +0 -2
- package/presentation/lexicalContext/useLexicalContext.js +11 -8
- package/presentation/lexicalContext/useLexicalContext.js.map +1 -1
- package/presentation/listPresenter/ListPresenter.d.ts +30 -0
- package/presentation/listPresenter/ListPresenter.js +216 -0
- package/presentation/listPresenter/ListPresenter.js.map +1 -0
- package/presentation/listPresenter/ListPresenter.test.d.ts +1 -0
- package/presentation/listPresenter/ListPresenter.test.js +816 -0
- package/presentation/listPresenter/ListPresenter.test.js.map +1 -0
- package/presentation/listPresenter/SelectionController.d.ts +21 -0
- package/presentation/listPresenter/SelectionController.js +74 -0
- package/presentation/listPresenter/SelectionController.js.map +1 -0
- package/presentation/listPresenter/abstractions.d.ts +107 -0
- package/presentation/listPresenter/abstractions.js +5 -0
- package/presentation/listPresenter/abstractions.js.map +1 -0
- package/presentation/listPresenter/feature.d.ts +3 -0
- package/presentation/listPresenter/feature.js +17 -0
- package/presentation/listPresenter/feature.js.map +1 -0
- package/presentation/listPresenter/index.d.ts +3 -0
- package/presentation/listPresenter/index.js +2 -0
- package/presentation/security/components/HasPermission.js +15 -25
- package/presentation/security/components/HasPermission.js.map +1 -1
- package/presentation/security/components/SecureRoute.js +6 -12
- package/presentation/security/components/SecureRoute.js.map +1 -1
- package/presentation/security/hooks/useAuthentication.js +11 -17
- package/presentation/security/hooks/useAuthentication.js.map +1 -1
- package/presentation/security/hooks/useIdentity.js +19 -18
- package/presentation/security/hooks/useIdentity.js.map +1 -1
- package/presentation/security/hooks/useSecurity.js +14 -24
- package/presentation/security/hooks/useSecurity.js.map +1 -1
- package/presentation/tenancy/TenancyProvider.js +23 -36
- package/presentation/tenancy/TenancyProvider.js.map +1 -1
- package/presentation/tenancy/createTenancyProvider.js +6 -11
- package/presentation/tenancy/createTenancyProvider.js.map +1 -1
- package/presentation/tenancy/useTenantContext.js +17 -18
- package/presentation/tenancy/useTenantContext.js.map +1 -1
- package/presentation/textToLexicalTool/TextToLexicalTool.js +20 -18
- package/presentation/textToLexicalTool/TextToLexicalTool.js.map +1 -1
- package/presentation/textToLexicalTool/feature.js +6 -5
- package/presentation/textToLexicalTool/feature.js.map +1 -1
- package/presentation/textToLexicalTool/textToLexicalState.js +28 -28
- package/presentation/textToLexicalTool/textToLexicalState.js.map +1 -1
- package/presentation/wcp/WcpProvider.js +16 -26
- package/presentation/wcp/WcpProvider.js.map +1 -1
- package/presentation/wcp/useWcp.js +11 -12
- package/presentation/wcp/useWcp.js.map +1 -1
- package/routes.d.ts +0 -1
- package/routes.js +14 -17
- package/routes.js.map +1 -1
- package/static/svg/SecureRouteError.e8b15981.svg +1 -0
- package/static/svg/add-18px.b3062af6.svg +3 -0
- package/static/svg/arrow_drop_down-24px.da74d713.svg +4 -0
- package/static/svg/attach_file_black_24dp.7fb13a7e.svg +1 -0
- package/static/svg/baseline-menu-24px.071b179d.svg +4 -0
- package/static/svg/baseline-notification_important-24px.29277e73.svg +4 -0
- package/static/svg/baseline-security-24px.12e519cc.svg +4 -0
- package/static/svg/file_download.afe3fbec.svg +1 -0
- package/static/svg/file_upload.6865d820.svg +1 -0
- package/static/svg/filter-24px.886d9ff0.svg +8 -0
- package/static/svg/github-brands.6311f0fa.svg +1 -0
- package/static/svg/highlight-24px.959a97f7.svg +1 -0
- package/static/svg/icon-community.cd087355.svg +16 -0
- package/static/svg/icon-documentation.a189d24c.svg +16 -0
- package/static/svg/info.fe810b72.svg +1 -0
- package/static/svg/insert_drive_file-24px.39d490eb.svg +1 -0
- package/static/svg/insert_photo-24px.81a5f945.svg +1 -0
- package/static/svg/introduction.108720aa.svg +154 -0
- package/static/svg/label-24px.9deafa4f.svg +1 -0
- package/static/svg/round-account_circle-24px.f0b48cb7.svg +1 -0
- package/static/svg/round-add-24px.4a5219b4.svg +16 -0
- package/static/svg/round-arrow_drop_down-24px.5fdf92d1.svg +1 -0
- package/static/svg/round-chevron_right-24px.34936511.svg +12 -0
- package/static/svg/round-feedback-24px.4dae7231.svg +54 -0
- package/static/svg/round-help-24px.a61b1d66.svg +1 -0
- package/static/svg/round-invert_colors-24px.a229a1dd.svg +52 -0
- package/static/svg/round-keyboard_arrow_down-24px.6febe804.svg +16 -0
- package/static/svg/round-keyboard_arrow_up-24px.b1f7db34.svg +16 -0
- package/static/svg/round-lock_open-24px.d527f6a5.svg +60 -0
- package/static/svg/round-more_vert-24px.68d41b07.svg +12 -0
- package/static/svg/round-open_in_new-24px.be5b4ddd.svg +44 -0
- package/static/svg/round-settings-24px.c0b3056f.svg +4 -0
- package/static/svg/search-24px.3c0f88dd.svg +20 -0
- package/static/svg/slack-logo.7ee35e7f.svg +1 -0
- package/static/svg/today-24px.df206362.svg +1 -0
- package/static/svg/touch_app.debf3744.svg +1 -0
- package/static/svg/wby-horizontal.03327bf6.svg +23 -0
- package/static/svg/wby-square.ff8f47c3.svg +3 -0
- package/static/svg/webiny-logo.ef56725c.svg +20 -0
- package/static/svg/webiny-orange-logo.4eccf0f2.svg +20 -0
- package/types.js +0 -3
- package/components/BulkActions/index.js.map +0 -1
- package/components/BulkActions/useDialogWithReport/index.js.map +0 -1
- package/components/Buttons/index.js.map +0 -1
- package/components/DeveloperMode/index.js.map +0 -1
- package/components/Filters/index.js.map +0 -1
- package/components/IconPicker/components/index.js.map +0 -1
- package/components/IconPicker/index.js.map +0 -1
- package/components/LexicalEditor/index.js.map +0 -1
- package/components/NotAuthorizedError/index.js.map +0 -1
- package/components/OptionsMenu/index.js.map +0 -1
- package/components/OverlayLayout/components/index.js.map +0 -1
- package/components/OverlayLayout/index.js.map +0 -1
- package/components/Permissions/index.js.map +0 -1
- package/components/ResizablePanels/index.js.map +0 -1
- package/components/SimpleForm/index.js.map +0 -1
- package/components/SplitView/index.js.map +0 -1
- package/components/index.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/UserMenuSeparator.js.map +0 -1
- package/config/AdminConfig/Menu/UserMenu/types.js.map +0 -1
- package/config/AdminConfig/Menu/types.js.map +0 -1
- package/config/AdminConfig/Theme/types.js.map +0 -1
- package/exports/admin/build-params.js.map +0 -1
- package/exports/admin/configs.js.map +0 -1
- package/exports/admin/form.js.map +0 -1
- package/exports/admin/security.js.map +0 -1
- package/exports/admin/tenancy.js.map +0 -1
- package/exports/admin/ui.js.map +0 -1
- package/exports/admin.js.map +0 -1
- package/features/buildParams/index.js.map +0 -1
- package/features/formModel/fieldTypes/index.js.map +0 -1
- package/features/formModel/index.js.map +0 -1
- package/features/formModel/renderers.js.map +0 -1
- package/features/security/AuthenticationContext/index.js.map +0 -1
- package/features/security/AuthenticationContext/types.js.map +0 -1
- package/features/security/IdentityContext/index.js.map +0 -1
- package/features/security/LogIn/index.js.map +0 -1
- package/features/security/LogOut/index.js.map +0 -1
- package/features/telemetry/index.js.map +0 -1
- package/features/tenancy/types.js.map +0 -1
- package/features/tools/LexicalContext/index.js.map +0 -1
- package/features/tools/index.js.map +0 -1
- package/features/wcp/types.js.map +0 -1
- package/features/webinySdk/index.js.map +0 -1
- package/hooks/index.js.map +0 -1
- package/index.js.map +0 -1
- package/permissions/index.js.map +0 -1
- package/permissions/types.js.map +0 -1
- package/presentation/installation/components/SystemInstaller/index.js.map +0 -1
- package/presentation/installation/presenters/SystemInstaller/index.js.map +0 -1
- package/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["isObjectField","TabBuilder","_label","constructor","existing","_existing","label","text","description","_description","icon","_icon","layout","factory","push","LayoutBuilderFactory","buildNodes","create","_layoutFactory","rules","r","_rules","_build","id","TabsBuilder","_pendingTabs","_lastAddedIdx","_id","renderer","name","_renderer","tab","tabId","configure","tb","tabBuilder","length","before","_target","after","build","type","tabs","map","p","TabsAccessBuilder","_node","find","t","target","splice","targetIdx","findIndex","row","fieldIds","position","builder","separator","element","props","object","fieldName","inner","resolveObjectInner","builders","b","resolvePositionedRows","nodes","result","deferred","node","targetIndex","n","includes","insertAt","api","resolved","tplId","Object","entries","createNodeHandle","handle","replace","matchesNodeId","nodeId","findNodeById","found","undefined","resolveTabDefinition","input","tabsNodeKey","join","accessNode","as","Error","collectBuilders","fields","predicate","Map","field","get","children","config","childBuilders","templates","tpl","collectBuildersFlat","collectFieldIds","ids","values"],"sources":["LayoutBuilderFactory.ts"],"sourcesContent":["import type { Icon } from \"~/components/IconPicker/types.js\";\nimport type {\n IField,\n IFieldBuilder,\n ILayoutBuilder,\n ILayoutNodeBuilder,\n ILayoutNodeHandle,\n IPositionedLayoutNode,\n IRule,\n ITabBuilder,\n ITabDefinition,\n ITabDefinitionInput,\n ITabsBuilder,\n ITabsNode,\n IRowBuilder,\n ISeparatorBuilder,\n IElementBuilder,\n IObjectBuilder,\n IRowNode,\n ISeparatorNode,\n IElementNode,\n IObjectNode,\n LayoutNode,\n LayoutPosition,\n LayoutNodeHandleMap,\n ILayoutNodeAccessHandle\n} from \"./abstractions.js\";\nimport { isObjectField } from \"./ObjectField.js\";\nimport type { IObjectFieldConfig } from \"./abstractions.js\";\n\ninterface TabBuilderInternal extends ITabBuilder {\n _build(id: string): ITabDefinition;\n}\n\nexport class TabBuilder implements TabBuilderInternal {\n private _existing: ITabDefinition | undefined;\n private _label = \"\";\n private _description: string | undefined;\n private _icon: ITabDefinition[\"icon\"];\n private _layoutFactory: ((l: ILayoutBuilder) => ILayoutNodeBuilder[]) | undefined;\n private _rules: IRule[] | undefined;\n\n constructor(existing?: ITabDefinition) {\n this._existing = existing;\n }\n\n label(text: string): this {\n if (this._existing) {\n this._existing.label = text;\n } else {\n this._label = text;\n }\n return this;\n }\n\n description(text: string): this {\n if (this._existing) {\n this._existing.description = text;\n } else {\n this._description = text;\n }\n return this;\n }\n\n icon(icon: Icon): this {\n if (this._existing) {\n this._existing.icon = icon;\n } else {\n this._icon = icon;\n }\n return this;\n }\n\n layout(factory: (l: ILayoutBuilder) => ILayoutNodeBuilder[]): this {\n if (this._existing) {\n this._existing.layout.push(\n ...LayoutBuilderFactory.buildNodes(factory(LayoutBuilderFactory.create()))\n );\n } else {\n this._layoutFactory = factory;\n }\n return this;\n }\n\n rules(r: IRule[]): this {\n if (this._existing) {\n this._existing.rules = r;\n } else {\n this._rules = r;\n }\n return this;\n }\n\n _build(id: string): ITabDefinition {\n if (this._existing) {\n return this._existing;\n }\n return {\n id,\n label: this._label,\n description: this._description,\n icon: this._icon,\n layout: this._layoutFactory\n ? LayoutBuilderFactory.buildNodes(\n this._layoutFactory(LayoutBuilderFactory.create())\n )\n : [],\n rules: this._rules\n };\n }\n}\n\nexport class TabsBuilder implements ITabsBuilder {\n private _id: string | undefined;\n private _renderer: string | undefined;\n private _rules: IRule[] | undefined;\n private _pendingTabs: { tabId: string; tabBuilder: TabBuilderInternal }[] = [];\n private _lastAddedIdx = -1;\n\n constructor(id?: string) {\n this._id = id;\n }\n\n renderer(name: string): this {\n this._renderer = name;\n return this;\n }\n\n tab(tabId: string, configure: (tab: ITabBuilder) => void): this {\n const tb = new TabBuilder();\n configure(tb);\n this._pendingTabs.push({ tabId, tabBuilder: tb });\n this._lastAddedIdx = this._pendingTabs.length - 1;\n return this;\n }\n\n before(_target: string): this {\n return this;\n }\n\n after(_target: string): this {\n return this;\n }\n\n rules(r: IRule[]): this {\n this._rules = r;\n return this;\n }\n\n build(): ITabsNode {\n return {\n type: \"tabs\",\n id: this._id,\n renderer: this._renderer,\n tabs: this._pendingTabs.map(p => p.tabBuilder._build(p.tabId)),\n rules: this._rules\n };\n }\n}\n\nexport class TabsAccessBuilder implements ITabsBuilder {\n private _lastAddedIdx = -1;\n\n constructor(private _node: ITabsNode) {}\n\n renderer(name: string): this {\n this._node.renderer = name;\n return this;\n }\n\n tab(tabId: string, configure: (tab: ITabBuilder) => void): this {\n const existing = this._node.tabs.find(t => t.id === tabId);\n if (existing) {\n configure(new TabBuilder(existing));\n } else {\n const tb = new TabBuilder();\n configure(tb);\n this._node.tabs.push(tb._build(tabId));\n this._lastAddedIdx = this._node.tabs.length - 1;\n }\n return this;\n }\n\n before(target: string): this {\n if (this._lastAddedIdx >= 0) {\n const tab = this._node.tabs.splice(this._lastAddedIdx, 1)[0];\n const targetIdx = this._node.tabs.findIndex(t => t.id === target);\n if (targetIdx !== -1) {\n this._node.tabs.splice(targetIdx, 0, tab);\n } else {\n this._node.tabs.push(tab);\n }\n }\n return this;\n }\n\n after(target: string): this {\n if (this._lastAddedIdx >= 0) {\n const tab = this._node.tabs.splice(this._lastAddedIdx, 1)[0];\n const targetIdx = this._node.tabs.findIndex(t => t.id === target);\n if (targetIdx !== -1) {\n this._node.tabs.splice(targetIdx + 1, 0, tab);\n } else {\n this._node.tabs.push(tab);\n }\n }\n return this;\n }\n\n rules(r: IRule[]): this {\n this._node.rules = r;\n return this;\n }\n\n build(): ITabsNode {\n return this._node;\n }\n}\n\nexport class LayoutBuilderFactory {\n static create(): ILayoutBuilder {\n return {\n row(...fieldIds: string[]): IRowBuilder {\n let position: LayoutPosition | undefined;\n const builder: IRowBuilder = {\n before(target: string) {\n position = { type: \"before\", target };\n return builder;\n },\n after(target: string) {\n position = { type: \"after\", target };\n return builder;\n },\n build(): IRowNode {\n return { type: \"row\", fieldIds, position };\n }\n };\n return builder;\n },\n separator(): ISeparatorBuilder {\n return {\n build(): ISeparatorNode {\n return { type: \"separator\" };\n }\n };\n },\n tabs(id?: string): ITabsBuilder {\n return new TabsBuilder(id);\n },\n element(renderer: string, props?: Record<string, unknown>): IElementBuilder {\n return {\n build(): IElementNode {\n return { type: \"element\", renderer, props };\n }\n };\n },\n object(\n fieldName: string,\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): IObjectBuilder {\n return {\n build(): IObjectNode {\n return {\n type: \"object\",\n fieldName,\n inner: LayoutBuilderFactory.resolveObjectInner(inner)\n };\n }\n };\n }\n };\n }\n\n static buildNodes(builders: ILayoutNodeBuilder[]): LayoutNode[] {\n return builders.map(b => b.build());\n }\n\n static resolvePositionedRows(nodes: LayoutNode[]): LayoutNode[] {\n const result: LayoutNode[] = [];\n const deferred: { node: LayoutNode; position: LayoutPosition }[] = [];\n\n for (const node of nodes) {\n if (node.type === \"row\" && node.position) {\n deferred.push({ node, position: node.position });\n } else {\n result.push(node);\n }\n }\n\n for (const { node, position } of deferred) {\n const targetIndex = result.findIndex(\n n => n.type === \"row\" && (n as IRowNode).fieldIds.includes(position.target)\n );\n if (targetIndex === -1) {\n result.push(node);\n continue;\n }\n const insertAt = position.type === \"after\" ? targetIndex + 1 : targetIndex;\n result.splice(insertAt, 0, node);\n }\n\n return result;\n }\n\n static resolveObjectInner(\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): LayoutNode[] | Record<string, LayoutNode[]> {\n const api = LayoutBuilderFactory.create();\n if (typeof inner === \"function\") {\n return LayoutBuilderFactory.resolvePositionedRows(\n LayoutBuilderFactory.buildNodes(inner(api))\n );\n }\n const resolved: Record<string, LayoutNode[]> = {};\n for (const [tplId, factory] of Object.entries(inner)) {\n resolved[tplId] = LayoutBuilderFactory.resolvePositionedRows(\n LayoutBuilderFactory.buildNodes(factory(api))\n );\n }\n return resolved;\n }\n\n static createNodeHandle(node: LayoutNode): ILayoutNodeHandle {\n const handle: ILayoutNodeHandle = {\n node,\n before(target: string): IPositionedLayoutNode {\n handle.position = { type: \"before\", target };\n return handle;\n },\n after(target: string): IPositionedLayoutNode {\n handle.position = { type: \"after\", target };\n return handle;\n },\n replace(target: string): IPositionedLayoutNode {\n handle.position = { type: \"replace\", target };\n return handle;\n }\n };\n return handle;\n }\n\n static matchesNodeId(node: LayoutNode, nodeId: string): boolean {\n if (\"id\" in node && node.id === nodeId) {\n return true;\n }\n if (node.type === \"object\" && node.fieldName === nodeId) {\n return true;\n }\n return false;\n }\n\n static findNodeById(layout: LayoutNode[], nodeId: string): LayoutNode | undefined {\n for (const node of layout) {\n if (LayoutBuilderFactory.matchesNodeId(node, nodeId)) {\n return node;\n }\n if (node.type === \"tabs\") {\n for (const tab of node.tabs) {\n const found = LayoutBuilderFactory.findNodeById(tab.layout, nodeId);\n if (found) {\n return found;\n }\n }\n }\n }\n return undefined;\n }\n\n static resolveTabDefinition(input: ITabDefinitionInput): ITabDefinition {\n const api = LayoutBuilderFactory.create();\n return {\n id: input.id,\n label: input.label,\n description: input.description,\n icon: input.icon,\n rules: input.rules,\n layout: LayoutBuilderFactory.buildNodes(input.layout(api))\n };\n }\n\n static tabsNodeKey(node: ITabsNode): string {\n return `__tabs_${node.tabs.map(t => t.id).join(\"_\")}`;\n }\n\n static accessNode(layout: LayoutNode[], nodeId: string): ILayoutNodeAccessHandle {\n return {\n as: <T extends keyof LayoutNodeHandleMap>(type: T): LayoutNodeHandleMap[T] => {\n const node = LayoutBuilderFactory.findNodeById(layout, nodeId);\n if (!node) {\n throw new Error(`Layout node \"${nodeId}\" not found.`);\n }\n if (node.type !== type) {\n throw new Error(\n `Layout node \"${nodeId}\" is type \"${node.type}\", not \"${type}\".`\n );\n }\n\n if (type === \"tabs\") {\n return new TabsAccessBuilder(\n node as ITabsNode\n ) as unknown as LayoutNodeHandleMap[T];\n }\n\n return node as unknown as LayoutNodeHandleMap[T];\n }\n };\n }\n\n static collectBuilders(\n fields: Map<string, IField>,\n builders: Map<string, IFieldBuilder> | Record<string, IFieldBuilder>,\n predicate: (builder: IFieldBuilder) => boolean,\n result: IFieldBuilder[]\n ): void {\n const entries = builders instanceof Map ? builders.entries() : Object.entries(builders);\n for (const [name, builder] of entries) {\n if (predicate(builder)) {\n result.push(builder);\n }\n const field = fields instanceof Map ? fields.get(name) : undefined;\n if (field && isObjectField(field)) {\n LayoutBuilderFactory.collectBuilders(\n field.children,\n field.config.childBuilders,\n predicate,\n result\n );\n const templates = (field.config as IObjectFieldConfig).templates;\n if (templates) {\n for (const tpl of templates) {\n LayoutBuilderFactory.collectBuildersFlat(\n tpl.childBuilders,\n predicate,\n result\n );\n }\n }\n }\n }\n }\n\n static collectFieldIds(layout: LayoutNode[]): string[] {\n const ids: string[] = [];\n for (const node of layout) {\n if (node.type === \"row\") {\n ids.push(...node.fieldIds);\n } else if (node.type === \"tabs\") {\n for (const tab of node.tabs) {\n ids.push(...LayoutBuilderFactory.collectFieldIds(tab.layout));\n }\n } else if (node.type === \"object\") {\n ids.push(node.fieldName);\n }\n }\n return ids;\n }\n\n static collectBuildersFlat(\n builders: Record<string, IFieldBuilder>,\n predicate: (builder: IFieldBuilder) => boolean,\n result: IFieldBuilder[]\n ): void {\n for (const builder of Object.values(builders)) {\n if (predicate(builder)) {\n result.push(builder);\n }\n }\n }\n}\n"],"mappings":"AA2BA,SAASA,aAAa;AAOtB,OAAO,MAAMC,UAAU,CAA+B;EAE1CC,MAAM,GAAG,EAAE;EAMnBC,WAAWA,CAACC,QAAyB,EAAE;IACnC,IAAI,CAACC,SAAS,GAAGD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{"version":3,"file":"features/formModel/LayoutBuilderFactory.js","sources":["../../../src/features/formModel/LayoutBuilderFactory.ts"],"sourcesContent":["import type { Icon } from \"~/components/IconPicker/types.js\";\nimport type {\n IField,\n IFieldBuilder,\n ILayoutBuilder,\n ILayoutNodeBuilder,\n ILayoutNodeHandle,\n IPositionedLayoutNode,\n IRule,\n ITabBuilder,\n ITabDefinition,\n ITabDefinitionInput,\n ITabsBuilder,\n ITabsNode,\n IRowBuilder,\n ISeparatorBuilder,\n IElementBuilder,\n IObjectBuilder,\n IRowNode,\n ISeparatorNode,\n IElementNode,\n IObjectNode,\n LayoutNode,\n LayoutPosition,\n LayoutNodeHandleMap,\n ILayoutNodeAccessHandle\n} from \"./abstractions.js\";\nimport { isObjectField } from \"./ObjectField.js\";\nimport type { IObjectFieldConfig } from \"./abstractions.js\";\n\ninterface TabBuilderInternal extends ITabBuilder {\n _build(id: string): ITabDefinition;\n}\n\nexport class TabBuilder implements TabBuilderInternal {\n private _existing: ITabDefinition | undefined;\n private _label = \"\";\n private _description: string | undefined;\n private _icon: ITabDefinition[\"icon\"];\n private _layoutFactory: ((l: ILayoutBuilder) => ILayoutNodeBuilder[]) | undefined;\n private _rules: IRule[] | undefined;\n\n constructor(existing?: ITabDefinition) {\n this._existing = existing;\n }\n\n label(text: string): this {\n if (this._existing) {\n this._existing.label = text;\n } else {\n this._label = text;\n }\n return this;\n }\n\n description(text: string): this {\n if (this._existing) {\n this._existing.description = text;\n } else {\n this._description = text;\n }\n return this;\n }\n\n icon(icon: Icon): this {\n if (this._existing) {\n this._existing.icon = icon;\n } else {\n this._icon = icon;\n }\n return this;\n }\n\n layout(factory: (l: ILayoutBuilder) => ILayoutNodeBuilder[]): this {\n if (this._existing) {\n this._existing.layout.push(\n ...LayoutBuilderFactory.buildNodes(factory(LayoutBuilderFactory.create()))\n );\n } else {\n this._layoutFactory = factory;\n }\n return this;\n }\n\n rules(r: IRule[]): this {\n if (this._existing) {\n this._existing.rules = r;\n } else {\n this._rules = r;\n }\n return this;\n }\n\n _build(id: string): ITabDefinition {\n if (this._existing) {\n return this._existing;\n }\n return {\n id,\n label: this._label,\n description: this._description,\n icon: this._icon,\n layout: this._layoutFactory\n ? LayoutBuilderFactory.buildNodes(\n this._layoutFactory(LayoutBuilderFactory.create())\n )\n : [],\n rules: this._rules\n };\n }\n}\n\nexport class TabsBuilder implements ITabsBuilder {\n private _id: string | undefined;\n private _renderer: string | undefined;\n private _rules: IRule[] | undefined;\n private _pendingTabs: { tabId: string; tabBuilder: TabBuilderInternal }[] = [];\n private _lastAddedIdx = -1;\n\n constructor(id?: string) {\n this._id = id;\n }\n\n renderer(name: string): this {\n this._renderer = name;\n return this;\n }\n\n tab(tabId: string, configure: (tab: ITabBuilder) => void): this {\n const tb = new TabBuilder();\n configure(tb);\n this._pendingTabs.push({ tabId, tabBuilder: tb });\n this._lastAddedIdx = this._pendingTabs.length - 1;\n return this;\n }\n\n before(_target: string): this {\n return this;\n }\n\n after(_target: string): this {\n return this;\n }\n\n rules(r: IRule[]): this {\n this._rules = r;\n return this;\n }\n\n build(): ITabsNode {\n return {\n type: \"tabs\",\n id: this._id,\n renderer: this._renderer,\n tabs: this._pendingTabs.map(p => p.tabBuilder._build(p.tabId)),\n rules: this._rules\n };\n }\n}\n\nexport class TabsAccessBuilder implements ITabsBuilder {\n private _lastAddedIdx = -1;\n\n constructor(private _node: ITabsNode) {}\n\n renderer(name: string): this {\n this._node.renderer = name;\n return this;\n }\n\n tab(tabId: string, configure: (tab: ITabBuilder) => void): this {\n const existing = this._node.tabs.find(t => t.id === tabId);\n if (existing) {\n configure(new TabBuilder(existing));\n } else {\n const tb = new TabBuilder();\n configure(tb);\n this._node.tabs.push(tb._build(tabId));\n this._lastAddedIdx = this._node.tabs.length - 1;\n }\n return this;\n }\n\n before(target: string): this {\n if (this._lastAddedIdx >= 0) {\n const tab = this._node.tabs.splice(this._lastAddedIdx, 1)[0];\n const targetIdx = this._node.tabs.findIndex(t => t.id === target);\n if (targetIdx !== -1) {\n this._node.tabs.splice(targetIdx, 0, tab);\n } else {\n this._node.tabs.push(tab);\n }\n }\n return this;\n }\n\n after(target: string): this {\n if (this._lastAddedIdx >= 0) {\n const tab = this._node.tabs.splice(this._lastAddedIdx, 1)[0];\n const targetIdx = this._node.tabs.findIndex(t => t.id === target);\n if (targetIdx !== -1) {\n this._node.tabs.splice(targetIdx + 1, 0, tab);\n } else {\n this._node.tabs.push(tab);\n }\n }\n return this;\n }\n\n rules(r: IRule[]): this {\n this._node.rules = r;\n return this;\n }\n\n build(): ITabsNode {\n return this._node;\n }\n}\n\nexport class LayoutBuilderFactory {\n static create(): ILayoutBuilder {\n return {\n row(...fieldIds: string[]): IRowBuilder {\n let position: LayoutPosition | undefined;\n const builder: IRowBuilder = {\n before(target: string) {\n position = { type: \"before\", target };\n return builder;\n },\n after(target: string) {\n position = { type: \"after\", target };\n return builder;\n },\n build(): IRowNode {\n return { type: \"row\", fieldIds, position };\n }\n };\n return builder;\n },\n separator(): ISeparatorBuilder {\n return {\n build(): ISeparatorNode {\n return { type: \"separator\" };\n }\n };\n },\n tabs(id?: string): ITabsBuilder {\n return new TabsBuilder(id);\n },\n element(renderer: string, props?: Record<string, unknown>): IElementBuilder {\n return {\n build(): IElementNode {\n return { type: \"element\", renderer, props };\n }\n };\n },\n object(\n fieldName: string,\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): IObjectBuilder {\n return {\n build(): IObjectNode {\n return {\n type: \"object\",\n fieldName,\n inner: LayoutBuilderFactory.resolveObjectInner(inner)\n };\n }\n };\n }\n };\n }\n\n static buildNodes(builders: ILayoutNodeBuilder[]): LayoutNode[] {\n return builders.map(b => b.build());\n }\n\n static resolvePositionedRows(nodes: LayoutNode[]): LayoutNode[] {\n const result: LayoutNode[] = [];\n const deferred: { node: LayoutNode; position: LayoutPosition }[] = [];\n\n for (const node of nodes) {\n if (node.type === \"row\" && node.position) {\n deferred.push({ node, position: node.position });\n } else {\n result.push(node);\n }\n }\n\n for (const { node, position } of deferred) {\n const targetIndex = result.findIndex(\n n => n.type === \"row\" && (n as IRowNode).fieldIds.includes(position.target)\n );\n if (targetIndex === -1) {\n result.push(node);\n continue;\n }\n const insertAt = position.type === \"after\" ? targetIndex + 1 : targetIndex;\n result.splice(insertAt, 0, node);\n }\n\n return result;\n }\n\n static resolveObjectInner(\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): LayoutNode[] | Record<string, LayoutNode[]> {\n const api = LayoutBuilderFactory.create();\n if (typeof inner === \"function\") {\n return LayoutBuilderFactory.resolvePositionedRows(\n LayoutBuilderFactory.buildNodes(inner(api))\n );\n }\n const resolved: Record<string, LayoutNode[]> = {};\n for (const [tplId, factory] of Object.entries(inner)) {\n resolved[tplId] = LayoutBuilderFactory.resolvePositionedRows(\n LayoutBuilderFactory.buildNodes(factory(api))\n );\n }\n return resolved;\n }\n\n static createNodeHandle(node: LayoutNode): ILayoutNodeHandle {\n const handle: ILayoutNodeHandle = {\n node,\n before(target: string): IPositionedLayoutNode {\n handle.position = { type: \"before\", target };\n return handle;\n },\n after(target: string): IPositionedLayoutNode {\n handle.position = { type: \"after\", target };\n return handle;\n },\n replace(target: string): IPositionedLayoutNode {\n handle.position = { type: \"replace\", target };\n return handle;\n }\n };\n return handle;\n }\n\n static matchesNodeId(node: LayoutNode, nodeId: string): boolean {\n if (\"id\" in node && node.id === nodeId) {\n return true;\n }\n if (node.type === \"object\" && node.fieldName === nodeId) {\n return true;\n }\n return false;\n }\n\n static findNodeById(layout: LayoutNode[], nodeId: string): LayoutNode | undefined {\n for (const node of layout) {\n if (LayoutBuilderFactory.matchesNodeId(node, nodeId)) {\n return node;\n }\n if (node.type === \"tabs\") {\n for (const tab of node.tabs) {\n const found = LayoutBuilderFactory.findNodeById(tab.layout, nodeId);\n if (found) {\n return found;\n }\n }\n }\n }\n return undefined;\n }\n\n static resolveTabDefinition(input: ITabDefinitionInput): ITabDefinition {\n const api = LayoutBuilderFactory.create();\n return {\n id: input.id,\n label: input.label,\n description: input.description,\n icon: input.icon,\n rules: input.rules,\n layout: LayoutBuilderFactory.buildNodes(input.layout(api))\n };\n }\n\n static tabsNodeKey(node: ITabsNode): string {\n return `__tabs_${node.tabs.map(t => t.id).join(\"_\")}`;\n }\n\n static accessNode(layout: LayoutNode[], nodeId: string): ILayoutNodeAccessHandle {\n return {\n as: <T extends keyof LayoutNodeHandleMap>(type: T): LayoutNodeHandleMap[T] => {\n const node = LayoutBuilderFactory.findNodeById(layout, nodeId);\n if (!node) {\n throw new Error(`Layout node \"${nodeId}\" not found.`);\n }\n if (node.type !== type) {\n throw new Error(\n `Layout node \"${nodeId}\" is type \"${node.type}\", not \"${type}\".`\n );\n }\n\n if (type === \"tabs\") {\n return new TabsAccessBuilder(\n node as ITabsNode\n ) as unknown as LayoutNodeHandleMap[T];\n }\n\n return node as unknown as LayoutNodeHandleMap[T];\n }\n };\n }\n\n static collectBuilders(\n fields: Map<string, IField>,\n builders: Map<string, IFieldBuilder> | Record<string, IFieldBuilder>,\n predicate: (builder: IFieldBuilder) => boolean,\n result: IFieldBuilder[]\n ): void {\n const entries = builders instanceof Map ? builders.entries() : Object.entries(builders);\n for (const [name, builder] of entries) {\n if (predicate(builder)) {\n result.push(builder);\n }\n const field = fields instanceof Map ? fields.get(name) : undefined;\n if (field && isObjectField(field)) {\n LayoutBuilderFactory.collectBuilders(\n field.children,\n field.config.childBuilders,\n predicate,\n result\n );\n const templates = (field.config as IObjectFieldConfig).templates;\n if (templates) {\n for (const tpl of templates) {\n LayoutBuilderFactory.collectBuildersFlat(\n tpl.childBuilders,\n predicate,\n result\n );\n }\n }\n }\n }\n }\n\n static collectFieldIds(layout: LayoutNode[]): string[] {\n const ids: string[] = [];\n for (const node of layout) {\n if (node.type === \"row\") {\n ids.push(...node.fieldIds);\n } else if (node.type === \"tabs\") {\n for (const tab of node.tabs) {\n ids.push(...LayoutBuilderFactory.collectFieldIds(tab.layout));\n }\n } else if (node.type === \"object\") {\n ids.push(node.fieldName);\n }\n }\n return ids;\n }\n\n static collectBuildersFlat(\n builders: Record<string, IFieldBuilder>,\n predicate: (builder: IFieldBuilder) => boolean,\n result: IFieldBuilder[]\n ): void {\n for (const builder of Object.values(builders)) {\n if (predicate(builder)) {\n result.push(builder);\n }\n }\n }\n}\n"],"names":["TabBuilder","existing","text","icon","factory","LayoutBuilderFactory","r","id","TabsBuilder","name","tabId","configure","tb","_target","p","TabsAccessBuilder","_node","t","target","tab","targetIdx","fieldIds","position","builder","renderer","props","fieldName","inner","builders","b","nodes","result","deferred","node","targetIndex","n","insertAt","api","resolved","tplId","Object","handle","nodeId","layout","found","input","type","Error","fields","predicate","entries","Map","field","undefined","isObjectField","templates","tpl","ids"],"mappings":";AAkCO,MAAMA;IAQT,YAAYC,QAAyB,CAAE;aAN/B,MAAM,GAAG;QAOb,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAMC,IAAY,EAAQ;QACtB,IAAI,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CAAC,KAAK,GAAGA;aAEvB,IAAI,CAAC,MAAM,GAAGA;QAElB,OAAO,IAAI;IACf;IAEA,YAAYA,IAAY,EAAQ;QAC5B,IAAI,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CAAC,WAAW,GAAGA;aAE7B,IAAI,CAAC,YAAY,GAAGA;QAExB,OAAO,IAAI;IACf;IAEA,KAAKC,IAAU,EAAQ;QACnB,IAAI,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CAAC,IAAI,GAAGA;aAEtB,IAAI,CAAC,KAAK,GAAGA;QAEjB,OAAO,IAAI;IACf;IAEA,OAAOC,OAAoD,EAAQ;QAC/D,IAAI,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,IACnBC,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Mutator {
|
|
3
|
+
createModifierAPI(removals) {
|
|
4
|
+
return {
|
|
5
|
+
row (...fieldIds) {
|
|
6
|
+
const node = {
|
|
7
|
+
type: "row",
|
|
8
|
+
fieldIds
|
|
9
|
+
};
|
|
10
|
+
return LayoutBuilderFactory.createNodeHandle(node);
|
|
11
|
+
},
|
|
12
|
+
separator () {
|
|
13
|
+
const node = {
|
|
14
|
+
type: "separator"
|
|
15
|
+
};
|
|
16
|
+
return LayoutBuilderFactory.createNodeHandle(node);
|
|
17
|
+
},
|
|
18
|
+
tabs (config) {
|
|
19
|
+
const node = {
|
|
20
|
+
type: "tabs",
|
|
21
|
+
id: config.id,
|
|
22
|
+
renderer: config.renderer,
|
|
23
|
+
tabs: config.tabs.map(LayoutBuilderFactory.resolveTabDefinition),
|
|
24
|
+
rules: config.rules
|
|
25
|
+
};
|
|
26
|
+
return LayoutBuilderFactory.createNodeHandle(node);
|
|
27
|
+
},
|
|
28
|
+
element (renderer, props) {
|
|
29
|
+
const node = {
|
|
30
|
+
type: "element",
|
|
31
|
+
renderer,
|
|
32
|
+
props
|
|
33
|
+
};
|
|
34
|
+
return LayoutBuilderFactory.createNodeHandle(node);
|
|
35
|
+
},
|
|
36
|
+
object (fieldName, inner) {
|
|
37
|
+
const node = {
|
|
38
|
+
type: "object",
|
|
39
|
+
fieldName,
|
|
40
|
+
inner: LayoutBuilderFactory.resolveObjectInner(inner)
|
|
41
|
+
};
|
|
42
|
+
return LayoutBuilderFactory.createNodeHandle(node);
|
|
43
|
+
},
|
|
44
|
+
remove (target) {
|
|
45
|
+
removals.push(target);
|
|
46
|
+
}
|
|
41
47
|
};
|
|
42
|
-
return LayoutBuilderFactory.createNodeHandle(node);
|
|
43
|
-
},
|
|
44
|
-
remove(target) {
|
|
45
|
-
removals.push(target);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
applyModifications(layout, factory) {
|
|
50
|
-
const removals = [];
|
|
51
|
-
const modifierAPI = this.createModifierAPI(removals);
|
|
52
|
-
const entries = factory(modifierAPI);
|
|
53
|
-
let result = layout;
|
|
54
|
-
for (const target of removals) {
|
|
55
|
-
result = this.removeFromLayout(result, target);
|
|
56
48
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
result = [
|
|
70
|
-
|
|
49
|
+
applyModifications(layout, factory) {
|
|
50
|
+
const removals = [];
|
|
51
|
+
const modifierAPI = this.createModifierAPI(removals);
|
|
52
|
+
const entries = factory(modifierAPI);
|
|
53
|
+
let result = layout;
|
|
54
|
+
for (const target of removals)result = this.removeFromLayout(result, target);
|
|
55
|
+
for (const entry of entries)if (this.isPositionedNode(entry)) {
|
|
56
|
+
const { node, position } = entry;
|
|
57
|
+
result = position ? this.insertIntoLayout(result, node, position) : [
|
|
58
|
+
...result,
|
|
59
|
+
node
|
|
60
|
+
];
|
|
61
|
+
} else result = [
|
|
62
|
+
...result,
|
|
63
|
+
entry
|
|
64
|
+
];
|
|
65
|
+
return result;
|
|
71
66
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
67
|
+
accessNode(layout, nodeId) {
|
|
68
|
+
return LayoutBuilderFactory.accessNode(layout, nodeId);
|
|
69
|
+
}
|
|
70
|
+
removeFromLayout(layout, target) {
|
|
71
|
+
return layout.map((node)=>{
|
|
72
|
+
if ("row" === node.type) {
|
|
73
|
+
const filtered = node.fieldIds.filter((id)=>id !== target);
|
|
74
|
+
if (0 === filtered.length) return null;
|
|
75
|
+
return {
|
|
76
|
+
...node,
|
|
77
|
+
fieldIds: filtered
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if ("tabs" === node.type && node.id === target || "element" === node.type && (node.id === target || node.renderer === target) || "object" === node.type && node.fieldName === target) return null;
|
|
81
|
+
return node;
|
|
82
|
+
}).filter(Boolean);
|
|
83
|
+
}
|
|
84
|
+
insertIntoLayout(layout, node, position) {
|
|
85
|
+
const targetIndex = this.findIndex(layout, position.target);
|
|
86
|
+
if (-1 === targetIndex) return [
|
|
87
|
+
...layout,
|
|
88
|
+
node
|
|
89
|
+
];
|
|
90
|
+
const result = [
|
|
91
|
+
...layout
|
|
92
|
+
];
|
|
93
|
+
switch(position.type){
|
|
94
|
+
case "before":
|
|
95
|
+
result.splice(targetIndex, 0, node);
|
|
96
|
+
break;
|
|
97
|
+
case "after":
|
|
98
|
+
result.splice(targetIndex + 1, 0, node);
|
|
99
|
+
break;
|
|
100
|
+
case "replace":
|
|
101
|
+
result.splice(targetIndex, 1, node);
|
|
102
|
+
break;
|
|
83
103
|
}
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
if (node.type === "tabs" && node.id === target || node.type === "element" && (node.id === target || node.renderer === target) || node.type === "object" && node.fieldName === target) {
|
|
90
|
-
return null;
|
|
91
|
-
}
|
|
92
|
-
return node;
|
|
93
|
-
}).filter(Boolean);
|
|
94
|
-
}
|
|
95
|
-
insertIntoLayout(layout, node, position) {
|
|
96
|
-
const targetIndex = this.findIndex(layout, position.target);
|
|
97
|
-
if (targetIndex === -1) {
|
|
98
|
-
return [...layout, node];
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
isPositionedNode(entry) {
|
|
107
|
+
return "node" in entry;
|
|
99
108
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
case "before":
|
|
103
|
-
result.splice(targetIndex, 0, node);
|
|
104
|
-
break;
|
|
105
|
-
case "after":
|
|
106
|
-
result.splice(targetIndex + 1, 0, node);
|
|
107
|
-
break;
|
|
108
|
-
case "replace":
|
|
109
|
-
result.splice(targetIndex, 1, node);
|
|
110
|
-
break;
|
|
109
|
+
findIndex(layout, target) {
|
|
110
|
+
return layout.findIndex((node)=>this.nodeMatchesTarget(node, target));
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
return node.id === target;
|
|
126
|
-
case "element":
|
|
127
|
-
return node.id === target || node.renderer === target;
|
|
128
|
-
case "object":
|
|
129
|
-
return node.fieldName === target;
|
|
130
|
-
default:
|
|
131
|
-
return false;
|
|
112
|
+
nodeMatchesTarget(node, target) {
|
|
113
|
+
switch(node.type){
|
|
114
|
+
case "row":
|
|
115
|
+
return node.fieldIds.includes(target);
|
|
116
|
+
case "tabs":
|
|
117
|
+
return node.id === target;
|
|
118
|
+
case "element":
|
|
119
|
+
return node.id === target || node.renderer === target;
|
|
120
|
+
case "object":
|
|
121
|
+
return node.fieldName === target;
|
|
122
|
+
default:
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
132
125
|
}
|
|
133
|
-
}
|
|
134
126
|
}
|
|
127
|
+
export { LayoutMutator };
|
|
135
128
|
|
|
136
129
|
//# sourceMappingURL=LayoutMutator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LayoutBuilderFactory","LayoutMutator","createModifierAPI","removals","row","fieldIds","node","type","createNodeHandle","separator","tabs","config","id","renderer","map","resolveTabDefinition","rules","element","props","object","fieldName","inner","resolveObjectInner","remove","target","push","applyModifications","layout","factory","modifierAPI","entries","result","removeFromLayout","entry","isPositionedNode","position","insertIntoLayout","accessNode","nodeId","filtered","filter","length","Boolean","targetIndex","findIndex","splice","nodeMatchesTarget","includes"],"sources":["LayoutMutator.ts"],"sourcesContent":["import { LayoutBuilderFactory } from \"./LayoutBuilderFactory.js\";\nimport type {\n ILayoutModifier,\n ILayoutNodeHandle,\n IPositionedLayoutNode,\n ILayoutNodeAccessHandle,\n ITabDefinitionInput,\n IRule,\n LayoutNode,\n LayoutPosition,\n IRowNode,\n ISeparatorNode,\n ITabsNode,\n IElementNode,\n IObjectNode,\n ILayoutBuilder,\n ILayoutNodeBuilder\n} from \"./abstractions.js\";\n\nexport class LayoutMutator {\n createModifierAPI(removals: string[]): ILayoutModifier {\n return {\n row(...fieldIds: string[]): ILayoutNodeHandle {\n const node: IRowNode = { type: \"row\", fieldIds };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n separator(): ILayoutNodeHandle {\n const node: ISeparatorNode = { type: \"separator\" };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n tabs(config: {\n id?: string;\n renderer?: string;\n tabs: ITabDefinitionInput[];\n rules?: IRule[];\n }): ILayoutNodeHandle {\n const node: ITabsNode = {\n type: \"tabs\",\n id: config.id,\n renderer: config.renderer,\n tabs: config.tabs.map(LayoutBuilderFactory.resolveTabDefinition),\n rules: config.rules\n };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n element(renderer: string, props?: Record<string, unknown>): ILayoutNodeHandle {\n const node: IElementNode = { type: \"element\", renderer, props };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n object(\n fieldName: string,\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): ILayoutNodeHandle {\n const node: IObjectNode = {\n type: \"object\",\n fieldName,\n inner: LayoutBuilderFactory.resolveObjectInner(inner)\n };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n remove(target: string): void {\n removals.push(target);\n }\n };\n }\n\n applyModifications(\n layout: LayoutNode[],\n factory: (modifier: ILayoutModifier) => (LayoutNode | IPositionedLayoutNode)[]\n ): LayoutNode[] {\n const removals: string[] = [];\n const modifierAPI = this.createModifierAPI(removals);\n const entries = factory(modifierAPI);\n\n let result = layout;\n\n for (const target of removals) {\n result = this.removeFromLayout(result, target);\n }\n\n for (const entry of entries) {\n if (this.isPositionedNode(entry)) {\n const { node, position } = entry;\n if (position) {\n result = this.insertIntoLayout(result, node, position);\n } else {\n result = [...result, node];\n }\n } else {\n result = [...result, entry];\n }\n }\n\n return result;\n }\n\n accessNode(layout: LayoutNode[], nodeId: string): ILayoutNodeAccessHandle {\n return LayoutBuilderFactory.accessNode(layout, nodeId);\n }\n\n removeFromLayout(layout: LayoutNode[], target: string): LayoutNode[] {\n return layout\n .map(node => {\n if (node.type === \"row\") {\n const filtered = node.fieldIds.filter(id => id !== target);\n if (filtered.length === 0) {\n return null;\n }\n return { ...node, fieldIds: filtered };\n }\n if (\n (node.type === \"tabs\" && node.id === target) ||\n (node.type === \"element\" && (node.id === target || node.renderer === target)) ||\n (node.type === \"object\" && node.fieldName === target)\n ) {\n return null;\n }\n return node;\n })\n .filter(Boolean) as LayoutNode[];\n }\n\n insertIntoLayout(\n layout: LayoutNode[],\n node: LayoutNode,\n position: LayoutPosition\n ): LayoutNode[] {\n const targetIndex = this.findIndex(layout, position.target);\n\n if (targetIndex === -1) {\n return [...layout, node];\n }\n\n const result = [...layout];\n\n switch (position.type) {\n case \"before\":\n result.splice(targetIndex, 0, node);\n break;\n case \"after\":\n result.splice(targetIndex + 1, 0, node);\n break;\n case \"replace\":\n result.splice(targetIndex, 1, node);\n break;\n }\n\n return result;\n }\n\n isPositionedNode(entry: LayoutNode | IPositionedLayoutNode): entry is IPositionedLayoutNode {\n return \"node\" in entry;\n }\n\n private findIndex(layout: LayoutNode[], target: string): number {\n return layout.findIndex(node => this.nodeMatchesTarget(node, target));\n }\n\n private nodeMatchesTarget(node: LayoutNode, target: string): boolean {\n switch (node.type) {\n case \"row\":\n return node.fieldIds.includes(target);\n case \"tabs\":\n return node.id === target;\n case \"element\":\n return node.id === target || node.renderer === target;\n case \"object\":\n return node.fieldName === target;\n default:\n return false;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,oBAAoB;AAmB7B,OAAO,MAAMC,aAAa,CAAC;EACvBC,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AAOyB,MAAM;EACjB;EAEAG,gBAAgBA,CAACD,KAAyC,EAAkC;IACxF,OAAO,MAAM,IAAIA,KAAK;EAC1B;EAEQW,SAASA,CAACjB,MAAoB,EAAEH,MAAc,EAAU;IAC5D,OAAOG,MAAM,CAACiB,SAAS,CAACtC,IAAI,IAAI,IAAI,CAACwC,iBAAiB,CAACxC,IAAI,EAAEkB,MAAM,CAAC,CAAC;EACzE;EAEQsB,iBAAiBA,CAACxC,IAAgB,EAAEkB,MAAc,EAAW;IACjE,QAAQlB,IAAI,CAACC,IAAI;MACb,KAAK,KAAK;QACN,OAAOD,IAAI,CAACD,QAAQ,CAAC0C,QAAQ,CAACvB,MAAM,CAAC;MACzC,KAAK,MAAM;QACP,OAAOlB,IAAI,CAACM,EAAE,KAAKY,MAAM;MAC7B,KAAK,SAAS;QACV,OAAOlB,IAAI,CAACM,EAAE,KAAKY,MAAM,IAAIlB,IAAI,CAACO,QAAQ,KAAKW,MAAM;MACzD,KAAK,QAAQ;QACT,OAAOlB,IAAI,CAACc,SAAS,KAAKI,MAAM;MACpC;QACI,OAAO,KAAK;IACpB;EACJ;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"features/formModel/LayoutMutator.js","sources":["../../../src/features/formModel/LayoutMutator.ts"],"sourcesContent":["import { LayoutBuilderFactory } from \"./LayoutBuilderFactory.js\";\nimport type {\n ILayoutModifier,\n ILayoutNodeHandle,\n IPositionedLayoutNode,\n ILayoutNodeAccessHandle,\n ITabDefinitionInput,\n IRule,\n LayoutNode,\n LayoutPosition,\n IRowNode,\n ISeparatorNode,\n ITabsNode,\n IElementNode,\n IObjectNode,\n ILayoutBuilder,\n ILayoutNodeBuilder\n} from \"./abstractions.js\";\n\nexport class LayoutMutator {\n createModifierAPI(removals: string[]): ILayoutModifier {\n return {\n row(...fieldIds: string[]): ILayoutNodeHandle {\n const node: IRowNode = { type: \"row\", fieldIds };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n separator(): ILayoutNodeHandle {\n const node: ISeparatorNode = { type: \"separator\" };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n tabs(config: {\n id?: string;\n renderer?: string;\n tabs: ITabDefinitionInput[];\n rules?: IRule[];\n }): ILayoutNodeHandle {\n const node: ITabsNode = {\n type: \"tabs\",\n id: config.id,\n renderer: config.renderer,\n tabs: config.tabs.map(LayoutBuilderFactory.resolveTabDefinition),\n rules: config.rules\n };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n element(renderer: string, props?: Record<string, unknown>): ILayoutNodeHandle {\n const node: IElementNode = { type: \"element\", renderer, props };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n object(\n fieldName: string,\n inner:\n | ((layout: ILayoutBuilder) => ILayoutNodeBuilder[])\n | Record<string, (layout: ILayoutBuilder) => ILayoutNodeBuilder[]>\n ): ILayoutNodeHandle {\n const node: IObjectNode = {\n type: \"object\",\n fieldName,\n inner: LayoutBuilderFactory.resolveObjectInner(inner)\n };\n return LayoutBuilderFactory.createNodeHandle(node);\n },\n remove(target: string): void {\n removals.push(target);\n }\n };\n }\n\n applyModifications(\n layout: LayoutNode[],\n factory: (modifier: ILayoutModifier) => (LayoutNode | IPositionedLayoutNode)[]\n ): LayoutNode[] {\n const removals: string[] = [];\n const modifierAPI = this.createModifierAPI(removals);\n const entries = factory(modifierAPI);\n\n let result = layout;\n\n for (const target of removals) {\n result = this.removeFromLayout(result, target);\n }\n\n for (const entry of entries) {\n if (this.isPositionedNode(entry)) {\n const { node, position } = entry;\n if (position) {\n result = this.insertIntoLayout(result, node, position);\n } else {\n result = [...result, node];\n }\n } else {\n result = [...result, entry];\n }\n }\n\n return result;\n }\n\n accessNode(layout: LayoutNode[], nodeId: string): ILayoutNodeAccessHandle {\n return LayoutBuilderFactory.accessNode(layout, nodeId);\n }\n\n removeFromLayout(layout: LayoutNode[], target: string): LayoutNode[] {\n return layout\n .map(node => {\n if (node.type === \"row\") {\n const filtered = node.fieldIds.filter(id => id !== target);\n if (filtered.length === 0) {\n return null;\n }\n return { ...node, fieldIds: filtered };\n }\n if (\n (node.type === \"tabs\" && node.id === target) ||\n (node.type === \"element\" && (node.id === target || node.renderer === target)) ||\n (node.type === \"object\" && node.fieldName === target)\n ) {\n return null;\n }\n return node;\n })\n .filter(Boolean) as LayoutNode[];\n }\n\n insertIntoLayout(\n layout: LayoutNode[],\n node: LayoutNode,\n position: LayoutPosition\n ): LayoutNode[] {\n const targetIndex = this.findIndex(layout, position.target);\n\n if (targetIndex === -1) {\n return [...layout, node];\n }\n\n const result = [...layout];\n\n switch (position.type) {\n case \"before\":\n result.splice(targetIndex, 0, node);\n break;\n case \"after\":\n result.splice(targetIndex + 1, 0, node);\n break;\n case \"replace\":\n result.splice(targetIndex, 1, node);\n break;\n }\n\n return result;\n }\n\n isPositionedNode(entry: LayoutNode | IPositionedLayoutNode): entry is IPositionedLayoutNode {\n return \"node\" in entry;\n }\n\n private findIndex(layout: LayoutNode[], target: string): number {\n return layout.findIndex(node => this.nodeMatchesTarget(node, target));\n }\n\n private nodeMatchesTarget(node: LayoutNode, target: string): boolean {\n switch (node.type) {\n case \"row\":\n return node.fieldIds.includes(target);\n case \"tabs\":\n return node.id === target;\n case \"element\":\n return node.id === target || node.renderer === target;\n case \"object\":\n return node.fieldName === target;\n default:\n return false;\n }\n }\n}\n"],"names":["LayoutMutator","removals","fieldIds","node","LayoutBuilderFactory","config","renderer","props","fieldName","inner","target","layout","factory","modifierAPI","entries","result","entry","position","nodeId","filtered","id","Boolean","targetIndex"],"mappings":";AAmBO,MAAMA;IACT,kBAAkBC,QAAkB,EAAmB;QACnD,OAAO;YACH,KAAI,GAAGC,QAAkB;gBACrB,MAAMC,OAAiB;oBAAE,MAAM;oBAAOD;gBAAS;gBAC/C,OAAOE,qBAAqB,gBAAgB,CAACD;YACjD;YACA;gBACI,MAAMA,OAAuB;oBAAE,MAAM;gBAAY;gBACjD,OAAOC,qBAAqB,gBAAgB,CAACD;YACjD;YACA,MAAKE,MAKJ;gBACG,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