chore: useless change

This commit is contained in:
Joel
2025-02-18 15:06:25 +08:00
parent 79a2a4f0aa
commit 6bcb8bcda1
11 changed files with 85 additions and 14046 deletions

View File

@ -98,9 +98,9 @@ const ExtraInfo = ({ isMobile, relatedApps, expand }: IExtraInfoProps) => {
/> />
} }
> >
<div className='inline-flex items-center system-xs-medium-uppercase text-text-secondary space-x-1 cursor-pointer'> <div className='system-xs-medium-uppercase inline-flex cursor-pointer items-center space-x-1 text-text-secondary'>
<span>{relatedAppsTotal || '--'} {t('common.datasetMenus.relatedApp')}</span> <span>{relatedAppsTotal || '--'} {t('common.datasetMenus.relatedApp')}</span>
<RiInformation2Line className='w-4 h-4' /> <RiInformation2Line className='h-4 w-4' />
</div> </div>
</Tooltip> </Tooltip>
)} )}
@ -117,13 +117,13 @@ const ExtraInfo = ({ isMobile, relatedApps, expand }: IExtraInfoProps) => {
noDecoration noDecoration
needsDelay needsDelay
popupContent={ popupContent={
<div className='p-4 w-[240px] bg-components-panel-bg-blur border-[0.5px] border-components-panel-border rounded-xl'> <div className='w-[240px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-4'>
<div className='inline-flex p-2 rounded-lg border-[0.5px] border-components-panel-border-subtle bg-background-default-subtle'> <div className='inline-flex rounded-lg border-[0.5px] border-components-panel-border-subtle bg-background-default-subtle p-2'>
<RiApps2AddLine className='h-4 w-4 text-text-tertiary' /> <RiApps2AddLine className='h-4 w-4 text-text-tertiary' />
</div> </div>
<div className='text-xs text-text-tertiary my-2'>{t('common.datasetMenus.emptyTip')}</div> <div className='my-2 text-xs text-text-tertiary'>{t('common.datasetMenus.emptyTip')}</div>
<a <a
className='inline-flex items-center text-xs text-text-accent mt-2 cursor-pointer' className='mt-2 inline-flex cursor-pointer items-center text-xs text-text-accent'
href={ href={
locale === LanguagesSupported[1] locale === LanguagesSupported[1]
? 'https://docs.dify.ai/v/zh-hans/guides/knowledge-base/integrate-knowledge-within-application' ? 'https://docs.dify.ai/v/zh-hans/guides/knowledge-base/integrate-knowledge-within-application'
@ -137,9 +137,9 @@ const ExtraInfo = ({ isMobile, relatedApps, expand }: IExtraInfoProps) => {
</div> </div>
} }
> >
<div className='inline-flex items-center system-xs-medium-uppercase text-text-secondary space-x-1 cursor-pointer'> <div className='system-xs-medium-uppercase inline-flex cursor-pointer items-center space-x-1 text-text-secondary'>
<span>{t('common.datasetMenus.noRelatedApp')}</span> <span>{t('common.datasetMenus.noRelatedApp')}</span>
<RiInformation2Line className='w-4 h-4' /> <RiInformation2Line className='h-4 w-4' />
</div> </div>
</Tooltip> </Tooltip>
)} )}
@ -204,7 +204,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
return <Loading type='app' /> return <Loading type='app' />
return ( return (
<div className='grow flex overflow-hidden'> <div className='flex grow overflow-hidden'>
{!hideSideBar && <AppSideBar {!hideSideBar && <AppSideBar
title={datasetRes?.name || '--'} title={datasetRes?.name || '--'}
icon={datasetRes?.icon || 'https://static.dify.ai/images/dataset-default-icon.png'} icon={datasetRes?.icon || 'https://static.dify.ai/images/dataset-default-icon.png'}
@ -220,7 +220,7 @@ const DatasetDetailLayout: FC<IAppDetailLayoutProps> = (props) => {
dataset: datasetRes, dataset: datasetRes,
mutateDatasetRes: () => mutateDatasetRes(), mutateDatasetRes: () => mutateDatasetRes(),
}}> }}>
<div className="bg-background-default-subtle grow overflow-hidden">{children}</div> <div className="grow overflow-hidden bg-background-default-subtle">{children}</div>
</DatasetDetailContext.Provider> </DatasetDetailContext.Provider>
</div> </div>
) )

