mirror of
https://github.com/langgenius/dify.git
synced 2026-05-26 13:00:51 -04:00
chore: upgrade dependencies (#36606)
This commit is contained in:
@@ -5257,11 +5257,6 @@
|
||||
"count": 3
|
||||
}
|
||||
},
|
||||
"web/types/react-18-input-autosize.d.ts": {
|
||||
"ts/no-explicit-any": {
|
||||
"count": 1
|
||||
}
|
||||
},
|
||||
"web/types/workflow.ts": {
|
||||
"ts/no-explicit-any": {
|
||||
"count": 17
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "dify",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"packageManager": "pnpm@11.1.3",
|
||||
"packageManager": "pnpm@11.2.2",
|
||||
"engines": {
|
||||
"node": "^22.22.1"
|
||||
},
|
||||
|
||||
1877
pnpm-lock.yaml
generated
1877
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -27,48 +27,31 @@ packages:
|
||||
- packages/*
|
||||
overrides:
|
||||
'@lexical/code': npm:lexical-code-no-prism@0.41.0
|
||||
'@monaco-editor/loader': 1.7.0
|
||||
brace-expansion@>=2.0.0 <2.0.3: 2.0.3
|
||||
brace-expansion@>=5.0.0 <5.0.6: ^5.0.6
|
||||
canvas: ^3.2.2
|
||||
dompurify@<3.4.0: ^3.4.0
|
||||
dompurify@<=3.3.3: ^3.3.4
|
||||
dompurify@>=1.0.10 <3.4.0: ^3.4.0
|
||||
dompurify@>=3.0.1 <3.4.0: ^3.4.0
|
||||
canvas: ^3.2.3
|
||||
esbuild@<0.27.2: 0.27.2
|
||||
flatted@<=3.4.1: 3.4.2
|
||||
glob@>=10.2.0 <10.5.0: 11.1.0
|
||||
is-core-module: npm:@nolyfill/is-core-module@^1.0.39
|
||||
lodash-es@>=4.0.0 <= 4.17.23: 4.18.0
|
||||
lodash@>=4.0.0 <= 4.17.23: 4.18.0
|
||||
picomatch@<2.3.2: 2.3.2
|
||||
picomatch@>=4.0.0 <4.0.4: 4.0.4
|
||||
postcss@<8.5.10: ^8.5.10
|
||||
rollup@>=4.0.0 <4.59.0: 4.59.0
|
||||
safe-buffer: ^5.2.1
|
||||
rollup@>=4.0.0 <4.59.0: 4.60.4
|
||||
safer-buffer: npm:@nolyfill/safer-buffer@^1.0.44
|
||||
side-channel: npm:@nolyfill/side-channel@^1.0.44
|
||||
smol-toml@<1.6.1: 1.6.1
|
||||
solid-js: 1.9.11
|
||||
string-width: ~8.2.0
|
||||
svgo@>=3.0.0 <3.3.3: 3.3.3
|
||||
tar@<=7.5.10: 7.5.11
|
||||
undici@>=7.0.0 <7.24.0: 7.24.0
|
||||
vite: npm:@voidzero-dev/vite-plus-core@0.1.21
|
||||
vitest: npm:@voidzero-dev/vite-plus-test@0.1.21
|
||||
ws@>=8.0.0 <8.20.1: ^8.20.1
|
||||
yaml@>=2.0.0 <2.8.3: 2.8.3
|
||||
solid-js: 1.9.13
|
||||
string-width: ~8.2.1
|
||||
vite: npm:@voidzero-dev/vite-plus-core@0.1.22
|
||||
vitest: npm:@voidzero-dev/vite-plus-test@0.1.22
|
||||
ws@>=8.0.0 <8.20.1: ^8.21.0
|
||||
yaml@>=2.0.0 <2.8.3: 2.9.0
|
||||
yauzl@<3.2.1: 3.2.1
|
||||
catalog:
|
||||
'@amplitude/analytics-browser': 2.42.3
|
||||
'@amplitude/plugin-session-replay-browser': 1.30.4
|
||||
'@amplitude/analytics-browser': 2.42.4
|
||||
'@amplitude/plugin-session-replay-browser': 1.31.0
|
||||
'@antfu/eslint-config': 9.0.0
|
||||
'@base-ui/react': 1.5.0
|
||||
'@chromatic-com/storybook': 5.2.1
|
||||
'@cucumber/cucumber': 12.9.0
|
||||
'@egoist/tailwindcss-icons': 1.9.2
|
||||
'@emoji-mart/data': 1.2.1
|
||||
'@eslint-react/eslint-plugin': 5.8.1
|
||||
'@eslint-react/eslint-plugin': 5.8.4
|
||||
'@eslint/js': 10.0.1
|
||||
'@floating-ui/react': 0.27.19
|
||||
'@formatjs/intl-localematcher': 0.8.8
|
||||
@@ -98,27 +81,27 @@ catalog:
|
||||
'@remixicon/react': 4.9.0
|
||||
'@rgrove/parse-xml': 4.2.0
|
||||
'@sentry/react': 10.53.1
|
||||
'@storybook/addon-docs': 10.4.0
|
||||
'@storybook/addon-links': 10.4.0
|
||||
'@storybook/addon-onboarding': 10.4.0
|
||||
'@storybook/addon-themes': 10.4.0
|
||||
'@storybook/nextjs-vite': 10.4.0
|
||||
'@storybook/react': 10.4.0
|
||||
'@storybook/react-vite': 10.4.0
|
||||
'@storybook/addon-docs': 10.4.1
|
||||
'@storybook/addon-links': 10.4.1
|
||||
'@storybook/addon-onboarding': 10.4.1
|
||||
'@storybook/addon-themes': 10.4.1
|
||||
'@storybook/nextjs-vite': 10.4.1
|
||||
'@storybook/react': 10.4.1
|
||||
'@storybook/react-vite': 10.4.1
|
||||
'@streamdown/math': 1.0.2
|
||||
'@svgdotjs/svg.js': 3.2.5
|
||||
'@t3-oss/env-nextjs': 0.13.11
|
||||
'@tailwindcss/postcss': 4.3.0
|
||||
'@tailwindcss/typography': 0.5.19
|
||||
'@tailwindcss/vite': 4.3.0
|
||||
'@tanstack/eslint-plugin-query': 5.100.11
|
||||
'@tanstack/eslint-plugin-query': 5.100.14
|
||||
'@tanstack/react-devtools': 0.10.5
|
||||
'@tanstack/react-form': 1.32.0
|
||||
'@tanstack/react-form-devtools': 0.2.27
|
||||
'@tanstack/react-hotkeys': 0.10.0
|
||||
'@tanstack/react-query': 5.100.11
|
||||
'@tanstack/react-query-devtools': 5.100.11
|
||||
'@tanstack/react-virtual': 3.13.24
|
||||
'@tanstack/react-query': 5.100.14
|
||||
'@tanstack/react-query-devtools': 5.100.14
|
||||
'@tanstack/react-virtual': 3.13.25
|
||||
'@testing-library/dom': 10.4.1
|
||||
'@testing-library/jest-dom': 6.9.1
|
||||
'@testing-library/react': 16.3.2
|
||||
@@ -129,17 +112,17 @@ catalog:
|
||||
'@types/js-cookie': 3.0.6
|
||||
'@types/js-yaml': 4.0.9
|
||||
'@types/negotiator': 0.6.4
|
||||
'@types/node': 25.9.0
|
||||
'@types/node': 25.9.1
|
||||
'@types/qs': 6.15.1
|
||||
'@types/react': 19.2.14
|
||||
'@types/react': 19.2.15
|
||||
'@types/react-dom': 19.2.3
|
||||
'@types/sortablejs': 1.15.9
|
||||
'@typescript-eslint/eslint-plugin': 8.59.4
|
||||
'@typescript-eslint/parser': 8.59.4
|
||||
'@typescript/native-preview': 7.0.0-dev.20260518.1
|
||||
'@typescript/native-preview': 7.0.0-dev.20260523.1
|
||||
'@vitejs/plugin-react': 6.0.2
|
||||
'@vitejs/plugin-rsc': 0.5.26
|
||||
'@vitest/coverage-v8': 4.1.6
|
||||
'@vitest/coverage-v8': 4.1.7
|
||||
abcjs: 6.6.3
|
||||
agentation: 3.0.2
|
||||
ahooks: 3.9.7
|
||||
@@ -156,7 +139,7 @@ catalog:
|
||||
dayjs: 1.11.20
|
||||
decimal.js: 10.6.0
|
||||
dompurify: 3.4.5
|
||||
echarts: 6.1.0-rc.2
|
||||
echarts: 6.1.0
|
||||
echarts-for-react: 3.0.6
|
||||
elkjs: 0.11.1
|
||||
embla-carousel-autoplay: 8.6.0
|
||||
@@ -171,12 +154,12 @@ catalog:
|
||||
eslint-plugin-no-barrel-files: 1.3.1
|
||||
eslint-plugin-react-refresh: 0.5.2
|
||||
eslint-plugin-sonarjs: 4.0.3
|
||||
eslint-plugin-storybook: 10.4.0
|
||||
eslint-plugin-storybook: 10.4.1
|
||||
fast-deep-equal: 3.1.3
|
||||
fuse.js: 7.3.0
|
||||
happy-dom: 20.9.0
|
||||
hast-util-to-jsx-runtime: 2.3.6
|
||||
hono: 4.12.19
|
||||
hono: 4.12.22
|
||||
html-entities: 2.6.0
|
||||
html-to-image: 1.11.13
|
||||
i18next: 26.2.0
|
||||
@@ -189,7 +172,7 @@ catalog:
|
||||
js-yaml: 4.1.1
|
||||
jsonschema: 1.5.0
|
||||
katex: 0.16.47
|
||||
knip: 6.14.1
|
||||
knip: 6.14.2
|
||||
ky: 2.0.2
|
||||
lamejs: 1.2.1
|
||||
lexical: 0.44.0
|
||||
@@ -203,15 +186,14 @@ catalog:
|
||||
nuqs: 2.8.9
|
||||
pinyin-pro: 3.28.1
|
||||
playwright: 1.60.0
|
||||
postcss: 8.5.14
|
||||
postcss: 8.5.15
|
||||
qrcode.react: 4.2.0
|
||||
qs: 6.15.2
|
||||
react: 19.2.6
|
||||
react-18-input-autosize: 3.0.0
|
||||
react-dom: 19.2.6
|
||||
react-easy-crop: 5.5.7
|
||||
react-hotkeys-hook: 5.3.2
|
||||
react-i18next: 16.5.8
|
||||
react-i18next: 16.6.6
|
||||
react-multi-email: 1.0.25
|
||||
react-papaparse: 4.4.0
|
||||
react-pdf-highlighter: 8.0.0-rc.0
|
||||
@@ -223,27 +205,27 @@ catalog:
|
||||
remark-directive: 4.0.0
|
||||
scheduler: 0.27.0
|
||||
sharp: 0.34.5
|
||||
shiki: 4.0.2
|
||||
shiki: 4.1.0
|
||||
socket.io-client: 4.8.3
|
||||
sortablejs: 1.15.7
|
||||
std-semver: 1.0.8
|
||||
storybook: 10.4.0
|
||||
storybook: 10.4.1
|
||||
streamdown: 2.5.0
|
||||
string-ts: 2.3.1
|
||||
tailwind-merge: 3.6.0
|
||||
tailwindcss: 4.3.0
|
||||
tldts: 7.0.30
|
||||
tsx: 4.22.2
|
||||
tldts: 7.1.0
|
||||
tsx: 4.22.3
|
||||
typescript: 6.0.3
|
||||
uglify-js: 3.19.3
|
||||
unist-util-visit: 5.1.0
|
||||
use-context-selector: 2.0.0
|
||||
uuid: 14.0.0
|
||||
vinext: 0.0.50
|
||||
vite: npm:@voidzero-dev/vite-plus-core@0.1.21
|
||||
vite: npm:@voidzero-dev/vite-plus-core@0.1.22
|
||||
vite-plugin-inspect: 12.0.0-beta.2
|
||||
vite-plus: 0.1.21
|
||||
vitest: npm:@voidzero-dev/vite-plus-test@0.1.21
|
||||
vite-plus: 0.1.22
|
||||
vitest: npm:@voidzero-dev/vite-plus-test@0.1.22
|
||||
vitest-browser-react: 2.2.0
|
||||
vitest-canvas-mock: 1.1.4
|
||||
zod: 4.4.3
|
||||
|
||||
@@ -54,6 +54,20 @@ describe('TagInput', () => {
|
||||
expect(screen.getByPlaceholderText('Custom placeholder'))!.toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should apply input className and expose visible text for CSS sizing', async () => {
|
||||
renderTagInput({ inputClassName: 'custom-input', placeholder: 'Tag' })
|
||||
const input = screen.getByRole('textbox')
|
||||
const inputContainer = input.parentElement
|
||||
|
||||
expect(input)!.toHaveClass('custom-input')
|
||||
expect(input)!.not.toHaveAttribute('style')
|
||||
expect(inputContainer).toHaveAttribute('data-input-value', 'Tag')
|
||||
|
||||
await userEvent.type(input, 'longer')
|
||||
|
||||
expect(inputContainer).toHaveAttribute('data-input-value', 'longer')
|
||||
})
|
||||
|
||||
it('should hide input when add is disabled', () => {
|
||||
renderTagInput({ disableAdd: true })
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
import type { ComponentType, InputHTMLAttributes } from 'react'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
|
||||
type AutosizeInputProps = InputHTMLAttributes<HTMLInputElement> & {
|
||||
inputClassName?: string
|
||||
}
|
||||
|
||||
const MockAutosizeInput: ComponentType<AutosizeInputProps> = ({ inputClassName, ...props }) => (
|
||||
<input data-testid="autosize-input" className={inputClassName} {...props} />
|
||||
)
|
||||
|
||||
describe('TagInput autosize interop', () => {
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks()
|
||||
vi.resetModules()
|
||||
})
|
||||
|
||||
it('should support a namespace-style default export from react-18-input-autosize', async () => {
|
||||
const toast = Object.assign(vi.fn(), {
|
||||
success: vi.fn(),
|
||||
error: vi.fn(),
|
||||
warning: vi.fn(),
|
||||
info: vi.fn(),
|
||||
dismiss: vi.fn(),
|
||||
update: vi.fn(),
|
||||
promise: vi.fn(),
|
||||
})
|
||||
vi.doMock('@langgenius/dify-ui/toast', () => ({
|
||||
toast,
|
||||
}))
|
||||
vi.doMock('react-18-input-autosize', () => ({
|
||||
default: {
|
||||
default: MockAutosizeInput,
|
||||
},
|
||||
}))
|
||||
|
||||
const { default: TagInput } = await import('../index')
|
||||
|
||||
render(<TagInput items={[]} onChange={vi.fn()} />)
|
||||
|
||||
expect(screen.getByTestId('autosize-input')).toBeInTheDocument()
|
||||
expect(screen.getByRole('textbox')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('should support a direct default export from react-18-input-autosize', async () => {
|
||||
const toast = Object.assign(vi.fn(), {
|
||||
success: vi.fn(),
|
||||
error: vi.fn(),
|
||||
warning: vi.fn(),
|
||||
info: vi.fn(),
|
||||
dismiss: vi.fn(),
|
||||
update: vi.fn(),
|
||||
promise: vi.fn(),
|
||||
})
|
||||
vi.doMock('@langgenius/dify-ui/toast', () => ({
|
||||
toast,
|
||||
}))
|
||||
vi.doMock('react-18-input-autosize', () => ({
|
||||
default: MockAutosizeInput,
|
||||
}))
|
||||
|
||||
const { default: TagInput } = await import('../index')
|
||||
|
||||
render(<TagInput items={[]} onChange={vi.fn()} />)
|
||||
|
||||
expect(screen.getByTestId('autosize-input')).toBeInTheDocument()
|
||||
expect(screen.getByRole('textbox')).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
@@ -1,12 +1,9 @@
|
||||
import type { ChangeEvent, FC, KeyboardEvent } from 'react'
|
||||
import type { ChangeEvent, KeyboardEvent } from 'react'
|
||||
import { cn } from '@langgenius/dify-ui/cn'
|
||||
import { toast } from '@langgenius/dify-ui/toast'
|
||||
import { useCallback, useState } from 'react'
|
||||
import _AutosizeInput from 'react-18-input-autosize'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
// CJS/ESM interop: Turbopack may resolve the module namespace object instead of the default export
|
||||
// eslint-disable-next-line ts/no-explicit-any
|
||||
const AutosizeInput = ('default' in (_AutosizeInput as any) ? (_AutosizeInput as any).default : _AutosizeInput) as typeof _AutosizeInput
|
||||
|
||||
type TagInputProps = {
|
||||
items: string[]
|
||||
onChange: (items: string[]) => void
|
||||
@@ -18,11 +15,13 @@ type TagInputProps = {
|
||||
required?: boolean
|
||||
inputClassName?: string
|
||||
}
|
||||
const TagInput: FC<TagInputProps> = ({ items, onChange, disableAdd, disableRemove, customizedConfirmKey = 'Enter', isInWorkflow, placeholder, required = false, inputClassName }) => {
|
||||
|
||||
const TagInput = ({ items, onChange, disableAdd, disableRemove, customizedConfirmKey = 'Enter', isInWorkflow, placeholder, required = false, inputClassName }: TagInputProps) => {
|
||||
const { t } = useTranslation()
|
||||
const [value, setValue] = useState('')
|
||||
const [focused, setFocused] = useState(false)
|
||||
const isSpecialMode = customizedConfirmKey === 'Tab'
|
||||
const inputPlaceholder = placeholder || (isSpecialMode ? t('model.params.stop_sequencesPlaceholder', { ns: 'common' }) : t('segment.addKeyWord', { ns: 'datasetDocuments' }))
|
||||
const handleRemove = (index: number) => {
|
||||
const copyItems = [...items]
|
||||
copyItems.splice(index, 1)
|
||||
@@ -81,18 +80,22 @@ const TagInput: FC<TagInputProps> = ({ items, onChange, disableAdd, disableRemov
|
||||
{!disableAdd && (
|
||||
<div className={cn('group/tag-add mt-1 flex items-center gap-x-0.5', !isSpecialMode ? 'rounded-md border border-dashed border-divider-deep px-1.5' : '')}>
|
||||
{!isSpecialMode && !focused && <span className="i-ri-add-line size-3.5 text-text-placeholder group-hover/tag-add:text-text-secondary" />}
|
||||
<AutosizeInput
|
||||
inputClassName={cn('appearance-none text-text-primary caret-[#295EFF] outline-hidden placeholder:text-text-placeholder group-hover/tag-add:placeholder:text-text-secondary', isSpecialMode ? 'bg-transparent' : '', inputClassName)}
|
||||
className={cn(!isInWorkflow && 'max-w-[300px]', isInWorkflow && 'max-w-[146px]', 'overflow-hidden rounded-md py-1 system-xs-regular', isSpecialMode && 'border border-transparent px-1.5', focused && isSpecialMode && 'border-dashed border-divider-deep')}
|
||||
onFocus={() => setFocused(true)}
|
||||
onBlur={handleBlur}
|
||||
value={value}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(e.target.value)
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder={placeholder || (isSpecialMode ? t('model.params.stop_sequencesPlaceholder', { ns: 'common' }) : t('segment.addKeyWord', { ns: 'datasetDocuments' }))}
|
||||
/>
|
||||
<span
|
||||
data-input-value={value || inputPlaceholder}
|
||||
className={cn(!isInWorkflow && 'max-w-[300px]', isInWorkflow && 'max-w-[146px]', 'grid overflow-hidden rounded-md py-1 system-xs-regular after:invisible after:col-start-1 after:row-start-1 after:whitespace-pre after:content-[attr(data-input-value)]', isSpecialMode && 'border border-transparent px-1.5', focused && isSpecialMode && 'border-dashed border-divider-deep')}
|
||||
>
|
||||
<input
|
||||
className={cn('col-start-1 row-start-1 w-full min-w-0 appearance-none text-text-primary caret-[#295EFF] outline-hidden placeholder:text-text-placeholder group-hover/tag-add:placeholder:text-text-secondary', isSpecialMode ? 'bg-transparent' : '', inputClassName)}
|
||||
onFocus={() => setFocused(true)}
|
||||
onBlur={handleBlur}
|
||||
value={value}
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
setValue(e.target.value)
|
||||
}}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder={inputPlaceholder}
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
1
web/global.d.ts
vendored
1
web/global.d.ts
vendored
@@ -7,7 +7,6 @@ declare module 'lamejs';
|
||||
declare module 'lamejs/src/js/MPEGMode';
|
||||
declare module 'lamejs/src/js/Lame';
|
||||
declare module 'lamejs/src/js/BitStream';
|
||||
declare module 'react-18-input-autosize';
|
||||
|
||||
declare global {
|
||||
// Google Analytics gtag types
|
||||
|
||||
@@ -123,7 +123,6 @@
|
||||
"qrcode.react": "catalog:",
|
||||
"qs": "catalog:",
|
||||
"react": "catalog:",
|
||||
"react-18-input-autosize": "catalog:",
|
||||
"react-dom": "catalog:",
|
||||
"react-easy-crop": "catalog:",
|
||||
"react-hotkeys-hook": "catalog:",
|
||||
|
||||
23
web/types/react-18-input-autosize.d.ts
vendored
23
web/types/react-18-input-autosize.d.ts
vendored
@@ -1,23 +0,0 @@
|
||||
declare module 'react-18-input-autosize' {
|
||||
import type { ChangeEvent, CSSProperties, FocusEvent, KeyboardEvent } from 'react'
|
||||
|
||||
export type AutosizeInputProps = {
|
||||
value?: string | number
|
||||
defaultValue?: string | number
|
||||
onChange?: (event: ChangeEvent<HTMLInputElement>) => void
|
||||
onFocus?: (event: FocusEvent<HTMLInputElement>) => void
|
||||
onBlur?: (event: FocusEvent<HTMLInputElement>) => void
|
||||
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void
|
||||
placeholder?: string
|
||||
className?: string
|
||||
inputClassName?: string
|
||||
style?: CSSProperties
|
||||
inputStyle?: CSSProperties
|
||||
minWidth?: number | string
|
||||
maxWidth?: number | string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
const AutosizeInput: React.FC<AutosizeInputProps>
|
||||
export default AutosizeInput
|
||||
}
|
||||
Reference in New Issue
Block a user