Files
ComfyUI_frontend/src/components/maskeditor/PaintBucketSettingsPanel.vue
Alexander Brown 69c8c84aef fix: resolve i18n no-restricted-imports lint warnings (#8704)
## Summary

Fix all i18n `no-restricted-imports` lint warnings and upgrade rules
from `warn` to `error`.

## Changes

- **What**: Migrate Vue components from `import { t/d } from '@/i18n'`
to `const { t } = useI18n()`. Migrate non-component `.ts` files from
`useI18n()` to `import { t/d } from '@/i18n'`. Allow `st` import from
`@/i18n` in Vue components (it wraps `te`/`t` for safe fallback
translation). Remove `@deprecated` tag from `i18n.ts` global exports
(still used by `st` and non-component code). Upgrade both lint rules
from `warn` to `error`.

## Review Focus

- The `st` helper is intentionally excluded from the Vue component
restriction since it provides safe fallback translation needed for
custom node definitions.

Fixes #8701

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-8704-fix-resolve-i18n-no-restricted-imports-lint-warnings-2ff6d73d365081ae84d8eb0dfef24323)
by [Unito](https://www.unito.io)

---------

Co-authored-by: Amp <amp@ampcode.com>
2026-02-06 20:54:53 -08:00

47 lines
1.0 KiB
Vue

<template>
<div class="flex flex-col gap-3 pb-3">
<h3
class="text-center text-[15px] font-sans text-[var(--descrip-text)] mt-2.5"
>
{{ t('maskEditor.paintBucketSettings') }}
</h3>
<SliderControl
:label="t('maskEditor.tolerance')"
:min="0"
:max="255"
:step="1"
:model-value="store.paintBucketTolerance"
@update:model-value="onToleranceChange"
/>
<SliderControl
:label="t('maskEditor.fillOpacity')"
:min="0"
:max="100"
:step="1"
:model-value="store.fillOpacity"
@update:model-value="onFillOpacityChange"
/>
</div>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { useMaskEditorStore } from '@/stores/maskEditorStore'
import SliderControl from './controls/SliderControl.vue'
const { t } = useI18n()
const store = useMaskEditorStore()
const onToleranceChange = (value: number) => {
store.setPaintBucketTolerance(value)
}
const onFillOpacityChange = (value: number) => {
store.setFillOpacity(value)
}
</script>