feat:移除了弹窗,服务器添加sls

This commit is contained in:
AxTps committed 2026-09-08 22:39:45 +08:00
commit 6a295f9a7a
4082 files changed
+1322534

No files matched your search

@@ -0,0 +1,39 @@
import { defineMessages, useVIntl } from '@modrinth/ui'
import { computed } from 'vue'
import { isResultValue, nextResultCount } from '@/lab/recipe-generator/count-display'
import type { RecipeSlot, SlotValue } from '@/lab/recipe-generator/types'
const messages = defineMessages({
scrollToAdjust: {
id: 'app.lab.recipe-generator.scroll-to-adjust',
defaultMessage: 'Scroll to adjust quantity',
},
})
export function useResultCountWheel(options: {
getSlot: () => RecipeSlot | null
getValue: () => SlotValue | undefined
getCount: () => number
setCount: (count: number) => void
}) {
const { formatMessage } = useVIntl()
const canAdjust = computed(() => Boolean(options.getSlot() && isResultValue(options.getValue())))
const hint = computed(() =>
canAdjust.value ? formatMessage(messages.scrollToAdjust) : undefined,
)
function onWheel(slot: RecipeSlot, event: WheelEvent) {
if (slot !== options.getSlot()) return
const value = options.getValue()
if (!isResultValue(value)) return
if (event.deltaY === 0) return
event.preventDefault()
event.stopPropagation()
const current = options.getCount()
const next = nextResultCount(current, event.deltaY)
if (next !== current) options.setCount(next)
}
return { canAdjust, hint, onWheel }
}