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
0ced891944
commit
dd3ef4a80f
@ -1,4 +1,4 @@
|
|||||||
import { createDraftSafeSelectorCreator, createSelector, createSelectorCreator, lruMemoize } from '@reduxjs/toolkit';
|
import { createDraftSafeSelectorCreator, createSelectorCreator, lruMemoize } from '@reduxjs/toolkit';
|
||||||
import type { GetSelectorsOptions } from '@reduxjs/toolkit/dist/entities/state_selectors';
|
import type { GetSelectorsOptions } from '@reduxjs/toolkit/dist/entities/state_selectors';
|
||||||
import type { RootState } from 'app/store/store';
|
import type { RootState } from 'app/store/store';
|
||||||
import { isEqual } from 'lodash-es';
|
import { isEqual } from 'lodash-es';
|
||||||
@ -21,5 +21,4 @@ export const getSelectorsOptions: GetSelectorsOptions = {
|
|||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createAppSelector = createSelector.withTypes<RootState>();
|
|
||||||
export const createMemoizedAppSelector = createMemoizedSelector.withTypes<RootState>();
|
export const createMemoizedAppSelector = createMemoizedSelector.withTypes<RootState>();
|
||||||
|
@ -66,11 +66,6 @@ export const setScopes = (scopes: InteractionScope[]) => {
|
|||||||
log.trace(`Set scopes: ${formatScopes($activeScopes.get())}`);
|
log.trace(`Set scopes: ${formatScopes($activeScopes.get())}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const clearScopes = () => {
|
|
||||||
$activeScopes.set(new Set());
|
|
||||||
log.trace(`Cleared scopes`);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useScopeOnFocus = (scope: InteractionScope, ref: RefObject<HTMLElement>) => {
|
export const useScopeOnFocus = (scope: InteractionScope, ref: RefObject<HTMLElement>) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const element = ref.current;
|
const element = ref.current;
|
||||||
|
@ -35,13 +35,12 @@ export const EntityLayerAdapterGate = memo(({ children }: PropsWithChildren) =>
|
|||||||
|
|
||||||
EntityLayerAdapterGate.displayName = 'EntityLayerAdapterGate';
|
EntityLayerAdapterGate.displayName = 'EntityLayerAdapterGate';
|
||||||
|
|
||||||
/** @knipignore */
|
// export const useEntityLayerAdapter = (): CanvasLayerAdapter => {
|
||||||
export const useEntityLayerAdapter = (): CanvasLayerAdapter => {
|
// const adapter = useContext(EntityAdapterContext);
|
||||||
const adapter = useContext(EntityAdapterContext);
|
// assert(adapter, 'useEntityLayerAdapter must be used within a EntityLayerAdapterGate');
|
||||||
assert(adapter, 'useEntityLayerAdapter must be used within a EntityLayerAdapterGate');
|
// assert(adapter.type === 'layer_adapter', 'useEntityLayerAdapter must be used with a layer adapter');
|
||||||
assert(adapter.type === 'layer_adapter', 'useEntityLayerAdapter must be used with a layer adapter');
|
// return adapter;
|
||||||
return adapter;
|
// };
|
||||||
};
|
|
||||||
|
|
||||||
export const EntityMaskAdapterGate = memo(({ children }: PropsWithChildren) => {
|
export const EntityMaskAdapterGate = memo(({ children }: PropsWithChildren) => {
|
||||||
const canvasManager = useCanvasManager();
|
const canvasManager = useCanvasManager();
|
||||||
@ -69,13 +68,12 @@ export const EntityMaskAdapterGate = memo(({ children }: PropsWithChildren) => {
|
|||||||
|
|
||||||
EntityMaskAdapterGate.displayName = 'EntityMaskAdapterGate';
|
EntityMaskAdapterGate.displayName = 'EntityMaskAdapterGate';
|
||||||
|
|
||||||
/** @knipignore */
|
// export const useEntityMaskAdapter = (): CanvasMaskAdapter => {
|
||||||
export const useEntityMaskAdapter = (): CanvasMaskAdapter => {
|
// const adapter = useContext(EntityAdapterContext);
|
||||||
const adapter = useContext(EntityAdapterContext);
|
// assert(adapter, 'useEntityMaskAdapter must be used within a CanvasMaskAdapterGate');
|
||||||
assert(adapter, 'useEntityMaskAdapter must be used within a CanvasMaskAdapterGate');
|
// assert(adapter.type === 'mask_adapter', 'useEntityMaskAdapter must be used with a mask adapter');
|
||||||
assert(adapter.type === 'mask_adapter', 'useEntityMaskAdapter must be used with a mask adapter');
|
// return adapter;
|
||||||
return adapter;
|
// };
|
||||||
};
|
|
||||||
|
|
||||||
export const useEntityAdapter = (): CanvasLayerAdapter | CanvasMaskAdapter => {
|
export const useEntityAdapter = (): CanvasLayerAdapter | CanvasMaskAdapter => {
|
||||||
const adapter = useContext(EntityAdapterContext);
|
const adapter = useContext(EntityAdapterContext);
|
||||||
|
@ -26,9 +26,9 @@ export const MetadataControlNets = ({ metadata }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{controlNets.map((controlNet) => (
|
{controlNets.map((controlNet, i) => (
|
||||||
<MetadataViewControlNet
|
<MetadataViewControlNet
|
||||||
key={controlNet.id}
|
key={`${controlNet.model.key}-${i}`}
|
||||||
label={label}
|
label={label}
|
||||||
controlNet={controlNet}
|
controlNet={controlNet}
|
||||||
handlers={handlers.controlNets}
|
handlers={handlers.controlNets}
|
||||||
|
@ -26,8 +26,13 @@ export const MetadataIPAdapters = ({ metadata }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{ipAdapters.map((ipAdapter) => (
|
{ipAdapters.map((ipAdapter, i) => (
|
||||||
<MetadataViewIPAdapter key={ipAdapter.id} label={label} ipAdapter={ipAdapter} handlers={handlers.ipAdapters} />
|
<MetadataViewIPAdapter
|
||||||
|
key={`${ipAdapter.model.key}-${i}`}
|
||||||
|
label={label}
|
||||||
|
ipAdapter={ipAdapter}
|
||||||
|
handlers={handlers.ipAdapters}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
@ -26,9 +26,9 @@ export const MetadataT2IAdapters = ({ metadata }: Props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{t2iAdapters.map((t2iAdapter) => (
|
{t2iAdapters.map((t2iAdapter, i) => (
|
||||||
<MetadataViewT2IAdapter
|
<MetadataViewT2IAdapter
|
||||||
key={t2iAdapter.id}
|
key={`${t2iAdapter.model.key}-${i}`}
|
||||||
label={label}
|
label={label}
|
||||||
t2iAdapter={t2iAdapter}
|
t2iAdapter={t2iAdapter}
|
||||||
handlers={handlers.t2iAdapters}
|
handlers={handlers.t2iAdapters}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import type { ControlNetConfig, IPAdapterConfig, T2IAdapterConfig } from 'features/controlAdapters/store/types';
|
import type { ControlNetConfig, IPAdapterConfig, T2IAdapterConfig } from 'features/controlLayers/store/types';
|
||||||
import type { O } from 'ts-toolbelt';
|
import type { O } from 'ts-toolbelt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user