Skip to content

Commit 30f9668

Browse files
committed
Style: prototype with larger node text
1 parent fd2ab84 commit 30f9668

File tree

4 files changed

+37
-49
lines changed

4 files changed

+37
-49
lines changed

src/renderer/extensions/vueNodes/components/InputSlot.vue

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,32 @@
11
<template>
22
<div v-if="renderError" class="node-error p-1 text-xs text-red-500">⚠️</div>
3-
<div v-else v-tooltip.left="tooltipConfig" :class="slotWrapperClass">
3+
<div
4+
v-else
5+
v-tooltip.left="tooltipConfig"
6+
:class="
7+
cn(
8+
'lg-slot lg-slot--input flex items-center group rounded-r-lg h-6',
9+
'cursor-crosshair',
10+
props.dotOnly ? 'lg-slot--dot-only' : 'pr-6',
11+
{
12+
'lg-slot--connected': props.connected,
13+
'lg-slot--compatible': props.compatible,
14+
'opacity-40': shouldDim
15+
},
16+
props.socketless && 'pointer-events-none invisible'
17+
)
18+
"
19+
>
420
<!-- Connection Dot -->
521
<SlotConnectionDot
622
ref="connectionDotRef"
723
:color="slotColor"
8-
:class="cn('-translate-x-1/2 w-3', errorClassesDot)"
24+
:class="
25+
cn(
26+
'-translate-x-1/2 w-3',
27+
hasSlotError && 'ring-2 ring-error ring-offset-0 rounded-full'
28+
)
29+
"
930
@click="onClick"
1031
@dblclick="onDoubleClick"
1132
@pointerdown="onPointerDown"
@@ -15,7 +36,12 @@
1536
<div class="h-full flex items-center min-w-0">
1637
<span
1738
v-if="!dotOnly"
18-
:class="cn('truncate text-xs font-normal', labelClasses)"
39+
:class="
40+
cn(
41+
'truncate text-node-component-slot-text',
42+
hasSlotError && 'text-error font-medium'
43+
)
44+
"
1945
>
2046
{{ slotData.localized_name || slotData.name || `Input ${index}` }}
2147
</span>
@@ -65,18 +91,6 @@ const hasSlotError = computed(() => {
6591
)
6692
})
6793
68-
const errorClassesDot = computed(() => {
69-
return hasSlotError.value
70-
? 'ring-2 ring-error ring-offset-0 rounded-full'
71-
: ''
72-
})
73-
74-
const labelClasses = computed(() =>
75-
hasSlotError.value
76-
? 'text-error font-medium'
77-
: 'text-node-component-slot-text'
78-
)
79-
8094
const renderError = ref<string | null>(null)
8195
const { toastErrorHandler } = useErrorHandling()
8296
@@ -113,20 +127,6 @@ const shouldDim = computed(() => {
113127
return !dragState.compatible.get(slotKey.value)
114128
})
115129
116-
const slotWrapperClass = computed(() =>
117-
cn(
118-
'lg-slot lg-slot--input flex items-center group rounded-r-lg h-6',
119-
'cursor-crosshair',
120-
props.dotOnly ? 'lg-slot--dot-only' : 'pr-6',
121-
{
122-
'lg-slot--connected': props.connected,
123-
'lg-slot--compatible': props.compatible,
124-
'opacity-40': shouldDim.value
125-
},
126-
props.socketless && 'pointer-events-none invisible'
127-
)
128-
)
129-
130130
const connectionDotRef = ref<ComponentPublicInstance<{
131131
slotElRef: HTMLElement | undefined
132132
}> | null>(null)

src/renderer/extensions/vueNodes/components/NodeWidgets.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
:model-value="widget.value"
5858
:node-id="nodeData?.id != null ? String(nodeData.id) : ''"
5959
:node-type="nodeType"
60-
class="flex-1 col-span-2"
60+
class="col-span-2"
6161
@update:model-value="widget.updateHandler"
6262
/>
6363
</div>

src/renderer/extensions/vueNodes/components/OutputSlot.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
<div v-else v-tooltip.right="tooltipConfig" :class="slotWrapperClass">
44
<div class="relative h-full flex items-center min-w-0">
55
<!-- Slot Name -->
6-
<span
7-
v-if="!dotOnly"
8-
class="text-xs font-normal truncate text-node-component-slot-text"
9-
>
6+
<span v-if="!dotOnly" class="truncate text-node-component-slot-text">
107
{{ slotData.localized_name || slotData.name || `Output ${index}` }}
118
</span>
129
</div>

src/renderer/extensions/vueNodes/widgets/components/layout/WidgetLayoutField.vue

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script setup lang="ts">
2-
import { noop } from 'es-toolkit'
32
import { inject } from 'vue'
43
54
import type { SimplifiedWidget } from '@/types/simplifiedWidget'
@@ -12,27 +11,19 @@ const hideLayoutField = inject<boolean>('hideLayoutField', false)
1211
</script>
1312

1413
<template>
15-
<div
16-
class="grid grid-cols-subgrid h-7.5 min-w-0 items-center justify-between gap-1"
17-
>
18-
<div
19-
v-if="!hideLayoutField"
20-
class="relative flex h-full min-w-0 items-center"
21-
>
22-
<p
23-
v-if="widget.name"
24-
class="flex-1 truncate text-xs font-normal text-node-component-slot-text"
25-
>
14+
<div class="grid grid-cols-subgrid min-w-0 justify-between gap-1">
15+
<div v-if="!hideLayoutField" class="relative flex min-w-0 items-center">
16+
<p v-if="widget.name" class="truncate m-0">
2617
{{ widget.label || widget.name }}
2718
</p>
2819
</div>
2920
<!-- basis-full grow -->
3021
<div class="relative min-w-0 flex-1">
3122
<div
3223
class="cursor-default min-w-0 rounded-lg space-y-1 focus-within:ring ring-component-node-widget-background-highlighted transition-all"
33-
@pointerdown.stop="noop"
34-
@pointermove.stop="noop"
35-
@pointerup.stop="noop"
24+
@pointerdown.stop
25+
@pointermove.stop
26+
@pointerup.stop
3627
>
3728
<slot />
3829
</div>

0 commit comments

Comments
 (0)