@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
|
@@ -16,8 +16,6 @@ interface MagicPdfContextValue {
|
|
|
16
16
|
layoutProvider: PageLayoutProvider;
|
|
17
17
|
markdownProvider: PageMarkdownProvider;
|
|
18
18
|
imageProvider: PageImageProvider;
|
|
19
|
-
xml: string;
|
|
20
|
-
xmlPages: string[];
|
|
21
19
|
pdfUrl: string;
|
|
22
20
|
pdfUrlLoading: boolean;
|
|
23
21
|
}
|
|
@@ -201,54 +199,42 @@ interface MagicPdfProviderProps {
|
|
|
201
199
|
export function MagicPdfProvider({ children, object }: MagicPdfProviderProps) {
|
|
202
200
|
const { client } = useUserSession();
|
|
203
201
|
const page_count = (object.metadata as DocumentMetadata).page_count || DEFAULT_PAGE_COUNT;
|
|
204
|
-
const isMarkdownProcessor = (object.metadata as DocumentMetadata)?.content_processor?.type === 'markdown';
|
|
205
202
|
|
|
206
|
-
// Create initial context immediately (synchronously) for both processor types
|
|
207
203
|
const [info, setInfo] = useState<MagicPdfContextValue>(() => {
|
|
208
204
|
const markdownProvider = new PageMarkdownProvider(page_count);
|
|
209
|
-
if (
|
|
205
|
+
if (object.text) {
|
|
210
206
|
markdownProvider.initFromContent(object.text);
|
|
211
207
|
}
|
|
212
|
-
const xml = object.text ? cleanXml(object.text) : '';
|
|
213
208
|
return {
|
|
214
209
|
count: page_count,
|
|
215
210
|
layoutProvider: new PageLayoutProvider(client, object.id, page_count),
|
|
216
211
|
markdownProvider,
|
|
217
212
|
imageProvider: new PageImageProvider(client, object.id, page_count),
|
|
218
|
-
xml,
|
|
219
|
-
xmlPages: object.text ? extractXmlPages(xml) : [],
|
|
220
213
|
pdfUrl: '',
|
|
221
214
|
pdfUrlLoading: true,
|
|
222
215
|
};
|
|
223
216
|
});
|
|
224
217
|
|
|
225
218
|
useEffect(() => {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
})
|
|
240
|
-
|
|
241
|
-
console.warn('Failed to get PDF URL:', e);
|
|
242
|
-
setInfo((prev) => ({ ...prev, pdfUrlLoading: false }));
|
|
243
|
-
});
|
|
244
|
-
} else {
|
|
245
|
-
setInfo((prev) => ({ ...prev, pdfUrlLoading: false }));
|
|
246
|
-
}
|
|
219
|
+
const metadata = object.metadata as DocumentMetadata;
|
|
220
|
+
const pdfRendition = metadata?.renditions?.find((r) => r.name === PDF_RENDITION_NAME);
|
|
221
|
+
const isPdfSource = object.content?.type === 'application/pdf';
|
|
222
|
+
const sourceToResolve = pdfRendition?.content?.source || (isPdfSource ? object.content?.source : undefined);
|
|
223
|
+
|
|
224
|
+
if (sourceToResolve) {
|
|
225
|
+
client.store.objects
|
|
226
|
+
.getDownloadUrl(sourceToResolve, undefined, 'inline')
|
|
227
|
+
.then((response) => {
|
|
228
|
+
setInfo((prev) => ({ ...prev, pdfUrl: response.url, pdfUrlLoading: false }));
|
|
229
|
+
})
|
|
230
|
+
.catch((e) => {
|
|
231
|
+
console.warn('Failed to get PDF URL:', e);
|
|
232
|
+
setInfo((prev) => ({ ...prev, pdfUrlLoading: false }));
|
|
233
|
+
});
|
|
247
234
|
} else {
|
|
248
|
-
// For XML processor, no pre-loading needed - images load on demand
|
|
249
235
|
setInfo((prev) => ({ ...prev, pdfUrlLoading: false }));
|
|
250
236
|
}
|
|
251
|
-
}, [client,
|
|
237
|
+
}, [client, object.metadata, object.content?.type, object.content?.source]);
|
|
252
238
|
|
|
253
239
|
return <MagicPdfContext.Provider value={info}>{children}</MagicPdfContext.Provider>;
|
|
254
240
|
}
|
|
@@ -264,19 +250,3 @@ export function useMagicPdfContext() {
|
|
|
264
250
|
}
|
|
265
251
|
return context;
|
|
266
252
|
}
|
|
267
|
-
|
|
268
|
-
function extractXmlPages(xml: string): string[] {
|
|
269
|
-
// Parse the XML string
|
|
270
|
-
const doc = new DOMParser().parseFromString(cleanXml(xml), 'text/xml');
|
|
271
|
-
const pages = doc.getElementsByTagName('page');
|
|
272
|
-
const serializer = new XMLSerializer();
|
|
273
|
-
return Array.from(pages).map((p) => serializer.serializeToString(p));
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function cleanXml(xml: string) {
|
|
277
|
-
const cleanedXML = xml
|
|
278
|
-
// biome-ignore lint/suspicious/noControlCharactersInRegex: deliberately stripping XML-illegal control characters
|
|
279
|
-
.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '')
|
|
280
|
-
.replace(/<\?xml.*?\?>/g, '');
|
|
281
|
-
return cleanedXML;
|
|
282
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContentObject
|
|
1
|
+
import type { ContentObject } from '@vertesia/common';
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
ErrorBox,
|
|
@@ -13,7 +13,6 @@ import { useUserSession } from '@vertesia/ui/session';
|
|
|
13
13
|
import { X } from 'lucide-react';
|
|
14
14
|
import { Component, type ErrorInfo, type ReactNode, useState } from 'react';
|
|
15
15
|
import { PdfPageSlider } from '../pdf-viewer/PdfPageSlider';
|
|
16
|
-
import { AnnotatedImageSlider } from './AnnotatedImageSlider';
|
|
17
16
|
import { DownloadPopover } from './DownloadPopover';
|
|
18
17
|
import { ExtractedContentView } from './ExtractedContentView';
|
|
19
18
|
import { MagicPdfProvider, useMagicPdfContext } from './MagicPdfProvider';
|
|
@@ -94,7 +93,7 @@ export function MagicPdfView({ objectId, onClose }: MagicPdfViewProps) {
|
|
|
94
93
|
{/* Header matching the main view layout */}
|
|
95
94
|
<div className="flex h-9 items-center justify-end shrink-0 bg-sidebar px-2 border-b border-sidebar-border">
|
|
96
95
|
{onClose && (
|
|
97
|
-
<Button variant="ghost" size="xs" onClick={onClose}
|
|
96
|
+
<Button variant="ghost" size="xs" onClick={onClose} title={t('pdf.close')}>
|
|
98
97
|
<X className="size-4" />
|
|
99
98
|
</Button>
|
|
100
99
|
)}
|
|
@@ -124,55 +123,8 @@ interface _MagicPdfViewProps {
|
|
|
124
123
|
function MagicPdfViewImpl({ object, onClose }: _MagicPdfViewProps) {
|
|
125
124
|
const { t } = useUITranslation();
|
|
126
125
|
const { count: totalPages, pdfUrl, pdfUrlLoading } = useMagicPdfContext();
|
|
127
|
-
|
|
128
|
-
const getProcessorType = (): 'xml' | 'markdown' => {
|
|
129
|
-
if (object.metadata?.type === 'document') {
|
|
130
|
-
const docMetadata = object.metadata as DocumentMetadata;
|
|
131
|
-
const type = docMetadata.content_processor?.type;
|
|
132
|
-
if (type === 'markdown') return 'markdown';
|
|
133
|
-
}
|
|
134
|
-
return 'xml'; // default
|
|
135
|
-
};
|
|
136
|
-
|
|
137
126
|
const [pageNumber, setPageNumber] = useState(1);
|
|
138
|
-
const processorType = getProcessorType();
|
|
139
|
-
|
|
140
|
-
// XML processor: ImageSlider (annotated images) on left, XML/JSON/Markdown text on right
|
|
141
|
-
// Markdown processor: PageSlider (PDF thumbnails) on left, Markdown on right
|
|
142
|
-
if (processorType === 'xml') {
|
|
143
|
-
return (
|
|
144
|
-
<ResizablePanelGroup direction="horizontal" className="absolute inset-0">
|
|
145
|
-
<ResizablePanel defaultSize={50} minSize={20} maxSize={80} className="bg-muted">
|
|
146
|
-
<AnnotatedImageSlider className="h-full" currentPage={pageNumber} onChange={setPageNumber} />
|
|
147
|
-
</ResizablePanel>
|
|
148
|
-
<ResizableHandle className="w-[4px] bg-border cursor-ew-resize" />
|
|
149
|
-
<ResizablePanel defaultSize={50} minSize={20} className="flex flex-col">
|
|
150
|
-
{/* Header */}
|
|
151
|
-
<div className="flex h-9 items-center justify-between shrink-0 bg-sidebar px-2 border-b border-sidebar-border">
|
|
152
|
-
<div className="flex items-center gap-x-2">
|
|
153
|
-
<DownloadPopover object={object} />
|
|
154
|
-
</div>
|
|
155
|
-
<span className="text-xs text-muted-foreground">
|
|
156
|
-
{t('pdf.pageOf', { pageNumber, totalPages })}
|
|
157
|
-
</span>
|
|
158
|
-
<div className="flex items-center gap-x-2">
|
|
159
|
-
{!!onClose && (
|
|
160
|
-
<Button variant="ghost" size="xs" onClick={onClose} alt={t('pdf.close')}>
|
|
161
|
-
<X className="size-4" />
|
|
162
|
-
</Button>
|
|
163
|
-
)}
|
|
164
|
-
</div>
|
|
165
|
-
</div>
|
|
166
|
-
{/* Content */}
|
|
167
|
-
<div className="flex-1 overflow-auto px-2">
|
|
168
|
-
<ExtractedContentView pageNumber={pageNumber} viewType="xml" />
|
|
169
|
-
</div>
|
|
170
|
-
</ResizablePanel>
|
|
171
|
-
</ResizablePanelGroup>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
127
|
|
|
175
|
-
// Markdown processor: PDF thumbnails on left, Markdown on right
|
|
176
128
|
return (
|
|
177
129
|
<ResizablePanelGroup direction="horizontal" className="absolute inset-0">
|
|
178
130
|
<ResizablePanel defaultSize={50} minSize={20} maxSize={80} className="bg-muted">
|
|
@@ -195,7 +147,7 @@ function MagicPdfViewImpl({ object, onClose }: _MagicPdfViewProps) {
|
|
|
195
147
|
<span className="text-xs text-muted-foreground">{t('pdf.pageOf', { pageNumber, totalPages })}</span>
|
|
196
148
|
<div className="flex items-center gap-x-2">
|
|
197
149
|
{!!onClose && (
|
|
198
|
-
<Button variant="ghost" size="xs" onClick={onClose}
|
|
150
|
+
<Button variant="ghost" size="xs" onClick={onClose} title={t('pdf.close')}>
|
|
199
151
|
<X className="size-4" />
|
|
200
152
|
</Button>
|
|
201
153
|
)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type ViewType = '
|
|
1
|
+
export type ViewType = 'json' | 'markdown';
|
|
@@ -161,7 +161,6 @@ export function McpConnectionsInlineList({
|
|
|
161
161
|
size="sm"
|
|
162
162
|
disabled
|
|
163
163
|
className="h-6 w-32 justify-center px-2 text-xs"
|
|
164
|
-
aria-label={t('mcpConnections.checkingStatus')}
|
|
165
164
|
title={t('mcpConnections.checkingStatus')}
|
|
166
165
|
>
|
|
167
166
|
<Spinner className="size-3" />
|
|
@@ -234,7 +233,6 @@ export function McpConnectionsActionMenu({
|
|
|
234
233
|
variant="ghost"
|
|
235
234
|
size="icon"
|
|
236
235
|
className="size-8 rounded-md text-muted hover:bg-muted"
|
|
237
|
-
aria-label={t('mcpConnections.settings')}
|
|
238
236
|
title={t('mcpConnections.settings')}
|
|
239
237
|
disabled={loading}
|
|
240
238
|
>
|
|
@@ -308,7 +308,7 @@ export function PdfPageSlider({
|
|
|
308
308
|
return (
|
|
309
309
|
<div ref={ref} className={clsx('flex flex-col items-stretch', compact ? 'gap-y-1' : 'gap-y-2', className)}>
|
|
310
310
|
<div className={clsx('relative flex items-center justify-center px-2', compact ? 'h-6' : 'h-9')}>
|
|
311
|
-
<Button variant="ghost" size="xs" onClick={goPrev}
|
|
311
|
+
<Button variant="ghost" size="xs" onClick={goPrev} title={t('pdf.previousPage')}>
|
|
312
312
|
<ChevronsUp className="size-4" />
|
|
313
313
|
</Button>
|
|
314
314
|
<div className="absolute start-2 flex items-center gap-x-1">
|
|
@@ -378,7 +378,7 @@ export function PdfPageSlider({
|
|
|
378
378
|
/>
|
|
379
379
|
</div>
|
|
380
380
|
<div className={clsx('flex items-center justify-center', compact ? 'h-6' : 'h-9')}>
|
|
381
|
-
<Button variant="ghost" size="xs" onClick={goNext}
|
|
381
|
+
<Button variant="ghost" size="xs" onClick={goNext} title={t('pdf.nextPage')}>
|
|
382
382
|
<ChevronsDown className="size-4" />
|
|
383
383
|
</Button>
|
|
384
384
|
</div>
|
|
@@ -454,18 +454,18 @@ function ZoomControls({ zoom, onZoomIn, onZoomOut, onFitToView, canZoomIn, canZo
|
|
|
454
454
|
const { t } = useUITranslation();
|
|
455
455
|
return (
|
|
456
456
|
<div className="flex items-center gap-x-0.5">
|
|
457
|
-
<Button variant="ghost" size="xs" onClick={onZoomOut} isDisabled={!canZoomOut}
|
|
457
|
+
<Button variant="ghost" size="xs" onClick={onZoomOut} isDisabled={!canZoomOut} title={t('pdf.zoomOut')}>
|
|
458
458
|
<Minus />
|
|
459
459
|
</Button>
|
|
460
460
|
<span className="text-xs text-muted-foreground min-w-[32px] text-center">{zoom}%</span>
|
|
461
|
-
<Button variant="ghost" size="xs" onClick={onZoomIn} isDisabled={!canZoomIn}
|
|
461
|
+
<Button variant="ghost" size="xs" onClick={onZoomIn} isDisabled={!canZoomIn} title={t('pdf.zoomIn')}>
|
|
462
462
|
<Plus />
|
|
463
463
|
</Button>
|
|
464
464
|
<Button
|
|
465
465
|
variant="ghost"
|
|
466
466
|
size="xs"
|
|
467
467
|
onClick={onFitToView}
|
|
468
|
-
|
|
468
|
+
title={t('pdf.fitToWidth')}
|
|
469
469
|
className={zoom === DEFAULT_ZOOM ? 'text-muted-foreground/40' : undefined}
|
|
470
470
|
>
|
|
471
471
|
<Maximize />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContentObject } from '@vertesia/common';
|
|
2
|
-
import { Button, Spinner
|
|
2
|
+
import { Button, Spinner } from '@vertesia/ui/core';
|
|
3
3
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
4
4
|
import { useUserSession } from '@vertesia/ui/session';
|
|
5
5
|
import { Maximize2, X } from 'lucide-react';
|
|
@@ -100,7 +100,7 @@ export function SimplePdfViewer({ object, url, source, className }: SimplePdfVie
|
|
|
100
100
|
variant="ghost"
|
|
101
101
|
size="xs"
|
|
102
102
|
onClick={() => setIsFullscreen(false)}
|
|
103
|
-
|
|
103
|
+
title={t('pdf.closeFullscreen')}
|
|
104
104
|
>
|
|
105
105
|
<X className="size-4" />
|
|
106
106
|
</Button>
|
|
@@ -131,16 +131,15 @@ export function SimplePdfViewer({ object, url, source, className }: SimplePdfVie
|
|
|
131
131
|
className={className}
|
|
132
132
|
compact
|
|
133
133
|
headerExtra={
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
</VTooltip>
|
|
134
|
+
<Button
|
|
135
|
+
title={t('pdf.fullscreen')}
|
|
136
|
+
tooltipPlacement="bottom"
|
|
137
|
+
variant="unstyled"
|
|
138
|
+
className="p-1 rounded cursor-pointer transition-colors text-muted-foreground hover:text-foreground hover:bg-muted"
|
|
139
|
+
onClick={() => setIsFullscreen(true)}
|
|
140
|
+
>
|
|
141
|
+
<Maximize2 className="size-4" />
|
|
142
|
+
</Button>
|
|
144
143
|
}
|
|
145
144
|
/>
|
|
146
145
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Permission, PrincipalType, type SystemRoleDefinition } from '@vertesia/common';
|
|
1
|
+
import { type AuthTokenPayload, type Permission, PrincipalType, type SystemRoleDefinition } from '@vertesia/common';
|
|
2
2
|
import { ErrorBox, errorMessage, useFetch } from '@vertesia/ui/core';
|
|
3
3
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
4
|
-
import {
|
|
4
|
+
import { useUserSession } from '@vertesia/ui/session';
|
|
5
5
|
import { createContext, useContext, useMemo } from 'react';
|
|
6
6
|
import { isAnyOf } from './helpers';
|
|
7
7
|
|
|
@@ -12,39 +12,18 @@ export class UserPermissions {
|
|
|
12
12
|
roles: Set<string>; // all roles of the current user
|
|
13
13
|
permissions: Set<string>; // all permissions of the current user
|
|
14
14
|
|
|
15
|
-
constructor(
|
|
16
|
-
if (!session.authToken) {
|
|
17
|
-
throw new Error('No auth token found in user session');
|
|
18
|
-
}
|
|
15
|
+
constructor(authToken: AuthTokenPayload, roles: ListRolesResponse = []) {
|
|
19
16
|
this.system_roles = roles;
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
for (const role of session.authToken.project_roles) {
|
|
23
|
-
userRoles.add(role);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
17
|
+
const roleNames = [...(authToken.account_roles || []), ...(authToken.project_roles || [])];
|
|
18
|
+
const userRoles = new Set<string>(roleNames);
|
|
26
19
|
this.roles = userRoles;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
for (const role of roles) {
|
|
30
|
-
map[role.name] = role.permissions;
|
|
31
|
-
}
|
|
20
|
+
const rolePermissions = authToken.permissions ?? getPermissionsForRolesFromMappings(roleNames, roles);
|
|
21
|
+
// OAuth access tokens are capped to the permissions granted to the token (its scopes).
|
|
32
22
|
const permissionCap =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
for (const role of userRoles) {
|
|
38
|
-
const rolePermissions = map[role];
|
|
39
|
-
if (rolePermissions) {
|
|
40
|
-
for (const permission of rolePermissions) {
|
|
41
|
-
if (!permissionCap || permissionCap.has(permission)) {
|
|
42
|
-
permissions.add(permission);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
this.permissions = permissions;
|
|
23
|
+
authToken.type === PrincipalType.OAuthAccess ? new Set<string>(authToken.permissions ?? []) : undefined;
|
|
24
|
+
this.permissions = new Set(
|
|
25
|
+
permissionCap ? rolePermissions.filter((permission) => permissionCap.has(permission)) : rolePermissions,
|
|
26
|
+
);
|
|
48
27
|
}
|
|
49
28
|
|
|
50
29
|
hasPermission(permission: string | string[]) {
|
|
@@ -64,6 +43,17 @@ export class UserPermissions {
|
|
|
64
43
|
}
|
|
65
44
|
}
|
|
66
45
|
|
|
46
|
+
function getPermissionsForRolesFromMappings(roleNames: Iterable<string>, roles: ListRolesResponse): Permission[] {
|
|
47
|
+
const permissionsByRole = new Map(roles.map((role) => [role.name, role.permissions]));
|
|
48
|
+
const permissions = new Set<Permission>();
|
|
49
|
+
for (const role of roleNames) {
|
|
50
|
+
for (const permission of permissionsByRole.get(role) ?? []) {
|
|
51
|
+
permissions.add(permission);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Array.from(permissions);
|
|
55
|
+
}
|
|
56
|
+
|
|
67
57
|
const UserPermissionsContext = createContext<UserPermissions | undefined>(undefined);
|
|
68
58
|
|
|
69
59
|
export { UserPermissionsContext };
|
|
@@ -82,21 +72,28 @@ interface UserPermissionProviderProps {
|
|
|
82
72
|
export function UserPermissionProvider({ children }: UserPermissionProviderProps) {
|
|
83
73
|
const { t } = useUITranslation();
|
|
84
74
|
const session = useUserSession();
|
|
75
|
+
const authToken = session.authToken;
|
|
76
|
+
const shouldFetchRoleMappings = Boolean(authToken && !authToken.permissions);
|
|
85
77
|
const { data, error, isLoading } = useFetch<ListRolesResponse | undefined>(() => {
|
|
86
|
-
if (
|
|
78
|
+
if (shouldFetchRoleMappings) {
|
|
87
79
|
return session.client.iam.roles.listSystem();
|
|
88
|
-
} else {
|
|
89
|
-
return Promise.resolve(undefined);
|
|
90
80
|
}
|
|
91
|
-
|
|
81
|
+
return Promise.resolve(undefined);
|
|
82
|
+
}, [session.client, authToken, shouldFetchRoleMappings]);
|
|
92
83
|
|
|
93
84
|
const perms = useMemo(() => {
|
|
94
|
-
if (
|
|
95
|
-
|
|
85
|
+
if (authToken) {
|
|
86
|
+
if (authToken.permissions || !shouldFetchRoleMappings) {
|
|
87
|
+
return new UserPermissions(authToken);
|
|
88
|
+
}
|
|
89
|
+
if (data && !isLoading) {
|
|
90
|
+
return new UserPermissions(authToken, data);
|
|
91
|
+
}
|
|
96
92
|
} else {
|
|
97
93
|
return undefined;
|
|
98
94
|
}
|
|
99
|
-
|
|
95
|
+
return undefined;
|
|
96
|
+
}, [authToken, data, isLoading, shouldFetchRoleMappings]);
|
|
100
97
|
|
|
101
98
|
if (error) {
|
|
102
99
|
return <ErrorBox title={t('store.failedToFetchRoleMappings')}>{errorMessage(error)}</ErrorBox>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, CopyButton
|
|
1
|
+
import { Button, CopyButton } from '@vertesia/ui/core';
|
|
2
2
|
import { Filter } from 'lucide-react';
|
|
3
3
|
import { createContext, type ReactNode, useContext } from 'react';
|
|
4
4
|
|
|
@@ -52,20 +52,18 @@ export function DocumentCellActions({
|
|
|
52
52
|
<CopyButton content={copyContent} className={ACTION_BTN_CLASS} />
|
|
53
53
|
)}
|
|
54
54
|
{hasValue && value !== undefined && (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</Button>
|
|
68
|
-
</VTooltip>
|
|
55
|
+
<Button
|
|
56
|
+
variant="ghost"
|
|
57
|
+
size="sm"
|
|
58
|
+
title={`Filter by ${label}`}
|
|
59
|
+
className={ACTION_BTN_CLASS}
|
|
60
|
+
onClick={(e) => {
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
onFilter?.(field, value);
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<Filter className="size-3" />
|
|
66
|
+
</Button>
|
|
69
67
|
)}
|
|
70
68
|
</>
|
|
71
69
|
);
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
Spinner,
|
|
13
13
|
useIntersectionObserver,
|
|
14
14
|
useToast,
|
|
15
|
-
VTooltip,
|
|
16
15
|
} from '@vertesia/ui/core';
|
|
17
16
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
18
17
|
import { useNavigate } from '@vertesia/ui/router';
|
|
@@ -452,11 +451,9 @@ function Toolsbar(props: ToolsbarProps) {
|
|
|
452
451
|
)}
|
|
453
452
|
<div className="flex gap-1 items-center">
|
|
454
453
|
{toolbarActions}
|
|
455
|
-
<
|
|
456
|
-
<
|
|
457
|
-
|
|
458
|
-
</Button>
|
|
459
|
-
</VTooltip>
|
|
454
|
+
<Button variant="outline" onClick={handleRefetch} title={t('store.refresh')}>
|
|
455
|
+
<RefreshCw size={16} />
|
|
456
|
+
</Button>
|
|
460
457
|
<ContentDispositionButton onUpdate={setIsGridView} />
|
|
461
458
|
</div>
|
|
462
459
|
</div>
|
|
@@ -33,7 +33,11 @@ export function ContentDispositionButton({ onUpdate }: Readonly<ContentDispositi
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
return (
|
|
36
|
-
<Button
|
|
36
|
+
<Button
|
|
37
|
+
variant="outline"
|
|
38
|
+
onClick={updateView}
|
|
39
|
+
title={isGridView ? t('misc.tableView') : t('misc.thumbnailView')}
|
|
40
|
+
>
|
|
37
41
|
{isGridView ? <TableProperties /> : <LayoutGrid />}
|
|
38
42
|
</Button>
|
|
39
43
|
);
|