@vertesia/ui 0.81.0 → 0.81.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/core/components/shadcn/dialog.js +7 -3
- package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
- package/lib/esm/core/components/shadcn/popover.js +3 -1
- package/lib/esm/core/components/shadcn/popover.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/tooltip.js +5 -1
- package/lib/esm/core/components/shadcn/tooltip.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +22 -0
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +6 -62
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/MessageInput.js.map +1 -1
- package/lib/esm/features/facets/AgentRunnerFacetsNav.js +86 -0
- package/lib/esm/features/facets/AgentRunnerFacetsNav.js.map +1 -0
- package/lib/esm/features/facets/index.js +1 -0
- package/lib/esm/features/facets/index.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +4 -6
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js +25 -39
- package/lib/esm/features/store/objects/components/PropertiesEditorModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/useContentPanelHooks.js +3 -3
- package/lib/esm/features/store/objects/components/useContentPanelHooks.js.map +1 -1
- package/lib/esm/features/store/types/ObjectSchemaEditor.js +4 -6
- package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
- package/lib/esm/features/store/types/TableLayoutEditor.js +4 -6
- package/lib/esm/features/store/types/TableLayoutEditor.js.map +1 -1
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/index.js.map +1 -1
- package/lib/esm/widgets/json-view/JSONCode.js +16 -151
- package/lib/esm/widgets/json-view/JSONCode.js.map +1 -1
- package/lib/esm/widgets/{codemirror → monacoEditor}/MonacoEditor.js +18 -6
- package/lib/esm/widgets/monacoEditor/MonacoEditor.js.map +1 -0
- package/lib/esm/widgets/monacoEditor/index.js +2 -0
- package/lib/esm/widgets/monacoEditor/index.js.map +1 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/shadcn/dialog.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/popover.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tooltip.d.ts.map +1 -1
- package/lib/types/features/agent/PayloadBuilder.d.ts +1 -0
- package/lib/types/features/agent/PayloadBuilder.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
- package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts +14 -0
- package/lib/types/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -0
- package/lib/types/features/facets/index.d.ts +1 -0
- package/lib/types/features/facets/index.d.ts.map +1 -1
- package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/PropertiesEditorModal.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/useContentPanelHooks.d.ts.map +1 -1
- package/lib/types/features/store/types/ObjectSchemaEditor.d.ts.map +1 -1
- package/lib/types/features/store/types/TableLayoutEditor.d.ts.map +1 -1
- package/lib/types/widgets/index.d.ts +1 -1
- package/lib/types/widgets/index.d.ts.map +1 -1
- package/lib/types/widgets/json-view/JSONCode.d.ts +2 -19
- package/lib/types/widgets/json-view/JSONCode.d.ts.map +1 -1
- package/lib/types/widgets/{codemirror → monacoEditor}/MonacoEditor.d.ts +6 -3
- package/lib/types/widgets/monacoEditor/MonacoEditor.d.ts.map +1 -0
- package/lib/types/widgets/monacoEditor/index.d.ts +3 -0
- package/lib/types/widgets/monacoEditor/index.d.ts.map +1 -0
- package/lib/vertesia-ui-core.js +1 -1
- package/lib/vertesia-ui-core.js.map +1 -1
- package/lib/vertesia-ui-features.js +1 -1
- package/lib/vertesia-ui-features.js.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +6 -10
- package/src/core/components/shadcn/calendar.tsx +2 -2
- package/src/core/components/shadcn/dialog.tsx +23 -19
- package/src/core/components/shadcn/filters/index.ts +1 -1
- package/src/core/components/shadcn/popover.tsx +3 -1
- package/src/core/components/shadcn/selectBox.tsx +2 -2
- package/src/core/components/shadcn/tooltip.tsx +20 -16
- package/src/features/agent/PayloadBuilder.tsx +28 -0
- package/src/features/agent/chat/ModernAgentConversation.tsx +6 -104
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +1 -1
- package/src/features/agent/chat/ModernAgentOutput/MessageInput.tsx +1 -1
- package/src/features/facets/AgentRunnerFacetsNav.tsx +125 -0
- package/src/features/facets/index.ts +1 -0
- package/src/features/store/collections/CreateCollection.tsx +1 -1
- package/src/features/store/collections/EditCollectionView.tsx +10 -8
- package/src/features/store/objects/components/PropertiesEditorModal.tsx +36 -51
- package/src/features/store/objects/components/useContentPanelHooks.ts +3 -3
- package/src/features/store/types/ObjectSchemaEditor.tsx +9 -7
- package/src/features/store/types/TableLayoutEditor.tsx +9 -7
- package/src/session/auth/auth-flow.md +1094 -0
- package/src/widgets/index.ts +1 -1
- package/src/widgets/json-view/JSONCode.tsx +30 -172
- package/src/widgets/{codemirror → monacoEditor}/MonacoEditor.tsx +30 -10
- package/src/widgets/monacoEditor/index.ts +3 -0
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js +0 -103
- package/lib/esm/widgets/codemirror/CodeMirrorEditor.js.map +0 -1
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js +0 -33
- package/lib/esm/widgets/codemirror/CodemirrorStateSingleton.js.map +0 -1
- package/lib/esm/widgets/codemirror/MonacoEditor.js.map +0 -1
- package/lib/esm/widgets/codemirror/index.js +0 -3
- package/lib/esm/widgets/codemirror/index.js.map +0 -1
- package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts +0 -24
- package/lib/types/widgets/codemirror/CodeMirrorEditor.d.ts.map +0 -1
- package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts +0 -15
- package/lib/types/widgets/codemirror/CodemirrorStateSingleton.d.ts.map +0 -1
- package/lib/types/widgets/codemirror/MonacoEditor.d.ts.map +0 -1
- package/lib/types/widgets/codemirror/index.d.ts +0 -5
- package/lib/types/widgets/codemirror/index.d.ts.map +0 -1
- package/src/widgets/codemirror/CodeMirrorEditor.tsx +0 -122
- package/src/widgets/codemirror/CodemirrorStateSingleton.tsx +0 -39
- package/src/widgets/codemirror/index.ts +0 -6
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
ModalBody,
|
|
7
7
|
ModalFooter,
|
|
8
8
|
ModalTitle,
|
|
9
|
-
useToast
|
|
9
|
+
useToast,
|
|
10
|
+
useTheme
|
|
10
11
|
} from '@vertesia/ui/core';
|
|
11
12
|
import { ContentObject } from '@vertesia/common';
|
|
12
13
|
import { useNavigate } from "@vertesia/ui/router";
|
|
13
14
|
|
|
14
|
-
// Import Monaco Editor
|
|
15
|
-
import
|
|
16
|
-
import { editor } from 'monaco-editor';
|
|
15
|
+
// Import Monaco Editor wrapper
|
|
16
|
+
import { MonacoEditor, IEditorApi } from '@vertesia/ui/widgets';
|
|
17
17
|
|
|
18
18
|
// Import SaveVersionConfirmModal
|
|
19
19
|
import { SaveVersionConfirmModal } from './SaveVersionConfirmModal';
|
|
@@ -28,13 +28,13 @@ export interface PropertiesEditorModalProps {
|
|
|
28
28
|
export function PropertiesEditorModal({ isOpen, onClose, object, refetch }: PropertiesEditorModalProps) {
|
|
29
29
|
const { client, store } = useUserSession();
|
|
30
30
|
const toast = useToast();
|
|
31
|
+
const { theme } = useTheme();
|
|
31
32
|
const navigate = useNavigate();
|
|
32
33
|
const [isLoading, setIsLoading] = useState(false);
|
|
33
34
|
const [propertiesJson, setPropertiesJson] = useState('');
|
|
34
35
|
const [showConfirmation, setShowConfirmation] = useState(false);
|
|
35
36
|
const [parsedProperties, setParsedProperties] = useState<any>(null);
|
|
36
|
-
const editorRef = useRef<
|
|
37
|
-
const monacoRef = useRef<Monaco | null>(null);
|
|
37
|
+
const editorRef = useRef<IEditorApi | undefined>(undefined);
|
|
38
38
|
const [jsonSchema, setJsonSchema] = useState<any>(null);
|
|
39
39
|
//TODO state not used
|
|
40
40
|
const [_newVersionId, setNewVersionId] = useState<string | null>(null);
|
|
@@ -51,47 +51,33 @@ export function PropertiesEditorModal({ isOpen, onClose, object, refetch }: Prop
|
|
|
51
51
|
}
|
|
52
52
|
}, [isOpen, object]);
|
|
53
53
|
|
|
54
|
-
// Handle editor mounting
|
|
55
|
-
function handleEditorDidMount(editor: editor.IStandaloneCodeEditor, monaco: Monaco) {
|
|
56
|
-
editorRef.current = editor;
|
|
57
|
-
monacoRef.current = monaco;
|
|
58
|
-
|
|
59
|
-
// Apply JSON schema validation if available
|
|
60
|
-
if (jsonSchema) {
|
|
61
|
-
setMonacoJsonSchema(monaco, jsonSchema);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
54
|
// Fetch JSON schema for the object type
|
|
66
55
|
async function fetchJsonSchema(typeId: string) {
|
|
67
56
|
try {
|
|
68
57
|
const typeDetails = await store.types.retrieve(typeId);
|
|
69
58
|
if (typeDetails.object_schema) {
|
|
70
59
|
setJsonSchema(typeDetails.object_schema);
|
|
71
|
-
|
|
72
|
-
// Apply schema if Monaco is already mounted
|
|
73
|
-
if (monacoRef.current) {
|
|
74
|
-
setMonacoJsonSchema(monacoRef.current, typeDetails.object_schema);
|
|
75
|
-
}
|
|
76
60
|
}
|
|
77
61
|
} catch (error) {
|
|
78
62
|
console.error('Failed to fetch JSON schema:', error);
|
|
79
63
|
}
|
|
80
64
|
}
|
|
81
65
|
|
|
82
|
-
// Configure Monaco editor with JSON schema
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
66
|
+
// Configure Monaco editor with JSON schema validation
|
|
67
|
+
const beforeMount = (monaco: typeof import('monaco-editor')) => {
|
|
68
|
+
if (jsonSchema) {
|
|
69
|
+
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
|
|
70
|
+
validate: true,
|
|
71
|
+
schemas: [
|
|
72
|
+
{
|
|
73
|
+
uri: 'http://myserver/object-schema.json',
|
|
74
|
+
fileMatch: ['*'],
|
|
75
|
+
schema: jsonSchema
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
95
81
|
|
|
96
82
|
// Validate JSON and open confirmation modal
|
|
97
83
|
function handleSave() {
|
|
@@ -113,6 +99,11 @@ export function PropertiesEditorModal({ isOpen, onClose, object, refetch }: Prop
|
|
|
113
99
|
}
|
|
114
100
|
}
|
|
115
101
|
|
|
102
|
+
// Handle editor changes
|
|
103
|
+
const handleEditorChange = (value: string) => {
|
|
104
|
+
setPropertiesJson(value);
|
|
105
|
+
};
|
|
106
|
+
|
|
116
107
|
// Save properties
|
|
117
108
|
async function saveProperties(createVersion: boolean, versionLabel?: string) {
|
|
118
109
|
try {
|
|
@@ -170,11 +161,11 @@ export function PropertiesEditorModal({ isOpen, onClose, object, refetch }: Prop
|
|
|
170
161
|
description: 'The object properties have been updated successfully.',
|
|
171
162
|
duration: 2000
|
|
172
163
|
});
|
|
173
|
-
|
|
164
|
+
|
|
174
165
|
if (refetch) {
|
|
175
166
|
await refetch();
|
|
176
167
|
}
|
|
177
|
-
|
|
168
|
+
|
|
178
169
|
setShowConfirmation(false);
|
|
179
170
|
onClose();
|
|
180
171
|
}
|
|
@@ -214,21 +205,15 @@ export function PropertiesEditorModal({ isOpen, onClose, object, refetch }: Prop
|
|
|
214
205
|
<span className="ml-2 text-green-600">(JSON schema validation enabled)</span>
|
|
215
206
|
)}
|
|
216
207
|
</div>
|
|
217
|
-
<div className="h-[75vh] border
|
|
218
|
-
<
|
|
219
|
-
height="100%"
|
|
220
|
-
language="json"
|
|
208
|
+
<div className="h-[75vh] border rounded-md overflow-hidden">
|
|
209
|
+
<MonacoEditor
|
|
221
210
|
value={propertiesJson}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
formatOnType: true,
|
|
229
|
-
automaticLayout: true,
|
|
230
|
-
wordWrap: 'on'
|
|
231
|
-
}}
|
|
211
|
+
language="json"
|
|
212
|
+
editorRef={editorRef}
|
|
213
|
+
onChange={(update) => handleEditorChange(update.state.doc.toString())}
|
|
214
|
+
beforeMount={beforeMount}
|
|
215
|
+
theme={theme === 'dark' ? 'vs-dark' : 'vs'}
|
|
216
|
+
minLines={40}
|
|
232
217
|
/>
|
|
233
218
|
</div>
|
|
234
219
|
</ModalBody>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
import { useUserSession } from "@vertesia/ui/session";
|
|
3
1
|
import { DocAnalyzerProgress, DocProcessorOutputFormat, MarkdownRenditionFormat, WorkflowExecutionStatus } from "@vertesia/common";
|
|
2
|
+
import { useUserSession } from "@vertesia/ui/session";
|
|
3
|
+
import { useCallback, useEffect, useState } from "react";
|
|
4
4
|
|
|
5
5
|
// Maximum text size before cropping (128K characters)
|
|
6
6
|
const MAX_TEXT_DISPLAY_SIZE = 128 * 1024;
|
|
@@ -29,7 +29,7 @@ export function useObjectText(objectId: string, initialText?: string, loadOnMoun
|
|
|
29
29
|
.getObjectText(objectId)
|
|
30
30
|
.then((res) => {
|
|
31
31
|
setFullText(res.text);
|
|
32
|
-
if (res.text.length > MAX_TEXT_DISPLAY_SIZE) {
|
|
32
|
+
if (res.text && res.text.length > MAX_TEXT_DISPLAY_SIZE) {
|
|
33
33
|
setDisplayText(res.text.substring(0, MAX_TEXT_DISPLAY_SIZE));
|
|
34
34
|
setIsCropped(true);
|
|
35
35
|
} else {
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { basicSetup } from 'codemirror';
|
|
2
1
|
import { useMemo, useRef, useState } from 'react';
|
|
3
2
|
|
|
4
3
|
import { useUserSession } from '@vertesia/ui/session';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { Button, useToast } from '@vertesia/ui/core';
|
|
4
|
+
import { MonacoEditor, EditorApi, SchemaEditor, useSchema } from '@vertesia/ui/widgets';
|
|
5
|
+
import { Button, useToast, useTheme } from '@vertesia/ui/core';
|
|
8
6
|
import { ContentObjectType } from '@vertesia/common';
|
|
9
7
|
import { Ajv } from "ajv";
|
|
10
8
|
|
|
11
|
-
const CODE_MIRROR_EXTENSIONS = [basicSetup, json()];
|
|
12
|
-
|
|
13
9
|
interface ObjectSchemaEditorProps {
|
|
14
10
|
objectType: ContentObjectType;
|
|
15
11
|
onSchemaUpdate: (jsonSchema: any) => void;
|
|
@@ -17,6 +13,7 @@ interface ObjectSchemaEditorProps {
|
|
|
17
13
|
export function ObjectSchemaEditor({ objectType, onSchemaUpdate }: ObjectSchemaEditorProps) {
|
|
18
14
|
const { store } = useUserSession();
|
|
19
15
|
const toast = useToast();
|
|
16
|
+
const { theme } = useTheme();
|
|
20
17
|
|
|
21
18
|
const [isUpdating, setUpdating] = useState(false);
|
|
22
19
|
const schema = useSchema(objectType.object_schema);
|
|
@@ -103,7 +100,12 @@ export function ObjectSchemaEditor({ objectType, onSchemaUpdate }: ObjectSchemaE
|
|
|
103
100
|
<div className="px-4 py-2">
|
|
104
101
|
{
|
|
105
102
|
displayJson
|
|
106
|
-
? <
|
|
103
|
+
? <MonacoEditor
|
|
104
|
+
value={value}
|
|
105
|
+
language="json"
|
|
106
|
+
editorRef={editorRef}
|
|
107
|
+
theme={theme === 'dark' ? 'vs-dark' : 'vs'}
|
|
108
|
+
/>
|
|
107
109
|
: <SchemaEditor schema={schema} />
|
|
108
110
|
}
|
|
109
111
|
</div>
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { basicSetup } from 'codemirror';
|
|
2
1
|
import { useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { json } from '@codemirror/lang-json';
|
|
4
2
|
import { ColumnLayout, ContentObjectType } from '@vertesia/common';
|
|
5
|
-
import { Button, useToast } from '@vertesia/ui/core';
|
|
3
|
+
import { Button, useToast, useTheme } from '@vertesia/ui/core';
|
|
6
4
|
import { useUserSession } from '@vertesia/ui/session';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
const extensions = [basicSetup, json()];
|
|
5
|
+
import { MonacoEditor, EditorApi } from '@vertesia/ui/widgets';
|
|
10
6
|
|
|
11
7
|
interface TableLayoutEditorProps {
|
|
12
8
|
objectType: ContentObjectType;
|
|
@@ -14,6 +10,7 @@ interface TableLayoutEditorProps {
|
|
|
14
10
|
}
|
|
15
11
|
export function TableLayoutEditor({ objectType, onLayoutUpdate }: TableLayoutEditorProps) {
|
|
16
12
|
const toast = useToast();
|
|
13
|
+
const { theme } = useTheme();
|
|
17
14
|
|
|
18
15
|
const [isUpdating, setUpdating] = useState(false);
|
|
19
16
|
const { store } = useUserSession();
|
|
@@ -89,7 +86,12 @@ export function TableLayoutEditor({ objectType, onLayoutUpdate }: TableLayoutEdi
|
|
|
89
86
|
</div>
|
|
90
87
|
</div>
|
|
91
88
|
<div className="px-4 py-2">
|
|
92
|
-
<
|
|
89
|
+
<MonacoEditor
|
|
90
|
+
value={value}
|
|
91
|
+
language="json"
|
|
92
|
+
editorRef={editorRef}
|
|
93
|
+
theme={theme === 'dark' ? 'vs-dark' : 'vs'}
|
|
94
|
+
/>
|
|
93
95
|
</div>
|
|
94
96
|
</div>
|
|
95
97
|
)
|