@vertesia/ui 1.5.0-dev.20260717.131047Z → 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/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 +5 -2
- 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 +1 -1
- 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/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 +2 -0
- package/lib/features/index.d.ts.map +1 -1
- package/lib/features/index.js +2 -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.js +1 -1
- 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 +78 -21
- 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 +16 -0
- package/lib/i18n/locales/de.json +12 -0
- package/lib/i18n/locales/en.json +245 -33
- package/lib/i18n/locales/es.json +13 -0
- package/lib/i18n/locales/fr.json +13 -0
- package/lib/i18n/locales/it.json +13 -0
- package/lib/i18n/locales/ja.json +11 -0
- package/lib/i18n/locales/ko.json +11 -0
- package/lib/i18n/locales/pt.json +13 -0
- package/lib/i18n/locales/ru.json +14 -0
- package/lib/i18n/locales/tr.json +12 -0
- package/lib/i18n/locales/zh-TW.json +11 -0
- package/lib/i18n/locales/zh.json +11 -0
- package/lib/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/router/HistoryNavigator.js +23 -13
- package/lib/router/HistoryNavigator.js.map +1 -1
- package/lib/router/Nav.d.ts.map +1 -1
- package/lib/router/Nav.js +15 -6
- package/lib/router/Nav.js.map +1 -1
- package/lib/session/UserSession.d.ts.map +1 -1
- package/lib/session/UserSession.js +5 -3
- package/lib/session/UserSession.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-features.js +34 -27
- 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/package.json +32 -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/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 +19 -9
- 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 +0 -2
- 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/environment/SelectEnvironment.tsx +186 -0
- package/src/features/environment/index.ts +1 -0
- package/src/features/index.ts +2 -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 +1 -1
- 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 +144 -44
- 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 +16 -0
- package/src/i18n/locales/de.json +12 -0
- package/src/i18n/locales/en.json +965 -753
- package/src/i18n/locales/es.json +13 -0
- package/src/i18n/locales/fr.json +13 -0
- package/src/i18n/locales/it.json +13 -0
- package/src/i18n/locales/ja.json +11 -0
- package/src/i18n/locales/ko.json +11 -0
- package/src/i18n/locales/pt.json +13 -0
- package/src/i18n/locales/ru.json +14 -0
- package/src/i18n/locales/tr.json +12 -0
- package/src/i18n/locales/zh-TW.json +11 -0
- package/src/i18n/locales/zh.json +11 -0
- package/src/router/HistoryNavigator.test.ts +48 -0
- package/src/router/HistoryNavigator.ts +24 -13
- package/src/router/Nav.tsx +18 -8
- package/src/session/UserSession.test.ts +39 -0
- package/src/session/UserSession.ts +5 -3
- 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
|
@@ -4,6 +4,8 @@ export interface EditableSchemaProperty {
|
|
|
4
4
|
name: string;
|
|
5
5
|
type: string;
|
|
6
6
|
description?: string;
|
|
7
|
+
/** When false, field is excluded from model extraction (`x-extract: false`). Default true. */
|
|
8
|
+
extractable?: boolean;
|
|
7
9
|
}
|
|
8
10
|
|
|
9
11
|
export function getEditableSchemaProperty(schema: SchemaNode): EditableSchemaProperty {
|
|
@@ -11,5 +13,6 @@ export function getEditableSchemaProperty(schema: SchemaNode): EditableSchemaPro
|
|
|
11
13
|
name: schema.getNameSignature(),
|
|
12
14
|
type: schema.getTypeSignature(),
|
|
13
15
|
description: schema.description,
|
|
16
|
+
extractable: schema.extractable,
|
|
14
17
|
};
|
|
15
18
|
}
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
+
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
1
2
|
import type { DataViewerProps } from './Editable.js';
|
|
2
3
|
import type { EditableSchemaProperty } from './EditableSchemaProperty.js';
|
|
3
4
|
|
|
4
5
|
export function PropertyViewer({ value }: DataViewerProps<EditableSchemaProperty>) {
|
|
6
|
+
const { t } = useUITranslation();
|
|
5
7
|
if (!value) return null;
|
|
8
|
+
const noExtract = value.extractable === false;
|
|
6
9
|
return (
|
|
7
|
-
<div className="w-full flex items-baseline">
|
|
8
|
-
<div>{value.name || ''}</div>
|
|
9
|
-
<div className="
|
|
10
|
+
<div className="w-full flex items-baseline gap-2 min-w-0">
|
|
11
|
+
<div className="truncate">{value.name || ''}</div>
|
|
12
|
+
<div className="text-sm text-muted shrink-0">{value.type || ''}</div>
|
|
13
|
+
{noExtract && (
|
|
14
|
+
<span
|
|
15
|
+
className="shrink-0 text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5"
|
|
16
|
+
title={t('widgets.schema.extractFromDocumentHint')}
|
|
17
|
+
>
|
|
18
|
+
{t('widgets.schema.noExtract')}
|
|
19
|
+
</span>
|
|
20
|
+
)}
|
|
10
21
|
</div>
|
|
11
22
|
);
|
|
12
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, errorMessage, useToast } from '@vertesia/ui/core';
|
|
1
|
+
import { Button, errorMessage, Switch, useToast } from '@vertesia/ui/core';
|
|
2
2
|
import { useUITranslation } from '@vertesia/ui/i18n';
|
|
3
3
|
import { ChevronDown, ChevronRight, Plus } from 'lucide-react';
|
|
4
4
|
import { useState } from 'react';
|
|
@@ -20,13 +20,26 @@ interface SchemaTreeProps {
|
|
|
20
20
|
readonly?: boolean;
|
|
21
21
|
}
|
|
22
22
|
export function SchemaEditor({ schema, readonly = false }: SchemaTreeProps) {
|
|
23
|
+
const { t } = useUITranslation();
|
|
23
24
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
<div className="space-y-1">
|
|
26
|
+
<div className="flex items-center gap-2 px-2 py-1 text-xs font-medium text-muted-foreground border-b border-border">
|
|
27
|
+
<div className="flex-1 min-w-0">{t('widgets.schema.propertyColumn')}</div>
|
|
28
|
+
{!readonly && (
|
|
29
|
+
<div className="shrink-0 w-28 text-end pe-1" title={t('widgets.schema.extractFromDocumentHint')}>
|
|
30
|
+
{t('widgets.schema.extractFromDocument')}
|
|
31
|
+
</div>
|
|
32
|
+
)}
|
|
33
|
+
{/* space for expand/collapse on parent rows */}
|
|
34
|
+
<div className="w-8 shrink-0" />
|
|
35
|
+
</div>
|
|
36
|
+
<ul className="">
|
|
37
|
+
{schema.children.map((prop) => {
|
|
38
|
+
return renderProperty(prop, readonly);
|
|
39
|
+
})}
|
|
40
|
+
{!readonly ? <AddPropertyButton parent={schema.root} /> : null}
|
|
41
|
+
</ul>
|
|
42
|
+
</div>
|
|
30
43
|
);
|
|
31
44
|
}
|
|
32
45
|
|
|
@@ -44,7 +57,7 @@ interface SimpleItemProps {
|
|
|
44
57
|
}
|
|
45
58
|
function SimpleItem({ node, readonly }: SimpleItemProps) {
|
|
46
59
|
return (
|
|
47
|
-
<li>
|
|
60
|
+
<li className="border-b border-border/40 last:border-0">
|
|
48
61
|
<PropertyTitleBar property={node} readonly={readonly} />
|
|
49
62
|
</li>
|
|
50
63
|
);
|
|
@@ -59,20 +72,21 @@ function ParentItem({ property, readonly }: ParentItemProps) {
|
|
|
59
72
|
const Icon = isOpen ? ChevronDown : ChevronRight;
|
|
60
73
|
|
|
61
74
|
return (
|
|
62
|
-
<li>
|
|
63
|
-
<div className="flex items-center w-full">
|
|
75
|
+
<li className="border-b border-border/40 last:border-0">
|
|
76
|
+
<div className="flex items-center w-full gap-1">
|
|
77
|
+
<div className="flex-1 min-w-0">
|
|
78
|
+
<PropertyTitleBar property={property} readonly={readonly} />
|
|
79
|
+
</div>
|
|
64
80
|
<Button
|
|
65
81
|
variant="ghost"
|
|
66
82
|
size="icon"
|
|
67
83
|
onClick={() => setOpen(!isOpen)}
|
|
68
84
|
aria-label={isOpen ? `Collapse ${property.name}` : `Expand ${property.name}`}
|
|
69
85
|
aria-expanded={isOpen}
|
|
86
|
+
className="shrink-0"
|
|
70
87
|
>
|
|
71
88
|
<Icon className="size-4 cn-rtl-flip" />
|
|
72
89
|
</Button>
|
|
73
|
-
<div className="flex-1">
|
|
74
|
-
<PropertyTitleBar property={property} readonly={readonly} />
|
|
75
|
-
</div>
|
|
76
90
|
</div>
|
|
77
91
|
{isOpen && (
|
|
78
92
|
<ul className="ms-4 border-s border-gray-400 border-dashed">
|
|
@@ -110,7 +124,13 @@ function PropertyTitleBar({ property, readonly }: PropertyTitleBarProps) {
|
|
|
110
124
|
|
|
111
125
|
const update = property.getUpdateFromNameAndTypeSignature(value.name, value.type);
|
|
112
126
|
|
|
113
|
-
if (
|
|
127
|
+
if (
|
|
128
|
+
property.update({
|
|
129
|
+
...update,
|
|
130
|
+
description: value.description,
|
|
131
|
+
extractable: value.extractable,
|
|
132
|
+
})
|
|
133
|
+
) {
|
|
114
134
|
property.reloadTree();
|
|
115
135
|
}
|
|
116
136
|
} catch (err: unknown) {
|
|
@@ -124,25 +144,56 @@ function PropertyTitleBar({ property, readonly }: PropertyTitleBarProps) {
|
|
|
124
144
|
}
|
|
125
145
|
return true;
|
|
126
146
|
};
|
|
147
|
+
|
|
148
|
+
/** Toggle extractability without entering name/type edit mode. */
|
|
149
|
+
const onExtractableChange = (extractable: boolean) => {
|
|
150
|
+
if (property.update({ extractable })) {
|
|
151
|
+
property.reloadTree();
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
127
155
|
const isNew = property.resetIsNew();
|
|
128
156
|
const editableProp = getEditableSchemaProperty(property);
|
|
129
157
|
|
|
130
158
|
return (
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
159
|
+
<div className="flex items-center gap-2 w-full min-w-0 py-0.5">
|
|
160
|
+
<div className="flex-1 min-w-0">
|
|
161
|
+
<Editable
|
|
162
|
+
value={editableProp}
|
|
163
|
+
onChange={onChange}
|
|
164
|
+
onDelete={() => {
|
|
165
|
+
property.remove();
|
|
166
|
+
property.reloadTree();
|
|
167
|
+
}}
|
|
168
|
+
editor={PropertyEditor}
|
|
169
|
+
viewer={PropertyViewer}
|
|
170
|
+
outlineOnHover
|
|
171
|
+
isEditing={isNew}
|
|
172
|
+
skipClickOutside={skipClickOutside}
|
|
173
|
+
readonly={readonly}
|
|
174
|
+
onValidate={(prop) => validatePropertyName(prop.name)}
|
|
175
|
+
/>
|
|
176
|
+
</div>
|
|
177
|
+
{!readonly ? (
|
|
178
|
+
<div className="shrink-0 w-28 flex items-center justify-end gap-1.5 pe-1">
|
|
179
|
+
<Switch
|
|
180
|
+
size="sm"
|
|
181
|
+
value={property.extractable}
|
|
182
|
+
onChange={onExtractableChange}
|
|
183
|
+
aria-label={`${t('widgets.schema.extractFromDocument')}: ${property.name}`}
|
|
184
|
+
/>
|
|
185
|
+
</div>
|
|
186
|
+
) : property.extractable === false ? (
|
|
187
|
+
<div className="shrink-0 w-28 flex justify-end pe-1">
|
|
188
|
+
<span
|
|
189
|
+
className="text-[10px] uppercase tracking-wide text-attention border border-attention/40 bg-attention/10 rounded px-1.5 py-0.5"
|
|
190
|
+
title={t('widgets.schema.extractFromDocumentHint')}
|
|
191
|
+
>
|
|
192
|
+
{t('widgets.schema.noExtract')}
|
|
193
|
+
</span>
|
|
194
|
+
</div>
|
|
195
|
+
) : null}
|
|
196
|
+
</div>
|
|
146
197
|
);
|
|
147
198
|
}
|
|
148
199
|
|