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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/components/load3d/Load3D.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="widget-expands relative h-full w-full"
class="relative size-full"
@mouseenter="handleMouseEnter"
@mouseleave="handleMouseLeave"
@pointerdown.stop
Expand All @@ -17,7 +17,7 @@
:on-model-drop="isPreview ? undefined : handleModelDrop"
:is-preview="isPreview"
/>
<div class="pointer-events-none absolute top-0 left-0 h-full w-full">
<div class="pointer-events-none absolute top-0 left-0 size-full">
<Load3DControls
v-model:scene-config="sceneConfig"
v-model:model-config="modelConfig"
Expand Down
36 changes: 31 additions & 5 deletions src/renderer/extensions/vueNodes/components/NodeWidgets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
v-else
:class="
cn(
'lg-node-widgets grid grid-cols-[min-content_minmax(80px,max-content)_minmax(125px,auto)] has-[.widget-expands]:flex-1 gap-y-1 pr-3',
'lg-node-widgets grid grid-cols-[min-content_minmax(80px,max-content)_minmax(125px,auto)] flex-1 gap-y-1 pr-3',
shouldHandleNodePointerEvents
? 'pointer-events-auto'
: 'pointer-events-none'
)
"
:style="{
'grid-template-rows': gridTemplateRows
}"
@pointerdown="handleWidgetPointerEvent"
@pointermove="handleWidgetPointerEvent"
@pointerup="handleWidgetPointerEvent"
Expand All @@ -22,11 +25,9 @@
>
<div
v-if="!widget.simplified.options?.hidden"
:data-is-hidden="`hidden: ${widget.simplified.options?.hidden}`"
class="lg-node-widget group col-span-full grid grid-cols-subgrid items-stretch has-[.widget-expands]:flex-1"
class="lg-node-widget group col-span-full grid grid-cols-subgrid items-stretch"
>
<!-- Widget Input Slot Dot -->

<div
:class="
cn(
Expand Down Expand Up @@ -66,7 +67,7 @@

<script setup lang="ts">
import type { TooltipOptions } from 'primevue'
import { computed, onErrorCaptured, ref } from 'vue'
import { computed, onErrorCaptured, ref, toValue } from 'vue'
import type { Component } from 'vue'

import type {
Expand Down Expand Up @@ -190,4 +191,29 @@ const processedWidgets = computed((): ProcessedWidget[] => {

return result
})

// TODO: Derive from types in widgetRegistry
const EXPANDING_TYPES = [
'textarea',
'TEXTAREA',
'multiline',
'customtext',
'markdown',
'MARKDOWN',
'progressText',
'load3D',
'LOAD_3D'
] as const

const gridTemplateRows = computed((): string => {
const widgets = toValue(processedWidgets)
return widgets
.filter((w) => !w.simplified.options?.hidden)
.map((w) =>
EXPANDING_TYPES.includes(w.type as (typeof EXPANDING_TYPES)[number])
? 'auto'
: 'min-content'
)
.join(' ')
})
</script>
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<template>
<div
class="widget-expands widget-markdown relative w-full"
@dblclick="startEditing"
>
<div class="widget-markdown relative w-full" @dblclick="startEditing">
<!-- Display mode: Rendered markdown -->
<div
class="comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<template>
<div class="widget-expands relative">
<Textarea
v-model="modelValue"
v-bind="filteredProps"
:class="cn(WidgetInputBaseClass, 'size-full text-xs resize-none')"
:placeholder="placeholder || widget.name || ''"
:aria-label="widget.name"
:readonly="widget.options?.read_only"
:disabled="widget.options?.read_only"
fluid
data-capture-wheel="true"
@pointerdown.capture.stop
@pointermove.capture.stop
@pointerup.capture.stop
@contextmenu.capture.stop
/>
</div>
<Textarea
v-model="modelValue"
v-bind="filteredProps"
:class="cn(WidgetInputBaseClass, 'relative size-full text-xs resize-none')"
:placeholder="placeholder || widget.name || ''"
:aria-label="widget.name"
:readonly="widget.options?.read_only"
:disabled="widget.options?.read_only"
fluid
data-capture-wheel="true"
@pointerdown.capture.stop
@pointermove.capture.stop
@pointerup.capture.stop
@contextmenu.capture.stop
/>
</template>

<script setup lang="ts">
Expand Down