View File

@ -16,7 +16,7 @@ import type {
ConversationItem, ConversationItem,
} from '@/models/share' } from '@/models/share'
export interface ChatWithHistoryContextValue { export type ChatWithHistoryContextValue = {
appInfoError?: any appInfoError?: any
appInfoLoading?: boolean appInfoLoading?: boolean
appMeta?: AppMeta appMeta?: AppMeta
@ -59,21 +59,21 @@ export const ChatWithHistoryContext = createContext<ChatWithHistoryContextValue>
showConfigPanelBeforeChat: false, showConfigPanelBeforeChat: false,
newConversationInputs: {}, newConversationInputs: {},
newConversationInputsRef: { current: {} }, newConversationInputsRef: { current: {} },
handleNewConversationInputsChange: () => {}, handleNewConversationInputsChange: () => { },
inputsForms: [], inputsForms: [],
handleNewConversation: () => {}, handleNewConversation: () => { },
handleStartChat: () => {}, handleStartChat: () => { },
handleChangeConversation: () => {}, handleChangeConversation: () => { },
handlePinConversation: () => {}, handlePinConversation: () => { },
handleUnpinConversation: () => {}, handleUnpinConversation: () => { },
handleDeleteConversation: () => {}, handleDeleteConversation: () => { },
conversationRenaming: false, conversationRenaming: false,
handleRenameConversation: () => {}, handleRenameConversation: () => { },
handleNewConversationCompleted: () => {}, handleNewConversationCompleted: () => { },
chatShouldReloadKey: '', chatShouldReloadKey: '',
isMobile: false, isMobile: false,
isInstalledApp: false, isInstalledApp: false,
handleFeedback: () => {}, handleFeedback: () => { },
currentChatInstanceRef: { current: { handleStop: () => {} } }, currentChatInstanceRef: { current: { handleStop: () => { } } },
}) })
export const useChatWithHistoryContext = () => useContext(ChatWithHistoryContext) export const useChatWithHistoryContext = () => useContext(ChatWithHistoryContext)

View File

