mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-16 20:57:21 +08:00
### What problem does this PR solve? Fix: Update the parsing editor to support dynamic field names and optimize UI styles #9869 -Modify the default background color of UI components such as Input and Select to 'bg bg base'` -Remove TagItems component reference from naive configuration page ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
68 lines
1.8 KiB
TypeScript
68 lines
1.8 KiB
TypeScript
import { CheckedState } from '@radix-ui/react-checkbox';
|
|
import { ChunkTextMode } from '../../constant';
|
|
import { ComponentParams, IChunk } from '../../interface';
|
|
import { parserKeyMap } from './json-parser';
|
|
|
|
export interface FormatPreserveEditorProps {
|
|
initialValue: {
|
|
key: keyof typeof parserKeyMap | 'text' | 'html';
|
|
type: string;
|
|
value: Array<{ [key: string]: string }>;
|
|
};
|
|
onSave: (value: any) => void;
|
|
className?: string;
|
|
isSelect?: boolean;
|
|
isDelete?: boolean;
|
|
isChunck?: boolean;
|
|
handleCheckboxClick?: (id: string | number, checked: boolean) => void;
|
|
selectedChunkIds?: string[];
|
|
textMode?: ChunkTextMode;
|
|
clickChunk: (chunk: IChunk) => void;
|
|
isReadonly: boolean;
|
|
}
|
|
|
|
export type IJsonContainerProps = {
|
|
initialValue: {
|
|
key: keyof typeof parserKeyMap;
|
|
type: string;
|
|
value: {
|
|
[key: string]: string;
|
|
}[];
|
|
params: ComponentParams;
|
|
};
|
|
isChunck?: boolean;
|
|
handleCheck: (e: CheckedState, index: number) => void;
|
|
selectedChunkIds: string[] | undefined;
|
|
unescapeNewlines: (text: string) => string;
|
|
escapeNewlines: (text: string) => string;
|
|
onSave: (data: {
|
|
value: {
|
|
text: string;
|
|
}[];
|
|
key: string;
|
|
type: string;
|
|
}) => void;
|
|
className?: string;
|
|
textMode?: ChunkTextMode;
|
|
clickChunk: (chunk: IChunk) => void;
|
|
isReadonly: boolean;
|
|
};
|
|
|
|
export type IObjContainerProps = {
|
|
initialValue: {
|
|
key: string;
|
|
type: string;
|
|
value: string;
|
|
params: ComponentParams;
|
|
};
|
|
isChunck?: boolean;
|
|
handleCheck: (e: CheckedState, index: number) => void;
|
|
unescapeNewlines: (text: string) => string;
|
|
escapeNewlines: (text: string) => string;
|
|
onSave: (data: { value: string; key: string; type: string }) => void;
|
|
className?: string;
|
|
textMode?: ChunkTextMode;
|
|
clickChunk: (chunk: IChunk) => void;
|
|
isReadonly: boolean;
|
|
};
|