@vertesia/ui 0.79.0 → 0.80.0-dev-20251118
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/Panel.js +8 -0
- package/lib/esm/core/components/Panel.js.map +1 -0
- package/lib/esm/core/components/SelectBox.js +1 -1
- package/lib/esm/core/components/SelectBox.js.map +1 -1
- package/lib/esm/core/components/SidePanel.js +2 -2
- package/lib/esm/core/components/SidePanel.js.map +1 -1
- package/lib/esm/core/components/index.js +1 -1
- package/lib/esm/core/components/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/breadcrumb.js +29 -8
- package/lib/esm/core/components/shadcn/breadcrumb.js.map +1 -1
- package/lib/esm/core/components/shadcn/button.js +3 -2
- package/lib/esm/core/components/shadcn/button.js.map +1 -1
- package/lib/esm/core/components/shadcn/filters/filterBar.js +2 -2
- package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
- package/lib/esm/core/components/shadcn/index.js +1 -0
- package/lib/esm/core/components/shadcn/index.js.map +1 -1
- package/lib/esm/core/components/shadcn/input.js +4 -1
- package/lib/esm/core/components/shadcn/input.js.map +1 -1
- package/lib/esm/core/components/shadcn/resizeable.js +2 -2
- package/lib/esm/core/components/shadcn/resizeable.js.map +1 -1
- package/lib/esm/core/components/shadcn/selectBox.js +15 -9
- package/lib/esm/core/components/shadcn/selectBox.js.map +1 -1
- package/lib/esm/core/components/shadcn/tabs.js +10 -3
- package/lib/esm/core/components/shadcn/tabs.js.map +1 -1
- package/lib/esm/core/components/shadcn/textarea.js +7 -0
- package/lib/esm/core/components/shadcn/textarea.js.map +1 -0
- package/lib/esm/core/hooks/CompositeState.js +139 -1
- package/lib/esm/core/hooks/CompositeState.js.map +1 -1
- package/lib/esm/core/hooks/index.js +1 -0
- package/lib/esm/core/hooks/index.js.map +1 -1
- package/lib/esm/core/hooks/useScrollableSearch.js +92 -0
- package/lib/esm/core/hooks/useScrollableSearch.js.map +1 -0
- package/lib/esm/env/index.js +1 -1
- package/lib/esm/env/index.js.map +1 -1
- package/lib/esm/features/agent/PayloadBuilder.js +80 -55
- package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentConversation.js +22 -24
- package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +2 -3
- package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js +2 -2
- package/lib/esm/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js +15 -20
- package/lib/esm/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js +1 -0
- package/lib/esm/features/agent/chat/ModernAgentOutput/PlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js +3 -3
- package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.js.map +1 -1
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js +6 -6
- package/lib/esm/features/agent/chat/ModernAgentOutput/WorkstreamTabs.js.map +1 -1
- package/lib/esm/features/facets/CollectionsFacetsNav.js +19 -0
- package/lib/esm/features/facets/CollectionsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/InteractionsFacetsNav.js +9 -3
- package/lib/esm/features/facets/InteractionsFacetsNav.js.map +1 -1
- package/lib/esm/features/facets/utils/VTypeFacet.js +4 -1
- package/lib/esm/features/facets/utils/VTypeFacet.js.map +1 -1
- package/lib/esm/features/layout/GenericPageNavHeader.js +58 -5
- package/lib/esm/features/layout/GenericPageNavHeader.js.map +1 -1
- package/lib/esm/features/store/collections/BrowseCollectionView.js +3 -0
- package/lib/esm/features/store/collections/BrowseCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/CreateCollection.js +2 -2
- package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
- package/lib/esm/features/store/collections/EditCollectionView.js +29 -30
- package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
- package/lib/esm/features/store/collections/SelectCollection.js +46 -45
- package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentSearchResults.js +35 -9
- package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
- package/lib/esm/features/store/objects/DocumentTable.js +6 -6
- package/lib/esm/features/store/objects/DocumentTable.js.map +1 -1
- package/lib/esm/features/store/objects/components/ContentOverview.js +158 -114
- package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
- package/lib/esm/features/store/objects/components/DocumentIcon.js +5 -3
- package/lib/esm/features/store/objects/components/DocumentIcon.js.map +1 -1
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js +11 -2
- package/lib/esm/features/store/objects/components/SaveVersionConfirmModal.js.map +1 -1
- package/lib/esm/features/store/objects/components/useDownloadObject.js +2 -2
- package/lib/esm/features/store/objects/components/useDownloadObject.js.map +1 -1
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js +13 -1
- package/lib/esm/features/store/objects/layout/DocumentTableColumn.js.map +1 -1
- package/lib/esm/features/store/objects/layout/documentLayout.js +5 -5
- package/lib/esm/features/store/objects/layout/documentLayout.js.map +1 -1
- package/lib/esm/features/store/objects/layout/renderers.js +28 -12
- package/lib/esm/features/store/objects/layout/renderers.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js +5 -1
- package/lib/esm/features/store/objects/search/DocumentSearchContext.js.map +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js +1 -1
- package/lib/esm/features/store/objects/search/DocumentSearchProvider.js.map +1 -1
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js +3 -2
- package/lib/esm/features/store/objects/selection/ObjectsActionContext.js.map +1 -1
- package/lib/esm/features/store/objects/selection/SelectionActions.js +2 -0
- package/lib/esm/features/store/objects/selection/SelectionActions.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +10 -2
- package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js +20 -2
- package/lib/esm/features/store/objects/selection/actions/DeleteObjectsAction.js.map +1 -1
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +15 -7
- package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js +1 -1
- package/lib/esm/features/store/types/CreateOrUpdateTypeModal.js.map +1 -1
- package/lib/esm/features/user/UserInfo.js +2 -0
- package/lib/esm/features/user/UserInfo.js.map +1 -1
- package/lib/esm/router/HistoryNavigator.js +25 -2
- package/lib/esm/router/HistoryNavigator.js.map +1 -1
- package/lib/esm/router/Nav.js +3 -3
- package/lib/esm/router/Nav.js.map +1 -1
- package/lib/esm/session/UserSession.js +1 -0
- package/lib/esm/session/UserSession.js.map +1 -1
- package/lib/esm/session/UserSessionProvider.js +9 -2
- package/lib/esm/session/UserSessionProvider.js.map +1 -1
- package/lib/esm/session/auth/composable.js +66 -67
- package/lib/esm/session/auth/composable.js.map +1 -1
- package/lib/esm/widgets/form/Form.js +17 -30
- package/lib/esm/widgets/form/Form.js.map +1 -1
- package/lib/esm/widgets/form/FormContext.js +4 -2
- package/lib/esm/widgets/form/FormContext.js.map +1 -1
- package/lib/esm/widgets/form/ManagedObject.js +4 -0
- package/lib/esm/widgets/form/ManagedObject.js.map +1 -1
- package/lib/esm/widgets/form/fields.js +4 -3
- package/lib/esm/widgets/form/fields.js.map +1 -1
- package/lib/esm/widgets/form/inputs.js +2 -0
- package/lib/esm/widgets/form/inputs.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/core/components/Panel.d.ts +11 -0
- package/lib/types/core/components/Panel.d.ts.map +1 -0
- package/lib/types/core/components/SidePanel.d.ts.map +1 -1
- package/lib/types/core/components/index.d.ts +1 -1
- package/lib/types/core/components/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/breadcrumb.d.ts +3 -2
- package/lib/types/core/components/shadcn/breadcrumb.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/button.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/filters/filterBar.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/index.d.ts +1 -0
- package/lib/types/core/components/shadcn/index.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/input.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/selectBox.d.ts +3 -2
- package/lib/types/core/components/shadcn/selectBox.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/tabs.d.ts.map +1 -1
- package/lib/types/core/components/shadcn/textarea.d.ts +4 -0
- package/lib/types/core/components/shadcn/textarea.d.ts.map +1 -0
- package/lib/types/core/hooks/CompositeState.d.ts +115 -6
- package/lib/types/core/hooks/CompositeState.d.ts.map +1 -1
- package/lib/types/core/hooks/index.d.ts +1 -0
- package/lib/types/core/hooks/index.d.ts.map +1 -1
- package/lib/types/core/hooks/useScrollableSearch.d.ts +82 -0
- package/lib/types/core/hooks/useScrollableSearch.d.ts.map +1 -0
- package/lib/types/env/index.d.ts +3 -1
- package/lib/types/env/index.d.ts.map +1 -1
- package/lib/types/features/agent/PayloadBuilder.d.ts +11 -19
- 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/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.d.ts.map +1 -1
- package/lib/types/features/agent/chat/ModernAgentOutput/PlanPanel.d.ts.map +1 -1
- package/lib/types/features/facets/CollectionsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts +1 -0
- package/lib/types/features/facets/InteractionsFacetsNav.d.ts.map +1 -1
- package/lib/types/features/facets/utils/SearchInterface.d.ts +6 -1
- package/lib/types/features/facets/utils/SearchInterface.d.ts.map +1 -1
- package/lib/types/features/facets/utils/VTypeFacet.d.ts +2 -1
- package/lib/types/features/facets/utils/VTypeFacet.d.ts.map +1 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts +2 -1
- package/lib/types/features/layout/GenericPageNavHeader.d.ts.map +1 -1
- package/lib/types/features/store/collections/BrowseCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/collections/CreateCollection.d.ts.map +1 -1
- package/lib/types/features/store/collections/EditCollectionView.d.ts.map +1 -1
- package/lib/types/features/store/collections/SelectCollection.d.ts +6 -4
- package/lib/types/features/store/collections/SelectCollection.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentSearchResults.d.ts.map +1 -1
- package/lib/types/features/store/objects/DocumentTable.d.ts +4 -0
- package/lib/types/features/store/objects/DocumentTable.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/ContentOverview.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts +3 -1
- package/lib/types/features/store/objects/components/DocumentIcon.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/SaveVersionConfirmModal.d.ts.map +1 -1
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts +1 -1
- package/lib/types/features/store/objects/components/useDownloadObject.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts +2 -1
- package/lib/types/features/store/objects/layout/DocumentTableColumn.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/documentLayout.d.ts +4 -2
- package/lib/types/features/store/objects/layout/documentLayout.d.ts.map +1 -1
- package/lib/types/features/store/objects/layout/renderers.d.ts +1 -1
- package/lib/types/features/store/objects/layout/renderers.d.ts.map +1 -1
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts +1 -0
- package/lib/types/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/ObjectsActionContext.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/SelectionActions.d.ts.map +1 -1
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts +1 -0
- package/lib/types/features/store/objects/selection/actions/DeleteObjectsAction.d.ts.map +1 -1
- package/lib/types/features/store/objects/upload/DocumentUploadModal.d.ts.map +1 -1
- package/lib/types/features/user/UserInfo.d.ts.map +1 -1
- package/lib/types/router/HistoryNavigator.d.ts.map +1 -1
- package/lib/types/router/Nav.d.ts +2 -1
- package/lib/types/router/Nav.d.ts.map +1 -1
- package/lib/types/session/UserSession.d.ts.map +1 -1
- package/lib/types/session/UserSessionProvider.d.ts.map +1 -1
- package/lib/types/session/auth/composable.d.ts.map +1 -1
- package/lib/types/widgets/form/Form.d.ts +2 -1
- package/lib/types/widgets/form/Form.d.ts.map +1 -1
- package/lib/types/widgets/form/FormContext.d.ts +5 -2
- package/lib/types/widgets/form/FormContext.d.ts.map +1 -1
- package/lib/types/widgets/form/ManagedObject.d.ts.map +1 -1
- package/lib/types/widgets/form/fields.d.ts +2 -2
- package/lib/types/widgets/form/fields.d.ts.map +1 -1
- package/lib/types/widgets/form/inputs.d.ts.map +1 -1
- package/lib/vertesia-ui-core.js +1 -1
- 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 +1 -1
- package/lib/vertesia-ui-features.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.map +1 -1
- package/lib/vertesia-ui-widgets.js +1 -1
- package/lib/vertesia-ui-widgets.js.map +1 -1
- package/package.json +170 -165
- package/src/core/components/Panel.tsx +34 -0
- package/src/core/components/SelectBox.tsx +1 -1
- package/src/core/components/SidePanel.tsx +5 -3
- package/src/core/components/TagsInput.tsx +388 -0
- package/src/core/components/index.ts +2 -1
- package/src/core/components/shadcn/breadcrumb.tsx +49 -30
- package/src/core/components/shadcn/button.tsx +3 -2
- package/src/core/components/shadcn/filters/filterBar.tsx +3 -3
- package/src/core/components/shadcn/index.ts +2 -1
- package/src/core/components/shadcn/input.tsx +10 -7
- package/src/core/components/shadcn/popover.tsx +2 -2
- package/src/core/components/shadcn/resizeable.tsx +4 -4
- package/src/core/components/shadcn/selectBox.tsx +87 -67
- package/src/core/components/shadcn/tabs.tsx +10 -3
- package/src/core/components/shadcn/textarea.tsx +21 -0
- package/src/core/hooks/CompositeState.tsx +156 -6
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/useScrollableSearch.tsx +193 -0
- package/src/env/index.ts +4 -3
- package/src/features/agent/PayloadBuilder.tsx +92 -65
- package/src/features/agent/chat/ModernAgentConversation.tsx +109 -118
- package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +3 -23
- package/src/features/agent/chat/ModernAgentOutput/Header.tsx +3 -11
- package/src/features/agent/chat/ModernAgentOutput/InlineSlidingPlanPanel.tsx +39 -55
- package/src/features/agent/chat/ModernAgentOutput/PlanPanel.tsx +1 -0
- package/src/features/agent/chat/ModernAgentOutput/SlidingPlanPanel.tsx +8 -8
- package/src/features/agent/chat/ModernAgentOutput/WorkstreamTabs.tsx +9 -9
- package/src/features/facets/CollectionsFacetsNav.tsx +21 -0
- package/src/features/facets/InteractionsFacetsNav.tsx +13 -3
- package/src/features/facets/utils/SearchInterface.tsx +5 -1
- package/src/features/facets/utils/VTypeFacet.tsx +6 -2
- package/src/features/layout/GenericPageNavHeader.tsx +73 -10
- package/src/features/store/collections/BrowseCollectionView.tsx +4 -0
- package/src/features/store/collections/CreateCollection.tsx +3 -4
- package/src/features/store/collections/EditCollectionView.tsx +112 -85
- package/src/features/store/collections/SelectCollection.tsx +105 -49
- package/src/features/store/collections/SharedPropsEditor.tsx +61 -0
- package/src/features/store/collections/SyncMemberHeadsToggle.tsx +48 -0
- package/src/features/store/collections/index.ts +3 -1
- package/src/features/store/objects/DocumentSearchResults.tsx +128 -53
- package/src/features/store/objects/DocumentTable.tsx +14 -4
- package/src/features/store/objects/components/ContentOverview.tsx +208 -110
- package/src/features/store/objects/components/DocumentIcon.tsx +11 -12
- package/src/features/store/objects/components/SaveVersionConfirmModal.tsx +12 -2
- package/src/features/store/objects/components/useDownloadObject.ts +7 -2
- package/src/features/store/objects/layout/DocumentTableColumn.tsx +16 -1
- package/src/features/store/objects/layout/documentLayout.tsx +7 -5
- package/src/features/store/objects/layout/knowledge.md +10 -10
- package/src/features/store/objects/layout/renderers.tsx +39 -18
- package/src/features/store/objects/search/DocumentSearchContext.ts +6 -1
- package/src/features/store/objects/search/DocumentSearchProvider.tsx +1 -1
- package/src/features/store/objects/selection/ObjectsActionContext.tsx +3 -2
- package/src/features/store/objects/selection/SelectionActions.tsx +2 -0
- package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +8 -2
- package/src/features/store/objects/selection/actions/DeleteObjectsAction.tsx +22 -2
- package/src/features/store/objects/upload/DocumentUploadModal.tsx +18 -9
- package/src/features/store/objects/upload/useSmartFileUploadProcessing.ts +10 -7
- package/src/features/store/types/CreateOrUpdateTypeModal.tsx +1 -1
- package/src/features/user/UserInfo.tsx +2 -0
- package/src/router/HistoryNavigator.ts +33 -2
- package/src/router/Nav.tsx +4 -3
- package/src/session/UserSession.ts +1 -0
- package/src/session/UserSessionProvider.tsx +10 -2
- package/src/session/auth/composable.ts +71 -70
- package/src/shell/apps/AppProjectSelector.tsx +2 -2
- package/src/widgets/form/Form.tsx +19 -43
- package/src/widgets/form/FormContext.ts +5 -2
- package/src/widgets/form/ManagedObject.ts +4 -0
- package/src/widgets/form/fields.tsx +8 -6
- package/src/widgets/form/inputs.tsx +1 -0
- package/lib/esm/core/components/Textarea.js +0 -15
- package/lib/esm/core/components/Textarea.js.map +0 -1
- package/lib/types/core/components/Textarea.d.ts +0 -8
- package/lib/types/core/components/Textarea.d.ts.map +0 -1
- package/src/core/components/Textarea.tsx +0 -25
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
1
|
+
import { useEffect, useState, memo } from "react";
|
|
2
2
|
|
|
3
3
|
import { useUserSession } from "@vertesia/ui/session";
|
|
4
4
|
import { Button, ResizableHandle, ResizablePanel, ResizablePanelGroup, Spinner, useToast } from "@vertesia/ui/core";
|
|
5
5
|
import { JSONDisplay, MarkdownRenderer } from "@vertesia/ui/widgets";
|
|
6
|
-
import { ContentObject, ImageRenditionFormat } from "@vertesia/common";
|
|
7
|
-
import { Copy, Download, SquarePen } from "lucide-react";
|
|
6
|
+
import { ContentNature, ContentObject, ImageRenditionFormat, VideoMetadata, POSTER_RENDITION_NAME } from "@vertesia/common";
|
|
7
|
+
import { Copy, Download, SquarePen, AlertTriangle } from "lucide-react";
|
|
8
8
|
import { PropertiesEditorModal } from "./PropertiesEditorModal";
|
|
9
9
|
import { NavLink } from "@vertesia/ui/router";
|
|
10
10
|
|
|
11
|
+
// Maximum text size before cropping (128K characters)
|
|
12
|
+
const MAX_TEXT_DISPLAY_SIZE = 128 * 1024;
|
|
13
|
+
|
|
14
|
+
enum PanelView {
|
|
15
|
+
Text = "text",
|
|
16
|
+
Image = "image",
|
|
17
|
+
Video = "video"
|
|
18
|
+
}
|
|
19
|
+
|
|
11
20
|
interface ContentOverviewProps {
|
|
12
21
|
object: ContentObject;
|
|
13
22
|
loadText?: boolean;
|
|
@@ -154,15 +163,21 @@ function PropertiesPanel({ object, refetch, handleCopyContent }: { object: Conte
|
|
|
154
163
|
function DataPanel({ object, loadText, handleCopyContent }: { object: ContentObject, loadText: boolean, handleCopyContent: (content: string, type: "text" | "properties") => Promise<void> }) {
|
|
155
164
|
const { store } = useUserSession();
|
|
156
165
|
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
content && content.type && content.type.startsWith("image/");
|
|
166
|
+
const isImage = object?.metadata?.type === ContentNature.Image;
|
|
167
|
+
const isVideo = object?.metadata?.type === ContentNature.Video;
|
|
160
168
|
|
|
161
|
-
|
|
169
|
+
// Determine initial panel view
|
|
170
|
+
const getInitialView = (): PanelView => {
|
|
171
|
+
if (isVideo) return PanelView.Video;
|
|
172
|
+
if (isImage) return PanelView.Image;
|
|
173
|
+
return PanelView.Text;
|
|
174
|
+
};
|
|
162
175
|
|
|
176
|
+
const [currentPanel, setCurrentPanel] = useState<PanelView>(getInitialView());
|
|
163
177
|
|
|
164
178
|
const [text, setText] = useState<string | undefined>(object.text);
|
|
165
179
|
const [isLoadingText, setIsLoadingText] = useState<boolean>(false);
|
|
180
|
+
const [isTextCropped, setIsTextCropped] = useState<boolean>(false);
|
|
166
181
|
|
|
167
182
|
useEffect(() => {
|
|
168
183
|
if (loadText && !text) {
|
|
@@ -170,7 +185,15 @@ function DataPanel({ object, loadText, handleCopyContent }: { object: ContentObj
|
|
|
170
185
|
store.objects
|
|
171
186
|
.getObjectText(object.id)
|
|
172
187
|
.then((res) => {
|
|
173
|
-
|
|
188
|
+
if (res.text.length > MAX_TEXT_DISPLAY_SIZE) {
|
|
189
|
+
// Crop the text to 128K characters
|
|
190
|
+
const croppedText = res.text.substring(0, MAX_TEXT_DISPLAY_SIZE);
|
|
191
|
+
setText(croppedText);
|
|
192
|
+
setIsTextCropped(true);
|
|
193
|
+
} else {
|
|
194
|
+
setText(res.text);
|
|
195
|
+
setIsTextCropped(false);
|
|
196
|
+
}
|
|
174
197
|
})
|
|
175
198
|
.catch((err) => {
|
|
176
199
|
console.error("Failed to load text", err);
|
|
@@ -187,36 +210,48 @@ function DataPanel({ object, loadText, handleCopyContent }: { object: ContentObj
|
|
|
187
210
|
<div className="flex items-center gap-1 bg-muted mb-2 p-1 rounded">
|
|
188
211
|
{isImage &&
|
|
189
212
|
<Button
|
|
190
|
-
variant={
|
|
213
|
+
variant={currentPanel === PanelView.Image ? "primary" : "ghost"}
|
|
191
214
|
size="sm"
|
|
192
215
|
alt="View Image"
|
|
193
|
-
onClick={() =>
|
|
216
|
+
onClick={() => setCurrentPanel(PanelView.Image)}
|
|
194
217
|
>
|
|
195
218
|
Image
|
|
196
219
|
</Button>
|
|
197
220
|
}
|
|
221
|
+
{isVideo &&
|
|
222
|
+
<Button
|
|
223
|
+
variant={currentPanel === PanelView.Video ? "primary" : "ghost"}
|
|
224
|
+
size="sm"
|
|
225
|
+
alt="View Video"
|
|
226
|
+
onClick={() => setCurrentPanel(PanelView.Video)}
|
|
227
|
+
>
|
|
228
|
+
Video
|
|
229
|
+
</Button>
|
|
230
|
+
}
|
|
198
231
|
<Button
|
|
199
|
-
variant={
|
|
232
|
+
variant={currentPanel === PanelView.Text ? "primary" : "ghost"}
|
|
200
233
|
size="sm"
|
|
201
234
|
alt="View Text"
|
|
202
|
-
onClick={() =>
|
|
235
|
+
onClick={() => setCurrentPanel(PanelView.Text)}
|
|
203
236
|
>
|
|
204
237
|
Text
|
|
205
238
|
</Button>
|
|
206
239
|
|
|
207
240
|
</div>
|
|
208
|
-
{
|
|
241
|
+
{currentPanel === PanelView.Text && <TextActions object={object} text={text} handleCopyContent={handleCopyContent} />}
|
|
209
242
|
</div>
|
|
210
243
|
{
|
|
211
|
-
|
|
244
|
+
currentPanel === PanelView.Image ? (
|
|
212
245
|
<ImagePanel object={object} />
|
|
246
|
+
) : currentPanel === PanelView.Video ? (
|
|
247
|
+
<VideoPanel object={object} />
|
|
213
248
|
) : (
|
|
214
249
|
isLoadingText ? (
|
|
215
250
|
<div className="flex justify-center items-center h-[calc(100vh-260px)]">
|
|
216
251
|
<Spinner size="lg" />
|
|
217
252
|
</div>
|
|
218
253
|
) : (
|
|
219
|
-
<TextPanel object={object} text={text} />
|
|
254
|
+
<TextPanel object={object} text={text} isTextCropped={isTextCropped} />
|
|
220
255
|
)
|
|
221
256
|
)
|
|
222
257
|
}
|
|
@@ -227,24 +262,29 @@ function DataPanel({ object, loadText, handleCopyContent }: { object: ContentObj
|
|
|
227
262
|
function TextActions({ object, text, handleCopyContent }: { object: ContentObject, handleCopyContent: (content: string, type: "text" | "properties") => Promise<void>, text: string | undefined }) {
|
|
228
263
|
const { client } = useUserSession();
|
|
229
264
|
const toast = useToast();
|
|
265
|
+
const [loadingFormat, setLoadingFormat] = useState<"docx" | "pdf" | null>(null);
|
|
230
266
|
|
|
231
267
|
const content = object.content;
|
|
232
268
|
|
|
233
|
-
const
|
|
269
|
+
const isMarkdown =
|
|
234
270
|
content &&
|
|
235
271
|
content.type &&
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
// Check for markdown indicators, ignoring any HTML comments
|
|
239
|
-
const seemsMarkdown =
|
|
240
|
-
text &&
|
|
241
|
-
// Look for markdown indicators
|
|
242
|
-
(text.includes("\n#") ||
|
|
243
|
-
text.includes("\n*") ||
|
|
244
|
-
text.includes("\n+") ||
|
|
245
|
-
text.includes("
|
|
422
|
+
);
|
|
411
423
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
title: "Document exported",
|
|
415
|
-
description: `Successfully exported to ${format.toUpperCase()} format`,
|
|
416
|
-
duration: 2000,
|
|
417
|
-
});
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
} catch (err) {
|
|
421
|
-
console.error(`Failed to export document as ${format}:`, err);
|
|
422
|
-
toast({
|
|
423
|
-
status: "error",
|
|
424
|
-
title: "Export failed",
|
|
425
|
-
description: `Failed to export document to ${format.toUpperCase()} format`,
|
|
426
|
-
duration: 5000,
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
};
|
|
424
|
+
// Render as markdown if it's markdown/text type OR if text looks like markdown
|
|
425
|
+
const shouldRenderAsMarkdown = isMarkdownOrText || seemsMarkdown;
|
|
430
426
|
|
|
431
427
|
return (
|
|
432
428
|
text ? (
|
|
433
429
|
<>
|
|
430
|
+
{isTextCropped && (
|
|
431
|
+
<div className="px-2 py-2 bg-attention/10 border-l-4 border-attention mx-2 mb-2 rounded">
|
|
432
|
+
<div className="flex items-center gap-2 text-attention">
|
|
433
|
+
<AlertTriangle className="size-4" />
|
|
434
|
+
<span className="text-sm font-semibold">Showing first 128K characters only</span>
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
)}
|
|
434
438
|
<div className="max-w-7xl px-2 h-[calc(100vh-210px)] overflow-auto">
|
|
435
|
-
{
|
|
439
|
+
{shouldRenderAsMarkdown ? (
|
|
436
440
|
<div className="vprose prose-sm p-1">
|
|
437
441
|
<MarkdownRenderer
|
|
438
442
|
components={{
|
|
@@ -511,16 +515,14 @@ function TextPanel({ object, text }: { object: ContentObject, text: string | und
|
|
|
511
515
|
<div>No content</div>
|
|
512
516
|
</div>
|
|
513
517
|
);
|
|
514
|
-
}
|
|
518
|
+
});
|
|
515
519
|
|
|
516
520
|
function ImagePanel({ object }: { object: ContentObject }) {
|
|
517
521
|
const { client } = useUserSession();
|
|
518
522
|
const [imageUrl, setImageUrl] = useState<string>();
|
|
519
523
|
|
|
520
|
-
|
|
521
524
|
const content = object.content;
|
|
522
|
-
const isImage =
|
|
523
|
-
content && content.type && content.type.startsWith("image/");
|
|
525
|
+
const isImage = object.metadata && object.metadata.type === ContentNature.Image;
|
|
524
526
|
|
|
525
527
|
useEffect(() => {
|
|
526
528
|
if (isImage) {
|
|
@@ -569,4 +571,100 @@ function ImagePanel({ object }: { object: ContentObject }) {
|
|
|
569
571
|
)}
|
|
570
572
|
</div>
|
|
571
573
|
);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function VideoPanel({ object }: { object: ContentObject }) {
|
|
577
|
+
const { client } = useUserSession();
|
|
578
|
+
const [videoUrl, setVideoUrl] = useState<string>();
|
|
579
|
+
const [posterUrl, setPosterUrl] = useState<string>();
|
|
580
|
+
const [isLoading, setIsLoading] = useState<boolean>(true);
|
|
581
|
+
|
|
582
|
+
const content = object.content;
|
|
583
|
+
const isVideo = object.metadata?.type === ContentNature.Video;
|
|
584
|
+
|
|
585
|
+
// Check if there are mp4 or webm renditions available in metadata
|
|
586
|
+
const metadata = object.metadata as VideoMetadata;
|
|
587
|
+
const renditions = metadata?.renditions || [];
|
|
588
|
+
|
|
589
|
+
// Find mp4 or webm rendition by mime type, preferring mp4
|
|
590
|
+
const webRendition = renditions.find(r => r.content.type === 'video/mp4') ||
|
|
591
|
+
renditions.find(r => r.content.type === 'video/webm');
|
|
592
|
+
|
|
593
|
+
// Check if original file is web-compatible
|
|
594
|
+
const webSupportedFormats = ['video/mp4', 'video/webm'];
|
|
595
|
+
const isOriginalWebSupported = content?.type && webSupportedFormats.includes(content.type);
|
|
596
|
+
|
|
597
|
+
// Get poster
|
|
598
|
+
const poster = renditions.find(r => r.name === POSTER_RENDITION_NAME);
|
|
599
|
+
|
|
600
|
+
useEffect(() => {
|
|
601
|
+
const loadPoster = async () => {
|
|
602
|
+
if (poster?.content?.source) {
|
|
603
|
+
try {
|
|
604
|
+
const response = await client.files.getDownloadUrl(poster.content.source);
|
|
605
|
+
setPosterUrl(response.url);
|
|
606
|
+
} catch (error) {
|
|
607
|
+
console.error("Failed to load poster image", error);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
};
|
|
611
|
+
loadPoster();
|
|
612
|
+
}, [poster, client]);
|
|
613
|
+
|
|
614
|
+
useEffect(() => {
|
|
615
|
+
if (isVideo && (webRendition?.content?.source || isOriginalWebSupported)) {
|
|
616
|
+
const loadVideoUrl = async () => {
|
|
617
|
+
try {
|
|
618
|
+
let downloadUrl;
|
|
619
|
+
if (webRendition?.content?.source) {
|
|
620
|
+
// Use rendition if available
|
|
621
|
+
downloadUrl = await client.files.getDownloadUrl(webRendition.content.source);
|
|
622
|
+
} else if (isOriginalWebSupported && content?.source) {
|
|
623
|
+
// Fall back to original file if web-supported
|
|
624
|
+
downloadUrl = await client.files.getDownloadUrl(content.source);
|
|
625
|
+
}
|
|
626
|
+
if (downloadUrl) {
|
|
627
|
+
setVideoUrl(downloadUrl.url);
|
|
628
|
+
}
|
|
629
|
+
} catch (error) {
|
|
630
|
+
console.error("Failed to get video URL", error);
|
|
631
|
+
} finally {
|
|
632
|
+
setIsLoading(false);
|
|
633
|
+
}
|
|
634
|
+
};
|
|
635
|
+
loadVideoUrl();
|
|
636
|
+
} else {
|
|
637
|
+
setIsLoading(false);
|
|
638
|
+
}
|
|
639
|
+
}, [isVideo, webRendition, isOriginalWebSupported, content?.source, client]);
|
|
640
|
+
|
|
641
|
+
return (
|
|
642
|
+
<div className="mb-4 px-2">
|
|
643
|
+
{!webRendition && !isOriginalWebSupported ? (
|
|
644
|
+
<div className="flex justify-center items-center h-[400px] text-muted">
|
|
645
|
+
<div className="text-center">
|
|
646
|
+
<p>No web-compatible video rendition available</p>
|
|
647
|
+
<p className="text-sm mt-2">MP4 or WebM format required</p>
|
|
648
|
+
</div>
|
|
649
|
+
</div>
|
|
650
|
+
) : isLoading ? (
|
|
651
|
+
<div className="flex justify-center items-center h-[400px]">
|
|
652
|
+
<Spinner size="md" />
|
|
653
|
+
</div>
|
|
654
|
+
) : videoUrl ? (
|
|
655
|
+
<video
|
|
656
|
+
src={videoUrl}
|
|
657
|
+
poster={posterUrl}
|
|
658
|
+
controls
|
|
659
|
+
className="w-full max-h-[calc(100vh-260px)] object-contain"
|
|
660
|
+
>
|
|
661
|
+
Your browser does not support the video tag.
|
|
662
|
+
</video>
|
|
663
|
+
) : (
|
|
664
|
+
<div className="flex justify-center items-center h-[400px] text-muted">
|
|
665
|
+
Failed to load video
|
|
666
|
+
</div>
|
|
667
|
+
)}
|
|
668
|
+
</div>
|
|
669
|
+
);
|
|
572
670
|
}
|
|
@@ -4,7 +4,6 @@ import { retrieveRendition } from '../../../utils'
|
|
|
4
4
|
|
|
5
5
|
import { ContentObjectItem } from '@vertesia/common'
|
|
6
6
|
import { Button, Card, CardContent, Separator, VTooltip } from "@vertesia/ui/core"
|
|
7
|
-
import { NavLink } from "@vertesia/ui/router"
|
|
8
7
|
import { useUserSession } from "@vertesia/ui/session"
|
|
9
8
|
import { DocumentSelection } from '../DocumentSelectionProvider'
|
|
10
9
|
import { Eye } from 'lucide-react'
|
|
@@ -14,6 +13,8 @@ interface DocumentIconProps {
|
|
|
14
13
|
onSelectionChange: ((object: ContentObjectItem, ev: ChangeEvent<HTMLInputElement>) => void);
|
|
15
14
|
selection: DocumentSelection;
|
|
16
15
|
onRowClick?: (object: ContentObjectItem) => void;
|
|
16
|
+
previewObject?: (objectId: string) => void;
|
|
17
|
+
selectedObject?: ContentObjectItem | null;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export function DocumentIconSkeleton({ isLoading = false, counts = 6 }: { isLoading?: boolean, counts?: number }) {
|
|
@@ -45,7 +46,7 @@ export function DocumentIconSkeleton({ isLoading = false, counts = 6 }: { isLoad
|
|
|
45
46
|
)
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export function DocumentIcon({ selection, document, onSelectionChange, onRowClick }: Readonly<DocumentIconProps>) {
|
|
49
|
+
export function DocumentIcon({ selection, document, onSelectionChange, onRowClick, previewObject, selectedObject }: Readonly<DocumentIconProps>) {
|
|
49
50
|
const { client } = useUserSession()
|
|
50
51
|
|
|
51
52
|
const [renditionUrl, setRenditionUrl] = useState<string | undefined>(undefined)
|
|
@@ -67,7 +68,7 @@ export function DocumentIcon({ selection, document, onSelectionChange, onRowClic
|
|
|
67
68
|
}, [document])
|
|
68
69
|
|
|
69
70
|
return (
|
|
70
|
-
<Card className=
|
|
71
|
+
<Card className={`relative flex flex-col border h-fit ${selectedObject?.id === document.id ? 'border-attention border-4' : ''}`} onClick={() => (onRowClick && onRowClick(document))}>
|
|
71
72
|
{
|
|
72
73
|
selection && (
|
|
73
74
|
<div
|
|
@@ -85,16 +86,14 @@ export function DocumentIcon({ selection, document, onSelectionChange, onRowClic
|
|
|
85
86
|
<div
|
|
86
87
|
className="absolute top-1 right-1 z-10 flex flex-col items-center"
|
|
87
88
|
>
|
|
88
|
-
<
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
<Button
|
|
90
|
+
variant="ghost" size="sm" title="Preivew Object" onClick={(e) => {
|
|
91
|
+
e.stopPropagation();
|
|
92
|
+
previewObject?.(document.id);
|
|
93
|
+
}}
|
|
91
94
|
>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
>
|
|
95
|
-
<Eye className={`size-4 ${renditionStatus === 'ready' ? 'text-muted' : 'text-white'}`} />
|
|
96
|
-
</Button>
|
|
97
|
-
</NavLink>
|
|
95
|
+
<Eye className={`size-4 ${renditionStatus === 'ready' ? 'text-muted' : 'text-white'}`} />
|
|
96
|
+
</Button>
|
|
98
97
|
</div>
|
|
99
98
|
|
|
100
99
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Modal,
|
|
@@ -65,10 +65,20 @@ export function SaveVersionConfirmModal({ isOpen, onClose, onConfirm, isLoading,
|
|
|
65
65
|
}
|
|
66
66
|
];
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
// Default to "create new version" when replacing a file, "update current version" when editing properties
|
|
69
|
+
const defaultOption = uploadedFileName ? saveOptions[1] : saveOptions[0];
|
|
70
|
+
const [selectedOption, setSelectedOption] = useState<SaveOptionType | undefined>(defaultOption);
|
|
69
71
|
const [versionLabel, setVersionLabel] = useState('');
|
|
70
72
|
const optionAdapter = new SaveOptionAdapter();
|
|
71
73
|
|
|
74
|
+
// Reset to default when modal opens or uploadedFileName changes
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (isOpen) {
|
|
77
|
+
setSelectedOption(defaultOption);
|
|
78
|
+
setVersionLabel('');
|
|
79
|
+
}
|
|
80
|
+
}, [isOpen, uploadedFileName]);
|
|
81
|
+
|
|
72
82
|
const createVersion = selectedOption?.id === "new-version";
|
|
73
83
|
|
|
74
84
|
const handleOptionChange = (option: SaveOptionType) => {
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { VertesiaClient, ZenoClient } from "@vertesia/client";
|
|
2
2
|
import { ToastFn } from "@vertesia/ui/core";
|
|
3
3
|
|
|
4
|
-
export function useDownloadDocument(
|
|
4
|
+
export function useDownloadDocument(
|
|
5
|
+
client: VertesiaClient | ZenoClient,
|
|
6
|
+
toast: ToastFn,
|
|
7
|
+
uri: string | undefined,
|
|
8
|
+
name?: string,
|
|
9
|
+
) {
|
|
5
10
|
const onDownload = () => {
|
|
6
11
|
if (uri) {
|
|
7
12
|
client.files
|
|
8
|
-
.
|
|
13
|
+
.getDownloadUrlWithOptions({ file: uri, name })
|
|
9
14
|
.then((r) => {
|
|
10
15
|
window.open(r.url, "_blank");
|
|
11
16
|
})
|
|
@@ -37,9 +37,11 @@ export class DocumentTableColumn {
|
|
|
37
37
|
renderer: (value: any, index: number) => React.ReactNode = defaultRenderer;
|
|
38
38
|
path: string[];
|
|
39
39
|
fallbackPath?: string[];
|
|
40
|
-
|
|
40
|
+
previewObject?: (objectId: string) => void;
|
|
41
|
+
constructor(public layout: ExtendedColumnLayout, previewObject?: (objectId: string) => void) {
|
|
41
42
|
this.path = splitPath(layout.field || '');
|
|
42
43
|
this.fallbackPath = layout.fallback ? splitPath(layout.fallback) : undefined;
|
|
44
|
+
this.previewObject = previewObject;
|
|
43
45
|
|
|
44
46
|
// If there's a custom render function, use it
|
|
45
47
|
if (layout.render) {
|
|
@@ -78,6 +80,19 @@ export class DocumentTableColumn {
|
|
|
78
80
|
if (this.layout.render) {
|
|
79
81
|
return <td key={index} className="whitespace-nowrap px-3 py-4 text-sm">{this.layout.render(object)}</td>;
|
|
80
82
|
}
|
|
83
|
+
|
|
84
|
+
const type = this.layout.type || 'string';
|
|
85
|
+
const baseType = type.indexOf('?') > 0 ? type.substring(0, type.indexOf('?')) : type;
|
|
86
|
+
|
|
87
|
+
if (baseType === 'objectId' && this.previewObject) {
|
|
88
|
+
const i = type.indexOf('?');
|
|
89
|
+
const params = i > 0 ? new URLSearchParams(type.substring(i + 1)) : undefined;
|
|
90
|
+
const objectIdRenderer = renderers.objectId(params, (_id: string) => {
|
|
91
|
+
this.previewObject!(object.id);
|
|
92
|
+
});
|
|
93
|
+
return objectIdRenderer(object, index);
|
|
94
|
+
}
|
|
95
|
+
|
|
81
96
|
// Otherwise use the type-based renderer with the resolved value
|
|
82
97
|
return this.renderer(this.resolveValue(object), index);
|
|
83
98
|
}
|
|
@@ -10,13 +10,15 @@ interface ViewProps {
|
|
|
10
10
|
isLoading: boolean;
|
|
11
11
|
layout?: ColumnLayout[];
|
|
12
12
|
onRowClick?: (object: ContentObjectItem) => void;
|
|
13
|
+
previewObject?: (objectId: string) => void;
|
|
14
|
+
selectedObject?: ContentObjectItem | null;
|
|
13
15
|
onSelectionChange: ((object: ContentObjectItem, ev: ChangeEvent<HTMLInputElement>) => void);
|
|
14
16
|
selection: DocumentSelection;
|
|
15
17
|
toggleAll?: (ev: ChangeEvent<HTMLInputElement>) => void;
|
|
16
18
|
columns: DocumentTableColumn[];
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export function DocumentTableView({ objects, selection, isLoading, onRowClick,
|
|
21
|
+
export function DocumentTableView({ objects, selection, isLoading, columns, onRowClick, selectedObject, toggleAll, onSelectionChange }: ViewProps) {
|
|
20
22
|
return (
|
|
21
23
|
<Table className="w-full border-t">
|
|
22
24
|
<thead>
|
|
@@ -31,12 +33,12 @@ export function DocumentTableView({ objects, selection, isLoading, onRowClick, c
|
|
|
31
33
|
{
|
|
32
34
|
objects?.map((obj: ContentObjectItem) => {
|
|
33
35
|
return (
|
|
34
|
-
<tr key={obj.id} className=
|
|
36
|
+
<tr key={obj.id} className={`cursor-pointer hover:bg-muted group ${selectedObject?.id === obj.id ? 'bg-muted' : ''}`} onClick={() => {
|
|
35
37
|
onRowClick && onRowClick(obj)
|
|
36
38
|
}}>
|
|
37
39
|
{selection &&
|
|
38
40
|
<td onClick={ev => ev.stopPropagation()}>
|
|
39
|
-
<input checked={selection.isSelected(obj.id)} type="checkbox"
|
|
41
|
+
<input checked={selection.isSelected(obj.id)} type="checkbox" className={`${!selection.isSelected(obj.id) ? 'hidden group-hover:block' : ''}`}
|
|
40
42
|
onChange={(ev: ChangeEvent<HTMLInputElement>) => onSelectionChange(obj, ev)} />
|
|
41
43
|
</td>
|
|
42
44
|
}
|
|
@@ -51,13 +53,13 @@ export function DocumentTableView({ objects, selection, isLoading, onRowClick, c
|
|
|
51
53
|
)
|
|
52
54
|
}
|
|
53
55
|
|
|
54
|
-
export function DocumentGridView({ objects, selection, isLoading, onSelectionChange, onRowClick }: ViewProps) {
|
|
56
|
+
export function DocumentGridView({ objects, selection, isLoading, onSelectionChange, onRowClick, previewObject, selectedObject }: ViewProps) {
|
|
55
57
|
return (
|
|
56
58
|
<>
|
|
57
59
|
<DocumentIconSkeleton isLoading={isLoading} />
|
|
58
60
|
<div className="w-full gap-2 grid lg:grid-cols-6">
|
|
59
61
|
{objects.map((document) => (
|
|
60
|
-
<DocumentIcon key={document.id} document={document} selection={selection} onSelectionChange={onSelectionChange} onRowClick={onRowClick} />
|
|
62
|
+
<DocumentIcon key={document.id} document={document} selection={selection} onSelectionChange={onSelectionChange} onRowClick={onRowClick} previewObject={previewObject} selectedObject={selectedObject} />
|
|
61
63
|
))}
|
|
62
64
|
</div>
|
|
63
65
|
</>
|