@ -20,7 +20,7 @@ import useBreakpoints, { MediaType } from '@/hooks/use-breakpoints'
import { checkOrSetAccessToken } from '@/app/components/share/utils' import { checkOrSetAccessToken } from '@/app/components/share/utils'
import AppUnavailable from '@/app/components/base/app-unavailable' import AppUnavailable from '@/app/components/base/app-unavailable'
interface ChatWithHistoryProps { type ChatWithHistoryProps = {
className?: string className?: string
} }
const ChatWithHistory: FC<ChatWithHistoryProps> = ({ const ChatWithHistory: FC<ChatWithHistoryProps> = ({
@ -65,7 +65,7 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({
} }
return ( return (
<div className={`h-full flex bg-white ${className} ${isMobile && 'flex-col'}`}> <div className={`flex h-full bg-white ${className} ${isMobile && 'flex-col'}`}>
{ {
!isMobile && ( !isMobile && (
<Sidebar /> <Sidebar />
@ -79,7 +79,7 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({
<div className={`grow overflow-hidden ${showConfigPanelBeforeChat && !appPrevChatTree.length && 'flex items-center justify-center'}`}> <div className={`grow overflow-hidden ${showConfigPanelBeforeChat && !appPrevChatTree.length && 'flex items-center justify-center'}`}>
{ {
showConfigPanelBeforeChat && !appChatListDataLoading && !appPrevChatTree.length && ( showConfigPanelBeforeChat && !appChatListDataLoading && !appPrevChatTree.length && (
<div className={`flex w-full items-center justify-center h-full ${isMobile && 'px-4'}`}> <div className={`flex h-full w-full items-center justify-center ${isMobile && 'px-4'}`}>
<ConfigPanel /> <ConfigPanel />
</div> </div>
) )
@ -99,7 +99,7 @@ const ChatWithHistory: FC<ChatWithHistoryProps> = ({
) )
} }
export interface ChatWithHistoryWrapProps { export type ChatWithHistoryWrapProps = {
installedAppInfo?: InstalledApp installedAppInfo?: InstalledApp
className?: string className?: string
} }

View File

@ -23,7 +23,7 @@ import { ChevronRight } from '@/app/components/base/icons/src/vender/line/arrows
import cn from '@/utils/classnames' import cn from '@/utils/classnames'
import { FileList } from '@/app/components/base/file-uploader' import { FileList } from '@/app/components/base/file-uploader'
interface AnswerProps { type AnswerProps = {
item: ChatItem item: ChatItem
question: string question: string
index: number index: number
@ -101,20 +101,20 @@ const Answer: FC<AnswerProps> = ({
}, []) }, [])
return ( return (
<div className='flex mb-2 last:mb-0'> <div className='mb-2 flex last:mb-0'>
<div className='shrink-0 relative w-10 h-10'> <div className='relative h-10 w-10 shrink-0'>
{answerIcon || <AnswerIcon />} {answerIcon || <AnswerIcon />}
{responding && ( {responding && (
<div className='absolute -top-[3px] -left-[3px] pl-[6px] flex items-center w-4 h-4 bg-white rounded-full shadow-xs border-[0.5px] border-gray-50'> <div className='absolute -left-[3px] -top-[3px] flex h-4 w-4 items-center rounded-full border-[0.5px] border-gray-50 bg-white pl-[6px] shadow-xs'>
<LoadingAnim type='avatar' /> <LoadingAnim type='avatar' />
</div> </div>
)} )}
</div> </div>
<div className='chat-answer-container group grow w-0 ml-4' ref={containerRef}> <div className='chat-answer-container group ml-4 w-0 grow' ref={containerRef}>
<div className={cn('group relative pr-10', chatAnswerContainerInner)}> <div className={cn('group relative pr-10', chatAnswerContainerInner)}>
<div <div
ref={contentRef} ref={contentRef}
className={cn('relative inline-block px-4 py-3 max-w-full bg-chat-bubble-bg rounded-2xl body-lg-regular text-text-primary', workflowProcess && 'w-full')} className={cn('body-lg-regular relative inline-block max-w-full rounded-2xl bg-chat-bubble-bg px-4 py-3 text-text-primary', workflowProcess && 'w-full')}
> >
{ {
!responding && ( !responding && (
@ -153,7 +153,7 @@ const Answer: FC<AnswerProps> = ({
} }
{ {
responding && !content && !hasAgentThoughts && ( responding && !content && !hasAgentThoughts && (
<div className='flex items-center justify-center w-6 h-5'> <div className='flex h-5 w-6 items-center justify-center'>
<LoadingAnim type='text' /> <LoadingAnim type='text' />
</div> </div>
) )
@ -207,13 +207,13 @@ const Answer: FC<AnswerProps> = ({
<Citation data={citation} showHitInfo={config?.supportCitationHitInfo} /> <Citation data={citation} showHitInfo={config?.supportCitationHitInfo} />
) )
} }
{item.siblingCount && item.siblingCount > 1 && item.siblingIndex !== undefined && <div className="pt-3.5 flex justify-center items-center text-sm"> {item.siblingCount && item.siblingCount > 1 && item.siblingIndex !== undefined && <div className="flex items-center justify-center pt-3.5 text-sm">
<button <button
className={`${item.prevSibling ? 'opacity-100' : 'opacity-30'}`} className={`${item.prevSibling ? 'opacity-100' : 'opacity-30'}`}
disabled={!item.prevSibling} disabled={!item.prevSibling}
onClick={() => item.prevSibling && switchSibling?.(item.prevSibling)} onClick={() => item.prevSibling && switchSibling?.(item.prevSibling)}
> >
<ChevronRight className="w-[14px] h-[14px] rotate-180 text-text-primary" /> <ChevronRight className="h-[14px] w-[14px] rotate-180 text-text-primary" />
</button> </button>
<span className="px-2 text-xs text-text-primary">{item.siblingIndex + 1} / {item.siblingCount}</span> <span className="px-2 text-xs text-text-primary">{item.siblingIndex + 1} / {item.siblingCount}</span>
<button <button
@ -221,7 +221,7 @@ const Answer: FC<AnswerProps> = ({
disabled={!item.nextSibling} disabled={!item.nextSibling}
onClick={() => item.nextSibling && switchSibling?.(item.nextSibling)} onClick={() => item.nextSibling && switchSibling?.(item.nextSibling)}
> >
<ChevronRight className="w-[14px] h-[14px] text-text-primary" /> <ChevronRight className="h-[14px] w-[14px] text-text-primary" />
</button> </button>
</div>} </div>}
</div> </div>

View File

@ -36,7 +36,7 @@ import {
} from '@/app/components/base/file-uploader/utils' } from '@/app/components/base/file-uploader/utils'
type GetAbortController = (abortController: AbortController) => void type GetAbortController = (abortController: AbortController) => void
interface SendCallback { type SendCallback = {
onGetConversationMessages?: (conversationId: string, getAbortController: GetAbortController) => Promise<any> onGetConversationMessages?: (conversationId: string, getAbortController: GetAbortController) => Promise<any>
onGetSuggestedQuestions?: (responseItemId: string, getAbortController: GetAbortController) => Promise<any> onGetSuggestedQuestions?: (responseItemId: string, getAbortController: GetAbortController) => Promise<any>
onConversationComplete?: (conversationId: string) => void onConversationComplete?: (conversationId: string) => void
@ -305,7 +305,7 @@ export const useChat = (
else else
ttsUrl = `/apps/${params.appId}/text-to-audio` ttsUrl = `/apps/${params.appId}/text-to-audio`
} }
const player = AudioPlayerManager.getInstance().getAudioPlayer(ttsUrl, ttsIsPublic, uuidV4(), 'none', 'none', (_: any): any => {}) const player = AudioPlayerManager.getInstance().getAudioPlayer(ttsUrl, ttsIsPublic, uuidV4(), 'none', 'none', (_: any): any => { })
ssePost( ssePost(
url, url,
{ {

View File

@ -14,14 +14,14 @@ export type {
PromptVariable, PromptVariable,
} from '@/models/debug' } from '@/models/debug'
export interface UserInputForm { export type UserInputForm = {
default: string default: string
label: string label: string
required: boolean required: boolean
variable: string variable: string
} }
export interface UserInputFormTextInput { export type UserInputFormTextInput = {
'text-input': UserInputForm & { 'text-input': UserInputForm & {
max_length: number max_length: number
} }
@ -39,7 +39,7 @@ export type UserInputFormParagraph = {
export type VisionConfig = VisionSettings export type VisionConfig = VisionSettings
export interface EnableType { export type EnableType = {
enabled: boolean enabled: boolean
} }
@ -50,7 +50,7 @@ export type ChatConfig = Omit<ModelConfig, 'model'> & {
supportCitationHitInfo?: boolean supportCitationHitInfo?: boolean
} }
export interface WorkflowProcess { export type WorkflowProcess = {
status: WorkflowRunningStatus status: WorkflowRunningStatus
tracing: NodeTracing[] tracing: NodeTracing[]
expand?: boolean // for UI expand?: boolean // for UI
@ -76,10 +76,10 @@ export type OnSend = {
export type OnRegenerate = (chatItem: ChatItem) => void export type OnRegenerate = (chatItem: ChatItem) => void
export interface Callback { export type Callback = {
onSuccess: () => void onSuccess: () => void
} }
export interface Feedback { export type Feedback = {
rating: 'like' | 'dislike' | null rating: 'like' | 'dislike' | null
} }

View File

@ -66,11 +66,11 @@ const VoiceParamConfig = ({
return ( return (
<> <>
<div className='mb-4 flex items-center justify-between'> <div className='mb-4 flex items-center justify-between'>
<div className='text-text-primary system-xl-semibold'>{t('appDebug.voice.voiceSettings.title')}</div> <div className='system-xl-semibold text-text-primary'>{t('appDebug.voice.voiceSettings.title')}</div>
<div className='p-1 cursor-pointer' onClick={onClose}><RiCloseLine className='w-4 h-4 text-text-tertiary' /></div> <div className='cursor-pointer p-1' onClick={onClose}><RiCloseLine className='h-4 w-4 text-text-tertiary' /></div>
</div> </div>
<div className='mb-3'> <div className='mb-3'>
<div className='mb-1 py-1 flex items-center text-text-secondary system-sm-semibold'> <div className='system-sm-semibold mb-1 flex items-center py-1 text-text-secondary'>
{t('appDebug.voice.voiceSettings.language')} {t('appDebug.voice.voiceSettings.language')}
<Tooltip <Tooltip
popupContent={ popupContent={
@ -93,7 +93,7 @@ const VoiceParamConfig = ({
> >
<div className='relative h-8'> <div className='relative h-8'>
<ListboxButton <ListboxButton
className={'w-full h-full rounded-lg border-0 bg-components-input-bg-normal py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-state-base-hover group-hover:bg-state-base-hover cursor-pointer'}> className={'h-full w-full cursor-pointer rounded-lg border-0 bg-components-input-bg-normal py-1.5 pl-3 pr-10 focus-visible:bg-state-base-hover focus-visible:outline-none group-hover:bg-state-base-hover sm:text-sm sm:leading-6'}>
<span className={classNames('block truncate text-left text-text-secondary', !languageItem?.name && 'text-text-tertiary')}> <span className={classNames('block truncate text-left text-text-secondary', !languageItem?.name && 'text-text-tertiary')}>
{languageItem?.name ? t(`common.voice.language.${languageItem?.value.replace('-', '')}`) : localLanguagePlaceholder} {languageItem?.name ? t(`common.voice.language.${languageItem?.value.replace('-', '')}`) : localLanguagePlaceholder}
</span> </span>
@ -112,11 +112,11 @@ const VoiceParamConfig = ({
> >
<ListboxOptions <ListboxOptions
className="absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-components-panel-bg py-1 text-base shadow-lg border-components-panel-border border-[0.5px] focus:outline-none sm:text-sm"> className="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md border-[0.5px] border-components-panel-border bg-components-panel-bg px-1 py-1 text-base shadow-lg focus:outline-none sm:text-sm">
{languages.map((item: Item) => ( {languages.map((item: Item) => (
<ListboxOption <ListboxOption
key={item.value} key={item.value}
className='relative cursor-pointer select-none py-2 pl-3 pr-9 rounded-lg hover:bg-state-base-hover text-text-secondary data-[active]:bg-state-base-active' className='relative cursor-pointer select-none rounded-lg py-2 pl-3 pr-9 text-text-secondary hover:bg-state-base-hover data-[active]:bg-state-base-active'
value={item} value={item}
disabled={false} disabled={false}
> >
@ -135,15 +135,15 @@ const VoiceParamConfig = ({
)} )}
</> </>
)} )}
</ListboxOption > </ListboxOption>
))} ))}
</ListboxOptions > </ListboxOptions>
</Transition > </Transition>
</div > </div >
</Listbox > </Listbox >
</div > </div >
<div className='mb-3'> <div className='mb-3'>
<div className='mb-1 py-1 text-text-secondary system-sm-semibold'> <div className='system-sm-semibold mb-1 py-1 text-text-secondary'>
{t('appDebug.voice.voiceSettings.voice')} {t('appDebug.voice.voiceSettings.voice')}
</div> </div>
<div className='flex items-center gap-1'> <div className='flex items-center gap-1'>
@ -156,9 +156,9 @@ const VoiceParamConfig = ({
}) })
}} }}
> >
<div className={'grow relative h-8'}> <div className={'relative h-8 grow'}>
<ListboxButton <ListboxButton
className={'w-full h-full rounded-lg border-0 bg-components-input-bg-normal py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-state-base-hover group-hover:bg-state-base-hover cursor-pointer'}> className={'h-full w-full cursor-pointer rounded-lg border-0 bg-components-input-bg-normal py-1.5 pl-3 pr-10 focus-visible:bg-state-base-hover focus-visible:outline-none group-hover:bg-state-base-hover sm:text-sm sm:leading-6'}>
<span <span
className={classNames('block truncate text-left text-text-secondary', !voiceItem?.name && 'text-text-tertiary')}>{voiceItem?.name ?? localVoicePlaceholder}</span> className={classNames('block truncate text-left text-text-secondary', !voiceItem?.name && 'text-text-tertiary')}>{voiceItem?.name ?? localVoicePlaceholder}</span>
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2"> <span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
@ -176,35 +176,36 @@ const VoiceParamConfig = ({
> >
<ListboxOptions <ListboxOptions
className="absolute z-10 mt-1 px-1 max-h-60 w-full overflow-auto rounded-md bg-components-panel-bg py-1 text-base shadow-lg border-components-panel-border border-[0.5px] focus:outline-none sm:text-sm"> className="absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md border-[0.5px] border-components-panel-border bg-components-panel-bg px-1 py-1 text-base shadow-lg focus:outline-none sm:text-sm">
{voiceItems?.map((item: Item) => ( {voiceItems?.map((item: Item) => (
<ListboxOption <ListboxOption
key={item.value} key={item.value}
className='relative cursor-pointer select-none py-2 pl-3 pr-9 rounded-lg hover:bg-state-base-hover text-text-secondary data-[active]:bg-state-base-active' className='relative cursor-pointer select-none rounded-lg py-2 pl-3 pr-9 text-text-secondary hover:bg-state-base-hover data-[active]:bg-state-base-active'
value={item} value={item}
disabled={false} disabled={false}
> >
<> {({ /* active, */ selected }) => (
<span className={classNames('block', selected && 'font-normal')}>{item.name}</span> <>
{(selected || item.value === text2speech?.voice) && ( <span className={classNames('block', selected && 'font-normal')}>{item.name}</span>
<span {(selected || item.value === text2speech?.voice) && (
className={classNames( <span
'absolute inset-y-0 right-0 flex items-center pr-4 text-text-secondary', className={classNames(
)} 'absolute inset-y-0 right-0 flex items-center pr-4 text-text-secondary',
> )}
<CheckIcon className="h-4 w-4" aria-hidden="true" /> >
</span> <CheckIcon className="h-4 w-4" aria-hidden="true" />
)} </span>
</> )}
</>
)} )}
</ListboxOption > </ListboxOption>
))} ))}
</ListboxOptions > </ListboxOptions>
</Transition > </Transition>
</div > </div >
</Listbox > </Listbox >
{languageItem?.example && ( {languageItem?.example && (
<div className='shrink-0 h-8 p-1 rounded-lg bg-components-button-tertiary-bg'> <div className='h-8 shrink-0 rounded-lg bg-components-button-tertiary-bg p-1'>
<AudioBtn <AudioBtn
value={languageItem?.example} value={languageItem?.example}
isAudition isAudition
@ -216,7 +217,7 @@ const VoiceParamConfig = ({
</div > </div >
</div > </div >
<div> <div>
<div className='mb-1 py-1 text-text-secondary system-sm-semibold'> <div className='system-sm-semibold mb-1 py-1 text-text-secondary'>
{t('appDebug.voice.voiceSettings.autoPlay')} {t('appDebug.voice.voiceSettings.autoPlay')}
</div> </div>
<Switch className='shrink-0' <Switch className='shrink-0'

View File

@ -61,7 +61,7 @@ import {
import { useEventEmitterContextContext } from '@/context/event-emitter' import { useEventEmitterContextContext } from '@/context/event-emitter'
import cn from '@/utils/classnames' import cn from '@/utils/classnames'
export interface PromptEditorProps { export type PromptEditorProps = {
instanceId?: string instanceId?: string
compact?: boolean compact?: boolean
className?: string className?: string
@ -149,7 +149,7 @@ const PromptEditor: FC<PromptEditorProps> = ({
<LexicalComposer initialConfig={{ ...initialConfig, editable }}> <LexicalComposer initialConfig={{ ...initialConfig, editable }}>
<div className='relative min-h-5'> <div className='relative min-h-5'>
<RichTextPlugin <RichTextPlugin
contentEditable={<ContentEditable className={`${className} outline-none ${compact ? 'leading-5 text-[13px]' : 'leading-6 text-sm'} text-text-secondary`} style={style || {}} />} contentEditable={<ContentEditable className={`${className} outline-none ${compact ? 'text-[13px] leading-5' : 'text-sm leading-6'} text-text-secondary`} style={style || {}} />}
placeholder={<Placeholder value={placeholder} className={cn('truncate', placeholderClassName)} compact={compact} />} placeholder={<Placeholder value={placeholder} className={cn('truncate', placeholderClassName)} compact={compact} />}
ErrorBoundary={LexicalErrorBoundary} ErrorBoundary={LexicalErrorBoundary}
/> />

View File

@ -32,7 +32,7 @@ import type { PickerBlockMenuOption } from './menu'
import VarReferenceVars from '@/app/components/workflow/nodes/_base/components/variable/var-reference-vars' import VarReferenceVars from '@/app/components/workflow/nodes/_base/components/variable/var-reference-vars'
import { useEventEmitterContextContext } from '@/context/event-emitter' import { useEventEmitterContextContext } from '@/context/event-emitter'
interface ComponentPickerProps { type ComponentPickerProps = {
triggerString: string triggerString: string
contextBlock?: ContextBlockType contextBlock?: ContextBlockType
queryBlock?: QueryBlockType queryBlock?: QueryBlockType
@ -133,9 +133,9 @@ const ComponentPicker = ({
// The `LexicalMenu` will try to calculate the position of the floating menu based on the first child. // The `LexicalMenu` will try to calculate the position of the floating menu based on the first child.
// Since we use floating ui, we need to wrap it with a div to prevent the position calculation being affected. // Since we use floating ui, we need to wrap it with a div to prevent the position calculation being affected.
// See https://github.com/facebook/lexical/blob/ac97dfa9e14a73ea2d6934ff566282d7f758e8bb/packages/lexical-react/src/shared/LexicalMenu.ts#L493 // See https://github.com/facebook/lexical/blob/ac97dfa9e14a73ea2d6934ff566282d7f758e8bb/packages/lexical-react/src/shared/LexicalMenu.ts#L493
<div className='w-0 h-0'> <div className='h-0 w-0'>
<div <div
className='p-1 w-[260px] bg-components-panel-bg-blur rounded-lg border-[0.5px] border-components-panel-border shadow-lg' className='w-[260px] rounded-lg border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg'
style={{ style={{
...floatingStyles, ...floatingStyles,
visibility: isPositioned ? 'visible' : 'hidden', visibility: isPositioned ? 'visible' : 'hidden',
@ -148,7 +148,7 @@ const ComponentPicker = ({
{ {
// Divider // Divider
index !== 0 && options.at(index - 1)?.group !== option.group && ( index !== 0 && options.at(index - 1)?.group !== option.group && (
<div className='h-px bg-divider-subtle my-1 w-full -translate-x-1'></div> <div className='my-1 h-px w-full -translate-x-1 bg-divider-subtle'></div>
) )
} }
{option.renderMenuOption({ {option.renderMenuOption({
@ -169,7 +169,7 @@ const ComponentPicker = ({
<> <>
{ {
(!!options.length) && ( (!!options.length) && (
<div className='h-px bg-divider-subtle my-1 w-full -translate-x-1'></div> <div className='my-1 h-px w-full -translate-x-1 bg-divider-subtle'></div>
) )
} }
<div className='p-1'> <div className='p-1'>

View File

@ -183,8 +183,8 @@
"uglify-js": "^3.19.3" "uglify-js": "^3.19.3"
}, },
"resolutions": { "resolutions": {
"@types/react": "~18.2.0", "@types/react": "19.0.7",
"@types/react-dom": "~18.2.0", "@types/react-dom": "19.0.3",
"string-width": "4.2.3" "string-width": "4.2.3"
}, },
"lint-staged": { "lint-staged": {

File diff suppressed because it is too large Load Diff