mirror of
https://github.com/langgenius/dify.git
synced 2026-04-25 01:26:57 +08:00
fix(trigger): add clickOutsideNotClose prop
This commit is contained in:
parent
dfed14ba67
commit
29cddc449f
@ -1,9 +1,9 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
import ImagePreview from '@/app/components/base/image-uploader/image-preview'
|
||||||
|
import cn from '@/utils/classnames'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import s from './style.module.css'
|
import s from './style.module.css'
|
||||||
import cn from '@/utils/classnames'
|
|
||||||
import ImagePreview from '@/app/components/base/image-uploader/image-preview'
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
srcs: string[]
|
srcs: string[]
|
||||||
@ -36,7 +36,6 @@ const ImageGallery: FC<Props> = ({
|
|||||||
const imgStyle = getWidthStyle(imgNum)
|
const imgStyle = getWidthStyle(imgNum)
|
||||||
return (
|
return (
|
||||||
<div className={cn(s[`img-${imgNum}`], 'flex flex-wrap')}>
|
<div className={cn(s[`img-${imgNum}`], 'flex flex-wrap')}>
|
||||||
{/* TODO: support preview */}
|
|
||||||
{srcs.map((src, index) => (
|
{srcs.map((src, index) => (
|
||||||
!src ? null : <img
|
!src ? null : <img
|
||||||
key={index}
|
key={index}
|
||||||
@ -52,7 +51,9 @@ const ImageGallery: FC<Props> = ({
|
|||||||
imagePreviewUrl && (
|
imagePreviewUrl && (
|
||||||
<ImagePreview
|
<ImagePreview
|
||||||
url={imagePreviewUrl}
|
url={imagePreviewUrl}
|
||||||
onCancel={() => setImagePreviewUrl('')} title={''} />
|
onCancel={() => setImagePreviewUrl('')}
|
||||||
|
title={''}
|
||||||
|
/>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -372,6 +372,7 @@ export const CommonCreateModal = ({ onClose, createType, builder }: Props) => {
|
|||||||
bottomSlot={currentStep === ApiKeyStep.Verify ? <EncryptedBottom /> : null}
|
bottomSlot={currentStep === ApiKeyStep.Verify ? <EncryptedBottom /> : null}
|
||||||
size={createType === SupportedCreationMethods.MANUAL ? 'md' : 'sm'}
|
size={createType === SupportedCreationMethods.MANUAL ? 'md' : 'sm'}
|
||||||
containerClassName='min-h-[360px]'
|
containerClassName='min-h-[360px]'
|
||||||
|
clickOutsideNotClose
|
||||||
>
|
>
|
||||||
{createType === SupportedCreationMethods.APIKEY && <MultiSteps currentStep={currentStep} />}
|
{createType === SupportedCreationMethods.APIKEY && <MultiSteps currentStep={currentStep} />}
|
||||||
{currentStep === ApiKeyStep.Verify && (
|
{currentStep === ApiKeyStep.Verify && (
|
||||||
|
|||||||
@ -183,6 +183,7 @@ export const OAuthClientSettingsModal = ({ oauthConfig, onClose, showOAuthCreate
|
|||||||
cancelButtonText={t('plugin.auth.saveOnly')}
|
cancelButtonText={t('plugin.auth.saveOnly')}
|
||||||
extraButtonText={t('common.operation.cancel')}
|
extraButtonText={t('common.operation.cancel')}
|
||||||
showExtraButton
|
showExtraButton
|
||||||
|
clickOutsideNotClose
|
||||||
extraButtonVariant='secondary'
|
extraButtonVariant='secondary'
|
||||||
onExtraButtonClick={onClose}
|
onExtraButtonClick={onClose}
|
||||||
onClose={onClose}
|
onClose={onClose}
|
||||||
|
|||||||
@ -701,7 +701,7 @@ export const usePluginReadme = ({ plugin_unique_identifier, language }: { plugin
|
|||||||
export const usePluginReadmeAsset = ({ file_name, plugin_unique_identifier }: { file_name?: string, plugin_unique_identifier?: string }) => {
|
export const usePluginReadmeAsset = ({ file_name, plugin_unique_identifier }: { file_name?: string, plugin_unique_identifier?: string }) => {
|
||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ['pluginReadmeAsset', plugin_unique_identifier, file_name],
|
queryKey: ['pluginReadmeAsset', plugin_unique_identifier, file_name],
|
||||||
queryFn: () => get<Blob>('/workspaces/current/plugin/asset', { params: { plugin_unique_identifier, file_name } }),
|
queryFn: () => get<Blob>('/workspaces/current/plugin/asset', { params: { plugin_unique_identifier, file_name } }, { silent: true }),
|
||||||
enabled: !!plugin_unique_identifier && !!file_name && /(^\.\/_assets|^_assets)/.test(file_name),
|
enabled: !!plugin_unique_identifier && !!file_name && /(^\.\/_assets|^_assets)/.test(file_name),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user