@vertesia/ui 1.5.0-dev.20260714.072725Z → 1.5.0-dev.20260722.120446Z
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/core/components/SidePanel.js +1 -1
- package/lib/core/components/SidePanel.js.map +1 -1
- package/lib/core/components/shadcn/button.d.ts +10 -3
- package/lib/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/core/components/shadcn/button.js +41 -9
- package/lib/core/components/shadcn/button.js.map +1 -1
- package/lib/core/components/shadcn/modal/dialog.js +1 -1
- package/lib/core/components/shadcn/modal/dialog.js.map +1 -1
- package/lib/core/components/shadcn/theme/ThemeSwitcher.js +1 -1
- package/lib/core/components/shadcn/theme/ThemeSwitcher.js.map +1 -1
- package/lib/env/index.d.ts +19 -0
- package/lib/env/index.d.ts.map +1 -1
- package/lib/env/index.js +6 -0
- package/lib/env/index.js.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentChatPlaybackControls.js +2 -2
- package/lib/features/agent/chat/AgentChatPlaybackControls.js.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.d.ts.map +1 -1
- package/lib/features/agent/chat/AgentRequestInputOverlay.js +2 -2
- package/lib/features/agent/chat/AgentRequestInputOverlay.js.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.d.ts.map +1 -1
- package/lib/features/agent/chat/ArtifactsTab.js +68 -11
- package/lib/features/agent/chat/ArtifactsTab.js.map +1 -1
- package/lib/features/agent/chat/ImageLightbox.d.ts.map +1 -1
- package/lib/features/agent/chat/ImageLightbox.js +1 -1
- package/lib/features/agent/chat/ImageLightbox.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentConversation.js +52 -49
- package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +5 -5
- package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/Header.js +4 -2
- package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js +2 -2
- package/lib/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +2 -1
- package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts +6 -0
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.d.ts.map +1 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js +15 -1
- package/lib/features/agent/chat/ModernAgentOutput/requestInputMessages.js.map +1 -1
- package/lib/features/agent/chat/hooks/useArtifacts.d.ts +8 -1
- package/lib/features/agent/chat/hooks/useArtifacts.d.ts.map +1 -1
- package/lib/features/agent/chat/hooks/useArtifacts.js +28 -10
- package/lib/features/agent/chat/hooks/useArtifacts.js.map +1 -1
- package/lib/features/document-viewer/UniversalDocumentViewer.d.ts +73 -0
- package/lib/features/document-viewer/UniversalDocumentViewer.d.ts.map +1 -0
- package/lib/features/document-viewer/UniversalDocumentViewer.js +415 -0
- package/lib/features/document-viewer/UniversalDocumentViewer.js.map +1 -0
- package/lib/features/document-viewer/index.d.ts +2 -0
- package/lib/features/document-viewer/index.d.ts.map +1 -0
- package/lib/features/document-viewer/index.js +2 -0
- package/lib/features/document-viewer/index.js.map +1 -0
- package/lib/features/environment/SelectEnvironment.d.ts +28 -0
- package/lib/features/environment/SelectEnvironment.d.ts.map +1 -0
- package/lib/features/environment/SelectEnvironment.js +97 -0
- package/lib/features/environment/SelectEnvironment.js.map +1 -0
- package/lib/features/environment/index.d.ts +2 -0
- package/lib/features/environment/index.d.ts.map +1 -0
- package/lib/features/environment/index.js +2 -0
- package/lib/features/environment/index.js.map +1 -0
- package/lib/features/index.d.ts +3 -0
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +3 -0
- package/lib/features/index.js.map +1 -1
- package/lib/features/magic-pdf/AnnotatedImageSlider.js +12 -12
- package/lib/features/magic-pdf/AnnotatedImageSlider.js.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.d.ts.map +1 -1
- package/lib/features/magic-pdf/DownloadPopover.js +3 -17
- package/lib/features/magic-pdf/DownloadPopover.js.map +1 -1
- package/lib/features/magic-pdf/ExtractedContentView.js +2 -6
- package/lib/features/magic-pdf/ExtractedContentView.js.map +1 -1
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts +25 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js +42 -0
- package/lib/features/magic-pdf/GroundedExtractionAssistantPanel.js.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts +27 -0
- package/lib/features/magic-pdf/GroundedExtractionView.d.ts.map +1 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js +377 -0
- package/lib/features/magic-pdf/GroundedExtractionView.js.map +1 -0
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts +0 -2
- package/lib/features/magic-pdf/MagicPdfProvider.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfProvider.js +15 -42
- package/lib/features/magic-pdf/MagicPdfProvider.js.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.d.ts.map +1 -1
- package/lib/features/magic-pdf/MagicPdfView.js +2 -19
- package/lib/features/magic-pdf/MagicPdfView.js.map +1 -1
- package/lib/features/magic-pdf/index.d.ts +1 -0
- package/lib/features/magic-pdf/index.d.ts.map +1 -1
- package/lib/features/magic-pdf/index.js +1 -0
- package/lib/features/magic-pdf/index.js.map +1 -1
- package/lib/features/magic-pdf/types.d.ts +1 -1
- package/lib/features/magic-pdf/types.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsButton.js +2 -2
- package/lib/features/oauth/McpConnectionsButton.js.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.d.ts.map +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js +1 -1
- package/lib/features/oauth/McpConnectionsDialog.js.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.d.ts.map +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js +1 -1
- package/lib/features/oauth/RemoteMcpConnectionButton.js.map +1 -1
- package/lib/features/pdf-viewer/PdfPageSlider.js +2 -2
- package/lib/features/pdf-viewer/PdfPageSlider.js.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.d.ts.map +1 -1
- package/lib/features/pdf-viewer/SimplePdfViewer.js +3 -3
- package/lib/features/pdf-viewer/SimplePdfViewer.js.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.d.ts +2 -3
- package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
- package/lib/features/permissions/UserPermissionsProvider.js +31 -38
- package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentQuickFilter.js +5 -5
- package/lib/features/store/objects/DocumentQuickFilter.js.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/features/store/objects/DocumentSearchResults.js +2 -2
- package/lib/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.js +1 -1
- package/lib/features/store/objects/components/ContentDispositionButton.js.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/features/store/objects/components/ContentOverview.js +148 -31
- package/lib/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/features/store/objects/components/DocumentIcon.js +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js +1 -1
- package/lib/features/store/objects/components/VectorSearchWidget.js.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts +1 -2
- package/lib/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
- package/lib/features/store/objects/components/useContentPanelHooks.js +4 -8
- package/lib/features/store/objects/components/useContentPanelHooks.js.map +1 -1
- package/lib/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/features/store/objects/layout/renderers.js +2 -2
- package/lib/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js +1 -1
- package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.d.ts.map +1 -1
- package/lib/features/store/types/ContentObjectTypesTable.js +4 -4
- package/lib/features/store/types/ContentObjectTypesTable.js.map +1 -1
- package/lib/features/store/types/IntakePolicyEditor.d.ts +15 -0
- package/lib/features/store/types/IntakePolicyEditor.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyEditor.js +455 -0
- package/lib/features/store/types/IntakePolicyEditor.js.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts +11 -0
- package/lib/features/store/types/IntakePolicyForm.d.ts.map +1 -0
- package/lib/features/store/types/IntakePolicyForm.js +91 -0
- package/lib/features/store/types/IntakePolicyForm.js.map +1 -0
- package/lib/features/store/types/SelectContentTypeModal.js +1 -1
- package/lib/features/store/types/SelectContentTypeModal.js.map +1 -1
- package/lib/features/store/types/index.d.ts +2 -0
- package/lib/features/store/types/index.d.ts.map +1 -1
- package/lib/features/store/types/index.js +2 -0
- package/lib/features/store/types/index.js.map +1 -1
- package/lib/features/store/types/intake-policy-editor.logic.d.ts +7 -0
- package/lib/features/store/types/intake-policy-editor.logic.d.ts.map +1 -0
- package/lib/features/store/types/intake-policy-editor.logic.js +60 -0
- package/lib/features/store/types/intake-policy-editor.logic.js.map +1 -0
- package/lib/features/store/types/typeCatalogCache.d.ts +5 -0
- package/lib/features/store/types/typeCatalogCache.d.ts.map +1 -0
- package/lib/features/store/types/typeCatalogCache.js +40 -0
- package/lib/features/store/types/typeCatalogCache.js.map +1 -0
- package/lib/features/user/UserInfo.js +7 -3
- package/lib/features/user/UserInfo.js.map +1 -1
- package/lib/features/views/ViewExperience.d.ts +20 -0
- package/lib/features/views/ViewExperience.d.ts.map +1 -0
- package/lib/features/views/ViewExperience.js +188 -0
- package/lib/features/views/ViewExperience.js.map +1 -0
- package/lib/features/views/ViewNavigation.d.ts +3 -0
- package/lib/features/views/ViewNavigation.d.ts.map +1 -0
- package/lib/features/views/ViewNavigation.js +36 -0
- package/lib/features/views/ViewNavigation.js.map +1 -0
- package/lib/features/views/ViewResults.d.ts +9 -0
- package/lib/features/views/ViewResults.d.ts.map +1 -0
- package/lib/features/views/ViewResults.js +229 -0
- package/lib/features/views/ViewResults.js.map +1 -0
- package/lib/features/views/ViewSearch.d.ts +3 -0
- package/lib/features/views/ViewSearch.d.ts.map +1 -0
- package/lib/features/views/ViewSearch.js +74 -0
- package/lib/features/views/ViewSearch.js.map +1 -0
- package/lib/features/views/index.d.ts +7 -0
- package/lib/features/views/index.d.ts.map +1 -0
- package/lib/features/views/index.js +7 -0
- package/lib/features/views/index.js.map +1 -0
- package/lib/features/views/types.d.ts +39 -0
- package/lib/features/views/types.d.ts.map +1 -0
- package/lib/features/views/types.js +2 -0
- package/lib/features/views/types.js.map +1 -0
- package/lib/features/views/viewState.d.ts +14 -0
- package/lib/features/views/viewState.d.ts.map +1 -0
- package/lib/features/views/viewState.js +117 -0
- package/lib/features/views/viewState.js.map +1 -0
- package/lib/i18n/locales/ar.json +18 -0
- package/lib/i18n/locales/de.json +14 -0
- package/lib/i18n/locales/en.json +246 -32
- package/lib/i18n/locales/es.json +15 -0
- package/lib/i18n/locales/fr.json +15 -0
- package/lib/i18n/locales/it.json +15 -0
- package/lib/i18n/locales/ja.json +13 -0
- package/lib/i18n/locales/ko.json +13 -0
- package/lib/i18n/locales/pt.json +15 -0
- package/lib/i18n/locales/ru.json +16 -0
- package/lib/i18n/locales/tr.json +14 -0
- package/lib/i18n/locales/zh-TW.json +13 -0
- package/lib/i18n/locales/zh.json +13 -0
- package/lib/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/router/HistoryNavigator.js +27 -14
- package/lib/router/HistoryNavigator.js.map +1 -1
- package/lib/router/Nav.d.ts.map +1 -1
- package/lib/router/Nav.js +21 -6
- package/lib/router/Nav.js.map +1 -1
- package/lib/router/Router.d.ts.map +1 -1
- package/lib/router/Router.js +19 -4
- package/lib/router/Router.js.map +1 -1
- package/lib/router/path.d.ts +15 -0
- package/lib/router/path.d.ts.map +1 -1
- package/lib/router/path.js +43 -0
- package/lib/router/path.js.map +1 -1
- package/lib/session/UserSession.d.ts +6 -0
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +36 -12
- package/lib/session/UserSession.js.map +1 -1
- package/lib/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/session/UserSessionProvider.js +111 -49
- package/lib/session/UserSessionProvider.js.map +1 -1
- package/lib/session/auth/composable.d.ts.map +1 -1
- package/lib/session/auth/composable.js +52 -3
- package/lib/session/auth/composable.js.map +1 -1
- package/lib/session/auth/domainRouting.d.ts +25 -0
- package/lib/session/auth/domainRouting.d.ts.map +1 -1
- package/lib/session/auth/domainRouting.js +36 -0
- package/lib/session/auth/domainRouting.js.map +1 -1
- package/lib/shell/login/SignInRestrictedEnvStep.d.ts +1 -1
- package/lib/shell/login/SignInRestrictedEnvStep.js +1 -1
- package/lib/shell/login/SigninScreen.js +9 -1
- package/lib/shell/login/SigninScreen.js.map +1 -1
- package/lib/shell/login/productionUrl.d.ts +0 -14
- package/lib/shell/login/productionUrl.d.ts.map +1 -1
- package/lib/shell/login/productionUrl.js +14 -5
- package/lib/shell/login/productionUrl.js.map +1 -1
- package/lib/vertesia-ui-core.js +4 -4
- 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 +35 -28
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-i18n.js +15 -15
- package/lib/vertesia-ui-i18n.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 +7 -7
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/lib/widgets/form/Form.js +1 -1
- package/lib/widgets/form/Form.js.map +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js +1 -1
- package/lib/widgets/json-view/JSONSwitcher.js.map +1 -1
- package/lib/widgets/json-view/JSONView.js +6 -6
- package/lib/widgets/json-view/JSONView.js.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -1
- package/lib/widgets/monacoEditor/MonacoEditor.js +29 -0
- package/lib/widgets/monacoEditor/MonacoEditor.js.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.d.ts +8 -0
- package/lib/widgets/schema-editor/ManagedSchema.d.ts.map +1 -1
- package/lib/widgets/schema-editor/ManagedSchema.js +16 -0
- package/lib/widgets/schema-editor/ManagedSchema.js.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts +2 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js +1 -0
- package/lib/widgets/schema-editor/editor/EditableSchemaProperty.js.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js +4 -1
- package/lib/widgets/schema-editor/editor/PropertyViewer.js.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.d.ts.map +1 -1
- package/lib/widgets/schema-editor/editor/SchemaEditor.js +22 -11
- package/lib/widgets/schema-editor/editor/SchemaEditor.js.map +1 -1
- package/llms.txt +70 -70
- package/package.json +33 -32
- package/src/__tests__/a11y.test.tsx +73 -0
- package/src/core/components/SidePanel.tsx +1 -1
- package/src/core/components/shadcn/button.tsx +67 -12
- package/src/core/components/shadcn/modal/dialog.tsx +1 -1
- package/src/core/components/shadcn/theme/ThemeSwitcher.tsx +1 -1
- package/src/env/index.ts +24 -0
- package/src/features/agent/chat/AgentChatPlaybackControls.tsx +0 -5
- package/src/features/agent/chat/AgentRequestInputOverlay.test.tsx +31 -0
- package/src/features/agent/chat/AgentRequestInputOverlay.tsx +6 -2
- package/src/features/agent/chat/ArtifactsTab.tsx +165 -21
- package/src/features/agent/chat/ImageLightbox.tsx +0 -1
- package/src/features/agent/chat/ModernAgentConversation.test.tsx +48 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +53 -51
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +6 -1
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +21 -15
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -3
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +0 -2
- package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +4 -1
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.test.ts +80 -0
- package/src/features/agent/chat/ModernAgentOutput/requestInputMessages.ts +21 -1
- package/src/features/agent/chat/hooks/useArtifacts.ts +44 -11
- package/src/features/document-viewer/UniversalDocumentViewer.test.tsx +123 -0
- package/src/features/document-viewer/UniversalDocumentViewer.tsx +746 -0
- package/src/features/document-viewer/index.ts +1 -0
- package/src/features/environment/SelectEnvironment.tsx +186 -0
- package/src/features/environment/index.ts +1 -0
- package/src/features/index.ts +3 -0
- package/src/features/magic-pdf/AnnotatedImageSlider.tsx +62 -66
- package/src/features/magic-pdf/DownloadPopover.tsx +5 -48
- package/src/features/magic-pdf/ExtractedContentView.tsx +2 -14
- package/src/features/magic-pdf/GroundedExtractionAssistantPanel.tsx +86 -0
- package/src/features/magic-pdf/GroundedExtractionView.test.tsx +65 -0
- package/src/features/magic-pdf/GroundedExtractionView.tsx +1055 -0
- package/src/features/magic-pdf/MagicPdfProvider.tsx +17 -47
- package/src/features/magic-pdf/MagicPdfView.tsx +3 -51
- package/src/features/magic-pdf/index.ts +1 -0
- package/src/features/magic-pdf/types.ts +1 -1
- package/src/features/oauth/McpConnectionsButton.tsx +0 -2
- package/src/features/oauth/McpConnectionsDialog.tsx +0 -1
- package/src/features/oauth/RemoteMcpConnectionButton.tsx +0 -1
- package/src/features/pdf-viewer/PdfPageSlider.tsx +5 -5
- package/src/features/pdf-viewer/SimplePdfViewer.tsx +11 -12
- package/src/features/permissions/UserPermissionsProvider.tsx +36 -39
- package/src/features/store/objects/DocumentQuickFilter.tsx +13 -15
- package/src/features/store/objects/DocumentSearchResults.tsx +3 -6
- package/src/features/store/objects/components/ContentDispositionButton.tsx +5 -1
- package/src/features/store/objects/components/ContentOverview.tsx +240 -67
- package/src/features/store/objects/components/DocumentIcon.tsx +1 -1
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/components/useContentPanelHooks.ts +3 -15
- package/src/features/store/objects/layout/renderers.tsx +1 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +1 -1
- package/src/features/store/types/ContentObjectTypesTable.tsx +12 -14
- package/src/features/store/types/IntakePolicyEditor.tsx +679 -0
- package/src/features/store/types/IntakePolicyForm.tsx +838 -0
- package/src/features/store/types/SelectContentTypeModal.tsx +2 -2
- package/src/features/store/types/index.ts +2 -0
- package/src/features/store/types/intake-policy-editor.logic.test.ts +109 -0
- package/src/features/store/types/intake-policy-editor.logic.ts +87 -0
- package/src/features/store/types/typeCatalogCache.ts +45 -0
- package/src/features/user/UserInfo.tsx +7 -7
- package/src/features/views/ViewExperience.test.tsx +273 -0
- package/src/features/views/ViewExperience.tsx +408 -0
- package/src/features/views/ViewNavigation.test.tsx +86 -0
- package/src/features/views/ViewNavigation.tsx +187 -0
- package/src/features/views/ViewResults.test.ts +82 -0
- package/src/features/views/ViewResults.tsx +609 -0
- package/src/features/views/ViewSearch.test.tsx +147 -0
- package/src/features/views/ViewSearch.tsx +205 -0
- package/src/features/views/index.ts +6 -0
- package/src/features/views/types.ts +57 -0
- package/src/features/views/viewState.test.ts +111 -0
- package/src/features/views/viewState.ts +132 -0
- package/src/i18n/locales/ar.json +18 -0
- package/src/i18n/locales/de.json +14 -0
- package/src/i18n/locales/en.json +965 -751
- package/src/i18n/locales/es.json +15 -0
- package/src/i18n/locales/fr.json +15 -0
- package/src/i18n/locales/it.json +15 -0
- package/src/i18n/locales/ja.json +13 -0
- package/src/i18n/locales/ko.json +13 -0
- package/src/i18n/locales/pt.json +15 -0
- package/src/i18n/locales/ru.json +16 -0
- package/src/i18n/locales/tr.json +14 -0
- package/src/i18n/locales/zh-TW.json +13 -0
- package/src/i18n/locales/zh.json +13 -0
- package/src/router/HistoryNavigator.test.ts +48 -0
- package/src/router/HistoryNavigator.ts +28 -14
- package/src/router/Nav.tsx +24 -8
- package/src/router/Router.tsx +18 -4
- package/src/router/path.test.ts +87 -0
- package/src/router/path.ts +38 -0
- package/src/session/UserSession.test.ts +39 -0
- package/src/session/UserSession.ts +37 -12
- package/src/session/UserSessionProvider.tsx +138 -62
- package/src/session/auth/composable.test.ts +111 -0
- package/src/session/auth/composable.ts +58 -3
- package/src/session/auth/domainRouting.test.ts +28 -1
- package/src/session/auth/domainRouting.ts +38 -0
- package/src/shell/login/SignInRestrictedEnvStep.tsx +1 -1
- package/src/shell/login/SigninScreen.tsx +9 -1
- package/src/shell/login/productionUrl.test.ts +8 -5
- package/src/shell/login/productionUrl.ts +15 -5
- package/src/widgets/form/Form.tsx +1 -1
- package/src/widgets/json-view/JSONSwitcher.tsx +2 -2
- package/src/widgets/json-view/JSONView.tsx +7 -7
- package/src/widgets/monacoEditor/MonacoEditor.tsx +29 -0
- package/src/widgets/schema-editor/ManagedSchema.ts +22 -0
- package/src/widgets/schema-editor/editor/EditableSchemaProperty.tsx +3 -0
- package/src/widgets/schema-editor/editor/PropertyViewer.tsx +14 -3
- package/src/widgets/schema-editor/editor/SchemaEditor.tsx +80 -29
|
@@ -110,10 +110,10 @@ export function SelectContentTypeModal({
|
|
|
110
110
|
)}
|
|
111
111
|
</ModalBody>
|
|
112
112
|
<ModalFooter>
|
|
113
|
-
<Button variant="ghost" onClick={handleClose}
|
|
113
|
+
<Button variant="ghost" onClick={handleClose} title={t('modal.cancel')}>
|
|
114
114
|
{t('modal.cancel')}
|
|
115
115
|
</Button>
|
|
116
|
-
<Button onClick={handleConfirm}
|
|
116
|
+
<Button onClick={handleConfirm} title={t('store.confirmSelection')}>
|
|
117
117
|
{t('modal.confirm')}
|
|
118
118
|
</Button>
|
|
119
119
|
</ModalFooter>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './ContentObjectTypesSearch';
|
|
2
2
|
export * from './ContentObjectTypesTable';
|
|
3
3
|
export * from './CreateOrUpdateTypeModal';
|
|
4
|
+
export * from './IntakePolicyEditor';
|
|
4
5
|
export * from './ObjectSchemaEditor';
|
|
5
6
|
export * from './SelectContentType';
|
|
6
7
|
export * from './SelectContentTypeModal';
|
|
@@ -8,3 +9,4 @@ export * from './search';
|
|
|
8
9
|
export * from './TableLayoutEditor';
|
|
9
10
|
export * from './TypeRegistry';
|
|
10
11
|
export * from './TypeRegistryProvider';
|
|
12
|
+
export * from './typeCatalogCache';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { ContentTypeIntakePolicy, InteractionExecutionConfiguration } from '@vertesia/common';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import {
|
|
4
|
+
replaceIntakeRange,
|
|
5
|
+
updateExecutionEnvironment,
|
|
6
|
+
updateExecutionModel,
|
|
7
|
+
updateIntakePolicy,
|
|
8
|
+
} from './intake-policy-editor.logic.js';
|
|
9
|
+
|
|
10
|
+
const MODEL_OPTIONS = { temperature: 0 } as unknown as NonNullable<InteractionExecutionConfiguration['model_options']>;
|
|
11
|
+
|
|
12
|
+
describe('updateIntakePolicy', () => {
|
|
13
|
+
it('updates a nested field without losing sibling or advanced fields', () => {
|
|
14
|
+
const policy = {
|
|
15
|
+
extraction: {
|
|
16
|
+
enabled: true,
|
|
17
|
+
grounding: {
|
|
18
|
+
enabled: true,
|
|
19
|
+
config: {
|
|
20
|
+
model: 'model-a',
|
|
21
|
+
model_options: { temperature: 0 },
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} as ContentTypeIntakePolicy;
|
|
26
|
+
|
|
27
|
+
const updated = updateIntakePolicy(policy, ['extraction', 'grounding', 'config', 'model'], 'model-b');
|
|
28
|
+
|
|
29
|
+
expect(updated.extraction?.grounding).toEqual({
|
|
30
|
+
enabled: true,
|
|
31
|
+
config: {
|
|
32
|
+
model: 'model-b',
|
|
33
|
+
model_options: { temperature: 0 },
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
expect(policy.extraction?.grounding?.config?.model).toBe('model-a');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('removes cleared fields and prunes empty containers', () => {
|
|
40
|
+
const policy: ContentTypeIntakePolicy = {
|
|
41
|
+
identification: {
|
|
42
|
+
guidance: 'Invoices',
|
|
43
|
+
},
|
|
44
|
+
default_view: 'pdf',
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
expect(updateIntakePolicy(policy, ['identification', 'guidance'], undefined)).toEqual({
|
|
48
|
+
default_view: 'pdf',
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('creates missing containers for a new nested value', () => {
|
|
53
|
+
expect(updateIntakePolicy({}, ['extraction', 'vision', 'max_pages_per_call'], 8)).toEqual({
|
|
54
|
+
extraction: {
|
|
55
|
+
vision: {
|
|
56
|
+
max_pages_per_call: 8,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('replaceIntakeRange', () => {
|
|
64
|
+
it('updates one endpoint without mutating the source range', () => {
|
|
65
|
+
const ranges: [number, number][] = [
|
|
66
|
+
[1, 3],
|
|
67
|
+
[-1, -1],
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
expect(replaceIntakeRange(ranges, 0, 1, 5)).toEqual([
|
|
71
|
+
[1, 5],
|
|
72
|
+
[-1, -1],
|
|
73
|
+
]);
|
|
74
|
+
expect(ranges[0]).toEqual([1, 3]);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe('execution configuration selection', () => {
|
|
79
|
+
it('clears a stale model and model options when the environment changes', () => {
|
|
80
|
+
expect(
|
|
81
|
+
updateExecutionEnvironment(
|
|
82
|
+
{
|
|
83
|
+
environment: 'environment-a',
|
|
84
|
+
model: 'model-a',
|
|
85
|
+
model_options: MODEL_OPTIONS,
|
|
86
|
+
do_validate: true,
|
|
87
|
+
},
|
|
88
|
+
'environment-b',
|
|
89
|
+
),
|
|
90
|
+
).toEqual({
|
|
91
|
+
environment: 'environment-b',
|
|
92
|
+
do_validate: true,
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('clears model options only when the model changes', () => {
|
|
97
|
+
const config = {
|
|
98
|
+
environment: 'environment-a',
|
|
99
|
+
model: 'model-a',
|
|
100
|
+
model_options: MODEL_OPTIONS,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
expect(updateExecutionModel(config, 'model-a')).toEqual(config);
|
|
104
|
+
expect(updateExecutionModel(config, 'model-b')).toEqual({
|
|
105
|
+
environment: 'environment-a',
|
|
106
|
+
model: 'model-b',
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ContentTypeIntakePolicy, InteractionExecutionConfiguration } from '@vertesia/common';
|
|
2
|
+
|
|
3
|
+
export type IntakePolicyPath = readonly string[];
|
|
4
|
+
|
|
5
|
+
export function updateIntakePolicy(
|
|
6
|
+
policy: ContentTypeIntakePolicy,
|
|
7
|
+
path: IntakePolicyPath,
|
|
8
|
+
value: unknown,
|
|
9
|
+
): ContentTypeIntakePolicy {
|
|
10
|
+
if (path.length === 0) {
|
|
11
|
+
return policy;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const next = structuredClone(policy) as Record<string, unknown>;
|
|
15
|
+
const parents: Record<string, unknown>[] = [next];
|
|
16
|
+
let target = next;
|
|
17
|
+
|
|
18
|
+
for (const key of path.slice(0, -1)) {
|
|
19
|
+
const existing = target[key];
|
|
20
|
+
const child = isRecord(existing) ? existing : {};
|
|
21
|
+
target[key] = child;
|
|
22
|
+
target = child;
|
|
23
|
+
parents.push(target);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const leaf = path[path.length - 1];
|
|
27
|
+
if (value === undefined || value === '') {
|
|
28
|
+
delete target[leaf];
|
|
29
|
+
pruneEmptyParents(parents, path);
|
|
30
|
+
} else {
|
|
31
|
+
target[leaf] = value;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return next as ContentTypeIntakePolicy;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function replaceIntakeRange(
|
|
38
|
+
ranges: [number, number][] | undefined,
|
|
39
|
+
index: number,
|
|
40
|
+
endpoint: 0 | 1,
|
|
41
|
+
value: number,
|
|
42
|
+
): [number, number][] {
|
|
43
|
+
const next = ranges?.map((range) => [...range] as [number, number]) ?? [];
|
|
44
|
+
const current = next[index] ?? [1, 1];
|
|
45
|
+
current[endpoint] = value;
|
|
46
|
+
next[index] = current;
|
|
47
|
+
return next;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function updateExecutionEnvironment(
|
|
51
|
+
config: InteractionExecutionConfiguration | undefined,
|
|
52
|
+
environment: string | undefined,
|
|
53
|
+
): InteractionExecutionConfiguration | undefined {
|
|
54
|
+
const next = { ...config, environment };
|
|
55
|
+
delete next.model;
|
|
56
|
+
delete next.model_options;
|
|
57
|
+
return hasConfiguration(next) ? next : undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function updateExecutionModel(
|
|
61
|
+
config: InteractionExecutionConfiguration | undefined,
|
|
62
|
+
model: string | undefined,
|
|
63
|
+
): InteractionExecutionConfiguration | undefined {
|
|
64
|
+
const next = { ...config, model };
|
|
65
|
+
if (model !== config?.model) {
|
|
66
|
+
delete next.model_options;
|
|
67
|
+
}
|
|
68
|
+
return hasConfiguration(next) ? next : undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function pruneEmptyParents(parents: Record<string, unknown>[], path: IntakePolicyPath) {
|
|
72
|
+
for (let index = parents.length - 1; index > 0; index -= 1) {
|
|
73
|
+
const child = parents[index];
|
|
74
|
+
if (Object.keys(child).length > 0) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
delete parents[index - 1][path[index - 1]];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
82
|
+
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function hasConfiguration(config: InteractionExecutionConfiguration) {
|
|
86
|
+
return Object.values(config).some((value) => value !== undefined);
|
|
87
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { VertesiaClient } from '@vertesia/client';
|
|
2
|
+
import type { ContentObjectTypeItem } from '@vertesia/common';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Browser-session cache for content-type catalog lookups, so render-time consumers
|
|
6
|
+
* (e.g. the document view resolving a type's `default_view`) don't pay a catalog request
|
|
7
|
+
* per document view.
|
|
8
|
+
*
|
|
9
|
+
* Scoped per VertesiaClient instance (WeakMap), so switching project/session naturally
|
|
10
|
+
* starts a fresh cache. Entries are cached promises to dedupe concurrent lookups; failed
|
|
11
|
+
* lookups self-evict so the next view retries. In-app type edits must call
|
|
12
|
+
* `invalidateTypeCache` — edits made elsewhere (assistant, another tab) are picked up on
|
|
13
|
+
* the next session.
|
|
14
|
+
*/
|
|
15
|
+
const cachePerClient = new WeakMap<VertesiaClient, Map<string, Promise<ContentObjectTypeItem | undefined>>>();
|
|
16
|
+
|
|
17
|
+
export function resolveTypeCached(client: VertesiaClient, typeId: string): Promise<ContentObjectTypeItem | undefined> {
|
|
18
|
+
let cache = cachePerClient.get(client);
|
|
19
|
+
if (!cache) {
|
|
20
|
+
cache = new Map();
|
|
21
|
+
cachePerClient.set(client, cache);
|
|
22
|
+
}
|
|
23
|
+
let entry = cache.get(typeId);
|
|
24
|
+
if (!entry) {
|
|
25
|
+
entry = client.types.catalog.resolve(typeId).then(
|
|
26
|
+
(type) => type ?? undefined,
|
|
27
|
+
() => {
|
|
28
|
+
cachePerClient.get(client)?.delete(typeId);
|
|
29
|
+
return undefined;
|
|
30
|
+
},
|
|
31
|
+
);
|
|
32
|
+
cache.set(typeId, entry);
|
|
33
|
+
}
|
|
34
|
+
return entry;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function invalidateTypeCache(client: VertesiaClient, typeId?: string): void {
|
|
38
|
+
const cache = cachePerClient.get(client);
|
|
39
|
+
if (!cache) return;
|
|
40
|
+
if (typeId) {
|
|
41
|
+
cache.delete(typeId);
|
|
42
|
+
} else {
|
|
43
|
+
cache.clear();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -140,7 +140,7 @@ function EmailAgentAvatar({ email, showTitle = false, size = 'md' }: EmailAgentA
|
|
|
140
140
|
|
|
141
141
|
const description = (
|
|
142
142
|
<>
|
|
143
|
-
<div>{t('user.
|
|
143
|
+
<div>{t('user.agentOnBehalfOf')}</div>
|
|
144
144
|
<div className="text-muted text-sm">
|
|
145
145
|
<span className="font-semibold">Email:</span> {email}
|
|
146
146
|
</div>
|
|
@@ -158,11 +158,7 @@ function EmailAgentAvatar({ email, showTitle = false, size = 'md' }: EmailAgentA
|
|
|
158
158
|
/>
|
|
159
159
|
<Avatar name={email} size={size} className="border-2 border-white dark:border-gray-800" />
|
|
160
160
|
</div>
|
|
161
|
-
{showTitle && (
|
|
162
|
-
<div className="text-sm font-semibold truncate">
|
|
163
|
-
{t('user.agentOnBehalfOf')} : {email}
|
|
164
|
-
</div>
|
|
165
|
-
)}
|
|
161
|
+
{showTitle && <div className="text-sm font-semibold truncate">Agent ({email})</div>}
|
|
166
162
|
</div>
|
|
167
163
|
</UserPopoverPanel>
|
|
168
164
|
);
|
|
@@ -260,7 +256,11 @@ function AgentAvatar({
|
|
|
260
256
|
</div>
|
|
261
257
|
{showTitle && (
|
|
262
258
|
<div className="text-sm font-semibold truncate">
|
|
263
|
-
{user
|
|
259
|
+
{user
|
|
260
|
+
? `Agent${'\u2003'}(${user.name || user.email})`
|
|
261
|
+
: apiKey
|
|
262
|
+
? `Agent (${apiKey.name})`
|
|
263
|
+
: title}
|
|
264
264
|
</div>
|
|
265
265
|
)}
|
|
266
266
|
</div>
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react';
|
|
2
|
+
import { ContentObjectStatus, type ViewExecutionResult } from '@vertesia/common';
|
|
3
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
4
|
+
import { renderWithProviders } from '../../__tests__/test-utils.js';
|
|
5
|
+
import { ViewExperience } from './ViewExperience.js';
|
|
6
|
+
|
|
7
|
+
const result: ViewExecutionResult = {
|
|
8
|
+
view: 'document-lib',
|
|
9
|
+
revision: 2,
|
|
10
|
+
definition: {
|
|
11
|
+
name: 'Document Library',
|
|
12
|
+
layout: { mode: 'browse', navigation_position: 'sidebar' },
|
|
13
|
+
search: { mode: 'deterministic', placeholder: 'Find documents' },
|
|
14
|
+
navigation: [
|
|
15
|
+
{
|
|
16
|
+
id: 'brand',
|
|
17
|
+
label: 'Brand',
|
|
18
|
+
source: 'terms',
|
|
19
|
+
field: 'properties.brand',
|
|
20
|
+
presentation: 'list',
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
results: {
|
|
24
|
+
default_display: 'table',
|
|
25
|
+
displays: [
|
|
26
|
+
{
|
|
27
|
+
id: 'table',
|
|
28
|
+
label: 'Table',
|
|
29
|
+
type: 'table',
|
|
30
|
+
columns: [
|
|
31
|
+
{ field: 'name', label: 'Name' },
|
|
32
|
+
{ field: 'properties.brand', label: 'Brand' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
display: 'table',
|
|
39
|
+
search: { requested_mode: 'browse', applied_mode: 'browse', warnings: [] },
|
|
40
|
+
hits: [
|
|
41
|
+
{
|
|
42
|
+
id: 'document-1',
|
|
43
|
+
document: {
|
|
44
|
+
id: 'document-1',
|
|
45
|
+
name: 'Renewal Agreement',
|
|
46
|
+
created_at: '2026-01-01T00:00:00.000Z',
|
|
47
|
+
created_by: 'user-1',
|
|
48
|
+
updated_at: '2026-01-02T00:00:00.000Z',
|
|
49
|
+
updated_by: 'user-1',
|
|
50
|
+
location: '/Customers/Acme',
|
|
51
|
+
status: ContentObjectStatus.completed,
|
|
52
|
+
properties: { brand: 'Acme' },
|
|
53
|
+
revision: { root: 'document-1', head: true },
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
total: 1,
|
|
58
|
+
navigation: {
|
|
59
|
+
brand: {
|
|
60
|
+
id: 'brand',
|
|
61
|
+
selected: [],
|
|
62
|
+
nodes: [{ id: 'Acme', label: 'Acme', count: 1 }],
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
took: 5,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
describe('ViewExperience', () => {
|
|
69
|
+
afterEach(() => {
|
|
70
|
+
cleanup();
|
|
71
|
+
vi.clearAllMocks();
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('renders configured search, navigation, and table results and executes selected facets', async () => {
|
|
75
|
+
const execute = vi.fn().mockResolvedValue(result);
|
|
76
|
+
renderWithProviders(
|
|
77
|
+
<ViewExperience viewId="document-lib" execute={execute} syncUrl={false} showHeader={false} />,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
expect(await screen.findByText('Renewal Agreement')).not.toBeNull();
|
|
81
|
+
expect(screen.getByPlaceholderText('Find documents')).not.toBeNull();
|
|
82
|
+
expect(screen.getAllByText('Brand').length).toBeGreaterThan(0);
|
|
83
|
+
expect(screen.getAllByText('Acme').length).toBeGreaterThan(0);
|
|
84
|
+
|
|
85
|
+
fireEvent.click(screen.getByRole('checkbox', { name: /Acme/ }));
|
|
86
|
+
|
|
87
|
+
await waitFor(() => {
|
|
88
|
+
expect(execute).toHaveBeenLastCalledWith(expect.objectContaining({ navigation: { brand: ['Acme'] } }));
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('places results before sidebar navigation visually for worklist layouts', async () => {
|
|
93
|
+
const execute = vi.fn().mockResolvedValue({
|
|
94
|
+
...result,
|
|
95
|
+
definition: {
|
|
96
|
+
...result.definition,
|
|
97
|
+
layout: { mode: 'worklist', navigation_position: 'sidebar' },
|
|
98
|
+
},
|
|
99
|
+
} satisfies ViewExecutionResult);
|
|
100
|
+
renderWithProviders(
|
|
101
|
+
<ViewExperience viewId="case-worklist" execute={execute} syncUrl={false} showHeader={false} />,
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
expect(await screen.findByText('Renewal Agreement')).not.toBeNull();
|
|
105
|
+
expect(document.querySelector('main')?.className).toContain('lg:order-1');
|
|
106
|
+
expect(document.querySelector('aside')?.className).toContain('lg:order-2');
|
|
107
|
+
expect(document.querySelector('main')?.parentElement?.className).toContain(
|
|
108
|
+
'lg:grid-cols-[minmax(0,1fr)_18rem]',
|
|
109
|
+
);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it('uses an app-provided resolver for content thumbnails', async () => {
|
|
113
|
+
const execute = vi.fn().mockResolvedValue({
|
|
114
|
+
...result,
|
|
115
|
+
definition: {
|
|
116
|
+
name: 'Visual assets',
|
|
117
|
+
results: {
|
|
118
|
+
default_display: 'gallery',
|
|
119
|
+
displays: [
|
|
120
|
+
{
|
|
121
|
+
id: 'gallery',
|
|
122
|
+
label: 'Gallery',
|
|
123
|
+
type: 'gallery',
|
|
124
|
+
title: { field: 'name' },
|
|
125
|
+
media: { source: 'content_thumbnail', fallback: 'type_icon' },
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
display: 'gallery',
|
|
131
|
+
} satisfies ViewExecutionResult);
|
|
132
|
+
const resolveMedia = vi.fn().mockResolvedValue('https://example.com/thumbnail.jpg');
|
|
133
|
+
|
|
134
|
+
renderWithProviders(
|
|
135
|
+
<ViewExperience
|
|
136
|
+
viewId="visual-assets"
|
|
137
|
+
execute={execute}
|
|
138
|
+
resolveMedia={resolveMedia}
|
|
139
|
+
syncUrl={false}
|
|
140
|
+
showHeader={false}
|
|
141
|
+
/>,
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
await waitFor(() => {
|
|
145
|
+
expect(document.querySelector('img')?.getAttribute('src')).toBe('https://example.com/thumbnail.jpg');
|
|
146
|
+
});
|
|
147
|
+
expect(resolveMedia).toHaveBeenCalledWith(
|
|
148
|
+
expect.objectContaining({ id: 'document-1' }),
|
|
149
|
+
expect.objectContaining({ source: 'content_thumbnail' }),
|
|
150
|
+
);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('resolves content thumbnails in list displays', async () => {
|
|
154
|
+
const execute = vi.fn().mockResolvedValue({
|
|
155
|
+
...result,
|
|
156
|
+
definition: {
|
|
157
|
+
name: 'Visual assets',
|
|
158
|
+
results: {
|
|
159
|
+
default_display: 'list',
|
|
160
|
+
displays: [
|
|
161
|
+
{
|
|
162
|
+
id: 'list',
|
|
163
|
+
label: 'List',
|
|
164
|
+
type: 'list',
|
|
165
|
+
title: { field: 'name' },
|
|
166
|
+
media: { source: 'content_thumbnail', fallback: 'type_icon' },
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
display: 'list',
|
|
172
|
+
} satisfies ViewExecutionResult);
|
|
173
|
+
const resolveMedia = vi.fn().mockResolvedValue('https://example.com/list-thumbnail.jpg');
|
|
174
|
+
|
|
175
|
+
renderWithProviders(
|
|
176
|
+
<ViewExperience
|
|
177
|
+
viewId="visual-list"
|
|
178
|
+
execute={execute}
|
|
179
|
+
resolveMedia={resolveMedia}
|
|
180
|
+
syncUrl={false}
|
|
181
|
+
showHeader={false}
|
|
182
|
+
/>,
|
|
183
|
+
);
|
|
184
|
+
|
|
185
|
+
await waitFor(() => {
|
|
186
|
+
expect(document.querySelector('img')?.getAttribute('src')).toBe('https://example.com/list-thumbnail.jpg');
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('honors configured media fallbacks', async () => {
|
|
191
|
+
const execute = vi.fn().mockResolvedValue({
|
|
192
|
+
...result,
|
|
193
|
+
definition: {
|
|
194
|
+
name: 'Visual assets',
|
|
195
|
+
results: {
|
|
196
|
+
default_display: 'cards',
|
|
197
|
+
displays: [
|
|
198
|
+
{
|
|
199
|
+
id: 'cards',
|
|
200
|
+
label: 'Cards',
|
|
201
|
+
type: 'cards',
|
|
202
|
+
title: { field: 'name' },
|
|
203
|
+
media: { source: 'content_thumbnail', fallback: 'placeholder' },
|
|
204
|
+
},
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
display: 'cards',
|
|
209
|
+
} satisfies ViewExecutionResult);
|
|
210
|
+
const resolveMedia = vi.fn().mockResolvedValue(undefined);
|
|
211
|
+
|
|
212
|
+
renderWithProviders(
|
|
213
|
+
<ViewExperience
|
|
214
|
+
viewId="visual-fallback"
|
|
215
|
+
execute={execute}
|
|
216
|
+
resolveMedia={resolveMedia}
|
|
217
|
+
syncUrl={false}
|
|
218
|
+
showHeader={false}
|
|
219
|
+
/>,
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
await waitFor(() => expect(resolveMedia).toHaveBeenCalled());
|
|
223
|
+
expect(document.querySelector('svg.lucide-image')).not.toBeNull();
|
|
224
|
+
expect(document.querySelector('svg.lucide-file-text')).toBeNull();
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('executes the sort option configured on a table column', async () => {
|
|
228
|
+
const sortableResult = {
|
|
229
|
+
...result,
|
|
230
|
+
sort: 'name_asc',
|
|
231
|
+
definition: {
|
|
232
|
+
...result.definition,
|
|
233
|
+
results: {
|
|
234
|
+
default_display: 'table',
|
|
235
|
+
default_sort: 'name_asc',
|
|
236
|
+
displays: [
|
|
237
|
+
{
|
|
238
|
+
id: 'table',
|
|
239
|
+
label: 'Table',
|
|
240
|
+
type: 'table',
|
|
241
|
+
columns: [
|
|
242
|
+
{
|
|
243
|
+
field: 'name',
|
|
244
|
+
label: 'Name',
|
|
245
|
+
sortable: true,
|
|
246
|
+
sort_option: 'name_asc',
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
sort_options: [
|
|
252
|
+
{
|
|
253
|
+
id: 'name_asc',
|
|
254
|
+
label: 'Name',
|
|
255
|
+
sort: [{ field: 'name.keyword', order: 'asc' }],
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
} satisfies ViewExecutionResult;
|
|
261
|
+
const execute = vi.fn().mockResolvedValue(sortableResult);
|
|
262
|
+
|
|
263
|
+
renderWithProviders(<ViewExperience viewId="sortable" execute={execute} syncUrl={false} showHeader={false} />);
|
|
264
|
+
|
|
265
|
+
const sortButton = await screen.findByRole('button', { name: 'Name' });
|
|
266
|
+
expect(sortButton.closest('th')?.getAttribute('aria-sort')).toBe('ascending');
|
|
267
|
+
fireEvent.click(sortButton);
|
|
268
|
+
|
|
269
|
+
await waitFor(() => {
|
|
270
|
+
expect(execute).toHaveBeenLastCalledWith(expect.objectContaining({ sort: 'name_asc' }));
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
});
|