Skip to content

Commit

Permalink
chore(ui): knip
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Feb 14, 2025
1 parent 65a37ca commit f3dfb1b
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 611 deletions.
12 changes: 0 additions & 12 deletions invokeai/frontend/web/src/features/dnd/dnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ export const singleCanvasEntityDndSource: DndSource<SingleCanvasEntityDndSourceD
getData: buildGetData(_singleCanvasEntity.key, _singleCanvasEntity.type),
};

const _singleWorkflowField = buildTypeAndKey('single-workflow-field');
type SingleWorkflowFieldDndSourceData = DndData<
typeof _singleWorkflowField.type,
typeof _singleWorkflowField.key,
{ fieldIdentifier: FieldIdentifier }
>;
export const singleWorkflowFieldDndSource: DndSource<SingleWorkflowFieldDndSourceData> = {
..._singleWorkflowField,
typeGuard: buildTypeGuard(_singleWorkflowField.key),
getData: buildGetData(_singleWorkflowField.key, _singleWorkflowField.type),
};

type DndTarget<TargetData extends DndData, SourceData extends DndData> = {
key: symbol;
type: TargetData['type'];
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useInputFieldIsInvalid } from 'features/nodes/hooks/useInputFieldIsInva
import { useInputFieldTemplate } from 'features/nodes/hooks/useInputFieldTemplate';
import { memo, useCallback, useRef, useState } from 'react';

import { InputFieldAddRemoveLinearViewIconButton } from './InputFieldAddRemoveLinearViewIconButton';
import { InputFieldRenderer } from './InputFieldRenderer';
import { InputFieldTitle } from './InputFieldTitle';
import { InputFieldWrapper } from './InputFieldWrapper';
Expand Down Expand Up @@ -84,7 +83,6 @@ export const InputFieldEditModeNodes = memo(({ nodeId, fieldName }: Props) => {
<>
<InputFieldDescriptionPopover nodeId={nodeId} fieldName={fieldName} />
<InputFieldResetToDefaultValueIconButton nodeId={nodeId} fieldName={fieldName} />
<InputFieldAddRemoveLinearViewIconButton nodeId={nodeId} fieldName={fieldName} />
</>
)}
</Flex>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,32 @@ import type { ChangeEvent } from 'react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

export const NodeFieldElementIntegerConfig = memo(({ id, config }: { id: string; config: NodeFieldIntegerSettings }) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
export const NodeFieldElementIntegerConfig = memo(
({ id, config }: { id: string; config: NodeFieldIntegerSettings }) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();

const onChangeComponent = useCallback(
(e: ChangeEvent<HTMLSelectElement>) => {
const newConfig: NodeFieldIntegerSettings = {
...config,
component: zNumberComponent.parse(e.target.value),
};
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
},
[config, dispatch, id]
);
const onChangeComponent = useCallback(
(e: ChangeEvent<HTMLSelectElement>) => {
const newConfig: NodeFieldIntegerSettings = {
...config,
component: zNumberComponent.parse(e.target.value),
};
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
},
[config, dispatch, id]
);

return (
<FormControl>
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
<Select value={config.component} onChange={onChangeComponent} size="sm">
<option value="number-input">{t('workflows.builder.numberInput')}</option>
<option value="slider">{t('workflows.builder.slider')}</option>
<option value="number-input-and-slider">{t('workflows.builder.both')}</option>
</Select>
</FormControl>
);
});
return (
<FormControl>
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
<Select value={config.component} onChange={onChangeComponent} size="sm">
<option value="number-input">{t('workflows.builder.numberInput')}</option>
<option value="slider">{t('workflows.builder.slider')}</option>
<option value="number-input-and-slider">{t('workflows.builder.both')}</option>
</Select>
</FormControl>
);
}
);
NodeFieldElementIntegerConfig.displayName = 'NodeFieldElementIntegerConfig';
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,31 @@ import type { ChangeEvent } from 'react';
import { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';

export const NodeFieldElementStringSettings = memo(({ id, config }: { id: string; config: NodeFieldStringSettings }) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
export const NodeFieldElementStringSettings = memo(
({ id, config }: { id: string; config: NodeFieldStringSettings }) => {
const { t } = useTranslation();
const dispatch = useAppDispatch();

const onChangeComponent = useCallback(
(e: ChangeEvent<HTMLSelectElement>) => {
const newConfig: NodeFieldStringSettings = {
...config,
component: zStringComponent.parse(e.target.value),
};
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
},
[config, dispatch, id]
);
const onChangeComponent = useCallback(
(e: ChangeEvent<HTMLSelectElement>) => {
const newConfig: NodeFieldStringSettings = {
...config,
component: zStringComponent.parse(e.target.value),
};
dispatch(formElementNodeFieldDataChanged({ id, changes: { settings: newConfig } }));
},
[config, dispatch, id]
);

return (
<FormControl>
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
<Select value={config.component} onChange={onChangeComponent} size="sm">
<option value="input">{t('workflows.builder.input')}</option>
<option value="textarea">{t('workflows.builder.textarea')}</option>
</Select>
</FormControl>
);
});
return (
<FormControl>
<FormLabel flex={1}>{t('workflows.builder.component')}</FormLabel>
<Select value={config.component} onChange={onChangeComponent} size="sm">
<option value="input">{t('workflows.builder.input')}</option>
<option value="textarea">{t('workflows.builder.textarea')}</option>
</Select>
</FormControl>
);
}
);
NodeFieldElementStringSettings.displayName = 'NodeFieldElementStringSettings';
Loading

0 comments on commit f3dfb1b

Please sign in to comment.