mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
chore(ui): lint
This commit is contained in:
parent
6dcaf75b5f
commit
a10c66797d
@ -200,6 +200,4 @@ export const isParameterLoRAWeight = (val: unknown): val is ParameterLoRAWeight
|
|||||||
// #region Regional Prompts AutoNegative
|
// #region Regional Prompts AutoNegative
|
||||||
const zAutoNegative = z.enum(['off', 'invert']);
|
const zAutoNegative = z.enum(['off', 'invert']);
|
||||||
export type ParameterAutoNegative = z.infer<typeof zAutoNegative>;
|
export type ParameterAutoNegative = z.infer<typeof zAutoNegative>;
|
||||||
export const isParameterAutoNegative = (val: unknown): val is ParameterAutoNegative =>
|
|
||||||
zAutoNegative.safeParse(val).success;
|
|
||||||
// #endregion
|
// #endregion
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
import { IconButton } from '@invoke-ai/ui-library';
|
|
||||||
import { getRegionalPromptLayerBlobs } from 'features/regionalPrompts/util/getLayerBlobs';
|
|
||||||
import { memo } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { PiBugBold } from 'react-icons/pi';
|
|
||||||
|
|
||||||
const debugBlobs = () => {
|
|
||||||
getRegionalPromptLayerBlobs(undefined, true);
|
|
||||||
};
|
|
||||||
export const DebugLayersButton = memo(() => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
return (
|
|
||||||
<IconButton
|
|
||||||
colorScheme="warning"
|
|
||||||
aria-label={t('regionalPrompts.debugLayers')}
|
|
||||||
tooltip={t('regionalPrompts.debugLayers')}
|
|
||||||
icon={<PiBugBold />}
|
|
||||||
onClick={debugBlobs}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
DebugLayersButton.displayName = 'DebugLayersButton';
|
|
@ -1,27 +0,0 @@
|
|||||||
import { FormControl, FormLabel, Switch } from '@invoke-ai/ui-library';
|
|
||||||
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
|
|
||||||
import { isEnabledChanged } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
|
||||||
import type { ChangeEvent } from 'react';
|
|
||||||
import { memo, useCallback } from 'react';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
|
|
||||||
export const RPEnabledSwitch = memo(() => {
|
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const isEnabled = useAppSelector((s) => s.regionalPrompts.present.isEnabled);
|
|
||||||
const onChange = useCallback(
|
|
||||||
(e: ChangeEvent<HTMLInputElement>) => {
|
|
||||||
dispatch(isEnabledChanged(e.target.checked));
|
|
||||||
},
|
|
||||||
[dispatch]
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<FormControl flexGrow={0} gap={2} w="min-content">
|
|
||||||
<FormLabel>{t('regionalPrompts.enableRegionalPrompts')}</FormLabel>
|
|
||||||
<Switch isChecked={isEnabled} onChange={onChange} />
|
|
||||||
</FormControl>
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
RPEnabledSwitch.displayName = 'RPEnabledSwitch';
|
|
@ -380,7 +380,6 @@ export const {
|
|||||||
maskLayerAutoNegativeChanged,
|
maskLayerAutoNegativeChanged,
|
||||||
maskLayerPreviewColorChanged,
|
maskLayerPreviewColorChanged,
|
||||||
// General actions
|
// General actions
|
||||||
isEnabledChanged,
|
|
||||||
brushSizeChanged,
|
brushSizeChanged,
|
||||||
globalMaskLayerOpacityChanged,
|
globalMaskLayerOpacityChanged,
|
||||||
undo,
|
undo,
|
||||||
@ -435,7 +434,6 @@ const undoableGroupByMatcher = isAnyOf(
|
|||||||
layerTranslated,
|
layerTranslated,
|
||||||
brushSizeChanged,
|
brushSizeChanged,
|
||||||
globalMaskLayerOpacityChanged,
|
globalMaskLayerOpacityChanged,
|
||||||
isEnabledChanged,
|
|
||||||
maskLayerPositivePromptChanged,
|
maskLayerPositivePromptChanged,
|
||||||
maskLayerNegativePromptChanged,
|
maskLayerNegativePromptChanged,
|
||||||
maskLayerPreviewColorChanged
|
maskLayerPreviewColorChanged
|
||||||
|
@ -6,7 +6,7 @@ import type { Layer as KonvaLayerType } from 'konva/lib/Layer';
|
|||||||
import type { IRect } from 'konva/lib/types';
|
import type { IRect } from 'konva/lib/types';
|
||||||
import { assert } from 'tsafe';
|
import { assert } from 'tsafe';
|
||||||
|
|
||||||
export const GET_CLIENT_RECT_CONFIG = { skipTransform: true };
|
const GET_CLIENT_RECT_CONFIG = { skipTransform: true };
|
||||||
|
|
||||||
type Extents = {
|
type Extents = {
|
||||||
minX: number;
|
minX: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { getStore } from 'app/store/nanostores/store';
|
import { getStore } from 'app/store/nanostores/store';
|
||||||
import { rgbaColorToString,rgbColorToString } from 'features/canvas/util/colorToString';
|
import { rgbaColorToString, rgbColorToString } from 'features/canvas/util/colorToString';
|
||||||
import { getScaledFlooredCursorPosition } from 'features/regionalPrompts/hooks/mouseEventHooks';
|
import { getScaledFlooredCursorPosition } from 'features/regionalPrompts/hooks/mouseEventHooks';
|
||||||
import type { Layer, Tool, VectorMaskLayer } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
import type { Layer, Tool, VectorMaskLayer } from 'features/regionalPrompts/store/regionalPromptsSlice';
|
||||||
import {
|
import {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user