chore(ui): lint

This commit is contained in:
psychedelicious 2024-04-22 22:36:09 +10:00
parent 6dcaf75b5f
commit a10c66797d
6 changed files with 2 additions and 56 deletions

View File

@ -200,6 +200,4 @@ export const isParameterLoRAWeight = (val: unknown): val is ParameterLoRAWeight
// #region Regional Prompts AutoNegative
const zAutoNegative = z.enum(['off', 'invert']);
export type ParameterAutoNegative = z.infer<typeof zAutoNegative>;
export const isParameterAutoNegative = (val: unknown): val is ParameterAutoNegative =>
zAutoNegative.safeParse(val).success;
// #endregion

View File

@ -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';

View File

@ -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';

View File

@ -380,7 +380,6 @@ export const {
maskLayerAutoNegativeChanged,
maskLayerPreviewColorChanged,
// General actions
isEnabledChanged,
brushSizeChanged,
globalMaskLayerOpacityChanged,
undo,
@ -435,7 +434,6 @@ const undoableGroupByMatcher = isAnyOf(
layerTranslated,
brushSizeChanged,
globalMaskLayerOpacityChanged,
isEnabledChanged,
maskLayerPositivePromptChanged,
maskLayerNegativePromptChanged,
maskLayerPreviewColorChanged

View File

@ -6,7 +6,7 @@ import type { Layer as KonvaLayerType } from 'konva/lib/Layer';
import type { IRect } from 'konva/lib/types';
import { assert } from 'tsafe';
export const GET_CLIENT_RECT_CONFIG = { skipTransform: true };
const GET_CLIENT_RECT_CONFIG = { skipTransform: true };
type Extents = {
minX: number;

View File

@ -1,5 +1,5 @@
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 type { Layer, Tool, VectorMaskLayer } from 'features/regionalPrompts/store/regionalPromptsSlice';
import {