@vertesia/ui 0.78.0 → 0.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/Panel.js +8 -0
- package/lib/esm/core/components/Panel.js.map +1 -0
- package/lib/esm/core/components/SelectBox.js +1 -1
- package/lib/esm/core/components/SelectBox.js.map +1 -1
- package/lib/esm/core/components/SelectList.js +18 -13
- package/lib/esm/core/components/SelectList.js.map +1 -1
- package/lib/esm/core/components/SidePanel.js +2 -2
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/index.js +1 -1
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/breadcrumb.js +29 -8
- package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -1
- package/lib/esm/core/components/shadcn/button.js +3 -2
- package/lib/esm/core/components/shadcn/button.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +41 -14
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/index.js +2 -0
- package/lib/esm/core/components/shadcn/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/input.js +4 -1
- package/lib/esm/core/components/shadcn/input.js.map +1 -1
- package/lib/esm/core/components/shadcn/resizeable.js +15 -0
- package/lib/esm/core/components/shadcn/resizeable.js.map +1 -0
- package/lib/esm/core/components/shadcn/selectBox.js +15 -9
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/tabs.js +20 -8
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
- package/lib/esm/core/components/shadcn/textarea.js +7 -0
- package/lib/esm/core/components/shadcn/textarea.js.map +1 -0
- package/lib/esm/core/components/table/index.js +1 -1
- package/lib/esm/core/components/table/index.js.map +1 -1
- package/lib/esm/core/hooks/CompositeState.js +139 -1
- package/lib/esm/core/hooks/CompositeState.js.map +1 -1
- package/lib/esm/core/hooks/index.js +1 -0
- package/lib/esm/core/hooks/index.js.map +1 -1
- package/lib/esm/core/hooks/useScrollableSearch.js +92 -0
- package/lib/esm/core/hooks/useScrollableSearch.js.map +1 -0
- package/lib/esm/env/index.js +1 -1
- package/lib/esm/env/index.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +80 -55
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +22 -24
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +2 -3
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +15 -20
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +3 -3
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +6 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
- package/lib/esm/features/facets/CollectionsFacetsNav.js +85 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/DocumentsFacetsNav.js +19 -7
- package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/EnvironmentFacet.js +1 -1
- package/lib/esm/features/facets/EnvironmentFacet.js.map +1 -1
- package/lib/esm/features/facets/InteractionsFacetsNav.js +88 -0
- package/lib/esm/features/facets/InteractionsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/PromptsFacetsNav.js +80 -0
- package/lib/esm/features/facets/PromptsFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/RunsFacetsNav.js +28 -6
- package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +7 -5
- package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/index.js +10 -8
- package/lib/esm/features/facets/index.js.map +1 -1
- package/lib/esm/features/facets/utils/SearchInterface.js +2 -0
- package/lib/esm/features/facets/utils/SearchInterface.js.map +1 -0
- package/lib/esm/features/facets/utils/StringFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/StringListFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/TypeFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VEnvironmentFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VInteractionFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/VStringFacet.js.map +1 -0
- package/lib/esm/features/facets/{VTypeFacet.js → utils/VTypeFacet.js} +9 -4
- package/lib/esm/features/facets/utils/VTypeFacet.js.map +1 -0
- package/lib/esm/features/facets/{VUserFacet.js → utils/VUserFacet.js} +1 -1
- package/lib/esm/features/facets/utils/VUserFacet.js.map +1 -0
- package/lib/esm/features/facets/utils/utils.js.map +1 -0
- package/lib/esm/features/layout/GenericPageNavHeader.js +58 -5
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
- package/lib/esm/features/store/collections/BrowseCollectionView.js +3 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +2 -2
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +43 -31
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +46 -16
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +43 -13
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentTable.js +6 -6
- package/lib/esm/features/store/objects/DocumentTable.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +225 -87
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentIcon.js +11 -3
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +11 -2
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/useDownloadObject.js +2 -2
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -1
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +13 -1
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
- package/lib/esm/features/store/objects/layout/documentLayout.js +7 -8
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
- package/lib/esm/features/store/objects/layout/renderers.js +28 -12
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +5 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -1
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +3 -2
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js +2 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +12 -4
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +20 -2
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +16 -8
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +35 -1
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +25 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/router/Nav.js +3 -3
- package/lib/esm/router/Nav.js.map +1 -1
- package/lib/esm/session/UserSession.js +1 -0
- package/lib/esm/session/UserSession.js.map +1 -1
- package/lib/esm/session/UserSessionProvider.js +9 -2
- package/lib/esm/session/UserSessionProvider.js.map +1 -1
- package/lib/esm/session/auth/composable.js +66 -67
- package/lib/esm/session/auth/composable.js.map +1 -1
- package/lib/esm/shell/login/UserInfo.js +1 -1
- package/lib/esm/shell/login/UserInfo.js.map +1 -1
- package/lib/esm/widgets/form/Form.js +17 -30
- package/lib/esm/widgets/form/Form.js.map +1 -1
- package/lib/esm/widgets/form/FormContext.js +4 -2
- package/lib/esm/widgets/form/FormContext.js.map +1 -1
- package/lib/esm/widgets/form/ManagedObject.js +4 -0
- package/lib/esm/widgets/form/ManagedObject.js.map +1 -1
- package/lib/esm/widgets/form/fields.js +4 -3
- package/lib/esm/widgets/form/fields.js.map +1 -1
- package/lib/esm/widgets/form/inputs.js +2 -0
- package/lib/esm/widgets/form/inputs.js.map +1 -1
- package/lib/esm/widgets/schema-editor/index.js +0 -1
- package/lib/esm/widgets/schema-editor/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/Panel.d.ts +11 -0
- package/lib/types/core/components/Panel.d.ts.map +1 -0
- package/lib/types/core/components/SelectList.d.ts +2 -1
- package/lib/types/core/components/SelectList.d.ts.map +1 -1
- package/lib/types/core/components/SidePanel.d.ts.map +1 -1
- package/lib/types/core/components/index.d.ts +1 -1
- package/lib/types/core/components/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/breadcrumb.d.ts +3 -2
- package/lib/types/core/components/shadcn/breadcrumb.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/index.d.ts +2 -0
- package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/input.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/resizeable.d.ts +9 -0
- package/lib/types/core/components/shadcn/resizeable.d.ts.map +1 -0
- package/lib/types/core/components/shadcn/selectBox.d.ts +3 -2
- package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tabs.d.ts +2 -1
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/textarea.d.ts +4 -0
- package/lib/types/core/components/shadcn/textarea.d.ts.map +1 -0
- package/lib/types/core/hooks/CompositeState.d.ts +115 -6
- package/lib/types/core/hooks/CompositeState.d.ts.map +1 -1
- package/lib/types/core/hooks/index.d.ts +1 -0
- package/lib/types/core/hooks/index.d.ts.map +1 -1
- package/lib/types/core/hooks/useScrollableSearch.d.ts +82 -0
- package/lib/types/core/hooks/useScrollableSearch.d.ts.map +1 -0
- package/lib/types/env/index.d.ts +3 -1
- package/lib/types/env/index.d.ts.map +1 -1
- package/lib/types/features/agent/PayloadBuilder.d.ts +11 -19
- package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -1
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts +14 -0
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/DocumentsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts +14 -0
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/PromptsFacetsNav.d.ts +15 -0
- package/lib/types/features/facets/PromptsFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/RunsFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/RunsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +1 -1
- package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/index.d.ts +10 -8
- package/lib/types/features/facets/index.d.ts.map +1 -1
- package/lib/types/features/facets/utils/SearchInterface.d.ts +14 -0
- package/lib/types/features/facets/utils/SearchInterface.d.ts.map +1 -0
- package/lib/types/features/facets/utils/StringFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/StringListFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/TypeFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VEnvironmentFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VInteractionFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VStringFacet.d.ts.map +1 -0
- package/lib/types/features/facets/{VTypeFacet.d.ts → utils/VTypeFacet.d.ts} +2 -1
- package/lib/types/features/facets/utils/VTypeFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/VUserFacet.d.ts.map +1 -0
- package/lib/types/features/facets/utils/utils.d.ts.map +1 -0
- package/lib/types/features/layout/GenericPageNavHeader.d.ts +2 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -1
- package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/collections/SelectCollection.d.ts +12 -8
- package/lib/types/features/store/collections/SelectCollection.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentTable.d.ts +4 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +7 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +1 -1
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +2 -1
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +4 -2
- package/lib/types/features/store/objects/layout/documentLayout.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/renderers.d.ts +1 -1
- package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +2 -3
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +1 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
- package/lib/types/features/user/UserInfo.d.ts +12 -1
- package/lib/types/features/user/UserInfo.d.ts.map +1 -1
- package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/types/router/Nav.d.ts +2 -1
- package/lib/types/router/Nav.d.ts.map +1 -1
- package/lib/types/session/UserSession.d.ts.map +1 -1
- package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/types/session/auth/composable.d.ts.map +1 -1
- package/lib/types/widgets/form/Form.d.ts +2 -1
- package/lib/types/widgets/form/Form.d.ts.map +1 -1
- package/lib/types/widgets/form/FormContext.d.ts +5 -2
- package/lib/types/widgets/form/FormContext.d.ts.map +1 -1
- package/lib/types/widgets/form/ManagedObject.d.ts.map +1 -1
- package/lib/types/widgets/form/fields.d.ts +2 -2
- package/lib/types/widgets/form/fields.d.ts.map +1 -1
- package/lib/types/widgets/form/inputs.d.ts.map +1 -1
- package/lib/types/widgets/schema-editor/index.d.ts +0 -1
- package/lib/types/widgets/schema-editor/index.d.ts.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-env.js +1 -1
- package/lib/vertesia-ui-env.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-session.js +1 -1
- package/lib/vertesia-ui-session.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +166 -165
- package/src/core/components/Panel.tsx +34 -0
- package/src/core/components/SelectList.tsx +11 -1
- package/src/core/components/SidePanel.tsx +18 -13
- package/src/core/components/index.ts +1 -1
- package/src/core/components/shadcn/breadcrumb.tsx +49 -30
- package/src/core/components/shadcn/button.tsx +3 -2
- package/src/core/components/shadcn/filters/filterBar.tsx +49 -23
- package/src/core/components/shadcn/index.ts +2 -0
- package/src/core/components/shadcn/input.tsx +10 -7
- package/src/core/components/shadcn/resizeable.tsx +54 -0
- package/src/core/components/shadcn/selectBox.tsx +87 -67
- package/src/core/components/shadcn/tabs.tsx +25 -8
- package/src/core/components/shadcn/textarea.tsx +21 -0
- package/src/core/components/table/index.tsx +1 -1
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useScrollableSearch.tsx +193 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +109 -118
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +2 -22
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +1 -9
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +39 -55
- package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +1 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +8 -8
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +8 -8
- package/src/features/facets/CollectionsFacetsNav.tsx +115 -0
- package/src/features/facets/DocumentsFacetsNav.tsx +22 -11
- package/src/features/facets/EnvironmentFacet.tsx +1 -1
- package/src/features/facets/InteractionsFacetsNav.tsx +121 -0
- package/src/features/facets/PromptsFacetsNav.tsx +110 -0
- package/src/features/facets/RunsFacetsNav.tsx +40 -9
- package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +10 -8
- package/src/features/facets/index.ts +11 -9
- package/src/features/facets/utils/SearchInterface.tsx +12 -0
- package/src/features/facets/{VTypeFacet.tsx → utils/VTypeFacet.tsx} +12 -5
- package/src/features/facets/{VUserFacet.tsx → utils/VUserFacet.tsx} +1 -1
- package/src/features/layout/GenericPageNavHeader.tsx +73 -10
- package/src/features/store/collections/BrowseCollectionView.tsx +4 -0
- package/src/features/store/collections/CreateCollection.tsx +3 -4
- package/src/features/store/collections/EditCollectionView.tsx +104 -85
- package/src/features/store/collections/SelectCollection.tsx +214 -29
- package/src/features/store/objects/DocumentSearchResults.tsx +98 -27
- package/src/features/store/objects/DocumentTable.tsx +14 -4
- package/src/features/store/objects/components/ContentOverview.tsx +536 -267
- package/src/features/store/objects/components/DocumentIcon.tsx +42 -13
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +12 -2
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +16 -1
- package/src/features/store/objects/layout/documentLayout.tsx +10 -12
- package/src/features/store/objects/layout/knowledge.md +10 -10
- package/src/features/store/objects/layout/renderers.tsx +39 -18
- package/src/features/store/objects/search/DocumentSearchContext.ts +6 -1
- package/src/features/store/objects/search/DocumentSearchProvider.tsx +1 -1
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +3 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +2 -0
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +23 -10
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +22 -2
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +23 -15
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +10 -7
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +1 -1
- package/src/features/store/types/ObjectSchemaEditor.tsx +1 -1
- package/src/features/user/UserInfo.tsx +66 -3
- package/src/router/HistoryNavigator.ts +33 -2
- package/src/router/Nav.tsx +4 -3
- package/src/shell/login/UserInfo.tsx +1 -1
- package/src/widgets/form/Form.tsx +19 -43
- package/src/widgets/form/FormContext.ts +5 -2
- package/src/widgets/form/fields.tsx +8 -6
- package/src/widgets/form/inputs.tsx +1 -0
- package/src/widgets/schema-editor/index.ts +0 -1
- package/lib/esm/core/components/Textarea.js +0 -15
- package/lib/esm/core/components/Textarea.js.map +0 -1
- package/lib/esm/features/facets/FacetsNav.js +0 -8
- package/lib/esm/features/facets/FacetsNav.js.map +0 -1
- package/lib/esm/features/facets/StringFacet.js.map +0 -1
- package/lib/esm/features/facets/StringListFacet.js.map +0 -1
- package/lib/esm/features/facets/TypeFacet.js.map +0 -1
- package/lib/esm/features/facets/VEnvironmentFacet.js.map +0 -1
- package/lib/esm/features/facets/VFacetsNav.js +0 -48
- package/lib/esm/features/facets/VFacetsNav.js.map +0 -1
- package/lib/esm/features/facets/VInteractionFacet.js.map +0 -1
- package/lib/esm/features/facets/VStringFacet.js.map +0 -1
- package/lib/esm/features/facets/VTypeFacet.js.map +0 -1
- package/lib/esm/features/facets/VUserFacet.js.map +0 -1
- package/lib/esm/features/facets/utils.js.map +0 -1
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js +0 -49
- package/lib/esm/widgets/schema-editor/JSONSchemaEditorModal.js.map +0 -1
- package/lib/types/core/components/Textarea.d.ts +0 -8
- package/lib/types/core/components/Textarea.d.ts.map +0 -1
- package/lib/types/features/facets/FacetsNav.d.ts +0 -7
- package/lib/types/features/facets/FacetsNav.d.ts.map +0 -1
- package/lib/types/features/facets/StringFacet.d.ts.map +0 -1
- package/lib/types/features/facets/StringListFacet.d.ts.map +0 -1
- package/lib/types/features/facets/TypeFacet.d.ts.map +0 -1
- package/lib/types/features/facets/VEnvironmentFacet.d.ts.map +0 -1
- package/lib/types/features/facets/VFacetsNav.d.ts +0 -16
- package/lib/types/features/facets/VFacetsNav.d.ts.map +0 -1
- package/lib/types/features/facets/VInteractionFacet.d.ts.map +0 -1
- package/lib/types/features/facets/VStringFacet.d.ts.map +0 -1
- package/lib/types/features/facets/VTypeFacet.d.ts.map +0 -1
- package/lib/types/features/facets/VUserFacet.d.ts.map +0 -1
- package/lib/types/features/facets/utils.d.ts.map +0 -1
- package/lib/types/widgets/schema-editor/JSONSchemaEditorModal.d.ts +0 -10
- package/lib/types/widgets/schema-editor/JSONSchemaEditorModal.d.ts.map +0 -1
- package/src/core/components/Textarea.tsx +0 -25
- package/src/features/facets/FacetsNav.tsx +0 -19
- package/src/features/facets/VFacetsNav.tsx +0 -81
- package/src/widgets/schema-editor/JSONSchemaEditorModal.tsx +0 -67
- /package/lib/esm/features/facets/{StringFacet.js → utils/StringFacet.js} +0 -0
- /package/lib/esm/features/facets/{StringListFacet.js → utils/StringListFacet.js} +0 -0
- /package/lib/esm/features/facets/{TypeFacet.js → utils/TypeFacet.js} +0 -0
- /package/lib/esm/features/facets/{VEnvironmentFacet.js → utils/VEnvironmentFacet.js} +0 -0
- /package/lib/esm/features/facets/{VInteractionFacet.js → utils/VInteractionFacet.js} +0 -0
- /package/lib/esm/features/facets/{VStringFacet.js → utils/VStringFacet.js} +0 -0
- /package/lib/esm/features/facets/{utils.js → utils/utils.js} +0 -0
- /package/lib/types/features/facets/{StringFacet.d.ts → utils/StringFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{StringListFacet.d.ts → utils/StringListFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{TypeFacet.d.ts → utils/TypeFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{VEnvironmentFacet.d.ts → utils/VEnvironmentFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{VInteractionFacet.d.ts → utils/VInteractionFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{VStringFacet.d.ts → utils/VStringFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{VUserFacet.d.ts → utils/VUserFacet.d.ts} +0 -0
- /package/lib/types/features/facets/{utils.d.ts → utils/utils.d.ts} +0 -0
- /package/src/features/facets/{StringFacet.tsx → utils/StringFacet.tsx} +0 -0
- /package/src/features/facets/{StringListFacet.tsx → utils/StringListFacet.tsx} +0 -0
- /package/src/features/facets/{TypeFacet.tsx → utils/TypeFacet.tsx} +0 -0
- /package/src/features/facets/{VEnvironmentFacet.tsx → utils/VEnvironmentFacet.tsx} +0 -0
- /package/src/features/facets/{VInteractionFacet.tsx → utils/VInteractionFacet.tsx} +0 -0
- /package/src/features/facets/{VStringFacet.tsx → utils/VStringFacet.tsx} +0 -0
- /package/src/features/facets/{utils.tsx → utils/utils.tsx} +0 -0
|
@@ -134,7 +134,10 @@ export function useSmartFileUploadProcessing() {
|
|
|
134
134
|
|
|
135
135
|
let res: ContentObjectItem[];
|
|
136
136
|
|
|
137
|
-
const payload: ComplexSearchPayload = {
|
|
137
|
+
const payload: ComplexSearchPayload = {
|
|
138
|
+
query: { match: query },
|
|
139
|
+
select: "id content.etag" // Only fetch fields needed for comparison
|
|
140
|
+
};
|
|
138
141
|
|
|
139
142
|
if (limitToCollectionId) {
|
|
140
143
|
res = (await client.store.collections.searchMembers(limitToCollectionId, payload)).results;
|
|
@@ -164,16 +167,16 @@ export function useSmartFileUploadProcessing() {
|
|
|
164
167
|
const namesInLocation = unskippedFiles
|
|
165
168
|
.filter((file) => file.location === location)
|
|
166
169
|
.map((file) => file.name);
|
|
167
|
-
const query = {
|
|
168
|
-
location: location ?? "",
|
|
170
|
+
const query: Record<string, any> = {
|
|
169
171
|
"content.name": { $in: namesInLocation },
|
|
172
|
+
location: location || "/"
|
|
170
173
|
};
|
|
171
174
|
if (limitToCollectionId) {
|
|
172
175
|
const res = client.store.collections.searchMembers(limitToCollectionId, {
|
|
173
176
|
query: {
|
|
174
177
|
match: query,
|
|
175
178
|
},
|
|
176
|
-
select:
|
|
179
|
+
select: "id content.name location" // Only fetch fields needed for comparison
|
|
177
180
|
}).then((response) => response.results);
|
|
178
181
|
queries.push(res);
|
|
179
182
|
} else {
|
|
@@ -181,7 +184,7 @@ export function useSmartFileUploadProcessing() {
|
|
|
181
184
|
query: {
|
|
182
185
|
match: query,
|
|
183
186
|
},
|
|
184
|
-
select:
|
|
187
|
+
select: "id content.name location" // Only fetch fields needed for comparison
|
|
185
188
|
});
|
|
186
189
|
queries.push(res);
|
|
187
190
|
}
|
|
@@ -193,10 +196,10 @@ export function useSmartFileUploadProcessing() {
|
|
|
193
196
|
//update fileWithMetadata
|
|
194
197
|
for (const doc of results) {
|
|
195
198
|
const file = filesWithMetadata.find(
|
|
196
|
-
//name must be the same, and location must
|
|
199
|
+
//name must be the same, and location must match (default is "/")
|
|
197
200
|
(f) =>
|
|
198
201
|
f.name === doc.content.name &&
|
|
199
|
-
(f.location ? f.location === doc.location : doc.location === ""),
|
|
202
|
+
(f.location ? f.location === doc.location : doc.location === "/"),
|
|
200
203
|
);
|
|
201
204
|
if (file) {
|
|
202
205
|
file.existingId = doc.id;
|
|
@@ -48,7 +48,7 @@ export function CreateOrUpdateTypeModal({ title, isOpen, onClose, okLabel, initi
|
|
|
48
48
|
</div>
|
|
49
49
|
<div>
|
|
50
50
|
<label className="block text-sm font-medium text-muted">Description</label>
|
|
51
|
-
<Textarea value={description} onChange={setDescription} />
|
|
51
|
+
<Textarea value={description} onChange={e => setDescription(e.target.value)} />
|
|
52
52
|
</div>
|
|
53
53
|
</div>
|
|
54
54
|
</ModalBody>
|
|
@@ -130,7 +130,7 @@ function contentToJson(content: string | undefined | null) {
|
|
|
130
130
|
const validateSchema = (schema: Record<string, any>) => {
|
|
131
131
|
try {
|
|
132
132
|
const ajv = new Ajv({
|
|
133
|
-
strict:
|
|
133
|
+
strict: false, // Enable strict mode to ensure all properties are validated
|
|
134
134
|
});
|
|
135
135
|
// Compile the schema. This implicitly validates the schema definition
|
|
136
136
|
// against the JSON Schema draft that ajv supports by default.
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { useUserSession } from "@vertesia/ui/session";
|
|
2
|
-
import { ApiKey, PrincipalType, User } from "@vertesia/common";
|
|
2
|
+
import { ApiKey, PrincipalType, User, UserGroup } from "@vertesia/common";
|
|
3
3
|
import { Avatar, Table, Popover, PopoverContent, PopoverTrigger, useFetch } from "@vertesia/ui/core";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
|
+
import { Users } from "lucide-react";
|
|
5
6
|
|
|
6
7
|
//TODO use a real cache
|
|
7
8
|
const USER_CACHE: Record<string, Promise<User>> = {};
|
|
9
|
+
const GROUP_CACHE: Record<string, Promise<UserGroup>> = {};
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Fetch the user information given a user reference.
|
|
@@ -26,6 +28,25 @@ export function useFetchUserInfo(userId: string) {
|
|
|
26
28
|
}, [userId]);
|
|
27
29
|
}
|
|
28
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Fetch the group information given a group ID.
|
|
33
|
+
* @param groupId
|
|
34
|
+
*/
|
|
35
|
+
export function useFetchGroupInfo(groupId: string) {
|
|
36
|
+
const { client } = useUserSession();
|
|
37
|
+
|
|
38
|
+
return useFetch(() => {
|
|
39
|
+
let group: Promise<UserGroup> | undefined = GROUP_CACHE[groupId];
|
|
40
|
+
if (!group) {
|
|
41
|
+
group = client.iam.groups.retrieve(groupId).then(group => {
|
|
42
|
+
return group;
|
|
43
|
+
});
|
|
44
|
+
GROUP_CACHE[groupId] = group;
|
|
45
|
+
}
|
|
46
|
+
return group;
|
|
47
|
+
}, [groupId]);
|
|
48
|
+
}
|
|
49
|
+
|
|
29
50
|
function AvatarPlaceholder() {
|
|
30
51
|
return <div className='size-8' />
|
|
31
52
|
}
|
|
@@ -38,8 +59,10 @@ interface InfoProps {
|
|
|
38
59
|
function SystemAvatar({ showTitle = false, size = "md" }: InfoProps) {
|
|
39
60
|
return (
|
|
40
61
|
<UserPopoverPanel title="System User" description="The system user is used to initialize built-in objects.">
|
|
41
|
-
<
|
|
42
|
-
|
|
62
|
+
<div className="flex gap-2 items-center">
|
|
63
|
+
<Avatar src="/icon.svg" size={size} />
|
|
64
|
+
{showTitle && <div className="text-sm font-semibold pl-2">System User</div>}
|
|
65
|
+
</div>
|
|
43
66
|
</UserPopoverPanel>
|
|
44
67
|
)
|
|
45
68
|
}
|
|
@@ -96,6 +119,8 @@ export function UserInfo({ userRef, showTitle = false, size = "md" }: UserInfoPr
|
|
|
96
119
|
switch (type) {
|
|
97
120
|
case PrincipalType.User:
|
|
98
121
|
return <UserAvatar userId={id} showTitle={showTitle} size={size} />
|
|
122
|
+
case PrincipalType.Group:
|
|
123
|
+
return <GroupAvatar userId={id} showTitle={showTitle} size={size} />
|
|
99
124
|
case "system":
|
|
100
125
|
return <SystemAvatar showTitle={showTitle} size={size} />
|
|
101
126
|
case PrincipalType.ServiceAccount:
|
|
@@ -123,6 +148,44 @@ function UnknownAvatar({ title, message, color, size = "md", showTitle = false }
|
|
|
123
148
|
)
|
|
124
149
|
}
|
|
125
150
|
|
|
151
|
+
interface GroupAvatarProps extends InfoProps {
|
|
152
|
+
userId: string;
|
|
153
|
+
}
|
|
154
|
+
function GroupAvatar({ userId, showTitle = false, size = "md" }: GroupAvatarProps) {
|
|
155
|
+
const { data: group, error } = useFetchGroupInfo(userId);
|
|
156
|
+
|
|
157
|
+
if (error) {
|
|
158
|
+
return <ErrorAvatar title="Failed to fetch group" error={error} showTitle={showTitle} size={size} />
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if (!group) {
|
|
162
|
+
return <AvatarPlaceholder />
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const description = (
|
|
166
|
+
<div className="space-y-1">
|
|
167
|
+
{group.description && <div className="text-sm">{group.description}</div>}
|
|
168
|
+
<div className="text-xs text-muted-foreground">Group ID: {group.id}</div>
|
|
169
|
+
{group.tags && group.tags.length > 0 && (
|
|
170
|
+
<div className="flex flex-wrap gap-1">
|
|
171
|
+
{group.tags.map(tag => (
|
|
172
|
+
<span key={tag} className="px-1.5 py-0.5 bg-muted rounded text-xs">{tag}</span>
|
|
173
|
+
))}
|
|
174
|
+
</div>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<UserPopoverPanel title={group.name || "Unnamed Group"} description={description}>
|
|
181
|
+
<div className="flex flex-row items-center gap-2">
|
|
182
|
+
<Users className="size-6 text-indigo-500" size={size} />
|
|
183
|
+
{showTitle && <div className="text-sm font-semibold pl-2">{group.name || "Unnamed Group"}</div>}
|
|
184
|
+
</div>
|
|
185
|
+
</UserPopoverPanel>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
126
189
|
interface UserAvatarProps extends InfoProps {
|
|
127
190
|
userId: string;
|
|
128
191
|
}
|
|
@@ -130,10 +130,41 @@ export class HistoryNavigator {
|
|
|
130
130
|
if (beforeEvent._canceled) {
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
|
-
|
|
133
|
+
|
|
134
|
+
// Build navigation chain by preserving previous history
|
|
135
|
+
const currentState = window.history.state;
|
|
136
|
+
const currentTitle = document.title;
|
|
137
|
+
|
|
138
|
+
// Create new history chain entry
|
|
139
|
+
const newChainEntry = {
|
|
140
|
+
title: currentTitle,
|
|
141
|
+
href: window.location.pathname + window.location.search + window.location.hash
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Build the history chain - clear if using replace
|
|
145
|
+
let historyChain: Array<{title: string, href: string}> = [];
|
|
146
|
+
if (!options.replace && currentState?.historyChain) {
|
|
147
|
+
historyChain = [...currentState.historyChain];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Only add to chain if not replacing
|
|
151
|
+
if (!options.replace) {
|
|
152
|
+
historyChain.push(newChainEntry);
|
|
153
|
+
|
|
154
|
+
// Limit chain length to prevent memory issues (keep last 10 entries)
|
|
155
|
+
if (historyChain.length > 10) {
|
|
156
|
+
historyChain = historyChain.slice(-10);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const stateToStore = {
|
|
134
161
|
from: window.location.href,
|
|
162
|
+
historyChain: historyChain,
|
|
135
163
|
data: options.state || undefined
|
|
136
|
-
}
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
window.history[options.replace ? 'replaceState' : 'pushState'](stateToStore, '', to.href);
|
|
167
|
+
|
|
137
168
|
this.fireLocationChange(new AfterLocationChangeEvent(type, to, options.state));
|
|
138
169
|
}
|
|
139
170
|
|
package/src/router/Nav.tsx
CHANGED
|
@@ -20,7 +20,7 @@ export function Nav({ children, onClick }: NavProps) {
|
|
|
20
20
|
if (link && link.href) {
|
|
21
21
|
ev.stopPropagation();
|
|
22
22
|
ev.preventDefault();
|
|
23
|
-
navigate(link.href);
|
|
23
|
+
navigate(link.href, { replace: true });
|
|
24
24
|
onClick?.(ev);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -40,14 +40,15 @@ interface NavLinkProps {
|
|
|
40
40
|
* use the root router to navigate
|
|
41
41
|
*/
|
|
42
42
|
topLevelNav?: boolean;
|
|
43
|
+
clearBreadcrumbs?: boolean;
|
|
43
44
|
}
|
|
44
|
-
export function NavLink({ children, href, className, topLevelNav }: NavLinkProps) {
|
|
45
|
+
export function NavLink({ children, href, className, topLevelNav, clearBreadcrumbs = false }: NavLinkProps) {
|
|
45
46
|
const { router } = useRouterContext();
|
|
46
47
|
const _onClick = (ev: SyntheticEvent) => {
|
|
47
48
|
ev.stopPropagation();
|
|
48
49
|
ev.preventDefault();
|
|
49
50
|
const actualRouter = topLevelNav ? router.getTopRouter() : router;
|
|
50
|
-
actualRouter.navigate(href);
|
|
51
|
+
actualRouter.navigate(href, { replace: clearBreadcrumbs });
|
|
51
52
|
}
|
|
52
53
|
return (
|
|
53
54
|
<a href={href} className={className} onClick={_onClick}>{children}</a>
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
|
|
2
2
|
import { Plus, Trash2 } from "lucide-react";
|
|
3
|
-
import { Button } from "@vertesia/ui/core";
|
|
3
|
+
import { Button, FormItem } from "@vertesia/ui/core";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import type { JSONSchemaObject } from "@vertesia/common";
|
|
6
6
|
import { ComponentType, ReactNode, SyntheticEvent, useState } from "react";
|
|
7
|
-
import { FormContextProvider, InputComponentProps, useForm } from "./FormContext.js";
|
|
7
|
+
import { FormContext, FormContextProvider, InputComponentProps, useForm } from "./FormContext.js";
|
|
8
8
|
import { ManagedListProperty, ManagedObject, ManagedObjectBase, ManagedProperty, Node } from "./ManagedObject.js";
|
|
9
|
-
import { FormLabel, FormHelper } from "./fields.js";
|
|
10
9
|
import { Input } from "./inputs.js";
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
11
|
interface FormProps {
|
|
16
12
|
object: ManagedObject;
|
|
17
13
|
components?: Record<string, ComponentType<InputComponentProps>>;
|
|
18
14
|
children?: ReactNode | ReactNode[];
|
|
19
15
|
onSubmit?: (data: JSONSchemaObject) => void;
|
|
20
16
|
onChange?: (prop: Node) => void;
|
|
17
|
+
disabled?: boolean;
|
|
21
18
|
}
|
|
22
|
-
export function Form({ object, components, onSubmit, children, onChange }: FormProps) {
|
|
19
|
+
export function Form({ object, components, onSubmit, children, onChange, disabled }: FormProps) {
|
|
23
20
|
const _onSubmit = (evt: SyntheticEvent) => {
|
|
24
21
|
evt.stopPropagation();
|
|
25
22
|
evt.preventDefault();
|
|
@@ -27,10 +24,7 @@ export function Form({ object, components, onSubmit, children, onChange }: FormP
|
|
|
27
24
|
}
|
|
28
25
|
object.observer = onChange;
|
|
29
26
|
return (
|
|
30
|
-
<FormContextProvider value={{
|
|
31
|
-
object,
|
|
32
|
-
components: components || {}
|
|
33
|
-
}}>
|
|
27
|
+
<FormContextProvider value={new FormContext(object, components || {}, disabled ?? false)}>
|
|
34
28
|
<form className="w-full" onSubmit={_onSubmit}>
|
|
35
29
|
{children}
|
|
36
30
|
</form>
|
|
@@ -58,24 +52,6 @@ export function GeneratedForm({ children, ...props }: FormProps) {
|
|
|
58
52
|
)
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
// interface FieldSetProps {
|
|
63
|
-
// name: string;
|
|
64
|
-
// children?: ReactNode | ReactNode[];
|
|
65
|
-
// }
|
|
66
|
-
// export function FieldSet({ name, children }: FieldSetProps) {
|
|
67
|
-
// const ctx = useForm();
|
|
68
|
-
// const newCtx = {
|
|
69
|
-
// ...ctx,
|
|
70
|
-
// object: ctx.object.getProperty(name) as ManagedObjectProperty
|
|
71
|
-
// }
|
|
72
|
-
// return (
|
|
73
|
-
// <FormContextProvider value={newCtx}>
|
|
74
|
-
// {children}
|
|
75
|
-
// </FormContextProvider>
|
|
76
|
-
// )
|
|
77
|
-
// }
|
|
78
|
-
|
|
79
55
|
function renderProperty(prop: Node) {
|
|
80
56
|
if (prop.isList) {
|
|
81
57
|
return <ListField key={prop.name} object={prop as ManagedListProperty} />
|
|
@@ -105,7 +81,7 @@ export function ScalarField({ object, editor, inline = false }: ScalarFieldProps
|
|
|
105
81
|
if (!editor) {
|
|
106
82
|
editor = object.schema.editor;
|
|
107
83
|
}
|
|
108
|
-
const { components } = useForm();
|
|
84
|
+
const { components, disabled } = useForm();
|
|
109
85
|
const Component = (editor && components[editor]) || Input;
|
|
110
86
|
const inputType = object.getInputType();
|
|
111
87
|
if (inputType === 'checkbox') {
|
|
@@ -113,20 +89,16 @@ export function ScalarField({ object, editor, inline = false }: ScalarFieldProps
|
|
|
113
89
|
}
|
|
114
90
|
|
|
115
91
|
const handleOnChange = (event: any) => {
|
|
92
|
+
if (disabled) return;
|
|
116
93
|
const { value } = event.target;
|
|
117
94
|
object.value = object.schema.isNumber ? parseFloat(value) : value
|
|
118
95
|
}
|
|
119
96
|
|
|
120
97
|
return (
|
|
121
|
-
<
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</div>
|
|
126
|
-
{
|
|
127
|
-
object.schema.description && <FormHelper>{object.schema.description}</FormHelper>
|
|
128
|
-
}
|
|
129
|
-
</div>
|
|
98
|
+
<FormItem label={object.title} required={object.schema.isRequired} description={object.schema.description}
|
|
99
|
+
className={clsx('flex', inline ? 'flex-row items-center' : 'flex-col')}>
|
|
100
|
+
{!object.isListItem && <Component object={object} type={inputType} onChange={handleOnChange} />}
|
|
101
|
+
</FormItem>
|
|
130
102
|
)
|
|
131
103
|
}
|
|
132
104
|
|
|
@@ -149,13 +121,16 @@ interface ListFieldProps {
|
|
|
149
121
|
}
|
|
150
122
|
function ListField({ object }: ListFieldProps) {
|
|
151
123
|
const [value, setValue] = useState<any[]>(object.value || []);
|
|
124
|
+
const { disabled } = useForm();
|
|
152
125
|
|
|
153
126
|
const addItem = () => {
|
|
127
|
+
if (disabled) return;
|
|
154
128
|
object.add();
|
|
155
129
|
setValue([...object.value]);
|
|
156
130
|
};
|
|
157
131
|
|
|
158
132
|
const deleteItem = (index: number) => {
|
|
133
|
+
if (disabled) return;
|
|
159
134
|
object.remove(index);
|
|
160
135
|
setValue([...object.value]);
|
|
161
136
|
};
|
|
@@ -165,11 +140,11 @@ function ListField({ object }: ListFieldProps) {
|
|
|
165
140
|
{!object.isListItem && <div className='text-gray-900 dark:text-gray-200 font-semibold'>{object.title}</div>}
|
|
166
141
|
{
|
|
167
142
|
object.items.map((item, index) => {
|
|
168
|
-
return <ListItem key={`${index}-${value[index] ?? ''}`} object={item} list={object} onDelete={() => deleteItem(index)} />;
|
|
143
|
+
return <ListItem key={`${index}-${value[index] ?? ''}`} object={item} list={object} onDelete={() => deleteItem(index)} disabled={disabled} />;
|
|
169
144
|
})
|
|
170
145
|
}
|
|
171
146
|
<div>
|
|
172
|
-
<Button variant='secondary' onClick={addItem}><Plus className="size-6" /> Add</Button>
|
|
147
|
+
<Button variant='secondary' onClick={addItem} disabled={disabled}><Plus className="size-6" /> Add</Button>
|
|
173
148
|
</div>
|
|
174
149
|
</div>
|
|
175
150
|
)
|
|
@@ -179,8 +154,9 @@ interface ListItemProps {
|
|
|
179
154
|
list: ManagedListProperty;
|
|
180
155
|
object: Node & { index: number };
|
|
181
156
|
onDelete: () => void;
|
|
157
|
+
disabled?: boolean;
|
|
182
158
|
}
|
|
183
|
-
function ListItem({ list, object, onDelete }: ListItemProps) {
|
|
159
|
+
function ListItem({ list, object, onDelete, disabled }: ListItemProps) {
|
|
184
160
|
return (
|
|
185
161
|
<div className='flex gap-2 w-full'>
|
|
186
162
|
<div className="flex-1">
|
|
@@ -188,7 +164,7 @@ function ListItem({ list, object, onDelete }: ListItemProps) {
|
|
|
188
164
|
renderItemProperty(object, list.schema.arraySchema.editor)
|
|
189
165
|
}
|
|
190
166
|
</div>
|
|
191
|
-
<Button variant='secondary' onClick={onDelete}><Trash2 className='size-4' /></Button>
|
|
167
|
+
<Button variant='secondary' onClick={onDelete} disabled={disabled}><Trash2 className='size-4' /></Button>
|
|
192
168
|
</div>
|
|
193
169
|
)
|
|
194
170
|
}
|
|
@@ -15,10 +15,13 @@ export function useFieldSet() {
|
|
|
15
15
|
export interface InputComponentProps {
|
|
16
16
|
object: Node;
|
|
17
17
|
type: string; // the editor/input type
|
|
18
|
+
onChange?: (event: any) => void;
|
|
19
|
+
disabled?: boolean;
|
|
18
20
|
}
|
|
19
|
-
class FormContext {
|
|
21
|
+
export class FormContext {
|
|
20
22
|
constructor(public object: ManagedObject,
|
|
21
|
-
public components: Record<string, ComponentType<InputComponentProps>> = {}
|
|
23
|
+
public components: Record<string, ComponentType<InputComponentProps>> = {},
|
|
24
|
+
public disabled: boolean = false) {
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
+
import { FormItem } from "@vertesia/ui/core";
|
|
2
|
+
|
|
1
3
|
interface FormLabelProps {
|
|
2
|
-
|
|
4
|
+
label?: string;
|
|
3
5
|
required?: boolean;
|
|
4
6
|
children: React.ReactNode | React.ReactNode[];
|
|
5
7
|
}
|
|
6
|
-
export function FormLabel({
|
|
8
|
+
export function FormLabel({ label, required, children }: FormLabelProps) {
|
|
7
9
|
return (
|
|
8
|
-
<label
|
|
9
|
-
{children}
|
|
10
|
-
</
|
|
11
|
-
)
|
|
10
|
+
<FormItem label={label} required={required}>
|
|
11
|
+
{children}
|
|
12
|
+
</FormItem>
|
|
13
|
+
);
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
interface FormHelperProps {
|
|
@@ -17,6 +17,7 @@ const Input = React.forwardRef<HTMLInputElement | HTMLTextAreaElement, InputProp
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const _onChange = (ev: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
|
20
|
+
if (props.disabled) return;
|
|
20
21
|
setValue(ev.target.value);
|
|
21
22
|
if (object.schema.isBoolean) {
|
|
22
23
|
object.value = (ev.target as HTMLInputElement).checked;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import clsx from "clsx";
|
|
3
|
-
import React, { useState } from "react";
|
|
4
|
-
import { Styles } from "./styles";
|
|
5
|
-
const Textarea = React.forwardRef(({ unstyled, value, onChange, className, ...others }, ref) => {
|
|
6
|
-
const [currentValue, setCurrentValue] = useState(value || "");
|
|
7
|
-
const _onChange = (ev) => {
|
|
8
|
-
const value = ev.target.value;
|
|
9
|
-
setCurrentValue(value);
|
|
10
|
-
onChange && onChange(value);
|
|
11
|
-
};
|
|
12
|
-
return (_jsx("textarea", { ref: ref, ...others, className: clsx('w-full', unstyled ? Styles.INPUT_UNSTYLED : Styles.INPUT, className), value: currentValue, onChange: _onChange }));
|
|
13
|
-
});
|
|
14
|
-
export { Textarea };
|
|
15
|
-
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../../../src/core/components/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAqC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,MAAM,EAAiB,EAAE,GAAG,EAAE,EAAE;IAC9I,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,CAAC,EAA0C,EAAE,EAAE;QAC7D,MAAM,KAAK,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC;QAC9B,eAAe,CAAC,KAAK,CAAC,CAAC;QACvB,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAA;IACD,OAAO,CACH,mBAAU,GAAG,EAAE,GAAG,KACV,MAAM,EACV,SAAS,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,EACrF,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,GAAI,CACnD,CAAA;AACL,CAAC,CAAC,CAAC;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { StringFacet } from './StringFacet';
|
|
3
|
-
import { StringListFacet } from './StringListFacet';
|
|
4
|
-
import { TypeFacet } from './TypeFacet';
|
|
5
|
-
export function FacetsNav({ facets, search }) {
|
|
6
|
-
return (_jsxs("div", { className: 'flex items-center gap-x-4 w-full', children: [facets.role && _jsx(StringFacet, { search: search, className: "flex-1", name: "role", buckets: facets.role || [], placeholder: "Filter by Role" }), facets.type && _jsx(TypeFacet, { search: search, className: "flex-1", buckets: facets.type || [] }), facets.status && _jsx(StringFacet, { search: search, className: "flex-1", name: "status", buckets: facets.status || [], placeholder: "Filter by Status" }), facets.location && _jsx(StringFacet, { search: search, className: "flex-1", name: "location", buckets: facets.location || [], placeholder: "Filter by Location" }), facets.tags && _jsx(StringListFacet, { search: search, className: "flex-1", name: 'tags', buckets: facets.tags || [], placeholder: "Filter by Tags" })] }));
|
|
7
|
-
}
|
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QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,EAAE,WAAW,EAAC,gBAAgB,GAAG,IACzI,CACT,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StringFacet.js","sourceRoot":"","sources":["../../../../src/features/facets/StringFacet.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAS3C,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,EAAoB;IAC3F,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,CAAC,IAAI,CAAW,CAAC;IAC1D,MAAM,QAAQ,GAAG,CAAC,MAA+B,EAAE,EAAE;QACjD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAA;IAED,MAAM,KAAK,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC;IAEpG,OAAO,CACH,KAAC,SAAS,IAAC,QAAQ,EAAC,KAAK,EAAC,SAAS,EAAE,SAAS,EAAE,WAAW,QAAC,WAAW,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAC,KAAK,EAAC,WAAW,EAAE,WAAW,GAAI,CACvL,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StringListFacet.js","sourceRoot":"","sources":["../../../../src/features/facets/StringListFacet.tsx"],"names":[],"mappings":";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N,CAAC;QACD,QAAQ,EAAE,CAAC,WAAmB,EAAE,UAAkB,EAAE,EAAE;YAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC;YACxD,MAAM,UAAU,GAAG,MAAM,EAAE,IAAI,IAAI,WAAW,CAAC;YAC/C,OAAO,UAAU,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC,CAAC;QACvE,CAAC;KACJ,CAAC;IAEF,OAAO,WAAW,CAAC;AACvB,CAAC"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FilterProvider, FilterBtn, FilterBar, FilterClear } from '@vertesia/ui/core';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
export function VFacetsNav({ search, textSearch = '' }) {
|
|
5
|
-
const [filters, setFilters] = useState([]);
|
|
6
|
-
const customFilterGroups = [];
|
|
7
|
-
if (textSearch) {
|
|
8
|
-
customFilterGroups.push({
|
|
9
|
-
placeholder: textSearch,
|
|
10
|
-
name: 'name',
|
|
11
|
-
type: 'text',
|
|
12
|
-
options: [],
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const handleFilterChange = (value) => {
|
|
16
|
-
const newFilters = typeof value === 'function' ? value(filters) : value;
|
|
17
|
-
if (newFilters.length === 0) {
|
|
18
|
-
search.clearFilters();
|
|
19
|
-
setFilters([]);
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
setFilters(newFilters);
|
|
23
|
-
// Reset the actual query before reapplying filters. Otherwise the removed filters remain.
|
|
24
|
-
search.clearFilters(false);
|
|
25
|
-
newFilters.forEach(filter => {
|
|
26
|
-
if (filter.value && filter.value.length > 0) {
|
|
27
|
-
const filterName = filter.name.toLowerCase();
|
|
28
|
-
const filterValue = filter.type === 'stringList'
|
|
29
|
-
? filter.value.map(v => typeof v === 'string' ? v : v.value)
|
|
30
|
-
: Array.isArray(filter.value) && filter.value[0] && typeof filter.value[0] === 'object'
|
|
31
|
-
? filter.value[0].value
|
|
32
|
-
: filter.value;
|
|
33
|
-
switch (filterName) {
|
|
34
|
-
case 'name':
|
|
35
|
-
search.query.search_term = filterValue;
|
|
36
|
-
search.query.name = filterValue;
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
search.query[filterName] = filterValue;
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
search.search();
|
|
45
|
-
};
|
|
46
|
-
return (_jsx(FilterProvider, { filterGroups: customFilterGroups, filters: filters, setFilters: handleFilterChange, children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(FilterBtn, {}), _jsx(FilterBar, {}), _jsx(FilterClear, {})] }) }));
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=VFacetsNav.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VFacetsNav.js","sourceRoot":"","sources":["../../../../src/features/facets/VFacetsNav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAwB,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AACzH,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAgBjC,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,UAAU,GAAG,EAAE,EAAkB;IAClE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAe,EAAE,CAAC,CAAC;IACzD,MAAM,kBAAkB,GAAkB,EAAE,CAAC;IAE7C,IAAI,UAAU,EAAE,CAAC;QACb,kBAAkB,CAAC,IAAI,CAAC;YACpB,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACd,CAAC,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,CAAC,WAAW,GAAG,WAAW,CAAC;wBACvC,MAAM,CAAC,KAAK,CAAC,IAAI,GAAG,WAAW,CAAC;wBAChC,MAAM;oBACV;wBACI,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,WAAW,CAAC;wBACvC,MAAM;gBACd,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,EAAE,CAAC;IACpB,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,cAAc,IACX,YAAY,EAAE,kBAAkB,EAChC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,kBAAkB,YAE9B,eAAK,SAAS,EAAC,yBAAyB,aACpC,KAAC,SAAS,KAAG,EACb,KAAC,SAAS,KAAG,EACb,KAAC,WAAW,KAAG,IACb,GACO,CACpB,CAAA;AACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VInteractionFacet.js","sourceRoot":"","sources":["../../../../src/features/facets/VInteractionFacet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAe,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAe,MAAM,mBAAmB,CAAC;AAcvD,MAAM,UAAU,iBAAiB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAyB;IACnF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACrC,KAAK,EAAE,IAAI,MAAM,CAAC,KAAK,GAAG;QAC1B,KAAK,EAAE,MAAM,CAAC,GAAG;KACpB,CAAC,CAAC,CAAC;IAEJ,MAAM,WAAW,GAAgB;QAC7B,IAAI,EAAE,IAAI;QACV,WAAW,EAAE,WAAW,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;QAC7E,OAAO,EAAE,OAAO;Q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