Skip to content

Commit f3dfb1b

Browse files
chore(ui): knip
1 parent 65a37ca commit f3dfb1b

14 files changed

+57
-611
lines changed

invokeai/frontend/web/src/features/dnd/dnd.ts

-12
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,6 @@ export const singleCanvasEntityDndSource: DndSource<SingleCanvasEntityDndSourceD
108108
getData: buildGetData(_singleCanvasEntity.key, _singleCanvasEntity.type),
109109
};
110110

111-
const _singleWorkflowField = buildTypeAndKey('single-workflow-field');
112-
type SingleWorkflowFieldDndSourceData = DndData<
113-
typeof _singleWorkflowField.type,
114-
typeof _singleWorkflowField.key,
115-
{ fieldIdentifier: FieldIdentifier }
116-
>;
117-
export const singleWorkflowFieldDndSource: DndSource<SingleWorkflowFieldDndSourceData> = {
118-
..._singleWorkflowField,
119-
typeGuard: buildTypeGuard(_singleWorkflowField.key),
120-
getData: buildGetData(_singleWorkflowField.key, _singleWorkflowField.type),
121-
};
122-
123111
type DndTarget<TargetData extends DndData, SourceData extends DndData> = {
124112
key: symbol;
125113
type: TargetData['type'];

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldAddRemoveLinearViewIconButton.tsx

-56
This file was deleted.

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldEditModeLinear.tsx

-82
This file was deleted.

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldEditModeNodes.tsx

-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { useInputFieldIsInvalid } from 'features/nodes/hooks/useInputFieldIsInva
99
import { useInputFieldTemplate } from 'features/nodes/hooks/useInputFieldTemplate';
1010
import { memo, useCallback, useRef, useState } from 'react';
1111

12-
import { InputFieldAddRemoveLinearViewIconButton } from './InputFieldAddRemoveLinearViewIconButton';
1312
import { InputFieldRenderer } from './InputFieldRenderer';
1413
import { InputFieldTitle } from './InputFieldTitle';
1514
import { InputFieldWrapper } from './InputFieldWrapper';
@@ -84,7 +83,6 @@ export const InputFieldEditModeNodes = memo(({ nodeId, fieldName }: Props) => {
8483
<>
8584
<InputFieldDescriptionPopover nodeId={nodeId} fieldName={fieldName} />
8685
<InputFieldResetToDefaultValueIconButton nodeId={nodeId} fieldName={fieldName} />
87-
<InputFieldAddRemoveLinearViewIconButton nodeId={nodeId} fieldName={fieldName} />
8886
</>
8987
)}
9088
</Flex>

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldResetToInitialLinearViewValueIconButton.tsx

-30
This file was deleted.

invokeai/frontend/web/src/features/nodes/components/flow/nodes/Invocation/fields/InputFieldViewMode.tsx

-31
This file was deleted.

invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/NodeFieldElementIntegerSettings.tsx

+26-24
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,32 @@ import type { ChangeEvent } from 'react';
66
import { memo, useCallback } from 'react';
77
import { useTranslation } from 'react-i18next';
88

9-
export const NodeFieldElementIntegerConfig = memo(({ id, config }: { id: string; config: NodeFieldIntegerSettings }) => {
10-
const { t } = useTranslation();
11-
const dispatch = useAppDispatch();
9+
export const NodeFieldElementIntegerConfig = memo(
10+
({ id, config }: { id: string; config: NodeFieldIntegerSettings }) => {
11+
const { t } = useTranslation();
12+
const dispatch = useAppDispatch();
1213

13-
const onChangeComponent = useCallback(
14-
(e: ChangeEvent<HTMLSelectElement>) => {
15-
const newConfig: NodeFieldIntegerSettings = {
16-
...config,
17-
component: zNumberComponent.parse(e.target.value),
18-
};
19-
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
20-
},
21-
[config, dispatch, id]
22-
);
14+
const onChangeComponent = useCallback(
15+
(e: ChangeEvent<HTMLSelectElement>) => {
16+
const newConfig: NodeFieldIntegerSettings = {
17+
...config,
18+
component: zNumberComponent.parse(e.target.value),
19+
};
20+
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
21+
},
22+
[config, dispatch, id]
23+
);
2324

24-
return (
25-
<FormControl>
26-
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
27-
<Select value={config.component} onChange={onChangeComponent} size="sm">
28-
<option value="number-input">{t('workflows.builder.numberInput')}</option>
29-
<option value="slider">{t('workflows.builder.slider')}</option>
30-
<option value="number-input-and-slider">{t('workflows.builder.both')}</option>
31-
</Select>
32-
</FormControl>
33-
);
34-
});
25+
return (
26+
<FormControl>
27+
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
28+
<Select value={config.component} onChange={onChangeComponent} size="sm">
29+
<option value="number-input">{t('workflows.builder.numberInput')}</option>
30+
<option value="slider">{t('workflows.builder.slider')}</option>
31+
<option value="number-input-and-slider">{t('workflows.builder.both')}</option>
32+
</Select>
33+
</FormControl>
34+
);
35+
}
36+
);
3537
NodeFieldElementIntegerConfig.displayName = 'NodeFieldElementIntegerConfig';

invokeai/frontend/web/src/features/nodes/components/sidePanel/builder/NodeFieldElementStringSettings.tsx

+25-23
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,31 @@ import type { ChangeEvent } from 'react';
66
import { memo, useCallback } from 'react';
77
import { useTranslation } from 'react-i18next';
88

9-
export const NodeFieldElementStringSettings = memo(({ id, config }: { id: string; config: NodeFieldStringSettings }) => {
10-
const { t } = useTranslation();
11-
const dispatch = useAppDispatch();
9+
export const NodeFieldElementStringSettings = memo(
10+
({ id, config }: { id: string; config: NodeFieldStringSettings }) => {
11+
const { t } = useTranslation();
12+
const dispatch = useAppDispatch();
1213

13-
const onChangeComponent = useCallback(
14-
(e: ChangeEvent<HTMLSelectElement>) => {
15-
const newConfig: NodeFieldStringSettings = {
16-
...config,
17-
component: zStringComponent.parse(e.target.value),
18-
};
19-
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
20-
},
21-
[config, dispatch, id]
22-
);
14+
const onChangeComponent = useCallback(
15+
(e: ChangeEvent<HTMLSelectElement>) => {
16+
const newConfig: NodeFieldStringSettings = {
17+
...config,
18+
component: zStringComponent.parse(e.target.value),
19+
};
20+
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
21+
},
22+
[config, dispatch, id]
23+
);
2324

24-
return (
25-
<FormControl>
26-
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
27-
<Select value={config.component} onChange={onChangeComponent} size="sm">
28-
<option value="input">{t('workflows.builder.input')}</option>
29-
<option value="textarea">{t('workflows.builder.textarea')}</option>
30-
</Select>
31-
</FormControl>
32-
);
33-
});
25+
return (
26+
<FormControl>
27+
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
28+
<Select value={config.component} onChange={onChangeComponent} size="sm">
29+
<option value="input">{t('workflows.builder.input')}</option>
30+
<option value="textarea">{t('workflows.builder.textarea')}</option>
31+
</Select>
32+
</FormControl>
33+
);
34+
}
35+
);
3436
NodeFieldElementStringSettings.displayName = 'NodeFieldElementStringSettings';

0 commit comments

Comments
 (0)