mirror of https://github.com/langgenius/dify.git
feat(web): migrate from es-toolkit/compat to native es-toolkit (#30244)
Migrate 172 files from es-toolkit/compat to native es-toolkit. Migrated: - noop → es-toolkit/function - cloneDeep, omit, clone, pick → es-toolkit/object - uniq, intersection → es-toolkit/array - capitalize, camelCase, kebabCase, escape → es-toolkit/string - isEqual → es-toolkit/predicate Kept in compat (API differences): - uniqueId, isEmpty - get, merge, flow, curry, debounce - different APIs - uniqBy, groupBy, intersectionBy - property string support - flatten - undefined handling Benefits: 2-3x faster, smaller bundle Part of #30243 Fixes #30244
This commit is contained in:
parent
c393d7a2dc
commit
f05d43d26f
|
|
@ -1,6 +1,7 @@
|
||||||
import type { Plan, UsagePlanInfo } from '@/app/components/billing/type'
|
import type { Plan, UsagePlanInfo } from '@/app/components/billing/type'
|
||||||
import type { ProviderContextState } from '@/context/provider-context'
|
import type { ProviderContextState } from '@/context/provider-context'
|
||||||
import { merge, noop } from 'es-toolkit/compat'
|
import { merge } from 'es-toolkit/compat'
|
||||||
|
import { noop } from 'es-toolkit/function'
|
||||||
import { defaultPlan } from '@/app/components/billing/config'
|
import { defaultPlan } from '@/app/components/billing/config'
|
||||||
|
|
||||||
// Avoid being mocked in tests
|
// Avoid being mocked in tests
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { FC } from 'react'
|
||||||
import type { TriggerProps } from '@/app/components/base/date-and-time-picker/types'
|
import type { TriggerProps } from '@/app/components/base/date-and-time-picker/types'
|
||||||
import { RiCalendarLine } from '@remixicon/react'
|
import { RiCalendarLine } from '@remixicon/react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import Picker from '@/app/components/base/date-and-time-picker/date-picker'
|
import Picker from '@/app/components/base/date-and-time-picker/date-picker'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { RiArrowLeftLine, RiLockPasswordLine } from '@remixicon/react'
|
import { RiArrowLeftLine, RiLockPasswordLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { ResponseError } from '@/service/fetch'
|
import type { ResponseError } from '@/service/fetch'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import {
|
||||||
RiAddLine,
|
RiAddLine,
|
||||||
RiEditLine,
|
RiEditLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { ExternalDataTool } from '@/models/common'
|
||||||
import type { PromptVariable } from '@/models/debug'
|
import type { PromptVariable } from '@/models/debug'
|
||||||
import type { GenRes } from '@/service/debug'
|
import type { GenRes } from '@/service/debug'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { ExternalDataTool } from '@/models/common'
|
import type { ExternalDataTool } from '@/models/common'
|
||||||
import copy from 'copy-to-clipboard'
|
import copy from 'copy-to-clipboard'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Slider from '@/app/components/base/slider'
|
import Slider from '@/app/components/base/slider'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { Member } from '@/models/common'
|
||||||
import type { DataSet } from '@/models/datasets'
|
import type { DataSet } from '@/models/datasets'
|
||||||
import type { RetrievalConfig } from '@/types/app'
|
import type { RetrievalConfig } from '@/types/app'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import type { ModelAndParameter } from '../types'
|
import type { ModelAndParameter } from '../types'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { createContext, useContext } from 'use-context-selector'
|
import { createContext, useContext } from 'use-context-selector'
|
||||||
|
|
||||||
export type DebugWithMultipleModelContextType = {
|
export type DebugWithMultipleModelContextType = {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@ import type {
|
||||||
OnSend,
|
OnSend,
|
||||||
TextGenerationConfig,
|
TextGenerationConfig,
|
||||||
} from '@/app/components/base/text-generation/types'
|
} from '@/app/components/base/text-generation/types'
|
||||||
import { cloneDeep, noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
|
import { cloneDeep } from 'es-toolkit/object'
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import TextGeneration from '@/app/components/app/text-generate/item'
|
import TextGeneration from '@/app/components/app/text-generate/item'
|
||||||
import { TransferMethod } from '@/app/components/base/chat/types'
|
import { TransferMethod } from '@/app/components/base/chat/types'
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import type {
|
||||||
ChatConfig,
|
ChatConfig,
|
||||||
ChatItem,
|
ChatItem,
|
||||||
} from '@/app/components/base/chat/types'
|
} from '@/app/components/base/chat/types'
|
||||||
import { cloneDeep } from 'es-toolkit/compat'
|
import { cloneDeep } from 'es-toolkit/object'
|
||||||
import {
|
import {
|
||||||
useCallback,
|
useCallback,
|
||||||
useRef,
|
useRef,
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,8 @@ import {
|
||||||
RiSparklingFill,
|
RiSparklingFill,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { cloneDeep, noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
|
import { cloneDeep } from 'es-toolkit/object'
|
||||||
import { produce, setAutoFreeze } from 'immer'
|
import { produce, setAutoFreeze } from 'immer'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
import type { FormValue } from '@/app/components/header/account-setting/model-provider-page/declarations'
|
||||||
import type { ChatPromptConfig, CompletionPromptConfig, ConversationHistoriesRole, PromptItem } from '@/models/debug'
|
import type { ChatPromptConfig, CompletionPromptConfig, ConversationHistoriesRole, PromptItem } from '@/models/debug'
|
||||||
import { clone } from 'es-toolkit/compat'
|
import { clone } from 'es-toolkit/object'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { checkHasContextBlock, checkHasHistoryBlock, checkHasQueryBlock, PRE_PROMPT_PLACEHOLDER_TEXT } from '@/app/components/base/prompt-editor/constants'
|
import { checkHasContextBlock, checkHasHistoryBlock, checkHasQueryBlock, PRE_PROMPT_PLACEHOLDER_TEXT } from '@/app/components/base/prompt-editor/constants'
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,8 @@ import type {
|
||||||
import type { ModelConfig as BackendModelConfig, UserInputFormItem, VisionSettings } from '@/types/app'
|
import type { ModelConfig as BackendModelConfig, UserInputFormItem, VisionSettings } from '@/types/app'
|
||||||
import { CodeBracketIcon } from '@heroicons/react/20/solid'
|
import { CodeBracketIcon } from '@heroicons/react/20/solid'
|
||||||
import { useBoolean, useGetState } from 'ahooks'
|
import { useBoolean, useGetState } from 'ahooks'
|
||||||
import { clone, isEqual } from 'es-toolkit/compat'
|
import { clone } from 'es-toolkit/object'
|
||||||
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type {
|
||||||
CodeBasedExtensionItem,
|
CodeBasedExtensionItem,
|
||||||
ExternalDataTool,
|
ExternalDataTool,
|
||||||
} from '@/models/common'
|
} from '@/models/common'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import type { MouseEventHandler } from 'react'
|
import type { MouseEventHandler } from 'react'
|
||||||
import { RiCloseLine, RiCommandLine, RiCornerDownLeftLine } from '@remixicon/react'
|
import { RiCloseLine, RiCommandLine, RiCornerDownLeftLine } from '@remixicon/react'
|
||||||
import { useDebounceFn, useKeyPress } from 'ahooks'
|
import { useDebounceFn, useKeyPress } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { AppIconType } from '@/types/app'
|
import type { AppIconType } from '@/types/app'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { FC } from 'react'
|
||||||
import type { App } from '@/types/app'
|
import type { App } from '@/types/app'
|
||||||
import { useDebounce } from 'ahooks'
|
import { useDebounce } from 'ahooks'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { omit } from 'es-toolkit/compat'
|
import { omit } from 'es-toolkit/object'
|
||||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ import { RiCloseLine, RiEditFill } from '@remixicon/react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import timezone from 'dayjs/plugin/timezone'
|
import timezone from 'dayjs/plugin/timezone'
|
||||||
import utc from 'dayjs/plugin/utc'
|
import utc from 'dayjs/plugin/utc'
|
||||||
import { get, noop } from 'es-toolkit/compat'
|
import { get } from 'es-toolkit/compat'
|
||||||
|
import { noop } from 'es-toolkit/function'
|
||||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
import { usePathname, useRouter, useSearchParams } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { RenderOptions } from '@testing-library/react'
|
||||||
import type { Mock, MockedFunction } from 'vitest'
|
import type { Mock, MockedFunction } from 'vitest'
|
||||||
import type { ModalContextState } from '@/context/modal-context'
|
import type { ModalContextState } from '@/context/modal-context'
|
||||||
import { fireEvent, render } from '@testing-library/react'
|
import { fireEvent, render } from '@testing-library/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { defaultPlan } from '@/app/components/billing/config'
|
import { defaultPlan } from '@/app/components/billing/config'
|
||||||
import { useModalContext as actualUseModalContext } from '@/context/modal-context'
|
import { useModalContext as actualUseModalContext } from '@/context/modal-context'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import type { App } from '@/types/app'
|
import type { App } from '@/types/app'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { useDebounce } from 'ahooks'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import timezone from 'dayjs/plugin/timezone'
|
import timezone from 'dayjs/plugin/timezone'
|
||||||
import utc from 'dayjs/plugin/utc'
|
import utc from 'dayjs/plugin/utc'
|
||||||
import { omit } from 'es-toolkit/compat'
|
import { omit } from 'es-toolkit/object'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { IChatItem } from '@/app/components/base/chat/chat/type'
|
import type { IChatItem } from '@/app/components/base/chat/chat/type'
|
||||||
import type { AgentIteration, AgentLogDetailResponse } from '@/models/log'
|
import type { AgentIteration, AgentLogDetailResponse } from '@/models/log'
|
||||||
import { flatten, uniq } from 'es-toolkit/compat'
|
import { uniq } from 'es-toolkit/array'
|
||||||
|
import { flatten } from 'es-toolkit/compat'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { Area } from 'react-easy-crop'
|
||||||
import type { OnImageInput } from './ImageInput'
|
import type { OnImageInput } from './ImageInput'
|
||||||
import type { AppIconType, ImageFile } from '@/types/app'
|
import type { AppIconType, ImageFile } from '@/types/app'
|
||||||
import { RiImageCircleAiLine } from '@remixicon/react'
|
import { RiImageCircleAiLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config'
|
import { DISABLE_UPLOAD_IMAGE_AS_ICON } from '@/config'
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import type {
|
||||||
AppMeta,
|
AppMeta,
|
||||||
ConversationItem,
|
ConversationItem,
|
||||||
} from '@/models/share'
|
} from '@/models/share'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { createContext, useContext } from 'use-context-selector'
|
import { createContext, useContext } from 'use-context-selector'
|
||||||
|
|
||||||
export type ChatWithHistoryContextValue = {
|
export type ChatWithHistoryContextValue = {
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import type {
|
||||||
ConversationItem,
|
ConversationItem,
|
||||||
} from '@/models/share'
|
} from '@/models/share'
|
||||||
import { useLocalStorageState } from 'ahooks'
|
import { useLocalStorageState } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import {
|
import {
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@ import type { InputForm } from './type'
|
||||||
import type AudioPlayer from '@/app/components/base/audio-btn/audio'
|
import type AudioPlayer from '@/app/components/base/audio-btn/audio'
|
||||||
import type { FileEntity } from '@/app/components/base/file-uploader/types'
|
import type { FileEntity } from '@/app/components/base/file-uploader/types'
|
||||||
import type { Annotation } from '@/models/log'
|
import type { Annotation } from '@/models/log'
|
||||||
import { noop, uniqBy } from 'es-toolkit/compat'
|
import { uniqBy } from 'es-toolkit/compat'
|
||||||
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce, setAutoFreeze } from 'immer'
|
import { produce, setAutoFreeze } from 'immer'
|
||||||
import { useParams, usePathname } from 'next/navigation'
|
import { useParams, usePathname } from 'next/navigation'
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type {
|
||||||
AppMeta,
|
AppMeta,
|
||||||
ConversationItem,
|
ConversationItem,
|
||||||
} from '@/models/share'
|
} from '@/models/share'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { createContext, useContext } from 'use-context-selector'
|
import { createContext, useContext } from 'use-context-selector'
|
||||||
|
|
||||||
export type EmbeddedChatbotContextValue = {
|
export type EmbeddedChatbotContextValue = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import type {
|
||||||
ConversationItem,
|
ConversationItem,
|
||||||
} from '@/models/share'
|
} from '@/models/share'
|
||||||
import { useLocalStorageState } from 'ahooks'
|
import { useLocalStorageState } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import {
|
import {
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { InputVar } from '@/app/components/workflow/types'
|
||||||
import type { PromptVariable } from '@/models/debug'
|
import type { PromptVariable } from '@/models/debug'
|
||||||
import { RiAddLine, RiAsterisk, RiCloseLine, RiDeleteBinLine, RiDraggable } from '@remixicon/react'
|
import { RiAddLine, RiAsterisk, RiCloseLine, RiDeleteBinLine, RiDraggable } from '@remixicon/react'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { ChangeEvent, FC } from 'react'
|
||||||
import type { CodeBasedExtensionItem } from '@/models/common'
|
import type { CodeBasedExtensionItem } from '@/models/common'
|
||||||
import type { ModerationConfig, ModerationContentConfig } from '@/models/debug'
|
import type { ModerationConfig, ModerationContentConfig } from '@/models/debug'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { ClipboardEvent } from 'react'
|
||||||
import type { FileEntity } from './types'
|
import type { FileEntity } from './types'
|
||||||
import type { FileUpload } from '@/app/components/base/features/types'
|
import type { FileUpload } from '@/app/components/base/features/types'
|
||||||
import type { FileUploadConfigResponse } from '@/models/common'
|
import type { FileUploadConfigResponse } from '@/models/common'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { useParams } from 'next/navigation'
|
import { useParams } from 'next/navigation'
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiCloseLine, RiZoomInLine, RiZoomOutLine } from '@remixicon/react'
|
import { RiCloseLine, RiZoomInLine, RiZoomOutLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { t } from 'i18next'
|
import { t } from 'i18next'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type {
|
import type {
|
||||||
FileEntity,
|
FileEntity,
|
||||||
} from './types'
|
} from './types'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import {
|
import {
|
||||||
createContext,
|
createContext,
|
||||||
useContext,
|
useContext,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
|
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
|
||||||
import { RiCloseLargeLine } from '@remixicon/react'
|
import { RiCloseLargeLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
||||||
type IModal = {
|
type IModal = {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiAddBoxLine, RiCloseLine, RiDownloadCloud2Line, RiFileCopyLine, RiZoomInLine, RiZoomOutLine } from '@remixicon/react'
|
import { RiAddBoxLine, RiCloseLine, RiDownloadCloud2Line, RiFileCopyLine, RiZoomInLine, RiZoomOutLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { t } from 'i18next'
|
import { t } from 'i18next'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { VariantProps } from 'class-variance-authority'
|
||||||
import type { ChangeEventHandler, CSSProperties, FocusEventHandler } from 'react'
|
import type { ChangeEventHandler, CSSProperties, FocusEventHandler } from 'react'
|
||||||
import { RiCloseCircleFill, RiErrorWarningLine, RiSearchLine } from '@remixicon/react'
|
import { RiCloseCircleFill, RiErrorWarningLine, RiSearchLine } from '@remixicon/react'
|
||||||
import { cva } from 'class-variance-authority'
|
import { cva } from 'class-variance-authority'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react'
|
import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild } from '@headlessui/react'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { Fragment } from 'react'
|
import { Fragment } from 'react'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
// https://headlessui.com/react/dialog
|
// https://headlessui.com/react/dialog
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { ButtonProps } from '@/app/components/base/button'
|
import type { ButtonProps } from '@/app/components/base/button'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { memo } from 'react'
|
import { memo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type {
|
||||||
IPaginationProps,
|
IPaginationProps,
|
||||||
PageButtonProps,
|
PageButtonProps,
|
||||||
} from './type'
|
} from './type'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
import usePagination from './hook'
|
import usePagination from './hook'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { ContextBlockType } from '../../types'
|
import type { ContextBlockType } from '../../types'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
import { mergeRegister } from '@lexical/utils'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { $applyNodeReplacement } from 'lexical'
|
import { $applyNodeReplacement } from 'lexical'
|
||||||
import {
|
import {
|
||||||
memo,
|
memo,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { ContextBlockType } from '../../types'
|
import type { ContextBlockType } from '../../types'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
import { mergeRegister } from '@lexical/utils'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import {
|
import {
|
||||||
$insertNodes,
|
$insertNodes,
|
||||||
COMMAND_PRIORITY_EDITOR,
|
COMMAND_PRIORITY_EDITOR,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { HistoryBlockType } from '../../types'
|
import type { HistoryBlockType } from '../../types'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
import { mergeRegister } from '@lexical/utils'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { $applyNodeReplacement } from 'lexical'
|
import { $applyNodeReplacement } from 'lexical'
|
||||||
import {
|
import {
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { HistoryBlockType } from '../../types'
|
import type { HistoryBlockType } from '../../types'
|
||||||
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
||||||
import { mergeRegister } from '@lexical/utils'
|
import { mergeRegister } from '@lexical/utils'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import {
|
import {
|
||||||
$insertNodes,
|
$insertNodes,
|
||||||
COMMAND_PRIORITY_EDITOR,
|
COMMAND_PRIORITY_EDITOR,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { HtmlContentProps } from '@/app/components/base/popover'
|
||||||
import type { Tag } from '@/app/components/base/tag-management/constant'
|
import type { Tag } from '@/app/components/base/tag-management/constant'
|
||||||
import { RiAddLine, RiPriceTag3Line } from '@remixicon/react'
|
import { RiAddLine, RiPriceTag3Line } from '@remixicon/react'
|
||||||
import { useUnmount } from 'ahooks'
|
import { useUnmount } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import type { Tag } from '@/app/components/base/tag-management/constant'
|
import type { Tag } from '@/app/components/base/tag-management/constant'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
|
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import { act, render, screen, waitFor } from '@testing-library/react'
|
import { act, render, screen, waitFor } from '@testing-library/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import Toast, { ToastProvider, useToastContext } from '.'
|
import Toast, { ToastProvider, useToastContext } from '.'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import {
|
||||||
RiErrorWarningFill,
|
RiErrorWarningFill,
|
||||||
RiInformation2Fill,
|
RiInformation2Fill,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { render, screen } from '@testing-library/react'
|
import { render, screen } from '@testing-library/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
import withValidation from '.'
|
import withValidation from '.'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { IndexingStatusResponse } from '@/models/datasets'
|
import type { IndexingStatusResponse } from '@/models/datasets'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useReducer } from 'react'
|
import { useEffect, useReducer } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { useDebounceFn, useKeyPress } from 'ahooks'
|
import { useDebounceFn, useKeyPress } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useMemo, useRef, useState } from 'react'
|
import { useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import {
|
||||||
RiArrowLeftLine,
|
RiArrowLeftLine,
|
||||||
RiSearchEyeLine,
|
RiSearchEyeLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { ChunkingMode, FileItem } from '@/models/datasets'
|
import type { ChunkingMode, FileItem } from '@/models/datasets'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
import Drawer from './drawer'
|
import Drawer from './drawer'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiLoader2Line } from '@remixicon/react'
|
import { RiLoader2Line } from '@remixicon/react'
|
||||||
import { useCountDown } from 'ahooks'
|
import { useCountDown } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useRef, useState } from 'react'
|
import { useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { Item } from '@/app/components/base/select'
|
||||||
import type { FileEntity } from '@/app/components/datasets/common/image-uploader/types'
|
import type { FileEntity } from '@/app/components/datasets/common/image-uploader/types'
|
||||||
import type { ChildChunkDetail, SegmentDetailModel, SegmentUpdater } from '@/models/datasets'
|
import type { ChildChunkDetail, SegmentDetailModel, SegmentUpdater } from '@/models/datasets'
|
||||||
import { useDebounceFn } from 'ahooks'
|
import { useDebounceFn } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import type { NotionPage } from '@/models/common'
|
import type { NotionPage } from '@/models/common'
|
||||||
import type { CrawlResultItem, CustomFile, FileIndexingEstimateResponse } from '@/models/datasets'
|
import type { CrawlResultItem, CustomFile, FileIndexingEstimateResponse } from '@/models/datasets'
|
||||||
import type { OnlineDriveFile, PublishedPipelineRunPreviewResponse } from '@/models/pipeline'
|
import type { OnlineDriveFile, PublishedPipelineRunPreviewResponse } from '@/models/pipeline'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { useCallback, useMemo, useRef, useState } from 'react'
|
import { useCallback, useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ import {
|
||||||
RiGlobalLine,
|
RiGlobalLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { pick, uniq } from 'es-toolkit/compat'
|
import { uniq } from 'es-toolkit/array'
|
||||||
|
import { pick } from 'es-toolkit/object'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useEffect, useMemo, useState } from 'react'
|
import { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
RiPlayCircleLine,
|
RiPlayCircleLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { useBoolean, useDebounceFn } from 'ahooks'
|
import { useBoolean, useDebounceFn } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiArrowLeftLine } from '@remixicon/react'
|
import { RiArrowLeftLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import type { MouseEventHandler } from 'react'
|
||||||
import type { AppIconSelection } from '../../base/app-icon-picker'
|
import type { AppIconSelection } from '../../base/app-icon-picker'
|
||||||
import type { DataSet } from '@/models/datasets'
|
import type { DataSet } from '@/models/datasets'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useCallback, useRef, useState } from 'react'
|
import { useCallback, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { AppIconType } from '@/types/app'
|
import type { AppIconType } from '@/types/app'
|
||||||
import { RiCloseLine, RiCommandLine, RiCornerDownLeftLine } from '@remixicon/react'
|
import { RiCloseLine, RiCommandLine, RiCornerDownLeftLine } from '@remixicon/react'
|
||||||
import { useDebounceFn, useKeyPress } from 'ahooks'
|
import { useDebounceFn, useKeyPress } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { ApiBasedExtension } from '@/models/common'
|
import type { ApiBasedExtension } from '@/models/common'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { DataSourceNotion as TDataSourceNotion } from '@/models/common'
|
import type { DataSourceNotion as TDataSourceNotion } from '@/models/common'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type { FC } from 'react'
|
||||||
import {
|
import {
|
||||||
RiDeleteBinLine,
|
RiDeleteBinLine,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { useContext } from 'use-context-selector'
|
import { useContext } from 'use-context-selector'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { InvitationResult } from '@/models/common'
|
import type { InvitationResult } from '@/models/common'
|
||||||
import { RiCloseLine, RiErrorWarningFill } from '@remixicon/react'
|
import { RiCloseLine, RiErrorWarningFill } from '@remixicon/react'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useCallback, useEffect, useState } from 'react'
|
import { useCallback, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { ReactMultiEmail } from 'react-multi-email'
|
import { ReactMultiEmail } from 'react-multi-email'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { InvitationResult } from '@/models/common'
|
||||||
import { XMarkIcon } from '@heroicons/react/24/outline'
|
import { XMarkIcon } from '@heroicons/react/24/outline'
|
||||||
import { CheckCircleIcon } from '@heroicons/react/24/solid'
|
import { CheckCircleIcon } from '@heroicons/react/24/solid'
|
||||||
import { RiQuestionLine } from '@remixicon/react'
|
import { RiQuestionLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { Trans, useTranslation } from 'react-i18next'
|
import { Trans, useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { ReactNode } from 'react'
|
import type { ReactNode } from 'react'
|
||||||
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
|
import { Dialog, DialogPanel, Transition, TransitionChild } from '@headlessui/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { Fragment, useCallback, useEffect } from 'react'
|
import { Fragment, useCallback, useEffect } from 'react'
|
||||||
import { cn } from '@/utils/classnames'
|
import { cn } from '@/utils/classnames'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { AppDetailResponse } from '@/models/app'
|
import type { AppDetailResponse } from '@/models/app'
|
||||||
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
|
import { Menu, MenuButton, MenuItem, MenuItems, Transition } from '@headlessui/react'
|
||||||
import { ChevronDownIcon, PlusIcon } from '@heroicons/react/24/solid'
|
import { ChevronDownIcon, PlusIcon } from '@heroicons/react/24/solid'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { Fragment, useState } from 'react'
|
import { Fragment, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import { RiAlertFill } from '@remixicon/react'
|
import { RiAlertFill } from '@remixicon/react'
|
||||||
import { camelCase } from 'es-toolkit/compat'
|
import { camelCase } from 'es-toolkit/string'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useMemo } from 'react'
|
import { useMemo } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ import type {
|
||||||
SearchParams,
|
SearchParams,
|
||||||
SearchParamsFromCollection,
|
SearchParamsFromCollection,
|
||||||
} from './types'
|
} from './types'
|
||||||
import { debounce, noop } from 'es-toolkit/compat'
|
import { debounce } from 'es-toolkit/compat'
|
||||||
|
import { noop } from 'es-toolkit/function'
|
||||||
import {
|
import {
|
||||||
useCallback,
|
useCallback,
|
||||||
useEffect,
|
useEffect,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
||||||
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
||||||
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { useMemo, useRef, useState } from 'react'
|
import { useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { EncryptedBottom } from '@/app/components/base/encrypted-bottom'
|
import { EncryptedBottom } from '@/app/components/base/encrypted-bottom'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
||||||
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
||||||
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { useMemo, useRef } from 'react'
|
import { useMemo, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { BaseForm } from '@/app/components/base/form/components/base'
|
import { BaseForm } from '@/app/components/base/form/components/base'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
||||||
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
import type { ParametersSchema, PluginDetail } from '@/app/components/plugins/types'
|
||||||
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
import type { TriggerSubscription } from '@/app/components/workflow/block-selector/types'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { useMemo, useRef } from 'react'
|
import { useMemo, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { BaseForm } from '@/app/components/base/form/components/base'
|
import { BaseForm } from '@/app/components/base/form/components/base'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import type { ReactNode, RefObject } from 'react'
|
import type { ReactNode, RefObject } from 'react'
|
||||||
import type { FilterState } from './filter-management'
|
import type { FilterState } from './filter-management'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import {
|
import {
|
||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
'use client'
|
'use client'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useMemo, useRef, useState } from 'react'
|
import { useEffect, useMemo, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import {
|
||||||
RiEqualizer2Line,
|
RiEqualizer2Line,
|
||||||
} from '@remixicon/react'
|
} from '@remixicon/react'
|
||||||
import { useBoolean } from 'ahooks'
|
import { useBoolean } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import {
|
import {
|
||||||
useRouter,
|
useRouter,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { RiAddLine, RiArrowDownSLine } from '@remixicon/react'
|
import { RiAddLine, RiArrowDownSLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useEffect, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import type { SortableItem } from './types'
|
import type { SortableItem } from './types'
|
||||||
import type { InputVar } from '@/models/pipeline'
|
import type { InputVar } from '@/models/pipeline'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import {
|
import {
|
||||||
memo,
|
memo,
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
|
import type { AppIconSelection } from '@/app/components/base/app-icon-picker'
|
||||||
import type { IconInfo } from '@/models/datasets'
|
import type { IconInfo } from '@/models/datasets'
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useCallback, useState } from 'react'
|
import { useCallback, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import AppIcon from '@/app/components/base/app-icon'
|
import AppIcon from '@/app/components/base/app-icon'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type { FC } from 'react'
|
||||||
import type { Label } from '@/app/components/tools/labels/constant'
|
import type { Label } from '@/app/components/tools/labels/constant'
|
||||||
import { RiArrowDownSLine } from '@remixicon/react'
|
import { RiArrowDownSLine } from '@remixicon/react'
|
||||||
import { useDebounceFn } from 'ahooks'
|
import { useDebounceFn } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useMemo, useState } from 'react'
|
import { useMemo, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Checkbox from '@/app/components/base/checkbox'
|
import Checkbox from '@/app/components/base/checkbox'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import type { ToolWithProvider } from '@/app/components/workflow/types'
|
||||||
import type { AppIconType } from '@/types/app'
|
import type { AppIconType } from '@/types/app'
|
||||||
import { RiCloseLine, RiEditLine } from '@remixicon/react'
|
import { RiCloseLine, RiEditLine } from '@remixicon/react'
|
||||||
import { useHover } from 'ahooks'
|
import { useHover } from 'ahooks'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useCallback, useRef, useState } from 'react'
|
import { useCallback, useRef, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { FC } from 'react'
|
import type { FC } from 'react'
|
||||||
import type { Collection } from '../../types'
|
import type { Collection } from '../../types'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { RiCloseLine } from '@remixicon/react'
|
import { RiCloseLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
|
import { AlertTriangle } from '@/app/components/base/icons/src/vender/solid/alertsAndFeedback'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import type AudioPlayer from '@/app/components/base/audio-btn/audio'
|
||||||
import type { Node } from '@/app/components/workflow/types'
|
import type { Node } from '@/app/components/workflow/types'
|
||||||
import type { IOtherOptions } from '@/service/base'
|
import type { IOtherOptions } from '@/service/base'
|
||||||
import type { VersionHistory } from '@/types/workflow'
|
import type { VersionHistory } from '@/types/workflow'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import { produce } from 'immer'
|
import { produce } from 'immer'
|
||||||
import { usePathname } from 'next/navigation'
|
import { usePathname } from 'next/navigation'
|
||||||
import { useCallback, useRef } from 'react'
|
import { useCallback, useRef } from 'react'
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
import type { RefObject } from 'react'
|
import type { RefObject } from 'react'
|
||||||
import type { Plugin, PluginCategoryEnum } from '@/app/components/plugins/types'
|
import type { Plugin, PluginCategoryEnum } from '@/app/components/plugins/types'
|
||||||
import { RiArrowRightUpLine, RiSearchLine } from '@remixicon/react'
|
import { RiArrowRightUpLine, RiSearchLine } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useEffect, useImperativeHandle, useMemo, useRef } from 'react'
|
import { useEffect, useImperativeHandle, useMemo, useRef } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type {
|
||||||
Edge,
|
Edge,
|
||||||
OnSelectBlock,
|
OnSelectBlock,
|
||||||
} from './types'
|
} from './types'
|
||||||
import { intersection } from 'es-toolkit/compat'
|
import { intersection } from 'es-toolkit/array'
|
||||||
import {
|
import {
|
||||||
memo,
|
memo,
|
||||||
useCallback,
|
useCallback,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use client'
|
'use client'
|
||||||
import type { EnvironmentVariable } from '@/app/components/workflow/types'
|
import type { EnvironmentVariable } from '@/app/components/workflow/types'
|
||||||
import { RiCloseLine, RiLock2Line } from '@remixicon/react'
|
import { RiCloseLine, RiLock2Line } from '@remixicon/react'
|
||||||
import { noop } from 'es-toolkit/compat'
|
import { noop } from 'es-toolkit/function'
|
||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ const VersionHistoryButton: FC<VersionHistoryButtonProps> = ({
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
className={cn(
|
className={cn(
|
||||||
'p-2 rounded-lg border border-transparent',
|
'rounded-lg border border-transparent p-2',
|
||||||
theme === 'dark' && 'border-black/5 bg-white/10 backdrop-blur-sm',
|
theme === 'dark' && 'border-black/5 bg-white/10 backdrop-blur-sm',
|
||||||
)}
|
)}
|
||||||
onClick={handleViewVersionHistory}
|
onClick={handleViewVersionHistory}
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,7 @@ import type { IOtherOptions } from '@/service/base'
|
||||||
import type { SchemaTypeDefinition } from '@/service/use-common'
|
import type { SchemaTypeDefinition } from '@/service/use-common'
|
||||||
import type { FlowType } from '@/types/common'
|
import type { FlowType } from '@/types/common'
|
||||||
import type { VarInInspect } from '@/types/workflow'
|
import type { VarInInspect } from '@/types/workflow'
|
||||||
import {
|
import { noop } from 'es-toolkit/function'
|
||||||
noop,
|
|
||||||
} from 'es-toolkit/compat'
|
|
||||||
import { useContext } from 'react'
|
import { useContext } from 'react'
|
||||||
import {
|
import {
|
||||||
useStore as useZustandStore,
|
useStore as useZustandStore,
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import type {
|
||||||
Node,
|
Node,
|
||||||
} from '../types'
|
} from '../types'
|
||||||
import ELK from 'elkjs/lib/elk.bundled.js'
|
import ELK from 'elkjs/lib/elk.bundled.js'
|
||||||
import { cloneDeep } from 'es-toolkit/compat'
|
import { cloneDeep } from 'es-toolkit/object'
|
||||||
import { useCallback } from 'react'
|
import { useCallback } from 'react'
|
||||||
import {
|
import {
|
||||||
useReactFlow,
|
useReactFlow,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import type { VarInInspect } from '@/types/workflow'
|
||||||
import {
|
import {
|
||||||
useEventListener,
|
useEventListener,
|
||||||
} from 'ahooks'
|
} from 'ahooks'
|
||||||
import { isEqual } from 'es-toolkit/compat'
|
import { isEqual } from 'es-toolkit/predicate'
|
||||||
import { setAutoFreeze } from 'immer'
|
import { setAutoFreeze } from 'immer'
|
||||||
import dynamic from 'next/dynamic'
|
import dynamic from 'next/dynamic'
|
||||||
import {
|
import {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue