@vertesia/ui 0.79.0 → 0.80.0-dev-20251118
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/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 +2 -2
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/index.js +1 -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 +2 -2
- package/lib/esm/core/components/shadcn/resizeable.js.map +1 -1
- 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 +10 -3
- 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/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 +19 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/InteractionsFacetsNav.js +9 -3
- package/lib/esm/features/facets/InteractionsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/utils/VTypeFacet.js +4 -1
- package/lib/esm/features/facets/utils/VTypeFacet.js.map +1 -1
- 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 +29 -30
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +46 -45
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +35 -9
- 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 +158 -114
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentIcon.js +5 -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 +5 -5
- 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 +10 -2
- 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 +15 -7
- 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/user/UserInfo.js +2 -0
- 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/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/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/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 +1 -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/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.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.map +1 -1
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts +1 -0
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/utils/SearchInterface.d.ts +6 -1
- package/lib/types/features/facets/utils/SearchInterface.d.ts.map +1 -1
- package/lib/types/features/facets/utils/VTypeFacet.d.ts +2 -1
- package/lib/types/features/facets/utils/VTypeFacet.d.ts.map +1 -1
- 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 +6 -4
- 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 +3 -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 +1 -0
- 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.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/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.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +170 -165
- package/src/core/components/Panel.tsx +34 -0
- package/src/core/components/SelectBox.tsx +1 -1
- package/src/core/components/SidePanel.tsx +5 -3
- package/src/core/components/TagsInput.tsx +388 -0
- package/src/core/components/index.ts +2 -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 +3 -3
- package/src/core/components/shadcn/index.ts +2 -1
- package/src/core/components/shadcn/input.tsx +10 -7
- package/src/core/components/shadcn/popover.tsx +2 -2
- package/src/core/components/shadcn/resizeable.tsx +4 -4
- package/src/core/components/shadcn/selectBox.tsx +87 -67
- package/src/core/components/shadcn/tabs.tsx +10 -3
- package/src/core/components/shadcn/textarea.tsx +21 -0
- package/src/core/hooks/CompositeState.tsx +156 -6
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useScrollableSearch.tsx +193 -0
- package/src/env/index.ts +4 -3
- package/src/features/agent/PayloadBuilder.tsx +92 -65
- package/src/features/agent/chat/ModernAgentConversation.tsx +109 -118
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +3 -23
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -11
- 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 +9 -9
- package/src/features/facets/CollectionsFacetsNav.tsx +21 -0
- package/src/features/facets/InteractionsFacetsNav.tsx +13 -3
- package/src/features/facets/utils/SearchInterface.tsx +5 -1
- package/src/features/facets/utils/VTypeFacet.tsx +6 -2
- 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 +112 -85
- package/src/features/store/collections/SelectCollection.tsx +105 -49
- package/src/features/store/collections/SharedPropsEditor.tsx +61 -0
- package/src/features/store/collections/SyncMemberHeadsToggle.tsx +48 -0
- package/src/features/store/collections/index.ts +3 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +128 -53
- package/src/features/store/objects/DocumentTable.tsx +14 -4
- package/src/features/store/objects/components/ContentOverview.tsx +208 -110
- package/src/features/store/objects/components/DocumentIcon.tsx +11 -12
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +12 -2
- package/src/features/store/objects/components/useDownloadObject.ts +7 -2
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +16 -1
- package/src/features/store/objects/layout/documentLayout.tsx +7 -5
- 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 +8 -2
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +22 -2
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +18 -9
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +10 -7
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +1 -1
- package/src/features/user/UserInfo.tsx +2 -0
- package/src/router/HistoryNavigator.ts +33 -2
- package/src/router/Nav.tsx +4 -3
- package/src/session/UserSession.ts +1 -0
- package/src/session/UserSessionProvider.tsx +10 -2
- package/src/session/auth/composable.ts +71 -70
- package/src/shell/apps/AppProjectSelector.tsx +2 -2
- package/src/widgets/form/Form.tsx +19 -43
- package/src/widgets/form/FormContext.ts +5 -2
- package/src/widgets/form/ManagedObject.ts +4 -0
- package/src/widgets/form/fields.tsx +8 -6
- package/src/widgets/form/inputs.tsx +1 -0
- package/lib/esm/core/components/Textarea.js +0 -15
- package/lib/esm/core/components/Textarea.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/src/core/components/Textarea.tsx +0 -25
|
@@ -32,95 +32,96 @@ export async function fetchComposableToken(getIdToken: () => Promise<string | nu
|
|
|
32
32
|
throw new Error('No id token found');
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
// Use STS endpoint - either configured or default to sts.vertesia.io
|
|
36
|
+
const stsEndpoint = Env.endpoints.sts;
|
|
37
|
+
console.log('Using STS for token generation:', stsEndpoint);
|
|
38
|
+
Env.logger.info('Using STS for token generation', {
|
|
37
39
|
vertesia: {
|
|
38
40
|
account_id: accountId,
|
|
39
41
|
project_id: projectId,
|
|
42
|
+
sts_url: stsEndpoint,
|
|
40
43
|
},
|
|
41
44
|
});
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
console.log(`Getting composable token for account ${accountId} and project ${projectId}`);
|
|
49
|
-
Env.logger.info('Getting composable token', {
|
|
50
|
-
vertesia: {
|
|
46
|
+
try {
|
|
47
|
+
// Call STS to generate a user token
|
|
48
|
+
const stsUrl = new URL(stsEndpoint + '/token/issue');
|
|
49
|
+
const requestBody = {
|
|
50
|
+
type: 'user',
|
|
51
51
|
account_id: accountId,
|
|
52
52
|
project_id: projectId,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
}).catch(err => {
|
|
63
|
-
localStorage.removeItem(LastSelectedAccountId_KEY);
|
|
64
|
-
localStorage.removeItem(LastSelectedProjectId_KEY);
|
|
65
|
-
console.error('Failed to get composable token', err);
|
|
66
|
-
Env.logger.error('Failed to get composable token', {
|
|
67
|
-
vertesia: {
|
|
68
|
-
account_id: accountId,
|
|
69
|
-
project_id: projectId,
|
|
70
|
-
error: err,
|
|
53
|
+
expires_at: ttl ? Math.floor(Date.now() / 1000) + ttl : undefined,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const stsRes = await fetch(stsUrl, {
|
|
57
|
+
method: 'POST',
|
|
58
|
+
headers: {
|
|
59
|
+
'Content-Type': 'application/json',
|
|
60
|
+
'Authorization': `Bearer ${idToken}` // Firebase token for authentication
|
|
71
61
|
},
|
|
62
|
+
body: JSON.stringify(requestBody)
|
|
72
63
|
});
|
|
73
|
-
throw new Error('Failed to get composable token');
|
|
74
|
-
});
|
|
75
64
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
Env.logger.error('User not found', {
|
|
91
|
-
vertesia: {
|
|
92
|
-
account_id: accountId,
|
|
93
|
-
project_id: projectId,
|
|
94
|
-
email: idTokenDecoded.email
|
|
65
|
+
if (idToken && stsRes?.status === 412) {
|
|
66
|
+
console.log("412: auth succeeded but user doesn't exist - signup required", stsRes?.status);
|
|
67
|
+
Env.logger.error("412: auth succeeded but user doesn't exist - signup required", {
|
|
68
|
+
vertesia: {
|
|
69
|
+
account_id: accountId,
|
|
70
|
+
project_id: projectId,
|
|
71
|
+
status: stsRes?.status
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
const idTokenDecoded = jwtDecode(idToken) as any;
|
|
75
|
+
if (!idTokenDecoded?.email) {
|
|
76
|
+
Env.logger.error('No email found in id token');
|
|
77
|
+
throw new Error('No email found in id token');
|
|
95
78
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
79
|
+
Env.logger.error('User not found', {
|
|
80
|
+
vertesia: {
|
|
81
|
+
account_id: accountId,
|
|
82
|
+
project_id: projectId,
|
|
83
|
+
email: idTokenDecoded.email
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
throw new UserNotFoundError('User not found', idTokenDecoded.email);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (!stsRes.ok) {
|
|
90
|
+
const errorText = await stsRes.text();
|
|
91
|
+
console.error('STS token generation failed:', stsRes.status, errorText);
|
|
92
|
+
Env.logger.error('STS token generation failed', {
|
|
93
|
+
vertesia: {
|
|
94
|
+
status: stsRes.status,
|
|
95
|
+
error: errorText,
|
|
96
|
+
account_id: accountId,
|
|
97
|
+
project_id: projectId,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
throw new Error(`Failed to get token from STS: ${stsRes.status}`);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const { token } = await stsRes.json();
|
|
104
|
+
console.log('Successfully got token from STS');
|
|
105
|
+
Env.logger.info('Successfully got token from STS');
|
|
106
|
+
return token;
|
|
99
107
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (error instanceof UserNotFoundError) {
|
|
110
|
+
throw error; // Re-throw UserNotFoundError
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
localStorage.removeItem(LastSelectedAccountId_KEY);
|
|
114
|
+
localStorage.removeItem(LastSelectedProjectId_KEY);
|
|
115
|
+
console.error('Failed to get composable token from STS', error);
|
|
116
|
+
Env.logger.error('Failed to get composable token from STS', {
|
|
103
117
|
vertesia: {
|
|
104
118
|
account_id: accountId,
|
|
105
119
|
project_id: projectId,
|
|
106
|
-
|
|
120
|
+
error: error,
|
|
107
121
|
},
|
|
108
122
|
});
|
|
109
123
|
throw new Error('Failed to get composable token');
|
|
110
124
|
}
|
|
111
|
-
|
|
112
|
-
const { token } = await res.json().catch(err => {
|
|
113
|
-
Env.logger.error('Failed to parse composable token', {
|
|
114
|
-
vertesia: {
|
|
115
|
-
account_id: accountId,
|
|
116
|
-
project_id: projectId,
|
|
117
|
-
error: err,
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
console.error('Failed to parse composable token', err);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
return token;
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
/**
|
|
@@ -187,4 +188,4 @@ export class UserNotFoundError extends Error {
|
|
|
187
188
|
this.name = 'UserNotFoundError';
|
|
188
189
|
this.email = email;
|
|
189
190
|
}
|
|
190
|
-
}
|
|
191
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProjectRef, RequireAtLeastOne } from "@vertesia/common";
|
|
2
|
-
import {
|
|
2
|
+
import { VSelectBox, useFetch } from "@vertesia/ui/core";
|
|
3
3
|
import { LastSelectedAccountId_KEY, LastSelectedProjectId_KEY, useUserSession } from "@vertesia/ui/session";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
|
|
@@ -47,7 +47,7 @@ function SelectProject({ initialValue, projects, onChange, placeholder = "Select
|
|
|
47
47
|
}
|
|
48
48
|
let actualValue = !value && initialValue ? projects.find(p => p.id === initialValue) : value;
|
|
49
49
|
return (
|
|
50
|
-
<
|
|
50
|
+
<VSelectBox
|
|
51
51
|
by="id"
|
|
52
52
|
value={actualValue}
|
|
53
53
|
options={projects}
|
|
@@ -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} disabled={disabled} />}
|
|
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
|
}
|
|
@@ -10,6 +10,10 @@ function getInputType(_name: string, schema: PropertySchema) {
|
|
|
10
10
|
if (schema.editor) {
|
|
11
11
|
return schema.editor;
|
|
12
12
|
}
|
|
13
|
+
// Check format as fallback (e.g., "document", "media", "date", etc.)
|
|
14
|
+
if (schema.schema.format) {
|
|
15
|
+
return schema.schema.format;
|
|
16
|
+
}
|
|
13
17
|
switch (schema.type) {
|
|
14
18
|
case 'number':
|
|
15
19
|
case 'integer':
|
|
@@ -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 React from "react";
|
|
2
|
-
interface TextareaProps extends Omit<React.HTMLProps<HTMLTextAreaElement>, 'ref' | 'onChange'> {
|
|
3
|
-
onChange: (value: string) => void;
|
|
4
|
-
unstyled?: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
7
|
-
export { Textarea };
|
|
8
|
-
//# sourceMappingURL=Textarea.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../../src/core/components/Textarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,UAAU,aAAc,SAAQ,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC1F,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,2FAaZ,CAAC;AAEH,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import clsx from "clsx";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
import { Styles } from "./styles";
|
|
4
|
-
|
|
5
|
-
interface TextareaProps extends Omit<React.HTMLProps<HTMLTextAreaElement>, 'ref' | 'onChange'> {
|
|
6
|
-
onChange: (value: string) => void;
|
|
7
|
-
unstyled?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(({ unstyled, value, onChange, className, ...others }: TextareaProps, ref) => {
|
|
11
|
-
const [currentValue, setCurrentValue] = useState(value || "");
|
|
12
|
-
const _onChange = (ev: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
13
|
-
const value = ev.target.value;
|
|
14
|
-
setCurrentValue(value);
|
|
15
|
-
onChange && onChange(value);
|
|
16
|
-
}
|
|
17
|
-
return (
|
|
18
|
-
<textarea ref={ref}
|
|
19
|
-
{...others}
|
|
20
|
-
className={clsx('w-full', unstyled ? Styles.INPUT_UNSTYLED : Styles.INPUT, className)}
|
|
21
|
-
value={currentValue} onChange={_onChange} />
|
|
22
|
-
)
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export { Textarea }
|