@webiny/app-admin 0.0.0-unstable.3fddf667ea → 0.0.0-unstable.4373247389
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/base/Admin.js +4 -0
- package/base/Admin.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js.map +1 -1
- package/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js.map +1 -1
- package/base/Base/LexicalPreset.js +1 -1
- package/base/Base/LexicalPreset.js.map +1 -1
- package/base/Base/Menus.js.map +1 -1
- package/base/Base/RoutesConfig.js.map +1 -1
- package/base/Base/Tenant.js.map +1 -1
- package/base/Base/UserMenu/SwitchTenant.d.ts +20 -0
- package/base/Base/UserMenu/SwitchTenant.js +45 -0
- package/base/Base/UserMenu/SwitchTenant.js.map +1 -0
- package/base/Base/UserMenu.js +4 -0
- package/base/Base/UserMenu.js.map +1 -1
- package/base/Base.js.map +1 -1
- package/base/ui/AiChatsPanel.d.ts +39 -0
- package/base/ui/AiChatsPanel.js +5 -0
- package/base/ui/AiChatsPanel.js.map +1 -0
- package/base/ui/AssumedPermissionsSelector.js.map +1 -1
- package/base/ui/Brand.js.map +1 -1
- package/base/ui/Dashboard.js.map +1 -1
- package/base/ui/FileManager.js.map +1 -1
- package/base/ui/LoginScreen.js.map +1 -1
- package/base/ui/Logo.js.map +1 -1
- package/base/ui/Navigation.js.map +1 -1
- package/base/ui/NotFound.js.map +1 -1
- package/base/ui/Tags.js.map +1 -1
- package/base/ui/TenantSelector.js.map +1 -1
- package/base/ui/UserMenu/UserMenu.js.map +1 -1
- package/base/ui/UserMenu/UserMenuHandle.js.map +1 -1
- package/base/ui/UserMenu.js.map +1 -1
- package/components/Buttons/useButtons.js.map +1 -1
- package/components/Dialogs/DialogParamsContext.js.map +1 -1
- package/components/Dialogs/DialogsContext.js.map +1 -1
- package/components/Drawers/DrawerParamsContext.js.map +1 -1
- package/components/Drawers/DrawersContext.js.map +1 -1
- package/components/Filters/FiltersToggle.js.map +1 -1
- package/components/IconPicker/IconPickerPresenterProvider.js.map +1 -1
- package/components/IconPicker/IconPickerTab.js.map +1 -1
- package/components/IconPicker/IconRenderer.js.map +1 -1
- package/components/IconPicker/config/IconType.js.map +1 -1
- package/components/IconPicker/config/index.js.map +1 -1
- package/components/IconPicker/plugins/customPlugin.js.map +1 -1
- package/components/IconPicker/plugins/emojisPlugin.js.map +1 -1
- package/components/IconPicker/plugins/iconsPlugin.js.map +1 -1
- package/components/IconPicker/types.js.map +1 -1
- package/components/LexicalEditor/DefaultLexicalEditorConfig.js +1 -1
- package/components/LexicalEditor/DefaultLexicalEditorConfig.js.map +1 -1
- package/components/LexicalEditor/LexicalEditor.d.ts +3 -1
- package/components/LexicalEditor/LexicalEditor.js +3 -2
- package/components/LexicalEditor/LexicalEditor.js.map +1 -1
- package/components/LexicalEditor/LexicalLinkForm.js.map +1 -1
- package/components/ListView/ListViewBottomBar.js.map +1 -1
- package/components/ListView/ListViewHeader.js.map +1 -1
- package/components/OptionsMenu/useOptionsMenuItem.js.map +1 -1
- package/components/Table/useTableRow.js.map +1 -1
- package/config/AdminConfig/LexicalTheme/Typography.js +4 -4
- package/config/AdminConfig/LexicalTheme/Typography.js.map +1 -1
- package/config/AdminConfig/Menu.js.map +1 -1
- package/config/AdminConfig/Theme.js +1 -1
- package/config/AdminConfig/Theme.js.map +1 -1
- package/config/AdminConfig.js +2 -2
- package/config/AdminConfig.js.map +1 -1
- package/config/createAdminConfig.js.map +1 -1
- package/domain/Identity.d.ts +8 -0
- package/domain/Identity.js +6 -0
- package/domain/Identity.js.map +1 -1
- package/exports/admin/security.d.ts +4 -1
- package/exports/admin/security.js +4 -1
- package/exports/admin.d.ts +2 -0
- package/exports/admin.js +2 -0
- package/features/accessManagement/constants.js.map +1 -1
- package/features/adminAssistant/AdminAssistantGateway.js +3 -0
- package/features/adminAssistant/AdminAssistantGateway.js.map +1 -1
- package/features/adminAssistant/AdminAssistantPresenter.d.ts +19 -2
- package/features/adminAssistant/AdminAssistantPresenter.js +132 -4
- package/features/adminAssistant/AdminAssistantPresenter.js.map +1 -1
- package/features/adminAssistant/abstractions.d.ts +27 -3
- package/features/adminAssistant/abstractions.js.map +1 -1
- package/features/adminUsers/capabilities/abstractions.d.ts +18 -0
- package/features/adminUsers/capabilities/abstractions.js +5 -0
- package/features/adminUsers/capabilities/abstractions.js.map +1 -0
- package/features/adminUsers/capabilities/feature.d.ts +4 -0
- package/features/adminUsers/capabilities/feature.js +19 -0
- package/features/adminUsers/capabilities/feature.js.map +1 -0
- package/features/adminUsers/capabilities/index.d.ts +3 -0
- package/features/adminUsers/capabilities/index.js +2 -0
- package/features/adminUsers/users/checkEmail/CheckEmailGateway.d.ts +11 -0
- package/features/adminUsers/users/checkEmail/CheckEmailGateway.js +44 -0
- package/features/adminUsers/users/checkEmail/CheckEmailGateway.js.map +1 -0
- package/features/adminUsers/users/checkEmail/CheckEmailUseCase.d.ts +10 -0
- package/features/adminUsers/users/checkEmail/CheckEmailUseCase.js +18 -0
- package/features/adminUsers/users/checkEmail/CheckEmailUseCase.js.map +1 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailGateway.d.ts +14 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailGateway.js +5 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailGateway.js.map +1 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailUseCase.d.ts +9 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailUseCase.js +5 -0
- package/features/adminUsers/users/checkEmail/abstractions/CheckEmailUseCase.js.map +1 -0
- package/features/adminUsers/users/checkEmail/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/checkEmail/abstractions/index.js +2 -0
- package/features/adminUsers/users/checkEmail/feature.d.ts +3 -0
- package/features/adminUsers/users/checkEmail/feature.js +19 -0
- package/features/adminUsers/users/checkEmail/feature.js.map +1 -0
- package/features/adminUsers/users/checkEmail/index.d.ts +2 -0
- package/features/adminUsers/users/checkEmail/index.js +2 -0
- package/features/adminUsers/users/createUser/CreateUserGateway.js +2 -1
- package/features/adminUsers/users/createUser/CreateUserGateway.js.map +1 -1
- package/features/adminUsers/users/createUser/CreateUserUseCase.test.d.ts +1 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.test.js +65 -0
- package/features/adminUsers/users/createUser/CreateUserUseCase.test.js.map +1 -0
- package/features/adminUsers/users/linkUser/LinkUserGateway.d.ts +11 -0
- package/features/adminUsers/users/linkUser/LinkUserGateway.js +50 -0
- package/features/adminUsers/users/linkUser/LinkUserGateway.js.map +1 -0
- package/features/adminUsers/users/linkUser/LinkUserUseCase.d.ts +10 -0
- package/features/adminUsers/users/linkUser/LinkUserUseCase.js +18 -0
- package/features/adminUsers/users/linkUser/LinkUserUseCase.js.map +1 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserGateway.d.ts +18 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserGateway.js +5 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserGateway.js.map +1 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserUseCase.d.ts +15 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserUseCase.js +5 -0
- package/features/adminUsers/users/linkUser/abstractions/LinkUserUseCase.js.map +1 -0
- package/features/adminUsers/users/linkUser/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/linkUser/abstractions/index.js +2 -0
- package/features/adminUsers/users/linkUser/feature.d.ts +3 -0
- package/features/adminUsers/users/linkUser/feature.js +19 -0
- package/features/adminUsers/users/linkUser/feature.js.map +1 -0
- package/features/adminUsers/users/linkUser/index.d.ts +2 -0
- package/features/adminUsers/users/linkUser/index.js +2 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaGateway.d.ts +11 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaGateway.js +42 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaGateway.js.map +1 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaUseCase.d.ts +10 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaUseCase.js +18 -0
- package/features/adminUsers/users/resetUserMfa/ResetUserMfaUseCase.js.map +1 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaGateway.d.ts +11 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaGateway.js +5 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaGateway.js.map +1 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaUseCase.d.ts +12 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaUseCase.js +5 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/ResetUserMfaUseCase.js.map +1 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/index.d.ts +2 -0
- package/features/adminUsers/users/resetUserMfa/abstractions/index.js +2 -0
- package/features/adminUsers/users/resetUserMfa/feature.d.ts +3 -0
- package/features/adminUsers/users/resetUserMfa/feature.js +19 -0
- package/features/adminUsers/users/resetUserMfa/feature.js.map +1 -0
- package/features/adminUsers/users/resetUserMfa/index.d.ts +2 -0
- package/features/adminUsers/users/resetUserMfa/index.js +2 -0
- package/features/adminUsers/users/shared/AdminUsersError.d.ts +13 -0
- package/features/adminUsers/users/shared/AdminUsersError.js +11 -0
- package/features/adminUsers/users/shared/AdminUsersError.js.map +1 -0
- package/features/assistantClientTools/AssistantClientTools.d.ts +13 -0
- package/features/assistantClientTools/AssistantClientTools.js +59 -0
- package/features/assistantClientTools/AssistantClientTools.js.map +1 -0
- package/features/assistantClientTools/abstractions.d.ts +62 -0
- package/features/assistantClientTools/abstractions.js +5 -0
- package/features/assistantClientTools/abstractions.js.map +1 -0
- package/features/assistantClientTools/feature.d.ts +3 -0
- package/features/assistantClientTools/feature.js +17 -0
- package/features/assistantClientTools/feature.js.map +1 -0
- package/features/assistantClientTools/index.d.ts +2 -0
- package/features/assistantClientTools/index.js +2 -0
- package/features/assistantComposerControls/AssistantComposerControls.d.ts +13 -0
- package/features/assistantComposerControls/AssistantComposerControls.js +49 -0
- package/features/assistantComposerControls/AssistantComposerControls.js.map +1 -0
- package/features/assistantComposerControls/abstractions.d.ts +35 -0
- package/features/assistantComposerControls/abstractions.js +5 -0
- package/features/assistantComposerControls/abstractions.js.map +1 -0
- package/features/assistantComposerControls/feature.d.ts +3 -0
- package/features/assistantComposerControls/feature.js +17 -0
- package/features/assistantComposerControls/feature.js.map +1 -0
- package/features/assistantComposerControls/index.d.ts +2 -0
- package/features/assistantComposerControls/index.js +2 -0
- package/features/assumePermissions/AssumePermissionsUseCase.js +2 -2
- package/features/assumePermissions/AssumePermissionsUseCase.js.map +1 -1
- package/features/assumePermissions/LogInUseCaseDecorator.d.ts +1 -1
- package/features/assumePermissions/LogInUseCaseDecorator.js +8 -6
- package/features/assumePermissions/LogInUseCaseDecorator.js.map +1 -1
- package/features/formModel/FormView.js.map +1 -1
- package/features/formModel/createFieldRenderer.js.map +1 -1
- package/features/formModel/demo/FormModelDemo.js.map +1 -1
- package/features/formModel/fieldTypes/dateLimits.js.map +1 -1
- package/features/security/LogIn/LogInError.d.ts +15 -0
- package/features/security/LogIn/LogInError.js +25 -0
- package/features/security/LogIn/LogInError.js.map +1 -0
- package/features/security/LogIn/LogInGateway.d.ts +2 -2
- package/features/security/LogIn/LogInGateway.js +22 -5
- package/features/security/LogIn/LogInGateway.js.map +1 -1
- package/features/security/LogIn/LogInRepository.d.ts +1 -2
- package/features/security/LogIn/LogInRepository.js +6 -2
- package/features/security/LogIn/LogInRepository.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.d.ts +7 -2
- package/features/security/LogIn/LogInUseCase.js +53 -3
- package/features/security/LogIn/LogInUseCase.js.map +1 -1
- package/features/security/LogIn/LogInUseCase.test.d.ts +1 -0
- package/features/security/LogIn/LogInUseCase.test.js +321 -0
- package/features/security/LogIn/LogInUseCase.test.js.map +1 -0
- package/features/security/LogIn/abstractions.d.ts +48 -3
- package/features/security/LogIn/abstractions.js.map +1 -1
- package/features/security/LogIn/createLoginMutation.js +40 -27
- package/features/security/LogIn/createLoginMutation.js.map +1 -1
- package/features/security/LogIn/feature.js +2 -0
- package/features/security/LogIn/feature.js.map +1 -1
- package/features/security/LogIn/index.d.ts +1 -0
- package/features/security/LogIn/index.js +1 -0
- package/features/security/LoginTenantResolver/LoginTenantResolver.d.ts +14 -0
- package/features/security/LoginTenantResolver/LoginTenantResolver.js +52 -0
- package/features/security/LoginTenantResolver/LoginTenantResolver.js.map +1 -0
- package/features/security/LoginTenantResolver/abstractions.d.ts +38 -0
- package/features/security/LoginTenantResolver/abstractions.js +5 -0
- package/features/security/LoginTenantResolver/abstractions.js.map +1 -0
- package/features/security/LoginTenantResolver/feature.d.ts +3 -0
- package/features/security/LoginTenantResolver/feature.js +17 -0
- package/features/security/LoginTenantResolver/feature.js.map +1 -0
- package/features/security/LoginTenantResolver/index.d.ts +2 -0
- package/features/security/LoginTenantResolver/index.js +2 -0
- package/features/webinySdk/WebinySdk.d.ts +2 -1
- package/features/webinySdk/WebinySdk.js +14 -2
- package/features/webinySdk/WebinySdk.js.map +1 -1
- package/features/webinySdk/__tests__/WebinySdk.test.d.ts +1 -0
- package/features/webinySdk/__tests__/WebinySdk.test.js +89 -0
- package/features/webinySdk/__tests__/WebinySdk.test.js.map +1 -0
- package/index.d.ts +3 -0
- package/index.js +5 -2
- package/modules/AccessManagementExtension.js +1 -1
- package/modules/AccessManagementExtension.js.map +1 -1
- package/modules/DebuggerExtension.js +1 -1
- package/modules/DebuggerExtension.js.map +1 -1
- package/package.json +30 -30
- package/permissions/PermissionRenderer.js.map +1 -1
- package/permissions/PermissionValueContext.js.map +1 -1
- package/presentation/accessManagement/SecurityPermissions.js +1 -1
- package/presentation/accessManagement/SecurityPermissions.js.map +1 -1
- package/presentation/accessManagement/apiKeys/components/ApiKeysView.js.map +1 -1
- package/presentation/adminUsers/AdminUsers.d.ts +8 -1
- package/presentation/adminUsers/AdminUsers.js +22 -2
- package/presentation/adminUsers/AdminUsers.js.map +1 -1
- package/presentation/adminUsers/SecurityPermission.js +1 -1
- package/presentation/adminUsers/SecurityPermission.js.map +1 -1
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.d.ts +27 -0
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.js +67 -0
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.js.map +1 -0
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.test.d.ts +1 -0
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.test.js +150 -0
- package/presentation/adminUsers/resetMfa/ResetMfaPresenter.test.js.map +1 -0
- package/presentation/adminUsers/resetMfa/abstractions.d.ts +38 -0
- package/presentation/adminUsers/resetMfa/abstractions.js +5 -0
- package/presentation/adminUsers/resetMfa/abstractions.js.map +1 -0
- package/presentation/adminUsers/resetMfa/feature.d.ts +6 -0
- package/presentation/adminUsers/resetMfa/feature.js +17 -0
- package/presentation/adminUsers/resetMfa/feature.js.map +1 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.d.ts +32 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.js +124 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.js.map +1 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.test.d.ts +1 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.test.js +264 -0
- package/presentation/adminUsers/userForm/UserFormPresenter.test.js.map +1 -0
- package/presentation/adminUsers/userForm/abstractions.d.ts +52 -0
- package/presentation/adminUsers/userForm/abstractions.js +5 -0
- package/presentation/adminUsers/userForm/abstractions.js.map +1 -0
- package/presentation/adminUsers/userForm/feature.d.ts +7 -0
- package/presentation/adminUsers/userForm/feature.js +17 -0
- package/presentation/adminUsers/userForm/feature.js.map +1 -0
- package/presentation/adminUsers/userMenu/AccountDetails.js +1 -1
- package/presentation/adminUsers/userMenu/AccountDetails.js.map +1 -1
- package/presentation/adminUsers/views/Users/UsersForm.d.ts +3 -1
- package/presentation/adminUsers/views/Users/UsersForm.js +51 -20
- package/presentation/adminUsers/views/Users/UsersForm.js.map +1 -1
- package/presentation/adminUsers/views/Users/components/LinkAccountAlert.d.ts +10 -0
- package/presentation/adminUsers/views/Users/components/LinkAccountAlert.js +17 -0
- package/presentation/adminUsers/views/Users/components/LinkAccountAlert.js.map +1 -0
- package/presentation/adminUsers/views/Users/components/ResetMfa.d.ts +12 -0
- package/presentation/adminUsers/views/Users/components/ResetMfa.js +63 -0
- package/presentation/adminUsers/views/Users/components/ResetMfa.js.map +1 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.d.ts +1 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js +31 -18
- package/presentation/adminUsers/views/Users/hooks/useUserForm.js.map +1 -1
- package/presentation/adminUsers/views/Users/hooks/useUserForm.test.js +9 -0
- package/presentation/adminUsers/views/Users/hooks/useUserForm.test.js.map +1 -1
- package/presentation/assumePermissions/components/AssumedPermissionsSelector.js.map +1 -1
- package/presentation/debugger/components/DebuggerIndicator.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/AdminUserStep.js.map +1 -1
- package/presentation/installation/components/SystemInstaller/steps/BasicInfoStep.js.map +1 -1
- package/presentation/listPresenter/ListPresenter.js +1 -1
- package/presentation/listPresenter/ListPresenter.js.map +1 -1
- package/presentation/listPresenter/ListPresenter.test.js +28 -0
- package/presentation/listPresenter/ListPresenter.test.js.map +1 -1
- package/presentation/security/components/LoginNoTenantAccess.d.ts +27 -0
- package/presentation/security/components/LoginNoTenantAccess.js +22 -0
- package/presentation/security/components/LoginNoTenantAccess.js.map +1 -0
- package/presentation/security/components/LoginTenantPicker.d.ts +30 -0
- package/presentation/security/components/LoginTenantPicker.js +32 -0
- package/presentation/security/components/LoginTenantPicker.js.map +1 -0
- package/presentation/security/hooks/useAuthentication.d.ts +2 -2
- package/presentation/security/hooks/useAuthentication.js.map +1 -1
- package/presentation/security/hooks/useSecurity.js +2 -2
- package/presentation/security/hooks/useSecurity.js.map +1 -1
- package/presentation/sortable/SortablePresenter.js +3 -2
- package/presentation/sortable/SortablePresenter.js.map +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js +1 -1
- package/presentation/trashBin/components/BulkActions/DeleteItems.test.js.map +1 -1
- package/presentation/trashBin/components/TrashBinConfigs.js +1 -1
- package/presentation/trashBin/components/TrashBinConfigs.js.map +1 -1
- package/presentation/trashBin/components/TrashBinOverlay.js.map +1 -1
- package/presentation/trashBin/configs/Browser/BulkAction.js +1 -1
- package/presentation/trashBin/configs/Browser/BulkAction.js.map +1 -1
- package/presentation/trashBin/hooks/useTrashBinItem.js +1 -1
- package/presentation/trashBin/hooks/useTrashBinItem.js.map +1 -1
- package/presentation/trashBin/hooks/useTrashBinPresenter.js +1 -1
- package/presentation/trashBin/hooks/useTrashBinPresenter.js.map +1 -1
package/base/Admin.js
CHANGED
|
@@ -31,6 +31,8 @@ import { CustomIconsPresenterFeature } from "../presentation/iconPicker/customIc
|
|
|
31
31
|
import { CommandPaletteFeature } from "../presentation/commandPalette/index.js";
|
|
32
32
|
import { AdminAssistantFeature } from "../features/adminAssistant/index.js";
|
|
33
33
|
import { AssistantPageContextFeature } from "../features/assistantPageContext/index.js";
|
|
34
|
+
import { AssistantClientToolsFeature } from "../features/assistantClientTools/index.js";
|
|
35
|
+
import { AssistantComposerControlsFeature } from "../features/assistantComposerControls/index.js";
|
|
34
36
|
import { AiChatsFeature } from "../features/aiChats/index.js";
|
|
35
37
|
import { AiChatsPanelFeature } from "../presentation/aiChats/index.js";
|
|
36
38
|
import { AdminCommandsFeature } from "../presentation/commandPalette/commands/feature.js";
|
|
@@ -53,6 +55,8 @@ const Admin = ({ children, createLegacyPlugins })=>{
|
|
|
53
55
|
CustomIconsPresenterFeature.register(container);
|
|
54
56
|
AiChatsFeature.register(container);
|
|
55
57
|
AssistantPageContextFeature.register(container);
|
|
58
|
+
AssistantClientToolsFeature.register(container);
|
|
59
|
+
AssistantComposerControlsFeature.register(container);
|
|
56
60
|
AdminAssistantFeature.register(container);
|
|
57
61
|
AiChatsPanelFeature.register(container);
|
|
58
62
|
CommandPaletteFeature.register(container);
|
package/base/Admin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Admin.js","sources":["../../src/base/Admin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Container } from \"@webiny/di\";\nimport { plugins } from \"@webiny/plugins\";\nimport { App, DiContainerProvider } from \"@webiny/app\";\nimport { Base } from \"./Base.js\";\nimport { createUiStateProvider } from \"./providers/UiStateProvider.js\";\nimport { createAdminUiStateProvider } from \"./providers/AdminUiStateProvider.js\";\nimport { createUiProviders } from \"./providers/UiProviders.js\";\nimport { createDialogsProvider } from \"~/components/Dialogs/DialogsContext.js\";\nimport { createDrawersProvider } from \"~/components/Drawers/DrawersContext.js\";\nimport { DefaultIcons, IconPickerConfigProvider } from \"~/components/IconPicker/config/index.js\";\nimport { createRootContainer } from \"~/base/createRootContainer.js\";\nimport { FeatureFlagsProvider } from \"~/presentation/featureFlags/FeatureFlagsProvider.js\";\nimport { createTenancyProvider } from \"~/presentation/tenancy/createTenancyProvider.js\";\nimport { TelemetryAdminAppStart } from \"./TelemetryAdminAppStart.js\";\nimport { SecurityFeature } from \"~/features/security/SecurityFeature.js\";\nimport { AssumePermissionsFeature } from \"~/features/assumePermissions/index.js\";\nimport { AssumePermissionsPresenterFeature } from \"~/presentation/assumePermissions/feature.js\";\nimport { BannersPresenterFeature } from \"~/presentation/banners/feature.js\";\nimport { DebuggerFeature } from \"~/features/debugger/feature.js\";\nimport { DebuggerPresenterFeature } from \"~/presentation/debugger/feature.js\";\nimport { FormModelFeature } from \"~/features/formModel/feature.js\";\nimport type { PluginCollection } from \"@webiny/plugins/types.js\";\nimport { AdminConfigPlugin, AdminConfigProvider } from \"~/config/AdminConfig.js\";\nimport { WebinySdkFeature } from \"~/features/webinySdk/feature.js\";\nimport { DateFormatterFeature } from \"~/features/dateFormatter/feature.js\";\nimport { StringFormatterFeature } from \"~/features/stringFormatter/feature.js\";\nimport { ListPresenterFeature } from \"~/presentation/listPresenter/index.js\";\nimport { SortableFeature } from \"~/presentation/sortable/index.js\";\nimport { NotificationsRenderer } from \"~/features/notifications/NotificationsRenderer.js\";\nimport { ListCustomIconsFeature } from \"~/features/iconPicker/listCustomIcons/feature.js\";\nimport { CustomIconsPresenterFeature } from \"~/presentation/iconPicker/customIcons/feature.js\";\nimport { CommandPaletteFeature } from \"~/presentation/commandPalette/index.js\";\nimport { AdminAssistantFeature } from \"~/features/adminAssistant/index.js\";\nimport { AssistantPageContextFeature } from \"~/features/assistantPageContext/index.js\";\nimport { AiChatsFeature } from \"~/features/aiChats/index.js\";\nimport { AiChatsPanelFeature } from \"~/presentation/aiChats/index.js\";\nimport { AdminCommandsFeature } from \"~/presentation/commandPalette/commands/feature.js\";\nimport { PasswordPolicyFeature } from \"~/features/adminUsers/passwordPolicy/index.js\";\nimport { readPasswordPolicyRules } from \"~/features/adminUsers/passwordPolicy/index.js\";\n\nexport interface AdminProps {\n createLegacyPlugins?: (container: Container) => PluginCollection;\n children?: React.ReactNode;\n}\n\nconst container = createRootContainer();\n\nexport const Admin = ({ children, createLegacyPlugins }: AdminProps) => {\n if (createLegacyPlugins) {\n plugins.register(...createLegacyPlugins(container));\n }\n\n SecurityFeature.register(container);\n // After SecurityFeature: the use case re-runs the login query through its LogInRepository.\n AssumePermissionsFeature.register(container);\n /*\n * The header control renders from the Layout, which mounts before the Admin config tree, so\n * its presenter cannot be registered through RegisterFeature down there: a useFeature() miss\n * throws, and the error boundary keeps the subtree dead even once the registration arrives.\n * Registering here also keeps the features layer from importing the presentation layer.\n */\n AssumePermissionsPresenterFeature.register(container);\n // The Layout renders the banner bar, so its presenter has to exist before the Layout mounts.\n BannersPresenterFeature.register(container);\n /*\n * Here rather than in the config tree for two reasons: the response handler has to exist\n * before the first GraphQL request, and the Layout renders the header indicator, so its\n * presenter has to exist before the Layout mounts.\n */\n DebuggerFeature.register(container);\n DebuggerPresenterFeature.register(container);\n DateFormatterFeature.register(container);\n StringFormatterFeature.register(container);\n FormModelFeature.register(container);\n WebinySdkFeature.register(container);\n ListPresenterFeature.register(container);\n ListCustomIconsFeature.register(container);\n CustomIconsPresenterFeature.register(container);\n AiChatsFeature.register(container);\n AssistantPageContextFeature.register(container);\n AdminAssistantFeature.register(container);\n AiChatsPanelFeature.register(container);\n CommandPaletteFeature.register(container);\n AdminCommandsFeature.register(container);\n SortableFeature.register(container);\n /*\n * Here because the install wizard's admin step needs it, and the wizard renders before any\n * identity provider extension is mounted. The user forms and the login screens use it too.\n */\n const passwordPolicyRules = readPasswordPolicyRules();\n PasswordPolicyFeature.register(container, passwordPolicyRules);\n\n const UIProviders = createUiProviders();\n const UiStateProvider = createUiStateProvider();\n const AdminUiStateProvider = createAdminUiStateProvider();\n const DialogsProvider = createDialogsProvider();\n const DrawersProvider = createDrawersProvider();\n const TenancyProvider = createTenancyProvider();\n\n return (\n <DiContainerProvider container={container}>\n <TelemetryAdminAppStart />\n <FeatureFlagsProvider>\n <App\n plugins={[AdminConfigPlugin]}\n routes={[]}\n providers={[\n AdminConfigProvider,\n UIProviders,\n UiStateProvider,\n DialogsProvider,\n DrawersProvider,\n IconPickerConfigProvider,\n AdminUiStateProvider,\n TenancyProvider\n ]}\n >\n <Base />\n <DefaultIcons />\n <NotificationsRenderer />\n {children}\n </App>\n </FeatureFlagsProvider>\n </DiContainerProvider>\n );\n};\n"],"names":["container","createRootContainer","Admin","children","createLegacyPlugins","plugins","SecurityFeature","AssumePermissionsFeature","AssumePermissionsPresenterFeature","BannersPresenterFeature","DebuggerFeature","DebuggerPresenterFeature","DateFormatterFeature","StringFormatterFeature","FormModelFeature","WebinySdkFeature","ListPresenterFeature","ListCustomIconsFeature","CustomIconsPresenterFeature","AiChatsFeature","AssistantPageContextFeature","AdminAssistantFeature","AiChatsPanelFeature","CommandPaletteFeature","AdminCommandsFeature","SortableFeature","passwordPolicyRules","readPasswordPolicyRules","PasswordPolicyFeature","UIProviders","createUiProviders","UiStateProvider","createUiStateProvider","AdminUiStateProvider","createAdminUiStateProvider","DialogsProvider","createDialogsProvider","DrawersProvider","createDrawersProvider","TenancyProvider","createTenancyProvider","DiContainerProvider","TelemetryAdminAppStart","FeatureFlagsProvider","App","AdminConfigPlugin","AdminConfigProvider","IconPickerConfigProvider","Base","DefaultIcons","NotificationsRenderer"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base/Admin.js","sources":["../../src/base/Admin.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Container } from \"@webiny/di\";\nimport { plugins } from \"@webiny/plugins\";\nimport { App, DiContainerProvider } from \"@webiny/app\";\nimport { Base } from \"./Base.js\";\nimport { createUiStateProvider } from \"./providers/UiStateProvider.js\";\nimport { createAdminUiStateProvider } from \"./providers/AdminUiStateProvider.js\";\nimport { createUiProviders } from \"./providers/UiProviders.js\";\nimport { createDialogsProvider } from \"~/components/Dialogs/DialogsContext.js\";\nimport { createDrawersProvider } from \"~/components/Drawers/DrawersContext.js\";\nimport { DefaultIcons, IconPickerConfigProvider } from \"~/components/IconPicker/config/index.js\";\nimport { createRootContainer } from \"~/base/createRootContainer.js\";\nimport { FeatureFlagsProvider } from \"~/presentation/featureFlags/FeatureFlagsProvider.js\";\nimport { createTenancyProvider } from \"~/presentation/tenancy/createTenancyProvider.js\";\nimport { TelemetryAdminAppStart } from \"./TelemetryAdminAppStart.js\";\nimport { SecurityFeature } from \"~/features/security/SecurityFeature.js\";\nimport { AssumePermissionsFeature } from \"~/features/assumePermissions/index.js\";\nimport { AssumePermissionsPresenterFeature } from \"~/presentation/assumePermissions/feature.js\";\nimport { BannersPresenterFeature } from \"~/presentation/banners/feature.js\";\nimport { DebuggerFeature } from \"~/features/debugger/feature.js\";\nimport { DebuggerPresenterFeature } from \"~/presentation/debugger/feature.js\";\nimport { FormModelFeature } from \"~/features/formModel/feature.js\";\nimport type { PluginCollection } from \"@webiny/plugins/types.js\";\nimport { AdminConfigPlugin, AdminConfigProvider } from \"~/config/AdminConfig.js\";\nimport { WebinySdkFeature } from \"~/features/webinySdk/feature.js\";\nimport { DateFormatterFeature } from \"~/features/dateFormatter/feature.js\";\nimport { StringFormatterFeature } from \"~/features/stringFormatter/feature.js\";\nimport { ListPresenterFeature } from \"~/presentation/listPresenter/index.js\";\nimport { SortableFeature } from \"~/presentation/sortable/index.js\";\nimport { NotificationsRenderer } from \"~/features/notifications/NotificationsRenderer.js\";\nimport { ListCustomIconsFeature } from \"~/features/iconPicker/listCustomIcons/feature.js\";\nimport { CustomIconsPresenterFeature } from \"~/presentation/iconPicker/customIcons/feature.js\";\nimport { CommandPaletteFeature } from \"~/presentation/commandPalette/index.js\";\nimport { AdminAssistantFeature } from \"~/features/adminAssistant/index.js\";\nimport { AssistantPageContextFeature } from \"~/features/assistantPageContext/index.js\";\nimport { AssistantClientToolsFeature } from \"~/features/assistantClientTools/index.js\";\nimport { AssistantComposerControlsFeature } from \"~/features/assistantComposerControls/index.js\";\nimport { AiChatsFeature } from \"~/features/aiChats/index.js\";\nimport { AiChatsPanelFeature } from \"~/presentation/aiChats/index.js\";\nimport { AdminCommandsFeature } from \"~/presentation/commandPalette/commands/feature.js\";\nimport { PasswordPolicyFeature } from \"~/features/adminUsers/passwordPolicy/index.js\";\nimport { readPasswordPolicyRules } from \"~/features/adminUsers/passwordPolicy/index.js\";\n\nexport interface AdminProps {\n createLegacyPlugins?: (container: Container) => PluginCollection;\n children?: React.ReactNode;\n}\n\nconst container = createRootContainer();\n\nexport const Admin = ({ children, createLegacyPlugins }: AdminProps) => {\n if (createLegacyPlugins) {\n plugins.register(...createLegacyPlugins(container));\n }\n\n SecurityFeature.register(container);\n // After SecurityFeature: the use case re-runs the login query through its LogInRepository.\n AssumePermissionsFeature.register(container);\n /*\n * The header control renders from the Layout, which mounts before the Admin config tree, so\n * its presenter cannot be registered through RegisterFeature down there: a useFeature() miss\n * throws, and the error boundary keeps the subtree dead even once the registration arrives.\n * Registering here also keeps the features layer from importing the presentation layer.\n */\n AssumePermissionsPresenterFeature.register(container);\n // The Layout renders the banner bar, so its presenter has to exist before the Layout mounts.\n BannersPresenterFeature.register(container);\n /*\n * Here rather than in the config tree for two reasons: the response handler has to exist\n * before the first GraphQL request, and the Layout renders the header indicator, so its\n * presenter has to exist before the Layout mounts.\n */\n DebuggerFeature.register(container);\n DebuggerPresenterFeature.register(container);\n DateFormatterFeature.register(container);\n StringFormatterFeature.register(container);\n FormModelFeature.register(container);\n WebinySdkFeature.register(container);\n ListPresenterFeature.register(container);\n ListCustomIconsFeature.register(container);\n CustomIconsPresenterFeature.register(container);\n AiChatsFeature.register(container);\n AssistantPageContextFeature.register(container);\n AssistantClientToolsFeature.register(container);\n AssistantComposerControlsFeature.register(container);\n AdminAssistantFeature.register(container);\n AiChatsPanelFeature.register(container);\n CommandPaletteFeature.register(container);\n AdminCommandsFeature.register(container);\n SortableFeature.register(container);\n /*\n * Here because the install wizard's admin step needs it, and the wizard renders before any\n * identity provider extension is mounted. The user forms and the login screens use it too.\n */\n const passwordPolicyRules = readPasswordPolicyRules();\n PasswordPolicyFeature.register(container, passwordPolicyRules);\n\n const UIProviders = createUiProviders();\n const UiStateProvider = createUiStateProvider();\n const AdminUiStateProvider = createAdminUiStateProvider();\n const DialogsProvider = createDialogsProvider();\n const DrawersProvider = createDrawersProvider();\n const TenancyProvider = createTenancyProvider();\n\n return (\n <DiContainerProvider container={container}>\n <TelemetryAdminAppStart />\n <FeatureFlagsProvider>\n <App\n plugins={[AdminConfigPlugin]}\n routes={[]}\n providers={[\n AdminConfigProvider,\n UIProviders,\n UiStateProvider,\n DialogsProvider,\n DrawersProvider,\n IconPickerConfigProvider,\n AdminUiStateProvider,\n TenancyProvider\n ]}\n >\n <Base />\n <DefaultIcons />\n <NotificationsRenderer />\n {children}\n </App>\n </FeatureFlagsProvider>\n </DiContainerProvider>\n );\n};\n"],"names":["container","createRootContainer","Admin","children","createLegacyPlugins","plugins","SecurityFeature","AssumePermissionsFeature","AssumePermissionsPresenterFeature","BannersPresenterFeature","DebuggerFeature","DebuggerPresenterFeature","DateFormatterFeature","StringFormatterFeature","FormModelFeature","WebinySdkFeature","ListPresenterFeature","ListCustomIconsFeature","CustomIconsPresenterFeature","AiChatsFeature","AssistantPageContextFeature","AssistantClientToolsFeature","AssistantComposerControlsFeature","AdminAssistantFeature","AiChatsPanelFeature","CommandPaletteFeature","AdminCommandsFeature","SortableFeature","passwordPolicyRules","readPasswordPolicyRules","PasswordPolicyFeature","UIProviders","createUiProviders","UiStateProvider","createUiStateProvider","AdminUiStateProvider","createAdminUiStateProvider","DialogsProvider","createDialogsProvider","DrawersProvider","createDrawersProvider","TenancyProvider","createTenancyProvider","DiContainerProvider","TelemetryAdminAppStart","FeatureFlagsProvider","App","AdminConfigPlugin","AdminConfigProvider","IconPickerConfigProvider","Base","DefaultIcons","NotificationsRenderer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,MAAMA,YAAYC;AAEX,MAAMC,QAAQ,CAAC,EAAEC,QAAQ,EAAEC,mBAAmB,EAAc;IAC/D,IAAIA,qBACAC,QAAQ,QAAQ,IAAID,oBAAoBJ;IAG5CM,gBAAgB,QAAQ,CAACN;IAEzBO,yBAAyB,QAAQ,CAACP;IAOlCQ,kCAAkC,QAAQ,CAACR;IAE3CS,wBAAwB,QAAQ,CAACT;IAMjCU,gBAAgB,QAAQ,CAACV;IACzBW,yBAAyB,QAAQ,CAACX;IAClCY,qBAAqB,QAAQ,CAACZ;IAC9Ba,uBAAuB,QAAQ,CAACb;IAChCc,iBAAiB,QAAQ,CAACd;IAC1Be,iBAAiB,QAAQ,CAACf;IAC1BgB,qBAAqB,QAAQ,CAAChB;IAC9BiB,uBAAuB,QAAQ,CAACjB;IAChCkB,4BAA4B,QAAQ,CAAClB;IACrCmB,eAAe,QAAQ,CAACnB;IACxBoB,4BAA4B,QAAQ,CAACpB;IACrCqB,4BAA4B,QAAQ,CAACrB;IACrCsB,iCAAiC,QAAQ,CAACtB;IAC1CuB,sBAAsB,QAAQ,CAACvB;IAC/BwB,oBAAoB,QAAQ,CAACxB;IAC7ByB,sBAAsB,QAAQ,CAACzB;IAC/B0B,qBAAqB,QAAQ,CAAC1B;IAC9B2B,gBAAgB,QAAQ,CAAC3B;IAKzB,MAAM4B,sBAAsBC;IAC5BC,sBAAsB,QAAQ,CAAC9B,WAAW4B;IAE1C,MAAMG,cAAcC;IACpB,MAAMC,kBAAkBC;IACxB,MAAMC,uBAAuBC;IAC7B,MAAMC,kBAAkBC;IACxB,MAAMC,kBAAkBC;IACxB,MAAMC,kBAAkBC;IAExB,OAAO,WAAP,GACI,oBAACC,qBAAmBA;QAAC,WAAW3C;qBAC5B,oBAAC4C,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,sBAAoBA,MAAAA,WAAAA,GACjB,oBAACC,KAAGA;QACA,SAAS;YAACC;SAAkB;QAC5B,QAAQ,EAAE;QACV,WAAW;YACPC;YACAjB;YACAE;YACAI;YACAE;YACAU;YACAd;YACAM;SACH;qBAED,oBAACS,MAAIA,OAAAA,WAAAA,GACL,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,uBAAqBA,OACrBjD;AAKrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { Button, FormComponentDescription, FormComponentLabel, IconButton } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport type { IObjectFieldItemVM } from \"~/features/formModel/index.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n keyValueTags: {\n fieldType: \"object\";\n settings?: { addItemLabel?: string };\n };\n }\n}\n\nexport const KeyValueTagsRenderer = createObjectFieldRenderer(({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n return <KeyValueTagsList field={field} />;\n});\n\nconst KeyValueTagsList = createObjectFieldRenderer<\"keyValueTags\">(({ field }) => {\n const settings = field.rendererSettings;\n\n const hasItems = field.items.length > 0;\n\n return (\n <>\n {field.label && <FormComponentLabel text={field.label} hint={field.help} />}\n {field.description && <FormComponentDescription text={field.description} />}\n {hasItems ? (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map(item => (\n <TagRow key={item.key} item={item} disabled={field.disabled} />\n ))}\n </div>\n ) : null}\n {!field.disabled ? (\n <div className={\"mt-md\"}>\n <Button\n onClick={() => field.addItem()}\n text={settings?.addItemLabel ?? \"Add tag\"}\n variant={\"secondary\"}\n size={\"sm\"}\n icon={<AddIcon />}\n />\n </div>\n ) : null}\n </>\n );\n});\n\nconst TagRow = observer(({ item, disabled }: { item: IObjectFieldItemVM; disabled: boolean }) => {\n const inlineLayout = [{ type: \"row\" as const, fields: item.fields }];\n\n return (\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"flex-1 gap-md\"}>\n <NestedLayout layout={inlineLayout} />\n </div>\n {!disabled && (\n <IconButton\n variant={\"ghost\"}\n size={\"lg\"}\n icon={<DeleteIcon />}\n onClick={() => item.remove()}\n />\n )}\n </div>\n );\n});\n"],"names":["KeyValueTagsRenderer","createObjectFieldRenderer","field","KeyValueTagsList","settings","hasItems","FormComponentLabel","FormComponentDescription","item","TagRow","Button","AddIcon","observer","disabled","inlineLayout","NestedLayout","IconButton","DeleteIcon"],"mappings":";;;;;;;AAkBO,MAAMA,uBAAuBC,0BAA0B,CAAC,EAAEC,KAAK,EAAE;IACpE,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACC,
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/KeyValueTagsRenderer.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { Button, FormComponentDescription, FormComponentLabel, IconButton } from \"@webiny/admin-ui\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport type { IObjectFieldItemVM } from \"~/features/formModel/index.js\";\nimport { NestedLayout } from \"./ObjectFieldComponents.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n keyValueTags: {\n fieldType: \"object\";\n settings?: { addItemLabel?: string };\n };\n }\n}\n\nexport const KeyValueTagsRenderer = createObjectFieldRenderer(({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n return <KeyValueTagsList field={field} />;\n});\n\nconst KeyValueTagsList = createObjectFieldRenderer<\"keyValueTags\">(({ field }) => {\n const settings = field.rendererSettings;\n\n const hasItems = field.items.length > 0;\n\n return (\n <>\n {field.label && <FormComponentLabel text={field.label} hint={field.help} />}\n {field.description && <FormComponentDescription text={field.description} />}\n {hasItems ? (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map(item => (\n <TagRow key={item.key} item={item} disabled={field.disabled} />\n ))}\n </div>\n ) : null}\n {!field.disabled ? (\n <div className={\"mt-md\"}>\n <Button\n onClick={() => field.addItem()}\n text={settings?.addItemLabel ?? \"Add tag\"}\n variant={\"secondary\"}\n size={\"sm\"}\n icon={<AddIcon />}\n />\n </div>\n ) : null}\n </>\n );\n});\n\nconst TagRow = observer(({ item, disabled }: { item: IObjectFieldItemVM; disabled: boolean }) => {\n const inlineLayout = [{ type: \"row\" as const, fields: item.fields }];\n\n return (\n <div className={\"flex items-center gap-sm\"}>\n <div className={\"flex-1 gap-md\"}>\n <NestedLayout layout={inlineLayout} />\n </div>\n {!disabled && (\n <IconButton\n variant={\"ghost\"}\n size={\"lg\"}\n icon={<DeleteIcon />}\n onClick={() => item.remove()}\n />\n )}\n </div>\n );\n});\n"],"names":["KeyValueTagsRenderer","createObjectFieldRenderer","field","KeyValueTagsList","settings","hasItems","FormComponentLabel","FormComponentDescription","item","TagRow","Button","AddIcon","observer","disabled","inlineLayout","NestedLayout","IconButton","DeleteIcon"],"mappings":";;;;;;;AAkBO,MAAMA,uBAAuBC,0BAA0B,CAAC,EAAEC,KAAK,EAAE;IACpE,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAGX,OAAO,WAAP,GAAO,oBAACC,kBAAAA;QAAiB,OAAOD;;AACpC;AAEA,MAAMC,mBAAmBF,0BAA0C,CAAC,EAAEC,KAAK,EAAE;IACzE,MAAME,WAAWF,MAAM,gBAAgB;IAEvC,MAAMG,WAAWH,MAAM,KAAK,CAAC,MAAM,GAAG;IAEtC,OAAO,WAAP,GACI,0CACKA,MAAM,KAAK,IAAI,WAAJ,GAAI,oBAACI,oBAAkBA;QAAC,MAAMJ,MAAM,KAAK;QAAE,MAAMA,MAAM,IAAI;QACtEA,MAAM,WAAW,IAAI,WAAJ,GAAI,oBAACK,0BAAwBA;QAAC,MAAML,MAAM,WAAW;QACtEG,WAAW,WAAXA,GACG,oBAAC;QAAI,WAAW;OACXH,MAAM,KAAK,CAAC,GAAG,CAACM,CAAAA,OAAAA,WAAAA,GACb,oBAACC,QAAAA;YAAO,KAAKD,KAAK,GAAG;YAAE,MAAMA;YAAM,UAAUN,MAAM,QAAQ;eAGnE,MACH,AAACA,MAAM,QAAQ,GAUZ,OAVe,WAAH,GACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACQ,QAAMA;QACH,SAAS,IAAMR,MAAM,OAAO;QAC5B,MAAME,UAAU,gBAAgB;QAChC,SAAS;QACT,MAAM;QACN,oBAAM,oBAACO,gBAAOA;;AAMtC;AAEA,MAAMF,SAASG,SAAS,CAAC,EAAEJ,IAAI,EAAEK,QAAQ,EAAmD;IACxF,MAAMC,eAAe;QAAC;YAAE,MAAM;YAAgB,QAAQN,KAAK,MAAM;QAAC;KAAE;IAEpE,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACO,cAAYA;QAAC,QAAQD;SAEzB,CAACD,YAAY,WAAZA,GACE,oBAACG,YAAUA;QACP,SAAS;QACT,MAAM;QACN,oBAAM,oBAACC,2BAAUA;QACjB,SAAS,IAAMT,KAAK,MAAM;;AAK9C"}
|
package/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js","sources":["../../../../../../src/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, Tooltip, useToast } from \"@webiny/admin-ui\";\nimport { useFeature, useContainer } from \"@webiny/app\";\nimport { hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\nimport { ReactComponent as CopyIcon } from \"@webiny/icons/content_copy.svg\";\nimport { ReactComponent as PasteIcon } from \"@webiny/icons/content_paste.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as CloneIcon } from \"@webiny/icons/library_add.svg\";\nimport { ReactComponent as ArrowUpIcon } from \"@webiny/icons/expand_less.svg\";\nimport { ReactComponent as ArrowDownIcon } from \"@webiny/icons/expand_more.svg\";\nimport { ReactComponent as HorizontalRuleIcon } from \"@webiny/icons/horizontal_rule.svg\";\nimport type { IObjectFieldItemVM, IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { TEMPLATE_DISCRIMINATOR } from \"~/features/formModel/ObjectField.js\";\nimport { ClipboardFeature } from \"~/features/clipboard/feature.js\";\nimport { useConfirmationDialog } from \"~/hooks/useConfirmationDialog.js\";\nimport { NestedLayout } from \"../ObjectFieldComponents.js\";\nimport { AddTemplateButton } from \"../TemplatePicker/index.js\";\nimport {\n MultiValueDynamicZonePresenter,\n type IMultiValueDynamicZonePresenter\n} from \"./abstractions.js\";\nimport type { ISortableItemProps } from \"~/presentation/sortable/index.js\";\nimport { Separator } from \"@webiny/admin-ui\";\n\ninterface MultiValueDynamicZoneProps {\n field: IObjectFieldVM;\n addItemLabel: string;\n showContainer?: boolean;\n}\n\nexport const MultiValueDynamicZone = observer(\n ({ field, addItemLabel, showContainer = true }: MultiValueDynamicZoneProps) => {\n const toast = useToast();\n const { clipboard } = useFeature(ClipboardFeature);\n const container = useContainer();\n\n const presenter = useMemo<IMultiValueDynamicZonePresenter>(() => {\n const p = container.resolve(MultiValueDynamicZonePresenter);\n p.init({ type: `dz:${field.name}`, onReorder: (from, to) => field.moveItem(from, to) });\n return p;\n }, []);\n\n useEffect(() => {\n return () => presenter.dispose();\n }, [presenter]);\n\n // Force the DZ list container open when a focus request lands anywhere\n // in its subtree, so \"jump to field\" can cascade through collapsed levels.\n const focusInside = hasSubtreeFocusRequest(field.items.flatMap(i => i.fields));\n const [containerOpen, setContainerOpen] = useState(true);\n useEffect(() => {\n if (focusInside) {\n setContainerOpen(true);\n }\n }, [focusInside]);\n\n const itemCount = field.items.length;\n\n const clipboardItem = clipboard.item;\n const canPaste =\n clipboardItem !== null &&\n clipboardItem.type === \"wby.dz\" &&\n typeof clipboardItem.data[TEMPLATE_DISCRIMINATOR] === \"string\" &&\n field.availableTemplates.some(t => t.id === clipboardItem.data[TEMPLATE_DISCRIMINATOR]);\n\n const content = (\n <div className={\"flex flex-col gap-lg\"}>\n {itemCount > 0 ? (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n className={\"gap-md flex flex-col\"}\n >\n {field.items.map((item, index) => (\n <TemplatedListItem\n key={item.key}\n item={item}\n index={index}\n total={itemCount}\n templates={field.availableTemplates}\n disabled={field.disabled}\n sortable={presenter.getItemProps(index)}\n />\n ))}\n </Accordion>\n ) : null}\n {!field.disabled && (\n <div className={\"flex gap-sm items-center\"}>\n <AddTemplateButton\n label={addItemLabel}\n templates={field.availableTemplates}\n onSelect={template => field.addItem(template.id)}\n />\n {canPaste && (\n <Button\n size={\"sm\"}\n variant={\"tertiary\"}\n text={\"Paste\"}\n icon={<PasteIcon />}\n onClick={() => {\n const pasted = clipboard.paste();\n if (pasted) {\n field.addItem(pasted.data);\n toast.showSuccessToast({\n title: \"Pasted from clipboard.\"\n });\n }\n }}\n />\n )}\n </div>\n )}\n </div>\n );\n\n if (!showContainer) {\n return (\n <>\n <Separator labelPosition={\"start\"} variant={\"accent\"}>\n <span className={\"text-accent-primary text-lg font-semibold\"}>\n {field.label ?? \"\"} ({itemCount})\n </span>\n </Separator>\n <div className={\"mt-md\"}>{content}</div>\n </>\n );\n }\n\n const label = `${field.label || \"\"}${itemCount ? ` (${itemCount})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n icon={\n <Accordion.Item.Icon\n color={\"accent\"}\n label={\"Dynamic Zone\"}\n icon={<HorizontalRuleIcon />}\n />\n }\n title={label}\n open={containerOpen}\n onOpenChange={setContainerOpen}\n >\n {content}\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface TemplatedListItemProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n templates: { id: string; label: string }[];\n disabled: boolean;\n sortable: ISortableItemProps;\n}\n\nconst TemplatedListItem = observer(\n ({ item, index, total, templates, disabled, sortable }: TemplatedListItemProps) => {\n const toast = useToast();\n const { clipboard } = useFeature(ClipboardFeature);\n const { showConfirmation } = useConfirmationDialog({\n title: \"Delete item\",\n message: \"Are you sure you want to delete this item? This action is not reversible.\",\n acceptLabel: \"Yes, I'm sure!\",\n cancelLabel: \"No, leave it.\"\n });\n\n const template = templates.find(t => t.id === item.templateId);\n const title = template?.label || `Item #${index + 1}`;\n\n // Force this item open when a focus request lands anywhere in its subtree.\n const focusInside = hasSubtreeFocusRequest(item.fields);\n const [open, setOpen] = useState(false);\n useEffect(() => {\n if (focusInside) {\n setOpen(true);\n }\n }, [focusInside]);\n\n const onDelete = () => {\n showConfirmation(() => {\n item.remove();\n });\n };\n\n const actions = (\n <>\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowUpIcon />} content={\"Move up\"} />}\n onClick={item.moveUp}\n disabled={index === 0}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowDownIcon />} content={\"Move down\"} />}\n onClick={item.moveDown}\n disabled={index === total - 1}\n />\n <Accordion.Item.Action.Separator />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CopyIcon />} content={\"Copy to clipboard\"} />}\n onClick={() => {\n clipboard.copy({ type: \"wby.dz\", data: item.getClonedData() });\n toast.showSuccessToast({ title: \"Copied to clipboard.\" });\n }}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CloneIcon />} content={\"Duplicate\"} />}\n onClick={item.duplicate}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<DeleteIcon />} content={\"Delete\"} />}\n onClick={onDelete}\n />\n </>\n );\n\n return (\n <div\n ref={sortable.ref}\n data-sortable-item=\"\"\n className={\"relative\"}\n style={{ opacity: sortable.isDragging ? 0.4 : 1 }}\n >\n {sortable.closestEdge === \"top\" && (\n <DropIndicator position={\"top\"} isFirst={index === 0} />\n )}\n <Accordion.Item\n title={title}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n draggable={!disabled}\n dragHandleRef={sortable.handleRef}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n {sortable.closestEdge === \"bottom\" && (\n <DropIndicator position={\"bottom\"} isLast={index === total - 1} />\n )}\n </div>\n );\n }\n);\n\nconst DropIndicator = ({\n position,\n isFirst = false,\n isLast = false\n}: {\n position: \"top\" | \"bottom\";\n isFirst?: boolean;\n isLast?: boolean;\n}) => {\n let offset = \"calc(var(--spacing-md) / -2)\";\n if (position === \"top\" && isFirst) {\n offset = \"0px\";\n }\n if (position === \"bottom\" && isLast) {\n offset = \"0px\";\n }\n\n return (\n <div\n className={\"absolute left-0 right-0 z-10\"}\n style={{\n [position]: offset,\n transform: position === \"top\" ? \"translateY(-50%)\" : \"translateY(50%)\"\n }}\n >\n <div className={\"w-full h-[2px] bg-primary rounded-full\"} />\n </div>\n );\n};\n"],"names":["MultiValueDynamicZone","observer","field","addItemLabel","showContainer","toast","useToast","clipboard","useFeature","ClipboardFeature","container","useContainer","presenter","useMemo","p","MultiValueDynamicZonePresenter","from","to","useEffect","focusInside","hasSubtreeFocusRequest","i","containerOpen","setContainerOpen","useState","itemCount","clipboardItem","canPaste","TEMPLATE_DISCRIMINATOR","t","content","Accordion","item","index","TemplatedListItem","AddTemplateButton","template","Button","PasteIcon","pasted","Separator","label","HorizontalRuleIcon","total","templates","disabled","sortable","showConfirmation","useConfirmationDialog","title","open","setOpen","onDelete","actions","Tooltip","ArrowUpIcon","ArrowDownIcon","CopyIcon","CloneIcon","DeleteIcon","DropIndicator","NestedLayout","position","isFirst","isLast","offset"],"mappings":";;;;;;;;;;;;;;;;;;AA+BO,MAAMA,wBAAwBC,SACjC,CAAC,EAAEC,KAAK,EAAEC,YAAY,EAAEC,gBAAgB,IAAI,EAA8B;IACtE,MAAMC,QAAQC;IACd,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAWC;IACjC,MAAMC,YAAYC;IAElB,MAAMC,YAAYC,QAAyC;QACvD,MAAMC,IAAIJ,UAAU,OAAO,CAACK;QAC5BD,EAAE,IAAI,CAAC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B,OAAO,WAAP,GACI,oBAAC;QACG,KAAKN,SAAS,GAAG;QACjB,sBAAmB;QACnB,WAAW;QACX,OAAO;YAAE,SAASA,SAAS,UAAU,GAAG,MAAM;QAAE;OAE/CA,AAAyB,UAAzBA,SAAS,WAAW,IAAc,WAAT,GACtB,oBAACc,eAAaA;QAAC,UAAU;QAAO,SAAS3B,AAAU,MAAVA;sBAE7C,oBAACF,UAAU,IAAI;QACX,OAAOkB;QACP,SAASJ,WAAW,OAAOQ;QAC3B,MAAMH;QACN,cAAcC;QACd,WAAW,CAACN;QACZ,eAAeC,SAAS,SAAS;qBAEjC,oBAACe,cAAYA;QAAC,QAAQ7B,KAAK,MAAM;SAEpCc,AAAyB,aAAzBA,SAAS,WAAW,IAAiB,WAAZ,GACtB,oBAACc,eAAaA;QAAC,UAAU;QAAU,QAAQ3B,UAAUU,QAAQ;;AAI7E;AAGJ,MAAMiB,gBAAgB,CAAC,EACnBE,QAAQ,EACRC,UAAU,KAAK,EACfC,SAAS,KAAK,EAKjB;IACG,IAAIC,SAAS;IACb,IAAIH,AAAa,UAAbA,YAAsBC,SACtBE,SAAS;IAEb,IAAIH,AAAa,aAAbA,YAAyBE,QACzBC,SAAS;IAGb,OAAO,WAAP,GACI,oBAAC;QACG,WAAW;QACX,OAAO;YACH,CAACH,SAAS,EAAEG;YACZ,WAAWH,AAAa,UAAbA,WAAqB,qBAAqB;QACzD;qBAEA,oBAAC;QAAI,WAAW;;AAG5B"}
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.js","sources":["../../../../../../src/base/Base/FieldRenderers/ObjectRenderer/MultiValueDynamicZone/MultiValueDynamicZone.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, Tooltip, useToast } from \"@webiny/admin-ui\";\nimport { useFeature, useContainer } from \"@webiny/app\";\nimport { hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\nimport { ReactComponent as CopyIcon } from \"@webiny/icons/content_copy.svg\";\nimport { ReactComponent as PasteIcon } from \"@webiny/icons/content_paste.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as CloneIcon } from \"@webiny/icons/library_add.svg\";\nimport { ReactComponent as ArrowUpIcon } from \"@webiny/icons/expand_less.svg\";\nimport { ReactComponent as ArrowDownIcon } from \"@webiny/icons/expand_more.svg\";\nimport { ReactComponent as HorizontalRuleIcon } from \"@webiny/icons/horizontal_rule.svg\";\nimport type { IObjectFieldItemVM, IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { TEMPLATE_DISCRIMINATOR } from \"~/features/formModel/ObjectField.js\";\nimport { ClipboardFeature } from \"~/features/clipboard/feature.js\";\nimport { useConfirmationDialog } from \"~/hooks/useConfirmationDialog.js\";\nimport { NestedLayout } from \"../ObjectFieldComponents.js\";\nimport { AddTemplateButton } from \"../TemplatePicker/index.js\";\nimport {\n MultiValueDynamicZonePresenter,\n type IMultiValueDynamicZonePresenter\n} from \"./abstractions.js\";\nimport type { ISortableItemProps } from \"~/presentation/sortable/index.js\";\nimport { Separator } from \"@webiny/admin-ui\";\n\ninterface MultiValueDynamicZoneProps {\n field: IObjectFieldVM;\n addItemLabel: string;\n showContainer?: boolean;\n}\n\nexport const MultiValueDynamicZone = observer(\n ({ field, addItemLabel, showContainer = true }: MultiValueDynamicZoneProps) => {\n const toast = useToast();\n const { clipboard } = useFeature(ClipboardFeature);\n const container = useContainer();\n\n const presenter = useMemo<IMultiValueDynamicZonePresenter>(() => {\n const p = container.resolve(MultiValueDynamicZonePresenter);\n p.init({ type: `dz:${field.name}`, onReorder: (from, to) => field.moveItem(from, to) });\n return p;\n }, []);\n\n useEffect(() => {\n return () => presenter.dispose();\n }, [presenter]);\n\n // Force the DZ list container open when a focus request lands anywhere\n // in its subtree, so \"jump to field\" can cascade through collapsed levels.\n const focusInside = hasSubtreeFocusRequest(field.items.flatMap(i => i.fields));\n const [containerOpen, setContainerOpen] = useState(true);\n useEffect(() => {\n if (focusInside) {\n setContainerOpen(true);\n }\n }, [focusInside]);\n\n const itemCount = field.items.length;\n\n const clipboardItem = clipboard.item;\n const canPaste =\n clipboardItem !== null &&\n clipboardItem.type === \"wby.dz\" &&\n typeof clipboardItem.data[TEMPLATE_DISCRIMINATOR] === \"string\" &&\n field.availableTemplates.some(t => t.id === clipboardItem.data[TEMPLATE_DISCRIMINATOR]);\n\n const content = (\n <div className={\"flex flex-col gap-lg\"}>\n {itemCount > 0 ? (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n className={\"gap-md flex flex-col\"}\n >\n {field.items.map((item, index) => (\n <TemplatedListItem\n key={item.key}\n item={item}\n index={index}\n total={itemCount}\n templates={field.availableTemplates}\n disabled={field.disabled}\n sortable={presenter.getItemProps(index)}\n />\n ))}\n </Accordion>\n ) : null}\n {!field.disabled && (\n <div className={\"flex gap-sm items-center\"}>\n <AddTemplateButton\n label={addItemLabel}\n templates={field.availableTemplates}\n onSelect={template => field.addItem(template.id)}\n />\n {canPaste && (\n <Button\n size={\"sm\"}\n variant={\"tertiary\"}\n text={\"Paste\"}\n icon={<PasteIcon />}\n onClick={() => {\n const pasted = clipboard.paste();\n if (pasted) {\n field.addItem(pasted.data);\n toast.showSuccessToast({\n title: \"Pasted from clipboard.\"\n });\n }\n }}\n />\n )}\n </div>\n )}\n </div>\n );\n\n if (!showContainer) {\n return (\n <>\n <Separator labelPosition={\"start\"} variant={\"accent\"}>\n <span className={\"text-accent-primary text-lg font-semibold\"}>\n {field.label ?? \"\"} ({itemCount})\n </span>\n </Separator>\n <div className={\"mt-md\"}>{content}</div>\n </>\n );\n }\n\n const label = `${field.label || \"\"}${itemCount ? ` (${itemCount})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n icon={\n <Accordion.Item.Icon\n color={\"accent\"}\n label={\"Dynamic Zone\"}\n icon={<HorizontalRuleIcon />}\n />\n }\n title={label}\n open={containerOpen}\n onOpenChange={setContainerOpen}\n >\n {content}\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface TemplatedListItemProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n templates: { id: string; label: string }[];\n disabled: boolean;\n sortable: ISortableItemProps;\n}\n\nconst TemplatedListItem = observer(\n ({ item, index, total, templates, disabled, sortable }: TemplatedListItemProps) => {\n const toast = useToast();\n const { clipboard } = useFeature(ClipboardFeature);\n const { showConfirmation } = useConfirmationDialog({\n title: \"Delete item\",\n message: \"Are you sure you want to delete this item? This action is not reversible.\",\n acceptLabel: \"Yes, I'm sure!\",\n cancelLabel: \"No, leave it.\"\n });\n\n const template = templates.find(t => t.id === item.templateId);\n const title = template?.label || `Item #${index + 1}`;\n\n // Force this item open when a focus request lands anywhere in its subtree.\n const focusInside = hasSubtreeFocusRequest(item.fields);\n const [open, setOpen] = useState(false);\n useEffect(() => {\n if (focusInside) {\n setOpen(true);\n }\n }, [focusInside]);\n\n const onDelete = () => {\n showConfirmation(() => {\n item.remove();\n });\n };\n\n const actions = (\n <>\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowUpIcon />} content={\"Move up\"} />}\n onClick={item.moveUp}\n disabled={index === 0}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<ArrowDownIcon />} content={\"Move down\"} />}\n onClick={item.moveDown}\n disabled={index === total - 1}\n />\n <Accordion.Item.Action.Separator />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CopyIcon />} content={\"Copy to clipboard\"} />}\n onClick={() => {\n clipboard.copy({ type: \"wby.dz\", data: item.getClonedData() });\n toast.showSuccessToast({ title: \"Copied to clipboard.\" });\n }}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<CloneIcon />} content={\"Duplicate\"} />}\n onClick={item.duplicate}\n />\n <Accordion.Item.Action\n icon={<Tooltip trigger={<DeleteIcon />} content={\"Delete\"} />}\n onClick={onDelete}\n />\n </>\n );\n\n return (\n <div\n ref={sortable.ref}\n data-sortable-item=\"\"\n className={\"relative\"}\n style={{ opacity: sortable.isDragging ? 0.4 : 1 }}\n >\n {sortable.closestEdge === \"top\" && (\n <DropIndicator position={\"top\"} isFirst={index === 0} />\n )}\n <Accordion.Item\n title={title}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n draggable={!disabled}\n dragHandleRef={sortable.handleRef}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n {sortable.closestEdge === \"bottom\" && (\n <DropIndicator position={\"bottom\"} isLast={index === total - 1} />\n )}\n </div>\n );\n }\n);\n\nconst DropIndicator = ({\n position,\n isFirst = false,\n isLast = false\n}: {\n position: \"top\" | \"bottom\";\n isFirst?: boolean;\n isLast?: boolean;\n}) => {\n let offset = \"calc(var(--spacing-md) / -2)\";\n if (position === \"top\" && isFirst) {\n offset = \"0px\";\n }\n if (position === \"bottom\" && isLast) {\n offset = \"0px\";\n }\n\n return (\n <div\n className={\"absolute left-0 right-0 z-10\"}\n style={{\n [position]: offset,\n transform: position === \"top\" ? \"translateY(-50%)\" : \"translateY(50%)\"\n }}\n >\n <div className={\"w-full h-[2px] bg-primary rounded-full\"} />\n </div>\n );\n};\n"],"names":["MultiValueDynamicZone","observer","field","addItemLabel","showContainer","toast","useToast","clipboard","useFeature","ClipboardFeature","container","useContainer","presenter","useMemo","p","MultiValueDynamicZonePresenter","from","to","useEffect","focusInside","hasSubtreeFocusRequest","i","containerOpen","setContainerOpen","useState","itemCount","clipboardItem","canPaste","TEMPLATE_DISCRIMINATOR","t","content","Accordion","item","index","TemplatedListItem","AddTemplateButton","template","Button","PasteIcon","pasted","Separator","label","HorizontalRuleIcon","total","templates","disabled","sortable","showConfirmation","useConfirmationDialog","title","open","setOpen","onDelete","actions","Tooltip","ArrowUpIcon","ArrowDownIcon","CopyIcon","CloneIcon","DeleteIcon","DropIndicator","NestedLayout","position","isFirst","isLast","offset"],"mappings":";;;;;;;;;;;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/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion } from \"@webiny/admin-ui\";\nimport { useContainer } from \"@webiny/app\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { ListItemRenderer, AddItemButton } from \"./ObjectFieldComponents.js\";\nimport { SortablePresenter } from \"~/presentation/sortable/index.js\";\nimport type { IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n container?: boolean;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?:\n | string\n | ((data: Record<string, unknown>, index: number) => string);\n addItemLabel?: string;\n };\n };\n }\n}\n\nexport const ObjectAccordionMultipleRenderer = createObjectFieldRenderer<\"objectAccordionMultiple\">(\n ({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n // Force the list container open when a focus request lands anywhere in\n // its subtree, so \"jump to field\" can cascade through collapsed levels.\n const focusInside = hasSubtreeFocusRequest(field.items.flatMap(i => i.fields));\n const [open, setOpen] = useState(true);\n useEffect(() => {\n if (focusInside) {\n setOpen(true);\n }\n }, [focusInside]);\n\n const settings = field.rendererSettings;\n const showContainer = settings?.container !== false;\n\n const addButton = (\n <AddItemButton\n label={settings?.addItemLabel ?? `Add ${field.label || \"Item\"}`}\n disabled={field.disabled}\n onAdd={() => field.addItem()}\n />\n );\n\n if (!showContainer) {\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n );\n }\n\n const label = `${field.label || \"\"} ${field.items.length ? `(${field.items.length})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n title={label}\n description={field.description}\n open={open}\n onOpenChange={setOpen}\n >\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface ListItemsProps {\n field: IObjectFieldVM;\n}\n\nconst ListItems = observer(({ field }: ListItemsProps) => {\n const settings = field.rendererSettings as\n | {\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?: string | ((data: Record<string, unknown>, index: number) => string);\n }\n | undefined;\n\n const container = useContainer();\n const sortable = useMemo(() => {\n const p = container.resolve(SortablePresenter);\n p.init({ type: `obj:${field.name}`, onReorder: (from, to) => field.moveItem(from, to) });\n return p;\n }, []);\n\n useEffect(() => {\n return () => sortable.dispose();\n }, [sortable]);\n\n return (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map((item, index) => (\n <ListItemRenderer\n key={item.key}\n item={item}\n index={index}\n total={field.items.length}\n label={field.label}\n itemTitle={settings?.itemTitle}\n itemDescription={settings?.itemDescription}\n disabled={field.disabled}\n sortable={sortable.getItemProps(index)}\n />\n ))}\n </div>\n );\n});\n"],"names":["ObjectAccordionMultipleRenderer","createObjectFieldRenderer","field","focusInside","hasSubtreeFocusRequest","i","open","setOpen","useState","useEffect","settings","showContainer","addButton","AddItemButton","ListItems","label","Accordion","observer","container","useContainer","sortable","useMemo","p","SortablePresenter","from","to","item","index","ListItemRenderer"],"mappings":";;;;;;;;AA2BO,MAAMA,kCAAkCC,0BAC3C,CAAC,EAAEC,KAAK,EAAE;IACN,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAKX,MAAMC,cAAcC,uBAAuBF,MAAM,KAAK,CAAC,OAAO,CAACG,CAAAA,IAAKA,EAAE,MAAM;IAC5E,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAS;IACjCC,UAAU;QACN,IAAIN,aACAI,QAAQ;IAEhB,GAAG;QAACJ;KAAY;IAEhB,MAAMO,WAAWR,MAAM,gBAAgB;IACvC,MAAMS,gBAAgBD,UAAU,cAAc;IAE9C,MAAME,YAAY,WAAZA,GACF,oBAACC,eAAaA;QACV,OAAOH,UAAU,gBAAgB,CAAC,IAAI,EAAER,MAAM,KAAK,IAAI,QAAQ;QAC/D,UAAUA,MAAM,QAAQ;QACxB,OAAO,IAAMA,MAAM,OAAO;;IAIlC,IAAI,CAACS,eACD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACG,
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectAccordionMultipleRenderer.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion } from \"@webiny/admin-ui\";\nimport { useContainer } from \"@webiny/app\";\nimport { createObjectFieldRenderer } from \"~/features/formModel/createFieldRenderer.js\";\nimport { ListItemRenderer, AddItemButton } from \"./ObjectFieldComponents.js\";\nimport { SortablePresenter } from \"~/presentation/sortable/index.js\";\nimport type { IObjectFieldVM } from \"~/features/formModel/index.js\";\nimport { hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\n\ndeclare module \"../../../../features/formModel/abstractions.js\" {\n interface IFieldRendererRegistry {\n objectAccordionMultiple: {\n fieldType: \"object\";\n settings?: {\n open?: boolean;\n container?: boolean;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?:\n | string\n | ((data: Record<string, unknown>, index: number) => string);\n addItemLabel?: string;\n };\n };\n }\n}\n\nexport const ObjectAccordionMultipleRenderer = createObjectFieldRenderer<\"objectAccordionMultiple\">(\n ({ field }) => {\n if (!field.isList) {\n return null;\n }\n\n // Force the list container open when a focus request lands anywhere in\n // its subtree, so \"jump to field\" can cascade through collapsed levels.\n const focusInside = hasSubtreeFocusRequest(field.items.flatMap(i => i.fields));\n const [open, setOpen] = useState(true);\n useEffect(() => {\n if (focusInside) {\n setOpen(true);\n }\n }, [focusInside]);\n\n const settings = field.rendererSettings;\n const showContainer = settings?.container !== false;\n\n const addButton = (\n <AddItemButton\n label={settings?.addItemLabel ?? `Add ${field.label || \"Item\"}`}\n disabled={field.disabled}\n onAdd={() => field.addItem()}\n />\n );\n\n if (!showContainer) {\n return (\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n );\n }\n\n const label = `${field.label || \"\"} ${field.items.length ? `(${field.items.length})` : \"\"}`;\n\n return (\n <Accordion background={\"base\"} variant={\"container\"}>\n <Accordion.Item\n title={label}\n description={field.description}\n open={open}\n onOpenChange={setOpen}\n >\n <div className={\"flex flex-col gap-lg\"}>\n <ListItems field={field} />\n {addButton}\n </div>\n </Accordion.Item>\n </Accordion>\n );\n }\n);\n\ninterface ListItemsProps {\n field: IObjectFieldVM;\n}\n\nconst ListItems = observer(({ field }: ListItemsProps) => {\n const settings = field.rendererSettings as\n | {\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?: string | ((data: Record<string, unknown>, index: number) => string);\n }\n | undefined;\n\n const container = useContainer();\n const sortable = useMemo(() => {\n const p = container.resolve(SortablePresenter);\n p.init({ type: `obj:${field.name}`, onReorder: (from, to) => field.moveItem(from, to) });\n return p;\n }, []);\n\n useEffect(() => {\n return () => sortable.dispose();\n }, [sortable]);\n\n return (\n <div className={\"flex flex-col gap-md\"}>\n {field.items.map((item, index) => (\n <ListItemRenderer\n key={item.key}\n item={item}\n index={index}\n total={field.items.length}\n label={field.label}\n itemTitle={settings?.itemTitle}\n itemDescription={settings?.itemDescription}\n disabled={field.disabled}\n sortable={sortable.getItemProps(index)}\n />\n ))}\n </div>\n );\n});\n"],"names":["ObjectAccordionMultipleRenderer","createObjectFieldRenderer","field","focusInside","hasSubtreeFocusRequest","i","open","setOpen","useState","useEffect","settings","showContainer","addButton","AddItemButton","ListItems","label","Accordion","observer","container","useContainer","sortable","useMemo","p","SortablePresenter","from","to","item","index","ListItemRenderer"],"mappings":";;;;;;;;AA2BO,MAAMA,kCAAkCC,0BAC3C,CAAC,EAAEC,KAAK,EAAE;IACN,IAAI,CAACA,MAAM,MAAM,EACb,OAAO;IAKX,MAAMC,cAAcC,uBAAuBF,MAAM,KAAK,CAAC,OAAO,CAACG,CAAAA,IAAKA,EAAE,MAAM;IAC5E,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAS;IACjCC,UAAU;QACN,IAAIN,aACAI,QAAQ;IAEhB,GAAG;QAACJ;KAAY;IAEhB,MAAMO,WAAWR,MAAM,gBAAgB;IACvC,MAAMS,gBAAgBD,UAAU,cAAc;IAE9C,MAAME,YAAY,WAAZA,GACF,oBAACC,eAAaA;QACV,OAAOH,UAAU,gBAAgB,CAAC,IAAI,EAAER,MAAM,KAAK,IAAI,QAAQ;QAC/D,UAAUA,MAAM,QAAQ;QACxB,OAAO,IAAMA,MAAM,OAAO;;IAIlC,IAAI,CAACS,eACD,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACG,WAAAA;QAAU,OAAOZ;QACjBU;IAKb,MAAMG,QAAQ,GAAGb,MAAM,KAAK,IAAI,GAAG,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,EAAEA,MAAM,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI;IAE3F,OAAO,WAAP,GACI,oBAACc,WAASA;QAAC,YAAY;QAAQ,SAAS;qBACpC,oBAACA,UAAU,IAAI;QACX,OAAOD;QACP,aAAab,MAAM,WAAW;QAC9B,MAAMI;QACN,cAAcC;qBAEd,oBAAC;QAAI,WAAW;qBACZ,oBAACO,WAAAA;QAAU,OAAOZ;QACjBU;AAKrB;AAOJ,MAAME,YAAYG,SAAS,CAAC,EAAEf,KAAK,EAAkB;IACjD,MAAMQ,WAAWR,MAAM,gBAAgB;IAOvC,MAAMgB,YAAYC;IAClB,MAAMC,WAAWC,QAAQ;QACrB,MAAMC,IAAIJ,UAAU,OAAO,CAACK;QAC5BD,EAAE,IAAI,CAAC;YAAE,MAAM,CAAC,IAAI,EAAEpB,MAAM,IAAI,EAAE;YAAE,WAAW,CAACsB,MAAMC,KAAOvB,MAAM,QAAQ,CAACsB,MAAMC;QAAI;QACtF,OAAOH;IACX,GAAG,EAAE;IAELb,UAAU,IACC,IAAMW,SAAS,OAAO,IAC9B;QAACA;KAAS;IAEb,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;OACXlB,MAAM,KAAK,CAAC,GAAG,CAAC,CAACwB,MAAMC,QAAAA,WAAAA,GACpB,oBAACC,kBAAgBA;YACb,KAAKF,KAAK,GAAG;YACb,MAAMA;YACN,OAAOC;YACP,OAAOzB,MAAM,KAAK,CAAC,MAAM;YACzB,OAAOA,MAAM,KAAK;YAClB,WAAWQ,UAAU;YACrB,iBAAiBA,UAAU;YAC3B,UAAUR,MAAM,QAAQ;YACxB,UAAUkB,SAAS,YAAY,CAACO;;AAKpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, IconButton } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as ArrowUp } from \"@webiny/icons/arrow_upward.svg\";\nimport { ReactComponent as ArrowDown } from \"@webiny/icons/arrow_downward.svg\";\nimport { useContainer } from \"@webiny/app\";\nimport type { IObjectFieldItemVM, LayoutNodeVM } from \"~/features/formModel/index.js\";\nimport { FieldValueFormatter, hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\nimport { LayoutNodeRenderer } from \"~/features/formModel/FormView.js\";\nimport { resolveItemTitle, resolveItemDescription } from \"./resolveItemTitle.js\";\nimport type { ISortableItemProps } from \"~/presentation/sortable/index.js\";\n\nexport const NestedLayout = observer(({ layout }: { layout: LayoutNodeVM[] }) => {\n return (\n <div className={\"flex flex-col gap-md\"}>\n {layout.map((node, index) => (\n <LayoutNodeRenderer key={index} node={node} />\n ))}\n </div>\n );\n});\n\nexport function useFieldValueFormatters(): FieldValueFormatter.Interface[] {\n const container = useContainer();\n return useMemo(() => container.resolveAll(FieldValueFormatter), [container]);\n}\n\nexport interface ListItemRendererProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n label?: string;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?: string | ((data: Record<string, unknown>, index: number) => string);\n disabled: boolean;\n sortable?: ISortableItemProps;\n}\n\nexport const ListItemRenderer = observer(\n ({\n item,\n index,\n total,\n label,\n itemTitle,\n itemDescription,\n disabled,\n sortable\n }: ListItemRendererProps) => {\n const [open, setOpen] = useState(false);\n const formatters = useFieldValueFormatters();\n const hasFocusRequest = hasSubtreeFocusRequest(item.fields);\n\n useEffect(() => {\n if (hasFocusRequest) {\n setOpen(true);\n }\n }, [hasFocusRequest]);\n\n const actions = (\n <>\n <IconButton\n icon={<ArrowDown />}\n onClick={e => {\n e.stopPropagation();\n item.moveDown();\n }}\n variant=\"ghost\"\n disabled={index === total - 1}\n />\n <IconButton\n icon={<ArrowUp />}\n onClick={e => {\n e.stopPropagation();\n item.moveUp();\n }}\n variant=\"ghost\"\n disabled={index === 0}\n />\n <Accordion.Item.Action.Separator />\n <IconButton\n icon={<DeleteIcon />}\n onClick={e => {\n e.stopPropagation();\n item.remove();\n }}\n variant=\"ghost\"\n />\n </>\n );\n\n const accordion = (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n openClosedIndicatorPosition={\"left\"}\n >\n <Accordion.Item\n title={resolveItemTitle(\n item.fields,\n index,\n `${label || \"Item\"} #${index + 1}`,\n itemTitle,\n formatters\n )}\n description={resolveItemDescription(\n item.fields,\n index,\n itemDescription,\n formatters\n )}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n draggable={!disabled && sortable !== undefined}\n dragHandleRef={sortable?.handleRef}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n </Accordion>\n );\n\n if (!sortable) {\n return accordion;\n }\n\n return (\n <div\n ref={sortable.ref}\n data-sortable-item=\"\"\n className={\"relative\"}\n style={{ opacity: sortable.isDragging ? 0.4 : 1 }}\n >\n {sortable.closestEdge === \"top\" && (\n <DropIndicator position={\"top\"} isFirst={index === 0} />\n )}\n {accordion}\n {sortable.closestEdge === \"bottom\" && (\n <DropIndicator position={\"bottom\"} isLast={index === total - 1} />\n )}\n </div>\n );\n }\n);\n\nconst DropIndicator = ({\n position,\n isFirst = false,\n isLast = false\n}: {\n position: \"top\" | \"bottom\";\n isFirst?: boolean;\n isLast?: boolean;\n}) => {\n let offset = \"calc(var(--spacing-md) / -2)\";\n if (position === \"top\" && isFirst) {\n offset = \"0px\";\n }\n if (position === \"bottom\" && isLast) {\n offset = \"0px\";\n }\n\n return (\n <div\n className={\"absolute left-0 right-0 z-10\"}\n style={{\n [position]: offset,\n transform: position === \"top\" ? \"translateY(-50%)\" : \"translateY(50%)\"\n }}\n >\n <div className={\"w-full h-[2px] bg-primary rounded-full\"} />\n </div>\n );\n};\n\nexport interface AddItemButtonProps {\n label?: string;\n disabled: boolean;\n onAdd: () => void;\n}\n\nexport const AddItemButton = ({ label, disabled, onAdd }: AddItemButtonProps) => {\n return (\n <div>\n <Button\n icon={<AddIcon />}\n text={label || \"Add Item\"}\n variant={\"tertiary\"}\n onClick={onAdd}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"names":["NestedLayout","observer","layout","node","index","LayoutNodeRenderer","useFieldValueFormatters","container","useContainer","useMemo","FieldValueFormatter","ListItemRenderer","item","total","label","itemTitle","itemDescription","disabled","sortable","open","setOpen","useState","formatters","hasFocusRequest","hasSubtreeFocusRequest","useEffect","actions","IconButton","ArrowDown","e","ArrowUp","Accordion","DeleteIcon","accordion","resolveItemTitle","resolveItemDescription","undefined","DropIndicator","position","isFirst","isLast","offset","AddItemButton","onAdd","Button","AddIcon"],"mappings":";;;;;;;;;;;AAcO,MAAMA,eAAeC,SAAS,CAAC,EAAEC,MAAM,EAA8B,GACjE,WAAP,GACI,oBAAC;QAAI,WAAW;OACXA,OAAO,GAAG,CAAC,CAACC,MAAMC,QAAAA,WAAAA,GACf,oBAACC,oBAAkBA;YAAC,KAAKD;YAAO,MAAMD;;AAM/C,SAASG;IACZ,MAAMC,YAAYC;IAClB,OAAOC,QAAQ,IAAMF,UAAU,UAAU,CAACG,sBAAsB;QAACH;KAAU;AAC/E;AAaO,MAAMI,mBAAmBV,SAC5B,CAAC,EACGW,IAAI,EACJR,KAAK,EACLS,KAAK,EACLC,KAAK,EACLC,SAAS,EACTC,eAAe,EACfC,QAAQ,EACRC,QAAQ,EACY;IACpB,MAAM,CAACC,MAAMC,QAAQ,GAAGC,SAAS;IACjC,MAAMC,aAAahB;IACnB,MAAMiB,kBAAkBC,uBAAuBZ,KAAK,MAAM;IAE1Da,UAAU;QACN,IAAIF,iBACAH,QAAQ;IAEhB,GAAG;QAACG;KAAgB;IAEpB,MAAMG,UAAU,WAAVA,GACF,wDACI,oBAACC,YAAUA;QACP,oBAAM,oBAACC,mCAASA;QAChB,SAASC,CAAAA;YACLA,EAAE,eAAe;YACjBjB,KAAK,QAAQ;QACjB;QACA,SAAQ;QACR,UAAUR,UAAUS,QAAQ;sBAEhC,oBAACc,YAAUA;QACP,oBAAM,oBAACG,iCAAOA;QACd,SAASD,CAAAA;YACLA,EAAE,eAAe;YACjBjB,KAAK,MAAM;QACf;QACA,SAAQ;QACR,UAAUR,AAAU,MAAVA;sBAEd,oBAAC2B,UAAU,IAAI,CAAC,MAAM,CAAC,SAAS,uBAChC,oBAACJ,YAAUA;QACP,oBAAM,oBAACK,mCAAUA;QACjB,SAASH,CAAAA;YACLA,EAAE,eAAe;YACjBjB,KAAK,MAAM;QACf;QACA,SAAQ;;IAKpB,MAAMqB,YAAY,WAAZA,GACF,oBAACF,WAASA;QACN,YAAY;QACZ,SAAS;QACT,6BAA6B;qBAE7B,oBAACA,UAAU,IAAI;QACX,OAAOG,iBACHtB,KAAK,MAAM,EACXR,OACA,GAAGU,SAAS,OAAO,EAAE,EAAEV,QAAQ,GAAG,EAClCW,WACAO;QAEJ,aAAaa,uBACTvB,KAAK,MAAM,EACXR,OACAY,iBACAM;QAEJ,SAASL,WAAW,OAAOS;QAC3B,MAAMP;QACN,cAAcC;QACd,WAAW,CAACH,YAAYC,AAAakB,WAAblB;QACxB,eAAeA,UAAU;qBAEzB,oBAAClB,
|
|
1
|
+
{"version":3,"file":"base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.js","sources":["../../../../../src/base/Base/FieldRenderers/ObjectRenderer/ObjectFieldComponents.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useState } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Accordion, Button, IconButton } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport { ReactComponent as ArrowUp } from \"@webiny/icons/arrow_upward.svg\";\nimport { ReactComponent as ArrowDown } from \"@webiny/icons/arrow_downward.svg\";\nimport { useContainer } from \"@webiny/app\";\nimport type { IObjectFieldItemVM, LayoutNodeVM } from \"~/features/formModel/index.js\";\nimport { FieldValueFormatter, hasSubtreeFocusRequest } from \"~/features/formModel/index.js\";\nimport { LayoutNodeRenderer } from \"~/features/formModel/FormView.js\";\nimport { resolveItemTitle, resolveItemDescription } from \"./resolveItemTitle.js\";\nimport type { ISortableItemProps } from \"~/presentation/sortable/index.js\";\n\nexport const NestedLayout = observer(({ layout }: { layout: LayoutNodeVM[] }) => {\n return (\n <div className={\"flex flex-col gap-md\"}>\n {layout.map((node, index) => (\n <LayoutNodeRenderer key={index} node={node} />\n ))}\n </div>\n );\n});\n\nexport function useFieldValueFormatters(): FieldValueFormatter.Interface[] {\n const container = useContainer();\n return useMemo(() => container.resolveAll(FieldValueFormatter), [container]);\n}\n\nexport interface ListItemRendererProps {\n item: IObjectFieldItemVM;\n index: number;\n total: number;\n label?: string;\n itemTitle?: string | ((data: Record<string, unknown>, index: number) => string);\n itemDescription?: string | ((data: Record<string, unknown>, index: number) => string);\n disabled: boolean;\n sortable?: ISortableItemProps;\n}\n\nexport const ListItemRenderer = observer(\n ({\n item,\n index,\n total,\n label,\n itemTitle,\n itemDescription,\n disabled,\n sortable\n }: ListItemRendererProps) => {\n const [open, setOpen] = useState(false);\n const formatters = useFieldValueFormatters();\n const hasFocusRequest = hasSubtreeFocusRequest(item.fields);\n\n useEffect(() => {\n if (hasFocusRequest) {\n setOpen(true);\n }\n }, [hasFocusRequest]);\n\n const actions = (\n <>\n <IconButton\n icon={<ArrowDown />}\n onClick={e => {\n e.stopPropagation();\n item.moveDown();\n }}\n variant=\"ghost\"\n disabled={index === total - 1}\n />\n <IconButton\n icon={<ArrowUp />}\n onClick={e => {\n e.stopPropagation();\n item.moveUp();\n }}\n variant=\"ghost\"\n disabled={index === 0}\n />\n <Accordion.Item.Action.Separator />\n <IconButton\n icon={<DeleteIcon />}\n onClick={e => {\n e.stopPropagation();\n item.remove();\n }}\n variant=\"ghost\"\n />\n </>\n );\n\n const accordion = (\n <Accordion\n background={\"base\"}\n variant={\"container\"}\n openClosedIndicatorPosition={\"left\"}\n >\n <Accordion.Item\n title={resolveItemTitle(\n item.fields,\n index,\n `${label || \"Item\"} #${index + 1}`,\n itemTitle,\n formatters\n )}\n description={resolveItemDescription(\n item.fields,\n index,\n itemDescription,\n formatters\n )}\n actions={disabled ? null : actions}\n open={open}\n onOpenChange={setOpen}\n draggable={!disabled && sortable !== undefined}\n dragHandleRef={sortable?.handleRef}\n >\n <NestedLayout layout={item.layout} />\n </Accordion.Item>\n </Accordion>\n );\n\n if (!sortable) {\n return accordion;\n }\n\n return (\n <div\n ref={sortable.ref}\n data-sortable-item=\"\"\n className={\"relative\"}\n style={{ opacity: sortable.isDragging ? 0.4 : 1 }}\n >\n {sortable.closestEdge === \"top\" && (\n <DropIndicator position={\"top\"} isFirst={index === 0} />\n )}\n {accordion}\n {sortable.closestEdge === \"bottom\" && (\n <DropIndicator position={\"bottom\"} isLast={index === total - 1} />\n )}\n </div>\n );\n }\n);\n\nconst DropIndicator = ({\n position,\n isFirst = false,\n isLast = false\n}: {\n position: \"top\" | \"bottom\";\n isFirst?: boolean;\n isLast?: boolean;\n}) => {\n let offset = \"calc(var(--spacing-md) / -2)\";\n if (position === \"top\" && isFirst) {\n offset = \"0px\";\n }\n if (position === \"bottom\" && isLast) {\n offset = \"0px\";\n }\n\n return (\n <div\n className={\"absolute left-0 right-0 z-10\"}\n style={{\n [position]: offset,\n transform: position === \"top\" ? \"translateY(-50%)\" : \"translateY(50%)\"\n }}\n >\n <div className={\"w-full h-[2px] bg-primary rounded-full\"} />\n </div>\n );\n};\n\nexport interface AddItemButtonProps {\n label?: string;\n disabled: boolean;\n onAdd: () => void;\n}\n\nexport const AddItemButton = ({ label, disabled, onAdd }: AddItemButtonProps) => {\n return (\n <div>\n <Button\n icon={<AddIcon />}\n text={label || \"Add Item\"}\n variant={\"tertiary\"}\n onClick={onAdd}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"names":["NestedLayout","observer","layout","node","index","LayoutNodeRenderer","useFieldValueFormatters","container","useContainer","useMemo","FieldValueFormatter","ListItemRenderer","item","total","label","itemTitle","itemDescription","disabled","sortable","open","setOpen","useState","formatters","hasFocusRequest","hasSubtreeFocusRequest","useEffect","actions","IconButton","ArrowDown","e","ArrowUp","Accordion","DeleteIcon","accordion","resolveItemTitle","resolveItemDescription","undefined","DropIndicator","position","isFirst","isLast","offset","AddItemButton","onAdd","Button","AddIcon"],"mappings":";;;;;;;;;;;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AOA;QACd,MAAM/B,SAAS;QACf,SAAS;QACT,SAAS6B;QACT,UAAU1B"}
|
|
@@ -4,7 +4,7 @@ import { FloatingLinkEditorPlugin } from "@webiny/lexical-editor";
|
|
|
4
4
|
import { AdminConfig } from "../../config/AdminConfig.js";
|
|
5
5
|
import { LexicalTheme } from "../../config/AdminConfig/LexicalTheme.js";
|
|
6
6
|
import { LexicalLinkForm } from "../../components/index.js";
|
|
7
|
-
const { Color
|
|
7
|
+
const { Color, Typography } = LexicalTheme;
|
|
8
8
|
const LexicalPreset = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Color, {
|
|
9
9
|
id: "color1",
|
|
10
10
|
label: "Primary color",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/LexicalPreset.js","sources":["../../../src/base/Base/LexicalPreset.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor/components/LexicalEditorConfig/LexicalEditorConfig.js\";\nimport { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { AdminConfig } from \"../../config/AdminConfig.js\";\nimport { LexicalTheme } from \"~/config/AdminConfig/LexicalTheme.js\";\nimport { LexicalLinkForm } from \"~/components/index.js\";\n\nconst { Color, Typography } = LexicalTheme;\n\nexport const LexicalPreset = () => {\n return (\n <>\n <AdminConfig>\n {/* Colors */}\n <Color id={\"color1\"} label=\"Primary color\" value={\"var(--wa-theme-color1)\"} />\n <Color id={\"color2\"} label=\"Secondary color\" value={\"var(--wa-theme-color2)\"} />\n <Color id={\"color3\"} label=\"Regular color\" value={\"var(--wa-theme-color3)\"} />\n {/* Typography */}\n <Typography.Heading\n id={\"heading1\"}\n label={\"Heading 1\"}\n tag={\"h1\"}\n className={\"wa-heading-1\"}\n />\n <Typography.Heading\n id={\"heading2\"}\n label={\"Heading 2\"}\n tag={\"h2\"}\n className={\"wa-heading-2\"}\n />\n <Typography.Heading\n id={\"heading3\"}\n label={\"Heading 3\"}\n tag={\"h3\"}\n className={\"wa-heading-3\"}\n />\n\n <Typography.Paragraph\n id={\"paragraph1\"}\n label={\"Paragraph\"}\n tag={\"p\"}\n className={\"wa-paragraph-1\"}\n />\n\n <Typography.Quote\n id={\"quote\"}\n label={\"Quote\"}\n tag={\"blockquote\"}\n className={\"wa-blockquote-1\"}\n />\n <Typography.List\n id={\"list1\"}\n label={\"Unordered list\"}\n tag={\"ul\"}\n className={\"wa-unordered-list-1\"}\n />\n <Typography.List\n id={\"list2\"}\n label={\"Ordered list\"}\n tag={\"ol\"}\n className={\"wa-ordered-list-1\"}\n />\n </AdminConfig>\n <LexicalEditorConfig>\n <LexicalEditorConfig.Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n </LexicalEditorConfig>\n </>\n );\n};\n"],"names":["Color","Typography","LexicalTheme","LexicalPreset","AdminConfig","LexicalEditorConfig","FloatingLinkEditorPlugin","LexicalLinkForm"],"mappings":";;;;;;AAOA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"base/Base/LexicalPreset.js","sources":["../../../src/base/Base/LexicalPreset.tsx"],"sourcesContent":["import React from \"react\";\nimport { LexicalEditorConfig } from \"@webiny/lexical-editor/components/LexicalEditorConfig/LexicalEditorConfig.js\";\nimport { FloatingLinkEditorPlugin } from \"@webiny/lexical-editor\";\nimport { AdminConfig } from \"../../config/AdminConfig.js\";\nimport { LexicalTheme } from \"~/config/AdminConfig/LexicalTheme.js\";\nimport { LexicalLinkForm } from \"~/components/index.js\";\n\nconst { Color, Typography } = LexicalTheme;\n\nexport const LexicalPreset = () => {\n return (\n <>\n <AdminConfig>\n {/* Colors */}\n <Color id={\"color1\"} label=\"Primary color\" value={\"var(--wa-theme-color1)\"} />\n <Color id={\"color2\"} label=\"Secondary color\" value={\"var(--wa-theme-color2)\"} />\n <Color id={\"color3\"} label=\"Regular color\" value={\"var(--wa-theme-color3)\"} />\n {/* Typography */}\n <Typography.Heading\n id={\"heading1\"}\n label={\"Heading 1\"}\n tag={\"h1\"}\n className={\"wa-heading-1\"}\n />\n <Typography.Heading\n id={\"heading2\"}\n label={\"Heading 2\"}\n tag={\"h2\"}\n className={\"wa-heading-2\"}\n />\n <Typography.Heading\n id={\"heading3\"}\n label={\"Heading 3\"}\n tag={\"h3\"}\n className={\"wa-heading-3\"}\n />\n\n <Typography.Paragraph\n id={\"paragraph1\"}\n label={\"Paragraph\"}\n tag={\"p\"}\n className={\"wa-paragraph-1\"}\n />\n\n <Typography.Quote\n id={\"quote\"}\n label={\"Quote\"}\n tag={\"blockquote\"}\n className={\"wa-blockquote-1\"}\n />\n <Typography.List\n id={\"list1\"}\n label={\"Unordered list\"}\n tag={\"ul\"}\n className={\"wa-unordered-list-1\"}\n />\n <Typography.List\n id={\"list2\"}\n label={\"Ordered list\"}\n tag={\"ol\"}\n className={\"wa-ordered-list-1\"}\n />\n </AdminConfig>\n <LexicalEditorConfig>\n <LexicalEditorConfig.Plugin\n name={\"floatingLinkEditor\"}\n element={<FloatingLinkEditorPlugin LinkForm={LexicalLinkForm} />}\n />\n </LexicalEditorConfig>\n </>\n );\n};\n"],"names":["Color","Typography","LexicalTheme","LexicalPreset","AdminConfig","LexicalEditorConfig","FloatingLinkEditorPlugin","LexicalLinkForm"],"mappings":";;;;;;AAOA,MAAM,EAAEA,KAAK,EAAEC,UAAU,EAAE,GAAGC;AAEvB,MAAMC,gBAAgB,IAClB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WAAAA,GAER,oBAACJ,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAClD,oBAACA,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAkB,OAAO;sBACpD,oBAACA,OAAAA;QAAM,IAAI;QAAU,OAAM;QAAgB,OAAO;sBAElD,oBAACC,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,OAAO;QACf,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,SAAS;QACjB,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAGf,oBAACA,WAAW,KAAK;QACb,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;sBAEf,oBAACA,WAAW,IAAI;QACZ,IAAI;QACJ,OAAO;QACP,KAAK;QACL,WAAW;uBAGnB,oBAACI,qBAAmBA,MAAAA,WAAAA,GAChB,oBAACA,oBAAoB,MAAM;QACvB,MAAM;QACN,uBAAS,oBAACC,0BAAwBA;YAAC,UAAUC"}
|
package/base/Base/Menus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/Menus.js","sources":["../../../src/base/Base/Menus.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DashboardIcon } from \"@webiny/icons/space_dashboard.svg\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as UpgradeIcon } from \"@webiny/icons/electric_bolt.svg\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\nimport { useFeatureFlags } from \"~/presentation/featureFlags/useFeatureFlags.js\";\n\nexport const Menus = React.memo(() => {\n const featureFlags = useFeatureFlags();\n const showUpgrade = !featureFlags.isEnabled(\"multiTenancy\");\n\n return (\n <AdminConfig>\n <Menu\n name={\"home\"}\n pin={\"start\"}\n element={\n <Menu.Link\n to={\"/\"}\n text={\"Home\"}\n icon={<Menu.Link.Icon label=\"Home\" element={<DashboardIcon />} />}\n />\n }\n />\n <Menu\n name={\"settings\"}\n hideIfEmpty={true}\n pin={\"end\"}\n element={\n <Menu.Item\n text={\"Settings\"}\n icon={<Menu.Link.Icon label=\"Settings\" element={<SettingsIcon />} />}\n />\n }\n />\n\n <Menu\n parent={\"settings\"}\n name=\"settings.system\"\n element={<Menu.Group text=\"System\" collapsible={false} />}\n />\n\n {showUpgrade && (\n <Menu.Footer\n name={\"upgrade\"}\n element={\n <Menu.Link\n text={\"Upgrade\"}\n icon={<Menu.Link.Icon label=\"Upgrade\" element={<UpgradeIcon />} />}\n to={\"https://www.webiny.com/pricing\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n className={\n \"[&_a]:text-accent-primary! [&_svg]:fill-accent-default! font-semibold\"\n }\n />\n }\n />\n )}\n </AdminConfig>\n );\n});\n\nMenus.displayName = \"Menus\";\n"],"names":["Menus","React","featureFlags","useFeatureFlags","showUpgrade","AdminConfig","Menu","DashboardIcon","SettingsIcon","UpgradeIcon"],"mappings":";;;;;;;AAQO,MAAMA,QAAQ,
|
|
1
|
+
{"version":3,"file":"base/Base/Menus.js","sources":["../../../src/base/Base/Menus.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as DashboardIcon } from \"@webiny/icons/space_dashboard.svg\";\nimport { ReactComponent as SettingsIcon } from \"@webiny/icons/settings.svg\";\nimport { ReactComponent as UpgradeIcon } from \"@webiny/icons/electric_bolt.svg\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\nimport { useFeatureFlags } from \"~/presentation/featureFlags/useFeatureFlags.js\";\n\nexport const Menus = React.memo(() => {\n const featureFlags = useFeatureFlags();\n const showUpgrade = !featureFlags.isEnabled(\"multiTenancy\");\n\n return (\n <AdminConfig>\n <Menu\n name={\"home\"}\n pin={\"start\"}\n element={\n <Menu.Link\n to={\"/\"}\n text={\"Home\"}\n icon={<Menu.Link.Icon label=\"Home\" element={<DashboardIcon />} />}\n />\n }\n />\n <Menu\n name={\"settings\"}\n hideIfEmpty={true}\n pin={\"end\"}\n element={\n <Menu.Item\n text={\"Settings\"}\n icon={<Menu.Link.Icon label=\"Settings\" element={<SettingsIcon />} />}\n />\n }\n />\n\n <Menu\n parent={\"settings\"}\n name=\"settings.system\"\n element={<Menu.Group text=\"System\" collapsible={false} />}\n />\n\n {showUpgrade && (\n <Menu.Footer\n name={\"upgrade\"}\n element={\n <Menu.Link\n text={\"Upgrade\"}\n icon={<Menu.Link.Icon label=\"Upgrade\" element={<UpgradeIcon />} />}\n to={\"https://www.webiny.com/pricing\"}\n rel={\"noopener noreferrer\"}\n target={\"_blank\"}\n className={\n \"[&_a]:text-accent-primary! [&_svg]:fill-accent-default! font-semibold\"\n }\n />\n }\n />\n )}\n </AdminConfig>\n );\n});\n\nMenus.displayName = \"Menus\";\n"],"names":["Menus","React","featureFlags","useFeatureFlags","showUpgrade","AdminConfig","Menu","DashboardIcon","SettingsIcon","UpgradeIcon"],"mappings":";;;;;;;AAQO,MAAMA,QAAQ,WAARA,GAAQC,MAAAA,IAAU,CAAC;IAC5B,MAAMC,eAAeC;IACrB,MAAMC,cAAc,CAACF,aAAa,SAAS,CAAC;IAE5C,OAAO,WAAP,GACI,oBAACG,aAAWA,MAAAA,WAAAA,GACR,oBAACC,MAAIA;QACD,MAAM;QACN,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,IAAI;YACJ,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAO,uBAAS,oBAACC,gBAAaA;;;sBAItE,oBAACD,MAAIA;QACD,MAAM;QACN,aAAa;QACb,KAAK;QACL,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAW,uBAAS,oBAACE,6BAAYA;;;sBAKzE,oBAACF,MAAIA;QACD,QAAQ;QACR,MAAK;QACL,uBAAS,oBAACA,KAAK,KAAK;YAAC,MAAK;YAAS,aAAa;;QAGnDF,eAAe,WAAfA,GACG,oBAACE,KAAK,MAAM;QACR,MAAM;QACN,uBACI,oBAACA,KAAK,IAAI;YACN,MAAM;YACN,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI;gBAAC,OAAM;gBAAU,uBAAS,oBAACG,kCAAWA;;YAC3D,IAAI;YACJ,KAAK;YACL,QAAQ;YACR,WACI;;;AAQhC;AAEAT,MAAM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/RoutesConfig.js","sources":["../../../src/base/Base/RoutesConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dashboard } from \"~/base/ui/Dashboard.js\";\nimport { AdminLayout } from \"~/components/AdminLayout.js\";\nimport { NotFound } from \"~/base/ui/NotFound.js\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Routes } from \"~/routes.js\";\nimport { Route } from \"~/config/AdminConfig/Route.js\";\nimport { FormModelDemo } from \"~/features/formModel/demo/FormModelDemo.js\";\n\nexport const RoutesConfig = React.memo(() => {\n return (\n <AdminConfig>\n <Route\n route={Routes.Dashboard}\n element={\n <AdminLayout title={\"Welcome!\"}>\n <Dashboard />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.FormModelDemo}\n element={\n <AdminLayout title={\"FormModel Demo\"}>\n <FormModelDemo />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.CatchAll}\n element={\n <AdminLayout title={\"Not Accessible\"}>\n <NotFound />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n});\n\nRoutesConfig.displayName = \"Routes\";\n"],"names":["RoutesConfig","React","AdminConfig","Route","Routes","AdminLayout","Dashboard","FormModelDemo","NotFound"],"mappings":";;;;;;;;AASO,MAAMA,eAAe,
|
|
1
|
+
{"version":3,"file":"base/Base/RoutesConfig.js","sources":["../../../src/base/Base/RoutesConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { Dashboard } from \"~/base/ui/Dashboard.js\";\nimport { AdminLayout } from \"~/components/AdminLayout.js\";\nimport { NotFound } from \"~/base/ui/NotFound.js\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { Routes } from \"~/routes.js\";\nimport { Route } from \"~/config/AdminConfig/Route.js\";\nimport { FormModelDemo } from \"~/features/formModel/demo/FormModelDemo.js\";\n\nexport const RoutesConfig = React.memo(() => {\n return (\n <AdminConfig>\n <Route\n route={Routes.Dashboard}\n element={\n <AdminLayout title={\"Welcome!\"}>\n <Dashboard />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.FormModelDemo}\n element={\n <AdminLayout title={\"FormModel Demo\"}>\n <FormModelDemo />\n </AdminLayout>\n }\n />\n\n <Route\n route={Routes.CatchAll}\n element={\n <AdminLayout title={\"Not Accessible\"}>\n <NotFound />\n </AdminLayout>\n }\n />\n </AdminConfig>\n );\n});\n\nRoutesConfig.displayName = \"Routes\";\n"],"names":["RoutesConfig","React","AdminConfig","Route","Routes","AdminLayout","Dashboard","FormModelDemo","NotFound"],"mappings":";;;;;;;;AASO,MAAMA,eAAe,WAAfA,GAAeC,MAAAA,IAAU,CAAC,IAC5B,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,OAAKA;QACF,OAAOC,OAAO,SAAS;QACvB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACC,WAASA;sBAKtB,oBAACH,OAAKA;QACF,OAAOC,OAAO,aAAa;QAC3B,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACE,eAAaA;sBAK1B,oBAACJ,OAAKA;QACF,OAAOC,OAAO,QAAQ;QACtB,uBACI,oBAACC,aAAWA;YAAC,OAAO;yBAChB,oBAACG,UAAQA;;AAQjCR,aAAa,WAAW,GAAG"}
|
package/base/Base/Tenant.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/Tenant.js","sources":["../../../src/base/Base/Tenant.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { ReactComponent as SquareLogo } from \"./Tenant/wby-square.svg\";\nimport { ReactComponent as HorizontalLogo } from \"./Tenant/wby-horizontal.svg\";\n\nexport const Tenant = React.memo(() => {\n const { Title, Logo } = AdminConfig;\n return (\n <AdminConfig.Public>\n <Title value={\"Webiny\"} />\n <Logo\n squareLogo={<SquareLogo alt={\"Webiny\"} width={32} />}\n horizontalLogo={<HorizontalLogo width={175} />}\n />\n </AdminConfig.Public>\n );\n});\n\nTenant.displayName = \"Tenant\";\n"],"names":["Tenant","React","Title","Logo","AdminConfig","SquareLogo","HorizontalLogo"],"mappings":";;;;AAKO,MAAMA,SAAS,
|
|
1
|
+
{"version":3,"file":"base/Base/Tenant.js","sources":["../../../src/base/Base/Tenant.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { ReactComponent as SquareLogo } from \"./Tenant/wby-square.svg\";\nimport { ReactComponent as HorizontalLogo } from \"./Tenant/wby-horizontal.svg\";\n\nexport const Tenant = React.memo(() => {\n const { Title, Logo } = AdminConfig;\n return (\n <AdminConfig.Public>\n <Title value={\"Webiny\"} />\n <Logo\n squareLogo={<SquareLogo alt={\"Webiny\"} width={32} />}\n horizontalLogo={<HorizontalLogo width={175} />}\n />\n </AdminConfig.Public>\n );\n});\n\nTenant.displayName = \"Tenant\";\n"],"names":["Tenant","React","Title","Logo","AdminConfig","SquareLogo","HorizontalLogo"],"mappings":";;;;AAKO,MAAMA,SAAS,WAATA,GAASC,MAAAA,IAAU,CAAC;IAC7B,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAE,GAAGC;IACxB,OAAO,WAAP,GACI,oBAACA,YAAY,MAAM,sBACf,oBAACF,OAAAA;QAAM,OAAO;sBACd,oBAACC,MAAAA;QACG,0BAAY,oBAACE,gBAAUA;YAAC,KAAK;YAAU,OAAO;;QAC9C,8BAAgB,oBAACC,kCAAcA;YAAC,OAAO;;;AAIvD;AAEAN,OAAO,WAAW,GAAG"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const SwitchTenant: (() => React.JSX.Element | null) & {
|
|
3
|
+
original: () => React.JSX.Element | null;
|
|
4
|
+
originalName: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
original: (() => React.JSX.Element | null) & {
|
|
8
|
+
original: () => React.JSX.Element | null;
|
|
9
|
+
originalName: string;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
originalName: string;
|
|
13
|
+
displayName: string;
|
|
14
|
+
} & {
|
|
15
|
+
createDecorator: (decorator: import("@webiny/app").ComponentDecorator<(() => React.JSX.Element | null) & {
|
|
16
|
+
original: () => React.JSX.Element | null;
|
|
17
|
+
originalName: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
20
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { makeDecoratable } from "@webiny/app";
|
|
3
|
+
import { Button } from "@webiny/admin-ui";
|
|
4
|
+
import { ReactComponent } from "@webiny/icons/swap_horiz.svg";
|
|
5
|
+
import { useAuthentication } from "../../../presentation/security/hooks/useAuthentication.js";
|
|
6
|
+
import { useTenantContext } from "../../../presentation/tenancy/useTenantContext.js";
|
|
7
|
+
import { useDialogs } from "../../../components/Dialogs/useDialogs.js";
|
|
8
|
+
import { Menu } from "../../../config/AdminConfig/Menu.js";
|
|
9
|
+
const SwitchTenant = makeDecoratable("SwitchTenant", ()=>{
|
|
10
|
+
const tenancy = useTenantContext();
|
|
11
|
+
const dialogs = useDialogs();
|
|
12
|
+
const { identity, isAuthenticated } = useAuthentication();
|
|
13
|
+
if (!isAuthenticated || !identity.canSwitchTenant) return null;
|
|
14
|
+
const showTenants = ()=>{
|
|
15
|
+
const currentTenantId = identity.currentTenant.id;
|
|
16
|
+
dialogs.showDialog({
|
|
17
|
+
title: "Switch tenant",
|
|
18
|
+
description: "Your account has access to these tenants. Pick the one to open.",
|
|
19
|
+
acceptLabel: null,
|
|
20
|
+
cancelLabel: "Cancel",
|
|
21
|
+
content: /*#__PURE__*/ react.createElement("div", {
|
|
22
|
+
className: "flex flex-col gap-sm",
|
|
23
|
+
"data-testid": "switch-tenant-list"
|
|
24
|
+
}, identity.tenants.map((tenant)=>/*#__PURE__*/ react.createElement(Button, {
|
|
25
|
+
key: tenant.id,
|
|
26
|
+
variant: "tertiary",
|
|
27
|
+
className: "w-full justify-start",
|
|
28
|
+
text: tenant.id === currentTenantId ? `${tenant.name} (current)` : tenant.name,
|
|
29
|
+
disabled: tenant.id === currentTenantId,
|
|
30
|
+
onClick: ()=>tenancy.setTenant(tenant.id)
|
|
31
|
+
})))
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return /*#__PURE__*/ react.createElement(Menu.User.Item, {
|
|
35
|
+
icon: /*#__PURE__*/ react.createElement(Menu.User.Item.Icon, {
|
|
36
|
+
element: /*#__PURE__*/ react.createElement(ReactComponent, null),
|
|
37
|
+
label: "Switch tenant"
|
|
38
|
+
}),
|
|
39
|
+
text: "Switch tenant",
|
|
40
|
+
onClick: showTenants
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
export { SwitchTenant };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=SwitchTenant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base/Base/UserMenu/SwitchTenant.js","sources":["../../../../src/base/Base/UserMenu/SwitchTenant.tsx"],"sourcesContent":["import React from \"react\";\nimport { makeDecoratable } from \"@webiny/app\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as SwitchIcon } from \"@webiny/icons/swap_horiz.svg\";\nimport { useAuthentication } from \"~/presentation/security/hooks/useAuthentication.js\";\nimport { useTenantContext } from \"~/presentation/tenancy/useTenantContext.js\";\nimport { useDialogs } from \"~/components/Dialogs/useDialogs.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\n\nexport const SwitchTenant = makeDecoratable(\"SwitchTenant\", () => {\n const tenancy = useTenantContext();\n const dialogs = useDialogs();\n const { identity, isAuthenticated } = useAuthentication();\n\n if (!isAuthenticated || !identity.canSwitchTenant) {\n return null;\n }\n\n const showTenants = () => {\n const currentTenantId = identity.currentTenant.id;\n\n dialogs.showDialog({\n title: \"Switch tenant\",\n description: \"Your account has access to these tenants. Pick the one to open.\",\n acceptLabel: null,\n cancelLabel: \"Cancel\",\n content: (\n <div className={\"flex flex-col gap-sm\"} data-testid={\"switch-tenant-list\"}>\n {identity.tenants.map(tenant => (\n <Button\n key={tenant.id}\n variant={\"tertiary\"}\n className={\"w-full justify-start\"}\n text={\n tenant.id === currentTenantId\n ? `${tenant.name} (current)`\n : tenant.name\n }\n disabled={tenant.id === currentTenantId}\n onClick={() => tenancy.setTenant(tenant.id)}\n />\n ))}\n </div>\n )\n });\n };\n\n return (\n <Menu.User.Item\n icon={<Menu.User.Item.Icon element={<SwitchIcon />} label={\"Switch tenant\"} />}\n text={\"Switch tenant\"}\n onClick={showTenants}\n />\n );\n});\n"],"names":["SwitchTenant","makeDecoratable","tenancy","useTenantContext","dialogs","useDialogs","identity","isAuthenticated","useAuthentication","showTenants","currentTenantId","tenant","Button","Menu","SwitchIcon"],"mappings":";;;;;;;;AASO,MAAMA,eAAeC,gBAAgB,gBAAgB;IACxD,MAAMC,UAAUC;IAChB,MAAMC,UAAUC;IAChB,MAAM,EAAEC,QAAQ,EAAEC,eAAe,EAAE,GAAGC;IAEtC,IAAI,CAACD,mBAAmB,CAACD,SAAS,eAAe,EAC7C,OAAO;IAGX,MAAMG,cAAc;QAChB,MAAMC,kBAAkBJ,SAAS,aAAa,CAAC,EAAE;QAEjDF,QAAQ,UAAU,CAAC;YACf,OAAO;YACP,aAAa;YACb,aAAa;YACb,aAAa;YACb,SAAS,WAAT,GACI,oBAAC;gBAAI,WAAW;gBAAwB,eAAa;eAChDE,SAAS,OAAO,CAAC,GAAG,CAACK,CAAAA,SAAAA,WAAAA,GAClB,oBAACC,QAAMA;oBACH,KAAKD,OAAO,EAAE;oBACd,SAAS;oBACT,WAAW;oBACX,MACIA,OAAO,EAAE,KAAKD,kBACR,GAAGC,OAAO,IAAI,CAAC,UAAU,CAAC,GAC1BA,OAAO,IAAI;oBAErB,UAAUA,OAAO,EAAE,KAAKD;oBACxB,SAAS,IAAMR,QAAQ,SAAS,CAACS,OAAO,EAAE;;QAK9D;IACJ;IAEA,OAAO,WAAP,GACI,oBAACE,KAAK,IAAI,CAAC,IAAI;QACX,oBAAM,oBAACA,KAAK,IAAI,CAAC,IAAI,CAAC,IAAI;YAAC,uBAAS,oBAACC,gBAAUA;YAAK,OAAO;;QAC3D,MAAM;QACN,SAASL;;AAGrB"}
|
package/base/Base/UserMenu.js
CHANGED
|
@@ -3,10 +3,14 @@ import { AdminConfig } from "../../config/AdminConfig.js";
|
|
|
3
3
|
import { SignOut } from "./UserMenu/SignOut.js";
|
|
4
4
|
import { UserInfo } from "./UserMenu/UserInfo.js";
|
|
5
5
|
import { ExitTenant } from "./UserMenu/ExitTenant.js";
|
|
6
|
+
import { SwitchTenant } from "./UserMenu/SwitchTenant.js";
|
|
6
7
|
import { Menu } from "../../config/AdminConfig/Menu.js";
|
|
7
8
|
const UserMenu = /*#__PURE__*/ react.memo(()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Menu.User, {
|
|
8
9
|
name: "userInfo",
|
|
9
10
|
element: /*#__PURE__*/ react.createElement(UserInfo, null)
|
|
11
|
+
}), /*#__PURE__*/ react.createElement(Menu.User, {
|
|
12
|
+
name: "switchTenant",
|
|
13
|
+
element: /*#__PURE__*/ react.createElement(SwitchTenant, null)
|
|
10
14
|
}), /*#__PURE__*/ react.createElement(Menu.User, {
|
|
11
15
|
name: "exitTenant",
|
|
12
16
|
element: /*#__PURE__*/ react.createElement(ExitTenant, null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base/UserMenu.js","sources":["../../../src/base/Base/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { SignOut } from \"./UserMenu/SignOut.js\";\nimport { UserInfo } from \"./UserMenu/UserInfo.js\";\nimport { ExitTenant } from \"./UserMenu/ExitTenant.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\n\nexport const UserMenu = React.memo(() => {\n return (\n <AdminConfig>\n <Menu.User name={\"userInfo\"} element={<UserInfo />} />\n <Menu.User name={\"exitTenant\"} element={<ExitTenant />} />\n <Menu.User name={\"signOut\"} element={<SignOut />} />\n </AdminConfig>\n );\n});\n\nUserMenu.displayName = \"UserMenu\";\n"],"names":["UserMenu","React","AdminConfig","Menu","UserInfo","ExitTenant","SignOut"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base/Base/UserMenu.js","sources":["../../../src/base/Base/UserMenu.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"~/config/AdminConfig.js\";\nimport { SignOut } from \"./UserMenu/SignOut.js\";\nimport { UserInfo } from \"./UserMenu/UserInfo.js\";\nimport { ExitTenant } from \"./UserMenu/ExitTenant.js\";\nimport { SwitchTenant } from \"./UserMenu/SwitchTenant.js\";\nimport { Menu } from \"~/config/AdminConfig/Menu.js\";\n\nexport const UserMenu = React.memo(() => {\n return (\n <AdminConfig>\n <Menu.User name={\"userInfo\"} element={<UserInfo />} />\n <Menu.User name={\"switchTenant\"} element={<SwitchTenant />} />\n <Menu.User name={\"exitTenant\"} element={<ExitTenant />} />\n <Menu.User name={\"signOut\"} element={<SignOut />} />\n </AdminConfig>\n );\n});\n\nUserMenu.displayName = \"UserMenu\";\n"],"names":["UserMenu","React","AdminConfig","Menu","UserInfo","SwitchTenant","ExitTenant","SignOut"],"mappings":";;;;;;;AAQO,MAAMA,WAAW,WAAXA,GAAWC,MAAAA,IAAU,CAAC,IACxB,WAAP,GACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,KAAK,IAAI;QAAC,MAAM;QAAY,uBAAS,oBAACC,UAAQA;sBAC/C,oBAACD,KAAK,IAAI;QAAC,MAAM;QAAgB,uBAAS,oBAACE,cAAYA;sBACvD,oBAACF,KAAK,IAAI;QAAC,MAAM;QAAc,uBAAS,oBAACG,YAAUA;sBACnD,oBAACH,KAAK,IAAI;QAAC,MAAM;QAAW,uBAAS,oBAACI,SAAOA;;AAKzDP,SAAS,WAAW,GAAG"}
|
package/base/Base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/Base.js","sources":["../../src/base/Base.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { Menus } from \"./Base/Menus.js\";\nimport { RoutesConfig } from \"./Base/RoutesConfig.js\";\nimport { Tenant } from \"./Base/Tenant.js\";\nimport { UserMenu } from \"./Base/UserMenu.js\";\nimport { LexicalPreset } from \"./Base/LexicalPreset.js\";\nimport { DefaultFieldRenderers } from \"./Base/DefaultFieldRenderers.js\";\nimport { DefaultLayoutRenderers } from \"./Base/DefaultLayoutRenderers.js\";\nimport { DefaultLexicalEditorConfig } from \"~/components/LexicalEditor/DefaultLexicalEditorConfig.js\";\nimport { AccessManagementExtension } from \"~/modules/AccessManagementExtension.js\";\nimport { DebuggerExtension } from \"~/modules/DebuggerExtension.js\";\n\nconst BaseExtension = () => {\n return (\n <>\n <Tenant />\n <Menus />\n <UserMenu />\n <RoutesConfig />\n <LexicalPreset />\n <DefaultFieldRenderers />\n <DefaultLayoutRenderers />\n <DefaultLexicalEditorConfig />\n <AccessManagementExtension />\n <DebuggerExtension />\n </>\n );\n};\n\nexport const Base = memo(BaseExtension);\n"],"names":["BaseExtension","Tenant","Menus","UserMenu","RoutesConfig","LexicalPreset","DefaultFieldRenderers","DefaultLayoutRenderers","DefaultLexicalEditorConfig","AccessManagementExtension","DebuggerExtension","Base","memo"],"mappings":";;;;;;;;;;;AAYA,MAAMA,gBAAgB,IACX,WAAP,GACI,wDACI,oBAACC,QAAMA,OAAAA,WAAAA,GACP,oBAACC,OAAKA,OAAAA,WAAAA,GACN,oBAACC,UAAQA,OAAAA,WAAAA,GACT,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,4BAA0BA,OAAAA,WAAAA,GAC3B,oBAACC,2BAAyBA,OAAAA,WAAAA,GAC1B,oBAACC,mBAAiBA;AAKvB,MAAMC,OAAO,
|
|
1
|
+
{"version":3,"file":"base/Base.js","sources":["../../src/base/Base.tsx"],"sourcesContent":["import React, { memo } from \"react\";\nimport { Menus } from \"./Base/Menus.js\";\nimport { RoutesConfig } from \"./Base/RoutesConfig.js\";\nimport { Tenant } from \"./Base/Tenant.js\";\nimport { UserMenu } from \"./Base/UserMenu.js\";\nimport { LexicalPreset } from \"./Base/LexicalPreset.js\";\nimport { DefaultFieldRenderers } from \"./Base/DefaultFieldRenderers.js\";\nimport { DefaultLayoutRenderers } from \"./Base/DefaultLayoutRenderers.js\";\nimport { DefaultLexicalEditorConfig } from \"~/components/LexicalEditor/DefaultLexicalEditorConfig.js\";\nimport { AccessManagementExtension } from \"~/modules/AccessManagementExtension.js\";\nimport { DebuggerExtension } from \"~/modules/DebuggerExtension.js\";\n\nconst BaseExtension = () => {\n return (\n <>\n <Tenant />\n <Menus />\n <UserMenu />\n <RoutesConfig />\n <LexicalPreset />\n <DefaultFieldRenderers />\n <DefaultLayoutRenderers />\n <DefaultLexicalEditorConfig />\n <AccessManagementExtension />\n <DebuggerExtension />\n </>\n );\n};\n\nexport const Base = memo(BaseExtension);\n"],"names":["BaseExtension","Tenant","Menus","UserMenu","RoutesConfig","LexicalPreset","DefaultFieldRenderers","DefaultLayoutRenderers","DefaultLexicalEditorConfig","AccessManagementExtension","DebuggerExtension","Base","memo"],"mappings":";;;;;;;;;;;AAYA,MAAMA,gBAAgB,IACX,WAAP,GACI,wDACI,oBAACC,QAAMA,OAAAA,WAAAA,GACP,oBAACC,OAAKA,OAAAA,WAAAA,GACN,oBAACC,UAAQA,OAAAA,WAAAA,GACT,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,eAAaA,OAAAA,WAAAA,GACd,oBAACC,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,4BAA0BA,OAAAA,WAAAA,GAC3B,oBAACC,2BAAyBA,OAAAA,WAAAA,GAC1B,oBAACC,mBAAiBA;AAKvB,MAAMC,OAAO,WAAPA,GAAOC,KAAKZ"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export interface AiChatsPanelProps {
|
|
3
|
+
/** Sizes the panel's height to its host. The admin frame uses `h-main-content`. */
|
|
4
|
+
className?: string;
|
|
5
|
+
width?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Set by a host that decides itself when the panel shows, such as the Website Builder editor: the panel
|
|
8
|
+
* then always renders, and its close button calls this. Without it the panel shows while the AI
|
|
9
|
+
* chats presenter says it is open.
|
|
10
|
+
*/
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/** The close button's label and icon, for a host where closing collapses the panel. */
|
|
13
|
+
closeLabel?: string;
|
|
14
|
+
closeIcon?: React.JSX.Element;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The AI chats side panel, for a screen that renders without the admin frame (the Website Builder
|
|
18
|
+
* editor) and still wants the assistant beside it. Renders nothing until an admin UI package
|
|
19
|
+
* decorates it; `@webiny/app-admin-ui` does.
|
|
20
|
+
*/
|
|
21
|
+
export declare const AiChatsPanelRenderer: ((props: AiChatsPanelProps) => React.JSX.Element | null) & {
|
|
22
|
+
original: (props: AiChatsPanelProps) => React.JSX.Element | null;
|
|
23
|
+
originalName: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
} & {
|
|
26
|
+
original: ((props: AiChatsPanelProps) => React.JSX.Element | null) & {
|
|
27
|
+
original: (props: AiChatsPanelProps) => React.JSX.Element | null;
|
|
28
|
+
originalName: string;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
originalName: string;
|
|
32
|
+
displayName: string;
|
|
33
|
+
} & {
|
|
34
|
+
createDecorator: (decorator: import("@webiny/app").ComponentDecorator<((props: AiChatsPanelProps) => React.JSX.Element | null) & {
|
|
35
|
+
original: (props: AiChatsPanelProps) => React.JSX.Element | null;
|
|
36
|
+
originalName: string;
|
|
37
|
+
displayName: string;
|
|
38
|
+
}>) => (props: unknown) => React.JSX.Element;
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base/ui/AiChatsPanel.js","sources":["../../../src/base/ui/AiChatsPanel.tsx"],"sourcesContent":["import type React from \"react\";\nimport { createVoidComponent } from \"@webiny/app\";\nimport { makeDecoratable } from \"@webiny/app\";\n\nexport interface AiChatsPanelProps {\n /** Sizes the panel's height to its host. The admin frame uses `h-main-content`. */\n className?: string;\n width?: number;\n /**\n * Set by a host that decides itself when the panel shows, such as the Website Builder editor: the panel\n * then always renders, and its close button calls this. Without it the panel shows while the AI\n * chats presenter says it is open.\n */\n onClose?: () => void;\n /** The close button's label and icon, for a host where closing collapses the panel. */\n closeLabel?: string;\n closeIcon?: React.JSX.Element;\n}\n\n/**\n * The AI chats side panel, for a screen that renders without the admin frame (the Website Builder\n * editor) and still wants the assistant beside it. Renders nothing until an admin UI package\n * decorates it; `@webiny/app-admin-ui` does.\n */\nexport const AiChatsPanelRenderer = makeDecoratable(\n \"AiChatsPanelRenderer\",\n createVoidComponent<AiChatsPanelProps>()\n);\n"],"names":["AiChatsPanelRenderer","makeDecoratable","createVoidComponent"],"mappings":";AAwBO,MAAMA,uBAAuBC,gBAChC,wBACAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/ui/AssumedPermissionsSelector.js","sources":["../../../src/base/ui/AssumedPermissionsSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent } from \"@webiny/app\";\nimport { makeDecoratable } from \"@webiny/app\";\n\n/**\n * Placeholder for the \"view as\" header control, mirroring TenantSelector. The Layout renders this,\n * and AccessManagementExtension decorates it with the real control.\n *\n * The real control renders nothing unless a preview is already active. Entering a preview happens\n * from the role and team forms. It exists so that someone comparing roles can jump straight from\n * one to the next instead of exiting and opening the next form each time.\n */\nexport const AssumedPermissionsSelector = makeDecoratable(\"AssumedPermissionsSelector\", () => {\n return <AssumedPermissionsSelectorRenderer />;\n});\n\nexport const AssumedPermissionsSelectorRenderer = makeDecoratable(\n \"AssumedPermissionsSelectorRenderer\",\n createVoidComponent()\n);\n"],"names":["AssumedPermissionsSelector","makeDecoratable","AssumedPermissionsSelectorRenderer","createVoidComponent"],"mappings":";;AAYO,MAAMA,6BAA6BC,gBAAgB,8BAA8B,IAC7E,WAAP,GAAO,oBAACC,
|
|
1
|
+
{"version":3,"file":"base/ui/AssumedPermissionsSelector.js","sources":["../../../src/base/ui/AssumedPermissionsSelector.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent } from \"@webiny/app\";\nimport { makeDecoratable } from \"@webiny/app\";\n\n/**\n * Placeholder for the \"view as\" header control, mirroring TenantSelector. The Layout renders this,\n * and AccessManagementExtension decorates it with the real control.\n *\n * The real control renders nothing unless a preview is already active. Entering a preview happens\n * from the role and team forms. It exists so that someone comparing roles can jump straight from\n * one to the next instead of exiting and opening the next form each time.\n */\nexport const AssumedPermissionsSelector = makeDecoratable(\"AssumedPermissionsSelector\", () => {\n return <AssumedPermissionsSelectorRenderer />;\n});\n\nexport const AssumedPermissionsSelectorRenderer = makeDecoratable(\n \"AssumedPermissionsSelectorRenderer\",\n createVoidComponent()\n);\n"],"names":["AssumedPermissionsSelector","makeDecoratable","AssumedPermissionsSelectorRenderer","createVoidComponent"],"mappings":";;AAYO,MAAMA,6BAA6BC,gBAAgB,8BAA8B,IAC7E,WAAP,GAAO,oBAACC,oCAAAA;AAGL,MAAMA,qCAAqCD,gBAC9C,sCACAE"}
|
package/base/ui/Brand.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/ui/Brand.js","sources":["../../../src/base/ui/Brand.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Brand = makeDecoratable(\"Brand\", () => {\n return <BrandRenderer />;\n});\n\nexport const BrandRenderer = makeDecoratable(\"BrandRenderer\", createVoidComponent());\n"],"names":["Brand","makeDecoratable","BrandRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,QAAQC,gBAAgB,SAAS,IACnC,WAAP,GAAO,oBAACC,
|
|
1
|
+
{"version":3,"file":"base/ui/Brand.js","sources":["../../../src/base/ui/Brand.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Brand = makeDecoratable(\"Brand\", () => {\n return <BrandRenderer />;\n});\n\nexport const BrandRenderer = makeDecoratable(\"BrandRenderer\", createVoidComponent());\n"],"names":["Brand","makeDecoratable","BrandRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,QAAQC,gBAAgB,SAAS,IACnC,WAAP,GAAO,oBAACC,eAAAA;AAGL,MAAMA,gBAAgBD,gBAAgB,iBAAiBE"}
|
package/base/ui/Dashboard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base/ui/Dashboard.js","sources":["../../../src/base/ui/Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Dashboard = makeDecoratable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeDecoratable(\"DashboardRenderer\", createVoidComponent());\n"],"names":["Dashboard","makeDecoratable","DashboardRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB,aAAa,IAC3C,WAAP,GAAO,oBAACC,
|
|
1
|
+
{"version":3,"file":"base/ui/Dashboard.js","sources":["../../../src/base/ui/Dashboard.tsx"],"sourcesContent":["import React from \"react\";\nimport { createVoidComponent, makeDecoratable } from \"@webiny/app\";\n\nexport const Dashboard = makeDecoratable(\"Dashboard\", () => {\n return <DashboardRenderer />;\n});\n\nexport const DashboardRenderer = makeDecoratable(\"DashboardRenderer\", createVoidComponent());\n"],"names":["Dashboard","makeDecoratable","DashboardRenderer","createVoidComponent"],"mappings":";;AAGO,MAAMA,YAAYC,gBAAgB,aAAa,IAC3C,WAAP,GAAO,oBAACC,mBAAAA;AAGL,MAAMA,oBAAoBD,gBAAgB,qBAAqBE"}
|