Merge branch 'chore/infrastructure-upgrade2' of github.com:langgenius/dify into chore/infrastructure-upgrade2
This commit is contained in:
commit
8012b092ce
@ -31,7 +31,7 @@ type IPagination = IUsePagination & {
|
||||
}
|
||||
|
||||
type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||
as?: React.ReactElement
|
||||
as?: React.ReactNode
|
||||
children?: string | React.ReactNode
|
||||
className?: string
|
||||
dataTestId?: string
|
||||
@ -39,9 +39,9 @@ type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
||||
|
||||
type PageButtonProps = ButtonProps & {
|
||||
/**
|
||||
* Provide a custom ReactElement (e.g. Next/Link)
|
||||
* Provide a custom ReactNode (e.g. Next/Link)
|
||||
*/
|
||||
as?: React.ReactElement
|
||||
as?: React.ReactNode
|
||||
activeClassName?: string
|
||||
inactiveClassName?: string
|
||||
dataTestIdActive?: string
|
||||
|
@ -9,7 +9,7 @@ export type HtmlContentProps = {
|
||||
|
||||
type IPopover = {
|
||||
className?: string
|
||||
htmlContent: React.ReactElement<HtmlContentProps>
|
||||
htmlContent: React.ReactNode<HtmlContentProps>
|
||||
popupClassName?: string
|
||||
trigger?: 'click' | 'hover'
|
||||
position?: 'bottom' | 'br' | 'bl'
|
||||
@ -99,7 +99,7 @@ export default function CustomPopover({
|
||||
})
|
||||
}
|
||||
>
|
||||
{cloneElement(htmlContent as React.ReactElement<HtmlContentProps>, {
|
||||
{cloneElement(htmlContent as React.ReactNode<HtmlContentProps>, {
|
||||
onClose: () => onMouseLeave(open),
|
||||
...(manualClose
|
||||
? {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import type { ReactElement } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
import RadioGroupContext from '../../context'
|
||||
import s from '../../style.module.css'
|
||||
import cn from '@/utils/classnames'
|
||||
|
||||
export type TRadioGroupProps = {
|
||||
children?: ReactElement | ReactElement[]
|
||||
children?: ReactNode | ReactNode[]
|
||||
value?: string | number
|
||||
className?: string
|
||||
onChange?: (value: any) => void
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ReactElement } from 'react'
|
||||
import type { ReactNode } from 'react'
|
||||
import { useId } from 'react'
|
||||
import { useContext } from 'use-context-selector'
|
||||
import RadioGroupContext from '../../context'
|
||||
@ -8,7 +8,7 @@ import cn from '@/utils/classnames'
|
||||
export type IRadioProps = {
|
||||
className?: string
|
||||
labelClassName?: string
|
||||
children?: string | ReactElement
|
||||
children?: string | ReactNode
|
||||
checked?: boolean
|
||||
value?: string | number
|
||||
disabled?: boolean
|
||||
|
@ -45,7 +45,7 @@ Object.defineProperty(globalThis, 'sessionStorage', {
|
||||
|
||||
const BrowserInitor = ({
|
||||
children,
|
||||
}: { children: React.ReactElement }) => {
|
||||
}: { children: React.ReactNode }) => {
|
||||
return children
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,7 @@ const languageNames = {
|
||||
} as { [key: string]: string }
|
||||
|
||||
type IChildrenProps = {
|
||||
children: React.ReactElement
|
||||
children: React.ReactNode
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ function CodePanelHeader({ tag, label }: { tag: string; label: string }) {
|
||||
}
|
||||
|
||||
type ICodePanelProps = {
|
||||
children: React.ReactElement
|
||||
children: React.ReactNode
|
||||
tag?: string
|
||||
code?: string
|
||||
label?: string
|
||||
@ -182,7 +182,7 @@ function CodeGroupHeader({ title, children, selectedIndex }: IChildrenProps) {
|
||||
}
|
||||
|
||||
type ICodeGroupPanelsProps = {
|
||||
children: React.ReactElement
|
||||
children: React.ReactNode
|
||||
[key: string]: any
|
||||
}
|
||||
function CodeGroupPanels({ children, targetCode, ...props }: ICodeGroupPanelsProps) {
|
||||
|
@ -7,7 +7,7 @@ const isDevelopment = process.env.NODE_ENV === 'development'
|
||||
|
||||
const SentryInit = ({
|
||||
children,
|
||||
}: { children: React.ReactElement }) => {
|
||||
}: { children: React.ReactNode }) => {
|
||||
useEffect(() => {
|
||||
const SENTRY_DSN = document?.body?.getAttribute('data-public-sentry-dsn')
|
||||
if (!isDevelopment && SENTRY_DSN) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type {
|
||||
FC,
|
||||
ReactElement,
|
||||
ReactNode,
|
||||
} from 'react'
|
||||
import {
|
||||
cloneElement,
|
||||
@ -46,7 +46,7 @@ import BlockIcon from '@/app/components/workflow/block-icon'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
|
||||
type BaseNodeProps = {
|
||||
children: ReactElement
|
||||
children: ReactNode
|
||||
} & NodeProps
|
||||
|
||||
const BaseNode: FC<BaseNodeProps> = ({
|
||||
|
@ -1,6 +1,6 @@
|
||||
import type {
|
||||
FC,
|
||||
ReactElement,
|
||||
ReactNode,
|
||||
} from 'react'
|
||||
import {
|
||||
cloneElement,
|
||||
@ -48,7 +48,7 @@ import { useStore as useAppStore } from '@/app/components/app/store'
|
||||
import { useStore } from '@/app/components/workflow/store'
|
||||
|
||||
type BasePanelProps = {
|
||||
children: ReactElement
|
||||
children: ReactNode
|
||||
} & Node
|
||||
|
||||
const BasePanel: FC<BasePanelProps> = ({
|
||||
|
@ -40,8 +40,8 @@ export const getLocaleOnServer = async (): Promise<Locale> => {
|
||||
|
||||
if (!languages.length) {
|
||||
// Negotiator expects plain object so we need to transform headers
|
||||
const negotiatorHeaders: Record<string, string> = {}
|
||||
headers().forEach((value, key) => (negotiatorHeaders[key] = value))
|
||||
const negotiatorHeaders: Record<string, string> = {};
|
||||
(await headers()).forEach((value, key) => (negotiatorHeaders[key] = value))
|
||||
// Use negotiator and intl-localematcher to get best locale
|
||||
languages = new Negotiator({ headers: negotiatorHeaders }).languages()
|
||||
}
|
||||
|
@ -121,7 +121,7 @@
|
||||
"sharp": "^0.33.2",
|
||||
"shave": "^5.0.4",
|
||||
"sortablejs": "^1.15.0",
|
||||
"swr": "^2.1.0",
|
||||
"swr": "^2.3.0",
|
||||
"tailwind-merge": "^2.5.4",
|
||||
"use-context-selector": "^2.0.0",
|
||||
"uuid": "^10.0.0",
|
||||
|
@ -305,8 +305,8 @@ importers:
|
||||
specifier: ^1.15.0
|
||||
version: 1.15.3
|
||||
swr:
|
||||
specifier: ^2.1.0
|
||||
version: 2.2.5(react@19.0.0)
|
||||
specifier: ^2.3.0
|
||||
version: 2.3.3(react@19.0.0)
|
||||
tailwind-merge:
|
||||
specifier: ^2.5.4
|
||||
version: 2.5.4
|
||||
@ -7516,10 +7516,10 @@ packages:
|
||||
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
|
||||
swr@2.2.5:
|
||||
resolution: {integrity: sha512-QtxqyclFeAsxEUeZIYmsaQ0UjimSq1RZ9Un7I68/0ClKK/U3LoyQunwkQfJZr2fc22DfIXLNDc2wFyTEikCUpg==}
|
||||
swr@2.3.3:
|
||||
resolution: {integrity: sha512-dshNvs3ExOqtZ6kJBaAsabhPdHyeY4P2cKwRCniDVifBMoG/SVI7tfLWqPXriVspf2Rg4tPzXJTnwaihIeFw2A==}
|
||||
peerDependencies:
|
||||
react: ^16.11.0 || ^17.0.0 || ^18.0.0
|
||||
react: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
|
||||
symbol-tree@3.2.4:
|
||||
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
|
||||
@ -7872,6 +7872,11 @@ packages:
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0
|
||||
|
||||
use-sync-external-store@1.4.0:
|
||||
resolution: {integrity: sha512-9WXSPC5fMv61vaupRkCKCxsPxBocVnwakBEkMIHHpkTTg6icbJtg6jzgtLDm4bl3cSHAca52rYWih0k4K3PfHw==}
|
||||
peerDependencies:
|
||||
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||
|
||||
util-deprecate@1.0.2:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
|
||||
@ -17089,11 +17094,11 @@ snapshots:
|
||||
|
||||
supports-preserve-symlinks-flag@1.0.0: {}
|
||||
|
||||
swr@2.2.5(react@19.0.0):
|
||||
swr@2.3.3(react@19.0.0):
|
||||
dependencies:
|
||||
client-only: 0.0.1
|
||||
dequal: 2.0.3
|
||||
react: 19.0.0
|
||||
use-sync-external-store: 1.2.2(react@19.0.0)
|
||||
use-sync-external-store: 1.4.0(react@19.0.0)
|
||||
|
||||
symbol-tree@3.2.4: {}
|
||||
|
||||
@ -17463,6 +17468,10 @@ snapshots:
|
||||
dependencies:
|
||||
react: 19.0.0
|
||||
|
||||
use-sync-external-store@1.4.0(react@19.0.0):
|
||||
dependencies:
|
||||
react: 19.0.0
|
||||
|
||||
util-deprecate@1.0.2: {}
|
||||
|
||||
util@0.12.5:
|
||||
|
Loading…
Reference in New Issue
Block a user