Files
ComfyUI_frontend/src/renderer/extensions/linearMode/DropZone.vue
Christian Byrne ef4e4a69d5 fix: enable enforce-consistent-class-order tailwind lint rule (#9428)
## Summary

Enable `better-tailwindcss/enforce-consistent-class-order` lint rule and
auto-fix all 1027 violations across 263 files. Stacked on #9427.

## Changes

- **What**: Sort Tailwind classes into consistent order via `eslint
--fix`
- Enable `enforce-consistent-class-order` as `'error'` in eslint config
- Purely cosmetic reordering — no behavioral or visual changes

## Review Focus

Mechanical auto-fix PR — all changes are class reordering only. This is
the largest diff but lowest risk since it changes no class names, only
their order.

**Stack:** #9417#9427 → **this PR**

Fixes #9300 (partial — 3 of 3 rules)

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-9428-fix-enable-enforce-consistent-class-order-tailwind-lint-rule-31a6d73d3650811c9065f5178ba3e724)
by [Unito](https://www.unito.io)
2026-03-05 17:24:34 -08:00

76 lines
1.9 KiB
Vue

<script setup lang="ts">
import { useDropZone } from '@vueuse/core'
import { ref } from 'vue'
import { cn } from '@/utils/tailwindUtil'
const props = defineProps<{
onDragOver?: (e: DragEvent) => boolean
onDragDrop?: (e: DragEvent) => Promise<boolean> | boolean
dropIndicator?: {
iconClass?: string
imageUrl?: string
label?: string
onClick?: (e: MouseEvent) => void
}
}>()
const dropZoneRef = ref<HTMLElement | null>(null)
const canAcceptDrop = ref(false)
const { isOverDropZone } = useDropZone(dropZoneRef, {
onDrop: (_files, event) => {
// Stop propagation to prevent global handlers from creating a new node
event?.stopPropagation()
if (props.onDragDrop && event) {
props.onDragDrop(event)
}
canAcceptDrop.value = false
},
onOver: (_, event) => {
if (props.onDragOver && event) {
canAcceptDrop.value = props.onDragOver(event)
}
},
onLeave: () => {
canAcceptDrop.value = false
}
})
</script>
<template>
<div
v-if="onDragOver && onDragDrop"
ref="dropZoneRef"
:class="
cn(
'rounded-lg ring-primary-500 ring-inset',
canAcceptDrop && isOverDropZone && 'bg-primary-500/10 ring-4'
)
"
>
<slot />
<div
v-if="dropIndicator"
:class="
cn(
'm-3 flex h-25 flex-col items-center justify-center gap-2 rounded-lg border border-dashed border-border-subtle py-2',
dropIndicator?.onClick && 'cursor-pointer'
)
"
@click.prevent="dropIndicator?.onClick?.($event)"
>
<img
v-if="dropIndicator?.imageUrl"
class="h-23"
:src="dropIndicator?.imageUrl"
/>
<template v-else>
<span v-if="dropIndicator.label" v-text="dropIndicator.label" />
<i v-if="dropIndicator.iconClass" :class="dropIndicator.iconClass" />
</template>
</div>
</div>
<slot v-else />
</template>