|
9 | 9 | cn( |
10 | 10 | 'bg-white dark-theme:bg-charcoal-100', |
11 | 11 | 'lg-node absolute rounded-2xl', |
12 | | - // border |
13 | 12 | 'border border-solid border-sand-100 dark-theme:border-charcoal-300', |
14 | | - !!executing && 'border-blue-100 dark-theme:border-blue-100', |
15 | | - hasAnyError && 'border-error', |
16 | | - // hover |
17 | 13 | 'hover:ring-7 ring-gray-500/50 dark-theme:ring-gray-500/20', |
18 | | - // Selected |
19 | 14 | 'outline-transparent -outline-offset-2 outline-2', |
20 | | - !!isSelected && 'outline-black dark-theme:outline-white', |
21 | | - !!(isSelected && executing) && |
22 | | - 'outline-blue-100 dark-theme:outline-blue-100', |
23 | | - isSelected && hasAnyError && 'outline-error', |
| 15 | + borderClass, |
| 16 | + outlineClass, |
24 | 17 | { |
25 | 18 | 'animate-pulse': executing, |
26 | | - 'opacity-50': nodeData.mode === 4, |
| 19 | + 'opacity-50 before:rounded-2xl before:pointer-events-none before:absolute before:bg-bypass/60 before:inset-0': |
| 20 | + bypassed, |
27 | 21 | 'will-change-transform': isDragging |
28 | 22 | }, |
29 | 23 | lodCssClass, |
@@ -238,6 +232,8 @@ const hasAnyError = computed( |
238 | 232 | (): boolean => !!(hasExecutionError.value || nodeData.hasErrors || error) |
239 | 233 | ) |
240 | 234 |
|
| 235 | +const bypassed = computed((): boolean => nodeData.mode === 4) |
| 236 | +
|
241 | 237 | // LOD (Level of Detail) system based on zoom level |
242 | 238 | const zoomRef = toRef(() => zoomLevel) |
243 | 239 | const { |
@@ -325,6 +321,29 @@ const shouldShowContent = computed( |
325 | 321 | () => shouldRenderContent.value && hasCustomContent.value |
326 | 322 | ) |
327 | 323 |
|
| 324 | +const borderClass = computed(() => { |
| 325 | + if (hasAnyError.value) { |
| 326 | + return 'border-error' |
| 327 | + } |
| 328 | + if (executing.value) { |
| 329 | + return 'border-blue-500' |
| 330 | + } |
| 331 | + return undefined |
| 332 | +}) |
| 333 | +
|
| 334 | +const outlineClass = computed(() => { |
| 335 | + if (!isSelected.value) { |
| 336 | + return undefined |
| 337 | + } |
| 338 | + if (hasAnyError.value) { |
| 339 | + return 'outline-error' |
| 340 | + } |
| 341 | + if (executing.value) { |
| 342 | + return 'outline-blue-500' |
| 343 | + } |
| 344 | + return 'outline-black dark-theme:outline-white' |
| 345 | +}) |
| 346 | +
|
328 | 347 | // Event handlers |
329 | 348 | const handlePointerDown = (event: PointerEvent) => { |
330 | 349 | if (!nodeData) { |
|
0 commit comments