|
8 | 8 | :data-node-id="nodeData.id" |
9 | 9 | :class=" |
10 | 10 | cn( |
11 | | - 'bg-node-component-surface', |
12 | | - 'lg-node absolute rounded-2xl touch-none flex flex-col', |
| 11 | + 'bg-node-component-surface lg-node absolute', |
| 12 | + 'min-h-min min-w-min contain-style contain-layout', |
| 13 | + 'rounded-2xl touch-none flex flex-col', |
13 | 14 | 'border-1 border-solid border-node-component-border', |
14 | 15 | // hover (only when node should handle events) |
15 | 16 | shouldHandleNodePointerEvents && |
|
83 | 84 |
|
84 | 85 | <!-- Node Body - rendered based on LOD level and collapsed state --> |
85 | 86 | <div |
86 | | - class="flex min-h-0 flex-1 flex-col gap-4 pb-4" |
| 87 | + class="flex min-h-min min-w-min flex-1 flex-col gap-4 pb-4" |
87 | 88 | :data-testid="`node-body-${nodeData.id}`" |
88 | 89 | > |
89 | 90 | <!-- Slots only rendered at full detail --> |
@@ -150,7 +151,6 @@ import { cn } from '@/utils/tailwindUtil' |
150 | 151 |
|
151 | 152 | import type { ResizeHandleDirection } from '../interactions/resize/resizeMath' |
152 | 153 | import { useNodeResize } from '../interactions/resize/useNodeResize' |
153 | | -import { calculateIntrinsicSize } from '../utils/calculateIntrinsicSize' |
154 | 154 | import LivePreview from './LivePreview.vue' |
155 | 155 | import NodeContent from './NodeContent.vue' |
156 | 156 | import NodeHeader from './NodeHeader.vue' |
@@ -269,18 +269,9 @@ const handleContextMenu = (event: MouseEvent) => { |
269 | 269 |
|
270 | 270 | onMounted(() => { |
271 | 271 | // Set initial DOM size from layout store, but respect intrinsic content minimum |
272 | | - if (size.value && nodeContainerRef.value && transformState) { |
273 | | - const intrinsicMin = calculateIntrinsicSize( |
274 | | - nodeContainerRef.value, |
275 | | - transformState.camera.z |
276 | | - ) |
277 | | -
|
278 | | - // Use the larger of stored size or intrinsic minimum |
279 | | - const finalWidth = Math.max(size.value.width, intrinsicMin.width) |
280 | | - const finalHeight = Math.max(size.value.height, intrinsicMin.height) |
281 | | -
|
282 | | - nodeContainerRef.value.style.width = `${finalWidth}px` |
283 | | - nodeContainerRef.value.style.height = `${finalHeight}px` |
| 272 | + if (size.value && nodeContainerRef.value) { |
| 273 | + nodeContainerRef.value.style.width = `${size.value.width}px` |
| 274 | + nodeContainerRef.value.style.height = `${size.value.height}px` |
284 | 275 | } |
285 | 276 | }) |
286 | 277 |
|
|
0 commit comments