@vertesia/ui 0.82.0 → 0.82.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/package.json +4 -4
- package/src/features/store/collections/BrowseCollectionView.tsx +0 -3
- package/src/features/store/objects/DocumentSearchResults.tsx +0 -4
- package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
- package/src/features/store/objects/search/DocumentSearchContext.ts +1 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +0 -4
- package/src/features/store/objects/selection/actions/ChangeTypeAction.tsx +2 -6
- package/src/features/store/types/SelectContentTypeModal.tsx +17 -30
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/ui",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"description": "Vertesia UI components and and hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"tailwind-merge": "^3.3.0",
|
|
61
61
|
"ts-md5": "^1.3.1",
|
|
62
62
|
"unist-util-visit": "^5.0.0",
|
|
63
|
-
"@vertesia/client": "0.82.
|
|
64
|
-
"@vertesia/common": "0.82.
|
|
65
|
-
"@vertesia/json": "0.82.
|
|
63
|
+
"@vertesia/client": "0.82.1",
|
|
64
|
+
"@vertesia/common": "0.82.1",
|
|
65
|
+
"@vertesia/json": "0.82.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@eslint/js": "^9.27.0",
|
|
@@ -2,7 +2,6 @@ import { useUserSession, TypeRegistry } from "@vertesia/ui/session";
|
|
|
2
2
|
import { Collection } from "@vertesia/common";
|
|
3
3
|
import { DocumentSearchResultsWithDropZone, DocumentSearchResults } from "../objects/DocumentSearchResults";
|
|
4
4
|
import { useToast } from "@vertesia/ui/core";
|
|
5
|
-
import { useDocumentSearch } from "../objects/search/DocumentSearchContext";
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
interface BrowseCollectionViewProps {
|
|
@@ -11,8 +10,6 @@ interface BrowseCollectionViewProps {
|
|
|
11
10
|
export function BrowseCollectionView({ collection }: BrowseCollectionViewProps) {
|
|
12
11
|
const toast = useToast();
|
|
13
12
|
const { client, typeRegistry } = useUserSession();
|
|
14
|
-
const search = useDocumentSearch();
|
|
15
|
-
search.query.all_revisions = true;
|
|
16
13
|
|
|
17
14
|
const onUploadDone = async (objectIds: string[]) => {
|
|
18
15
|
if (objectIds.length > 0) {
|
|
@@ -320,10 +320,6 @@ function Toolsbar(props: ToolsbarProps) {
|
|
|
320
320
|
}
|
|
321
321
|
<FilterBtn />
|
|
322
322
|
</div>
|
|
323
|
-
<div className="flex gap-1 items-center">
|
|
324
|
-
<Button variant="outline" onClick={handleRefetch} alt="Refresh"><RefreshCw size={16} /></Button>
|
|
325
|
-
<ContentDispositionButton onUpdate={setIsGridView} />
|
|
326
|
-
</div>
|
|
327
323
|
</div>
|
|
328
324
|
<div className="flex gap-2 items-center pt-2">
|
|
329
325
|
<FilterBar />
|
|
@@ -103,8 +103,8 @@ export function VectorSearchWidget({ onChange, isLoading, refresh, searchTypes }
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
return (
|
|
106
|
-
<div className="flex gap-1 items-center
|
|
107
|
-
<Input placeholder="Type what you are looking for, or select a filter" value={searchText} onChange={setSearchText} onKeyDown={handleKeyPress} />
|
|
106
|
+
<div className="flex gap-1 items-center">
|
|
107
|
+
<Input placeholder="Type what you are looking for, or select a filter" value={searchText} onChange={setSearchText} onKeyDown={handleKeyPress} className='min-w-[200px]' />
|
|
108
108
|
<Button variant="ghost" onClick={() => setShowSettings(true)} alt="Semantic search settings" className="ml-1"><Settings size={18} /></Button>
|
|
109
109
|
<Modal isOpen={showSettings} onClose={() => setShowSettings(false)}>
|
|
110
110
|
<ModalTitle>Search Types</ModalTitle>
|
|
@@ -61,7 +61,7 @@ export class DocumentSearch implements SearchInterface {
|
|
|
61
61
|
|
|
62
62
|
clearFilters(autoSearch: boolean = true) {
|
|
63
63
|
// Preserve search-related fields when clearing filters
|
|
64
|
-
const { parent, full_text, vector, weights, score_aggregation, dynamic_scaling, limit
|
|
64
|
+
const { parent, full_text, vector, weights, score_aggregation, dynamic_scaling, limit } = this.query;
|
|
65
65
|
this.query = {
|
|
66
66
|
parent,
|
|
67
67
|
...(full_text !== undefined && { full_text }),
|
|
@@ -69,7 +69,6 @@ export class DocumentSearch implements SearchInterface {
|
|
|
69
69
|
...(weights !== undefined && { weights }),
|
|
70
70
|
...(score_aggregation !== undefined && { score_aggregation }),
|
|
71
71
|
...(dynamic_scaling !== undefined && { dynamic_scaling }),
|
|
72
|
-
...(all_revisions !== undefined && { all_revisions }),
|
|
73
72
|
...(limit !== undefined && { limit })
|
|
74
73
|
};
|
|
75
74
|
|
|
@@ -56,9 +56,6 @@ function ActionsWrapper({ }: ActionsWrapperProps) {
|
|
|
56
56
|
export function UploadObjectsButton({ collectionId, allowFolders = true }: { collectionId?: string, allowFolders?: boolean }) {
|
|
57
57
|
const [files, setFiles] = useState<File[]>([]);
|
|
58
58
|
const [isOpen, setIsOpen] = useState(false);
|
|
59
|
-
const selection = useDocumentSelection();
|
|
60
|
-
|
|
61
|
-
const hasSelection = selection?.hasSelection();
|
|
62
59
|
|
|
63
60
|
const onClose = () => {
|
|
64
61
|
setIsOpen(false);
|
|
@@ -66,7 +63,6 @@ export function UploadObjectsButton({ collectionId, allowFolders = true }: { col
|
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
return (
|
|
69
|
-
!hasSelection &&
|
|
70
66
|
<>
|
|
71
67
|
<Button onClick={() => setIsOpen(true)}>Upload</Button>
|
|
72
68
|
<DocumentUploadModal
|
|
@@ -56,12 +56,8 @@ export function ChangeTypeActionComponent({ action, objectIds, children }: Actio
|
|
|
56
56
|
title="Change Content Type"
|
|
57
57
|
confirmLabel="Change Type"
|
|
58
58
|
>
|
|
59
|
-
<
|
|
60
|
-
|
|
61
|
-
or let the system choose or generate a type based on the content.</p>
|
|
62
|
-
<p className="pt-2 text-xs">Note: This action will raise the <code>change_type</code> event and will trigger the standard intake workflows
|
|
63
|
-
which may reset the object properties.</p>
|
|
64
|
-
</div>
|
|
59
|
+
<p className="pt-2 text-xs">Note: This action will raise the <code>change_type</code> event and will trigger the standard intake workflows
|
|
60
|
+
which may reset the object properties.</p>
|
|
65
61
|
</SelectContentTypeModal>
|
|
66
62
|
</div>
|
|
67
63
|
)
|
|
@@ -6,10 +6,11 @@ import {
|
|
|
6
6
|
ModalFooter,
|
|
7
7
|
ModalTitle,
|
|
8
8
|
SelectBox,
|
|
9
|
+
VTooltip,
|
|
9
10
|
} from "@vertesia/ui/core";
|
|
10
11
|
import { ContentObjectTypeItem } from "@vertesia/common";
|
|
11
12
|
import { useUserSession } from "@vertesia/ui/session";
|
|
12
|
-
import { CheckCircleIcon } from "lucide-react";
|
|
13
|
+
import { CheckCircleIcon, Info } from "lucide-react";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Props for the SelectTypeModal component
|
|
@@ -46,7 +47,6 @@ export function SelectContentTypeModal({
|
|
|
46
47
|
title = "Select Content Type",
|
|
47
48
|
children,
|
|
48
49
|
initialSelectedType = null,
|
|
49
|
-
confirmLabel = "Select Type",
|
|
50
50
|
allowNone = true,
|
|
51
51
|
}: SelectContentTypeModalProps) {
|
|
52
52
|
const { typeRegistry } = useUserSession();
|
|
@@ -63,6 +63,7 @@ export function SelectContentTypeModal({
|
|
|
63
63
|
// Handle type selection and confirmation
|
|
64
64
|
const handleConfirm = () => {
|
|
65
65
|
onClose(selectedType?.id ?? null);
|
|
66
|
+
setSelectedType(null);
|
|
66
67
|
};
|
|
67
68
|
|
|
68
69
|
return (
|
|
@@ -72,7 +73,7 @@ export function SelectContentTypeModal({
|
|
|
72
73
|
className="w-full max-w-xl mx-auto"
|
|
73
74
|
>
|
|
74
75
|
<ModalTitle>{title}</ModalTitle>
|
|
75
|
-
<ModalBody
|
|
76
|
+
<ModalBody>
|
|
76
77
|
{children}
|
|
77
78
|
|
|
78
79
|
{/* Type selection */}
|
|
@@ -100,41 +101,27 @@ export function SelectContentTypeModal({
|
|
|
100
101
|
filterBy="name"
|
|
101
102
|
/>
|
|
102
103
|
)}
|
|
103
|
-
|
|
104
|
-
{allowNone && (
|
|
105
|
-
<div className="mt-2 text-sm text-blue-600 flex items-center">
|
|
106
|
-
<CheckCircleIcon className="h-4 w-4 mr-1" />
|
|
107
|
-
<span><strong>Type selection is optional.</strong> Leave empty to let Vertesia choose the appropriate type</span>
|
|
108
|
-
</div>
|
|
109
|
-
)}
|
|
110
104
|
</div>
|
|
111
105
|
|
|
112
|
-
{selectedType
|
|
113
|
-
<div className="
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
<div className="mt-1">
|
|
123
|
-
Vertesia will analyze each file's content and automatically select the most appropriate type.
|
|
124
|
-
<br />
|
|
125
|
-
<span className="mt-1 block font-medium">This is recommended for most uploads.</span>
|
|
126
|
-
</div>
|
|
106
|
+
{!selectedType && (
|
|
107
|
+
<div className="flex items-center text-attention">
|
|
108
|
+
<CheckCircleIcon className="size-4 mr-1" />
|
|
109
|
+
Automatic Type Detection
|
|
110
|
+
<VTooltip
|
|
111
|
+
description="Vertesia will analyze the content and select the most appropriate type. This is recommended for most uploads and ensures optimal processing."
|
|
112
|
+
placement="top" size="xs"
|
|
113
|
+
>
|
|
114
|
+
<Info className="size-3 ml-2" />
|
|
115
|
+
</VTooltip>
|
|
127
116
|
</div>
|
|
128
117
|
)}
|
|
129
118
|
</ModalBody>
|
|
130
119
|
<ModalFooter>
|
|
131
|
-
<Button variant="ghost" onClick={handleClose}>
|
|
120
|
+
<Button variant="ghost" onClick={handleClose} alt="Cancel">
|
|
132
121
|
Cancel
|
|
133
122
|
</Button>
|
|
134
|
-
<Button
|
|
135
|
-
|
|
136
|
-
>
|
|
137
|
-
{selectedType ? `${confirmLabel}: ${selectedType.name}` : allowNone ? "Let Vertesia Choose" : confirmLabel}
|
|
123
|
+
<Button onClick={handleConfirm} alt="Confirm selection">
|
|
124
|
+
Confirm
|
|
138
125
|
</Button>
|
|
139
126
|
</ModalFooter>
|
|
140
127
|
</Modal>
|