Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/components/load3d/controls/ViewerControls.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useI18n } from 'vue-i18n'

import Load3DViewerContent from '@/components/load3d/Load3dViewerContent.vue'
import Button from '@/components/ui/button/Button.vue'
import { LOAD3D_VIEWER_CONTENT_CLASS } from '@/components/load3d/load3dViewerDialog'
import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import type { LGraphNode } from '@/lib/litegraph/src/LGraphNode'
import { useLoad3dService } from '@/services/load3dService'
import { useDialogStore } from '@/stores/dialogStore'
Expand All @@ -42,10 +42,7 @@ const openIn3DViewer = () => {
component: Load3DViewerContent,
props: props,
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: LOAD3D_VIEWER_CONTENT_CLASS,
maximizable: true,
...LOAD3D_VIEWER_DIALOG_PROPS,
onClose: async () => {
await useLoad3dService().handleViewerClose(props.node)
}
Expand Down
11 changes: 9 additions & 2 deletions src/components/load3d/load3dViewerDialog.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
export const LOAD3D_VIEWER_CONTENT_CLASS =
'w-[80vw] max-w-[min(80vw,calc(100vw-var(--workspace-inset-right,0px)-1rem))] h-[80vh] max-h-[80vh]'
import type { DialogComponentProps } from '@/stores/dialogStore'

export const LOAD3D_VIEWER_DIALOG_PROPS = {
Comment thread
christian-byrne marked this conversation as resolved.
Resolved
renderer: 'reka',
size: 'full',
contentClass:
'w-[80vw] max-w-[min(80vw,calc(100vw-var(--workspace-inset-right,0px)-1rem))] sm:max-w-[min(80vw,calc(100vw-var(--workspace-inset-right,0px)-1rem))] h-[80vh] max-h-[80vh]',
maximizable: true
} satisfies DialogComponentProps
Comment thread
christian-byrne marked this conversation as resolved.
Resolved
8 changes: 2 additions & 6 deletions src/components/sidebar/tabs/AssetsSidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ import {
import { useI18n } from 'vue-i18n'

import NoResultsPlaceholder from '@/components/common/NoResultsPlaceholder.vue'
import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import AssetsSidebarGridView from '@/components/sidebar/tabs/AssetsSidebarGridView.vue'
import AssetsSidebarListView from '@/components/sidebar/tabs/AssetsSidebarListView.vue'
import SidebarTabTemplate from '@/components/sidebar/tabs/SidebarTabTemplate.vue'
Expand Down Expand Up @@ -582,12 +583,7 @@ const handleZoomClick = (asset: AssetItem) => {
props: {
modelUrl: getAssetFileUrl(asset)
},
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: 'left-1/2 w-[80vw] sm:max-w-[80vw] h-[80vh] max-h-[80vh]',
maximizable: true
}
dialogComponentProps: LOAD3D_VIEWER_DIALOG_PROPS
})
return
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/sidebar/tabs/JobHistorySidebarTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import { computed, defineAsyncComponent, ref } from 'vue'
import { useI18n } from 'vue-i18n'

import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import JobFilterActions from '@/components/queue/job/JobFilterActions.vue'
import JobFilterTabs from '@/components/queue/job/JobFilterTabs.vue'
import JobAssetsList from '@/components/queue/job/JobAssetsList.vue'
Expand Down Expand Up @@ -188,12 +189,7 @@ const onViewItem = wrapWithErrorHandlingAsync(async (item: JobListItem) => {
props: {
modelUrl: previewOutput.url || ''
},
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: 'left-1/2 w-[80vw] sm:max-w-[80vw] h-[80vh] max-h-[80vh]',
maximizable: true
}
dialogComponentProps: LOAD3D_VIEWER_DIALOG_PROPS
})
return
}
Expand Down
7 changes: 2 additions & 5 deletions src/extensions/core/load3d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { nextTick } from 'vue'

import Load3D from '@/components/load3d/Load3D.vue'
import Load3DViewerContent from '@/components/load3d/Load3dViewerContent.vue'
import { LOAD3D_VIEWER_CONTENT_CLASS } from '@/components/load3d/load3dViewerDialog'
import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import {
type Load3dCachedOutput,
getLoad3dOutputCache,
Expand Down Expand Up @@ -283,10 +283,7 @@ useExtensionService().registerExtension({
component: Load3DViewerContent,
props: props,
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: LOAD3D_VIEWER_CONTENT_CLASS,
maximizable: true,
...LOAD3D_VIEWER_DIALOG_PROPS,
onClose: async () => {
await useLoad3dService().handleViewerClose(props.node)
}
Expand Down
8 changes: 2 additions & 6 deletions src/services/hdrViewerService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineAsyncComponent } from 'vue'

import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import { t } from '@/i18n'
import { useDialogStore } from '@/stores/dialogStore'
import {
Expand All @@ -18,11 +19,6 @@ export function openHdrViewer(url: string) {
title: getImageFilenameFromUrl(fullResUrl) ?? t('hdrViewer.title'),
component: HdrViewerContent,
props: { imageUrl: fullResUrl },
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: 'left-1/2 w-[80vw] sm:max-w-[80vw] h-[80vh] max-h-[80vh]',
maximizable: true
}
dialogComponentProps: LOAD3D_VIEWER_DIALOG_PROPS
Comment thread
christian-byrne marked this conversation as resolved.
Resolved
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { computed, defineAsyncComponent, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'

import { LOAD3D_VIEWER_DIALOG_PROPS } from '@/components/load3d/load3dViewerDialog'
import Button from '@/components/ui/button/Button.vue'
import {
findOutputAsset,
Expand Down Expand Up @@ -125,10 +126,7 @@ function inspect(asset: ReplyAsset): void {
component: Load3dViewerContent,
props: { modelUrl: asset.url },
dialogComponentProps: {
renderer: 'reka',
size: 'full',
contentClass: 'left-1/2 w-[80vw] sm:max-w-[80vw] h-[80vh] max-h-[80vh]',
maximizable: true,
...LOAD3D_VIEWER_DIALOG_PROPS,
onClose: () => refreshModelThumbnail(asset)
}
})
Expand Down
Loading