diff --git a/.vite-hooks/pre-commit b/.vite-hooks/pre-commit index 54e09f80d6d..a4b5531ab18 100755 --- a/.vite-hooks/pre-commit +++ b/.vite-hooks/pre-commit @@ -89,6 +89,12 @@ if $web_modified; then echo "No staged TypeScript changes detected, skipping type-check:tsgo" fi + echo "Running knip" + if ! pnpm run knip; then + echo "Knip check failed. Please run 'pnpm run knip' to fix the errors." + exit 1 + fi + echo "Running unit tests check" modified_files=$(git diff --cached --name-only -- utils | grep -v '\.spec\.ts$' || true) diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx index 0c87fd1a4df..d3f15bdf460 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/layout-main.tsx @@ -35,7 +35,7 @@ const TagManagementModal = dynamic(() => import('@/app/components/base/tag-manag ssr: false, }) -export type IAppDetailLayoutProps = { +type IAppDetailLayoutProps = { children: React.ReactNode appId: string } diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx index 26373bd42ae..fb2edf0102d 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/card-view.tsx @@ -25,7 +25,7 @@ import { useAppWorkflow } from '@/service/use-workflow' import { AppModeEnum } from '@/types/app' import { asyncRunSafe } from '@/utils' -export type ICardViewProps = { +type ICardViewProps = { appId: string isInPanel?: boolean className?: string diff --git a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx index b6e902f456e..0d33de29720 100644 --- a/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx +++ b/web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx @@ -27,7 +27,7 @@ const TIME_PERIOD_MAPPING: { value: number, name: TimePeriodName }[] = [ const queryDateFormat = 'YYYY-MM-DD HH:mm' -export type IChartViewProps = { +type IChartViewProps = { appId: string headerRight: React.ReactNode } diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css deleted file mode 100644 index 67a9fe3bf5d..00000000000 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/documents/style.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.logTable td { - padding: 7px 8px; - box-sizing: border-box; - max-width: 200px; -} - -.pagination li { - list-style: none; -} diff --git a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx index 730b76ee19f..092e47278f4 100644 --- a/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx +++ b/web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/layout-main.tsx @@ -26,7 +26,7 @@ import { usePathname } from '@/next/navigation' import { useDatasetDetail, useDatasetRelatedApps } from '@/service/knowledge/use-dataset' import { cn } from '@/utils/classnames' -export type IAppDetailLayoutProps = { +type IAppDetailLayoutProps = { children: React.ReactNode datasetId: string } diff --git a/web/app/account/(commonLayout)/avatar.tsx b/web/app/account/(commonLayout)/avatar.tsx index 5461ce739ca..36a510cf638 100644 --- a/web/app/account/(commonLayout)/avatar.tsx +++ b/web/app/account/(commonLayout)/avatar.tsx @@ -13,10 +13,6 @@ import { useProviderContext } from '@/context/provider-context' import { useRouter } from '@/next/navigation' import { useLogout, useUserProfile } from '@/service/use-common' -export type IAppSelector = { - isMobile: boolean -} - export default function AppSelector() { const router = useRouter() const { t } = useTranslation() diff --git a/web/app/components/app-sidebar/app-info/index.tsx b/web/app/components/app-sidebar/app-info/index.tsx index 2530add2dca..a0628ec7861 100644 --- a/web/app/components/app-sidebar/app-info/index.tsx +++ b/web/app/components/app-sidebar/app-info/index.tsx @@ -5,7 +5,7 @@ import AppInfoModals from './app-info-modals' import AppInfoTrigger from './app-info-trigger' import { useAppInfoActions } from './use-app-info-actions' -export type IAppInfoProps = { +type IAppInfoProps = { expand: boolean onlyShowDetail?: boolean openState?: boolean diff --git a/web/app/components/app-sidebar/basic.tsx b/web/app/components/app-sidebar/basic.tsx index 24746aa687e..29a08f8a01b 100644 --- a/web/app/components/app-sidebar/basic.tsx +++ b/web/app/components/app-sidebar/basic.tsx @@ -7,7 +7,7 @@ import { import Tooltip from '@/app/components/base/tooltip' import AppIcon from '../base/app-icon' -export type IAppBasicProps = { +type IAppBasicProps = { iconType?: 'app' | 'api' | 'dataset' | 'webapp' | 'notion' icon?: string icon_background?: string | null diff --git a/web/app/components/app-sidebar/index.tsx b/web/app/components/app-sidebar/index.tsx index bbf71c6cf95..f86cd617e39 100644 --- a/web/app/components/app-sidebar/index.tsx +++ b/web/app/components/app-sidebar/index.tsx @@ -17,7 +17,7 @@ import DatasetSidebarDropdown from './dataset-sidebar-dropdown' import NavLink from './nav-link' import ToggleButton from './toggle-button' -export type IAppDetailNavProps = { +type IAppDetailNavProps = { iconType?: 'app' | 'dataset' navigation: Array<{ name: string diff --git a/web/app/components/app/annotation/type.ts b/web/app/components/app/annotation/type.ts index e2f2264f072..076ef8f9bdf 100644 --- a/web/app/components/app/annotation/type.ts +++ b/web/app/components/app/annotation/type.ts @@ -39,7 +39,5 @@ export enum AnnotationEnableStatus { } export enum JobStatus { - waiting = 'waiting', - processing = 'processing', completed = 'completed', } diff --git a/web/app/components/app/app-publisher/suggested-action.tsx b/web/app/components/app/app-publisher/suggested-action.tsx index 71ddceec01c..56879d8fead 100644 --- a/web/app/components/app/app-publisher/suggested-action.tsx +++ b/web/app/components/app/app-publisher/suggested-action.tsx @@ -2,7 +2,7 @@ import type { HTMLProps, PropsWithChildren } from 'react' import { RiArrowRightUpLine } from '@remixicon/react' import { cn } from '@/utils/classnames' -export type SuggestedActionProps = PropsWithChildren & { +type SuggestedActionProps = PropsWithChildren & { icon?: React.ReactNode link?: string disabled?: boolean diff --git a/web/app/components/app/configuration/base/feature-panel/index.tsx b/web/app/components/app/configuration/base/feature-panel/index.tsx index 7f337c1572a..77ee7bc8dd4 100644 --- a/web/app/components/app/configuration/base/feature-panel/index.tsx +++ b/web/app/components/app/configuration/base/feature-panel/index.tsx @@ -3,7 +3,7 @@ import type { FC, ReactNode } from 'react' import * as React from 'react' import { cn } from '@/utils/classnames' -export type IFeaturePanelProps = { +type IFeaturePanelProps = { className?: string headerIcon?: ReactNode title: ReactNode diff --git a/web/app/components/app/configuration/base/group-name/index.tsx b/web/app/components/app/configuration/base/group-name/index.tsx index b21b0c5825d..210ba4ca877 100644 --- a/web/app/components/app/configuration/base/group-name/index.tsx +++ b/web/app/components/app/configuration/base/group-name/index.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react' import * as React from 'react' -export type IGroupNameProps = { +type IGroupNameProps = { name: string } diff --git a/web/app/components/app/configuration/base/operation-btn/index.tsx b/web/app/components/app/configuration/base/operation-btn/index.tsx index d33b6320713..e3bdfd01ba4 100644 --- a/web/app/components/app/configuration/base/operation-btn/index.tsx +++ b/web/app/components/app/configuration/base/operation-btn/index.tsx @@ -9,7 +9,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { cn } from '@/utils/classnames' -export type IOperationBtnProps = { +type IOperationBtnProps = { className?: string type: 'add' | 'edit' actionName?: string diff --git a/web/app/components/app/configuration/base/var-highlight/index.tsx b/web/app/components/app/configuration/base/var-highlight/index.tsx index 697007d0b04..fda58f0b65a 100644 --- a/web/app/components/app/configuration/base/var-highlight/index.tsx +++ b/web/app/components/app/configuration/base/var-highlight/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import s from './style.module.css' -export type IVarHighlightProps = { +type IVarHighlightProps = { name: string className?: string } diff --git a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx index 791230566bc..d5fbd9e78f6 100644 --- a/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx +++ b/web/app/components/app/configuration/base/warning-mask/cannot-query-dataset.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import WarningMask from '.' -export type IFormattingChangedProps = { +type IFormattingChangedProps = { onConfirm: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx index 1fe7b9c1822..56ccae5ade1 100644 --- a/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx +++ b/web/app/components/app/configuration/base/warning-mask/formatting-changed.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import WarningMask from '.' -export type IFormattingChangedProps = { +type IFormattingChangedProps = { onConfirm: () => void onCancel: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx index 06c81a9f956..25587c5e581 100644 --- a/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx +++ b/web/app/components/app/configuration/base/warning-mask/has-not-set-api.tsx @@ -3,7 +3,7 @@ import type { FC } from 'react' import * as React from 'react' import { useTranslation } from 'react-i18next' -export type IHasNotSetAPIProps = { +type IHasNotSetAPIProps = { onSetting: () => void } diff --git a/web/app/components/app/configuration/base/warning-mask/index.tsx b/web/app/components/app/configuration/base/warning-mask/index.tsx index 6d6aeceb97d..5275f022cb4 100644 --- a/web/app/components/app/configuration/base/warning-mask/index.tsx +++ b/web/app/components/app/configuration/base/warning-mask/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import s from './style.module.css' -export type IWarningMaskProps = { +type IWarningMaskProps = { title: string description: string footer: React.ReactNode diff --git a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx index c2f0cb000a7..47d9aaa4d2c 100644 --- a/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx +++ b/web/app/components/app/configuration/config-prompt/confirm-add-var/index.tsx @@ -6,7 +6,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import VarHighlight from '../../base/var-highlight' -export type IConfirmAddVarProps = { +type IConfirmAddVarProps = { varNameArr: string[] onConfirm: () => void onCancel: () => void diff --git a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx index e5f1556cc5d..da1949af603 100644 --- a/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx +++ b/web/app/components/app/configuration/config-prompt/simple-prompt-input.tsx @@ -33,7 +33,7 @@ import { getNewVar, getVars } from '@/utils/var' import ConfirmAddVar from './confirm-add-var' import PromptEditorHeightResizeWrap from './prompt-editor-height-resize-wrap' -export type ISimplePromptInput = { +type ISimplePromptInput = { mode: AppModeEnum promptTemplate: string promptVariables: PromptVariable[] diff --git a/web/app/components/app/configuration/config-var/config-modal/config.ts b/web/app/components/app/configuration/config-var/config-modal/config.ts index 6586c2fd548..e03464d4535 100644 --- a/web/app/components/app/configuration/config-var/config-modal/config.ts +++ b/web/app/components/app/configuration/config-var/config-modal/config.ts @@ -1,10 +1,3 @@ -export const jsonObjectWrap = { - type: 'object', - properties: {}, - required: [], - additionalProperties: true, -} - export const jsonConfigPlaceHolder = JSON.stringify( { type: 'object', diff --git a/web/app/components/app/configuration/config-var/config-modal/index.tsx b/web/app/components/app/configuration/config-var/config-modal/index.tsx index 31b936f3e4b..34954946761 100644 --- a/web/app/components/app/configuration/config-var/config-modal/index.tsx +++ b/web/app/components/app/configuration/config-var/config-modal/index.tsx @@ -52,7 +52,7 @@ const normalizeSelectDefaultValue = (inputVar: InputVar) => { return inputVar } -export type IConfigModalProps = { +type IConfigModalProps = { isCreate?: boolean payload?: InputVar isShow: boolean diff --git a/web/app/components/app/configuration/config-var/config-select/index.tsx b/web/app/components/app/configuration/config-var/config-select/index.tsx index 847d5303753..6a5b12c417c 100644 --- a/web/app/components/app/configuration/config-var/config-select/index.tsx +++ b/web/app/components/app/configuration/config-var/config-select/index.tsx @@ -8,7 +8,7 @@ import { ReactSortable } from 'react-sortablejs' import { cn } from '@/utils/classnames' export type Options = string[] -export type IConfigSelectProps = { +type IConfigSelectProps = { options: Options onChange: (options: Options) => void } diff --git a/web/app/components/app/configuration/config-var/modal-foot.tsx b/web/app/components/app/configuration/config-var/modal-foot.tsx index fbb00b72bf0..1fcaebbc0d5 100644 --- a/web/app/components/app/configuration/config-var/modal-foot.tsx +++ b/web/app/components/app/configuration/config-var/modal-foot.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type IModalFootProps = { +type IModalFootProps = { onConfirm: () => void onCancel: () => void } diff --git a/web/app/components/app/configuration/config-var/select-type-item/index.tsx b/web/app/components/app/configuration/config-var/select-type-item/index.tsx index e6ae34664ff..7385dfd4c8c 100644 --- a/web/app/components/app/configuration/config-var/select-type-item/index.tsx +++ b/web/app/components/app/configuration/config-var/select-type-item/index.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next' import InputVarTypeIcon from '@/app/components/workflow/nodes/_base/components/input-var-type-icon' import { cn } from '@/utils/classnames' -export type ISelectTypeItemProps = { +type ISelectTypeItemProps = { type: InputVarType selected: boolean onClick: () => void diff --git a/web/app/components/app/configuration/config/agent/prompt-editor.tsx b/web/app/components/app/configuration/config/agent/prompt-editor.tsx deleted file mode 100644 index e807c21518e..00000000000 --- a/web/app/components/app/configuration/config/agent/prompt-editor.tsx +++ /dev/null @@ -1,152 +0,0 @@ -'use client' -import type { FC } from 'react' -import type { ExternalDataTool } from '@/models/common' -import copy from 'copy-to-clipboard' -import { noop } from 'es-toolkit/function' -import * as React from 'react' -import { useTranslation } from 'react-i18next' -import { useContext } from 'use-context-selector' -import s from '@/app/components/app/configuration/config-prompt/style.module.css' -import { - Copy, - CopyCheck, -} from '@/app/components/base/icons/src/vender/line/files' -import PromptEditor from '@/app/components/base/prompt-editor' -import { toast } from '@/app/components/base/ui/toast' -import ConfigContext from '@/context/debug-configuration' -import { useModalContext } from '@/context/modal-context' -import { cn } from '@/utils/classnames' - -type Props = { - className?: string - type: 'first-prompt' | 'next-iteration' - value: string - onChange: (value: string) => void -} - -const Editor: FC = ({ - className, - type, - value, - onChange, -}) => { - const { t } = useTranslation() - - const [isCopied, setIsCopied] = React.useState(false) - const { - modelConfig, - hasSetBlockStatus, - dataSets, - showSelectDataSet, - externalDataToolsConfig, - setExternalDataToolsConfig, - } = useContext(ConfigContext) - const promptVariables = modelConfig.configs.prompt_variables - const { setShowExternalDataToolModal } = useModalContext() - const isFirstPrompt = type === 'first-prompt' - const editorHeight = isFirstPrompt ? 'h-[336px]' : 'h-[52px]' - - const handleOpenExternalDataToolModal = () => { - setShowExternalDataToolModal({ - payload: {}, - onSaveCallback: (newExternalDataTool?: ExternalDataTool) => { - if (!newExternalDataTool) - return - setExternalDataToolsConfig([...externalDataToolsConfig, newExternalDataTool]) - }, - onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => { - for (let i = 0; i < promptVariables.length; i++) { - if (promptVariables[i].key === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key })) - return false - } - } - - for (let i = 0; i < externalDataToolsConfig.length; i++) { - if (externalDataToolsConfig[i].variable === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: externalDataToolsConfig[i].variable })) - return false - } - } - - return true - }, - }) - } - return ( -
-
-
-
{t(`agent.${isFirstPrompt ? 'firstPrompt' : 'nextIteration'}`, { ns: 'appDebug' })}
-
- {!isCopied - ? ( - { - copy(value) - setIsCopied(true) - }} - /> - ) - : ( - - )} -
-
-
- ({ - id: item.id, - name: item.name, - type: item.data_source_type, - })), - onAddContext: showSelectDataSet, - }} - variableBlock={{ - show: true, - variables: modelConfig.configs.prompt_variables.filter(item => item.key && item.key.trim() && item.name && item.name.trim()).map(item => ({ - name: item.name, - value: item.key, - })), - }} - externalToolBlock={{ - show: true, - externalTools: externalDataToolsConfig.map(item => ({ - name: item.label!, - variableName: item.variable!, - icon: item.icon, - icon_background: item.icon_background, - })), - onAddExternalTool: handleOpenExternalDataToolModal, - }} - historyBlock={{ - show: false, - selectable: false, - history: { - user: '', - assistant: '', - }, - onEditRole: noop, - }} - queryBlock={{ - show: false, - selectable: false, - }} - onChange={onChange} - onBlur={noop} - /> -
-
-
{value.length}
-
-
-
- ) -} -export default React.memo(Editor) diff --git a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx index 49d9bc4cc16..7999ba87af7 100644 --- a/web/app/components/app/configuration/config/automatic/automatic-btn.tsx +++ b/web/app/components/app/configuration/config/automatic/automatic-btn.tsx @@ -7,7 +7,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type IAutomaticBtnProps = { +type IAutomaticBtnProps = { onClick: () => void } const AutomaticBtn: FC = ({ diff --git a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx index a2ca99a9d05..d2522e875e3 100644 --- a/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx +++ b/web/app/components/app/configuration/config/automatic/get-automatic-res.tsx @@ -43,7 +43,7 @@ import useGenData from './use-gen-data' const i18nPrefix = 'generate' -export type IGetAutomaticResProps = { +type IGetAutomaticResProps = { mode: AppModeEnum isShow: boolean onClose: () => void diff --git a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx index 4c7971dc1d9..2d6b3efb3d4 100644 --- a/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx +++ b/web/app/components/app/configuration/config/code-generator/get-code-generator-res.tsx @@ -31,7 +31,7 @@ import { GeneratorType } from '../automatic/types' import useGenData from '../automatic/use-gen-data' const i18nPrefix = 'generate' -export type IGetCodeGeneratorResProps = { +type IGetCodeGeneratorResProps = { flowId: string nodeId: string currentCode?: string diff --git a/web/app/components/app/configuration/ctrl-btn-group/index.tsx b/web/app/components/app/configuration/ctrl-btn-group/index.tsx index ff8576cc432..53a07a9b1d3 100644 --- a/web/app/components/app/configuration/ctrl-btn-group/index.tsx +++ b/web/app/components/app/configuration/ctrl-btn-group/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import s from './style.module.css' -export type IContrlBtnGroupProps = { +type IContrlBtnGroupProps = { onSave: () => void onReset: () => void } diff --git a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx index dd69774b2b0..5fc594dc6bf 100644 --- a/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx +++ b/web/app/components/app/configuration/dataset-config/select-dataset/index.tsx @@ -17,7 +17,7 @@ import Link from '@/next/link' import { useInfiniteDatasets } from '@/service/knowledge/use-dataset' import { cn } from '@/utils/classnames' -export type ISelectDataSetProps = { +type ISelectDataSetProps = { isShow: boolean onClose: () => void selectedIds: string[] diff --git a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts index e3ad06f1b92..9e760672348 100644 --- a/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts +++ b/web/app/components/app/configuration/debug/debug-with-multiple-model/context.ts @@ -18,5 +18,3 @@ export const DebugWithMultipleModelContext = createContext useContext(DebugWithMultipleModelContext) - -export default DebugWithMultipleModelContext diff --git a/web/app/components/app/configuration/style.module.css b/web/app/components/app/configuration/style.module.css deleted file mode 100644 index 01f2c93167a..00000000000 --- a/web/app/components/app/configuration/style.module.css +++ /dev/null @@ -1,14 +0,0 @@ -.advancedPromptMode { - position: relative; -} - -.advancedPromptMode::before { - content: ''; - position: absolute; - bottom: 0; - left: -1px; - width: 100%; - height: 3px; - background-color: rgba(68, 76, 231, 0.18); - transform: skewX(-30deg); -} diff --git a/web/app/components/app/configuration/tools/index.tsx b/web/app/components/app/configuration/tools/index.tsx deleted file mode 100644 index 2b4511a0c64..00000000000 --- a/web/app/components/app/configuration/tools/index.tsx +++ /dev/null @@ -1,204 +0,0 @@ -import type { ExternalDataTool } from '@/models/common' -import { - RiAddLine, - RiArrowDownSLine, - RiDeleteBinLine, -} from '@remixicon/react' -import copy from 'copy-to-clipboard' -import { useState } from 'react' -import { useTranslation } from 'react-i18next' -import { useContext } from 'use-context-selector' -import AppIcon from '@/app/components/base/app-icon' -import { - Settings01, -} from '@/app/components/base/icons/src/vender/line/general' -import { Tool03 } from '@/app/components/base/icons/src/vender/solid/general' -import Switch from '@/app/components/base/switch' -import { toast } from '@/app/components/base/ui/toast' -import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from '@/app/components/base/ui/tooltip' -import ConfigContext from '@/context/debug-configuration' -import { useModalContext } from '@/context/modal-context' - -const Tools = () => { - const { t } = useTranslation() - const { setShowExternalDataToolModal } = useModalContext() - const { - externalDataToolsConfig, - setExternalDataToolsConfig, - modelConfig, - } = useContext(ConfigContext) - const [expanded, setExpanded] = useState(true) - const [copied, setCopied] = useState(false) - - const handleSaveExternalDataToolModal = (externalDataTool: ExternalDataTool, index: number) => { - if (index > -1) { - setExternalDataToolsConfig([ - ...externalDataToolsConfig.slice(0, index), - externalDataTool, - ...externalDataToolsConfig.slice(index + 1), - ]) - } - else { - setExternalDataToolsConfig([...externalDataToolsConfig, externalDataTool]) - } - } - const handleValidateBeforeSaveExternalDataToolModal = (newExternalDataTool: ExternalDataTool, index: number) => { - const promptVariables = modelConfig?.configs?.prompt_variables || [] - for (let i = 0; i < promptVariables.length; i++) { - if (promptVariables[i].key === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: promptVariables[i].key })) - return false - } - } - - let existedExternalDataTools = [] - if (index > -1) { - existedExternalDataTools = [ - ...externalDataToolsConfig.slice(0, index), - ...externalDataToolsConfig.slice(index + 1), - ] - } - else { - existedExternalDataTools = [...externalDataToolsConfig] - } - - for (let i = 0; i < existedExternalDataTools.length; i++) { - if (existedExternalDataTools[i].variable === newExternalDataTool.variable) { - toast.error(t('varKeyError.keyAlreadyExists', { ns: 'appDebug', key: existedExternalDataTools[i].variable })) - return false - } - } - - return true - } - const handleOpenExternalDataToolModal = (payload: ExternalDataTool, index: number) => { - setShowExternalDataToolModal({ - payload, - onSaveCallback: (externalDataTool?: ExternalDataTool) => { - if (!externalDataTool) - return - handleSaveExternalDataToolModal(externalDataTool, index) - }, - onValidateBeforeSaveCallback: (newExternalDataTool: ExternalDataTool) => handleValidateBeforeSaveExternalDataToolModal(newExternalDataTool, index), - }) - } - - return ( -
-
-
-
setExpanded(v => !v)} - > - { - externalDataToolsConfig.length - ? - : - } - { - !!externalDataToolsConfig.length && ( - - ) - } -
-
- {t('feature.tools.title', { ns: 'appDebug' })} -
- - } /> - -
- {t('feature.tools.tips', { ns: 'appDebug' })} -
-
-
-
- { - !expanded && !!externalDataToolsConfig.length && ( - <> -
{t('feature.tools.toolsInUse', { ns: 'appDebug', count: externalDataToolsConfig.length })}
-
- - ) - } -
handleOpenExternalDataToolModal({}, -1)} - > - - {t('operation.add', { ns: 'common' })} -
-
- { - expanded && !!externalDataToolsConfig.length && ( -
- { - externalDataToolsConfig.map((item, index: number) => ( -
-
- -
{item.label}
- - { - copy(item.variable || '') - setCopied(true) - }} - > - {item.variable} -
- )} - /> - - {copied ? t('copied', { ns: 'appApi' }) : `${item.variable}, ${t('copy', { ns: 'appApi' })}`} - - -
-
handleOpenExternalDataToolModal(item, index)} - > - -
-
setExternalDataToolsConfig([...externalDataToolsConfig.slice(0, index), ...externalDataToolsConfig.slice(index + 1)])} - > - -
-
- handleSaveExternalDataToolModal({ ...item, enabled }, index)} - /> -
- )) - } -
- ) - } -
- ) -} - -export default Tools diff --git a/web/app/components/app/create-app-dialog/app-card/index.tsx b/web/app/components/app/create-app-dialog/app-card/index.tsx index 8afb5cbf4b2..f0633288fd0 100644 --- a/web/app/components/app/create-app-dialog/app-card/index.tsx +++ b/web/app/components/app/create-app-dialog/app-card/index.tsx @@ -12,7 +12,7 @@ import { useGlobalPublicStore } from '@/context/global-public-context' import { cn } from '@/utils/classnames' import { AppTypeIcon, AppTypeLabel } from '../../type-selector' -export type AppCardProps = { +type AppCardProps = { app: App canCreate: boolean onCreate: () => void diff --git a/web/app/components/app/create-from-dsl-modal/uploader.tsx b/web/app/components/app/create-from-dsl-modal/uploader.tsx index e376d04a9fa..7480da4b5f7 100644 --- a/web/app/components/app/create-from-dsl-modal/uploader.tsx +++ b/web/app/components/app/create-from-dsl-modal/uploader.tsx @@ -13,7 +13,7 @@ import { toast } from '@/app/components/base/ui/toast' import { cn } from '@/utils/classnames' import { formatFileSize } from '@/utils/format' -export type Props = { +type Props = { file: File | undefined updateFile: (file?: File) => void className?: string diff --git a/web/app/components/app/log/index.tsx b/web/app/components/app/log/index.tsx index 59f454f754a..c30cf6cf510 100644 --- a/web/app/components/app/log/index.tsx +++ b/web/app/components/app/log/index.tsx @@ -17,7 +17,7 @@ import EmptyElement from './empty-element' import Filter, { TIME_PERIOD_MAPPING } from './filter' import List from './list' -export type ILogsProps = { +type ILogsProps = { appDetail: App } diff --git a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx index 54763907df8..4bab54b7110 100644 --- a/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx +++ b/web/app/components/app/overview/apikey-info-panel/apikey-info-panel.test-utils.tsx @@ -72,17 +72,17 @@ const defaultModalContext: ModalContextState = { setShowTriggerEventsLimitModal: noop, } -export type MockOverrides = { +type MockOverrides = { providerContext?: Partial modalContext?: Partial } -export type APIKeyInfoPanelRenderOptions = { +type APIKeyInfoPanelRenderOptions = { mockOverrides?: MockOverrides } & Omit // Setup function to configure mocks -export function setupMocks(overrides: MockOverrides = {}) { +function setupMocks(overrides: MockOverrides = {}) { mockUseProviderContext.mockReturnValue({ ...defaultProviderContext, ...overrides.providerContext, @@ -95,7 +95,7 @@ export function setupMocks(overrides: MockOverrides = {}) { } // Custom render function -export function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) { +function renderAPIKeyInfoPanel(options: APIKeyInfoPanelRenderOptions = {}) { const { mockOverrides, ...renderOptions } = options setupMocks(mockOverrides) @@ -210,4 +210,4 @@ export function clearAllMocks() { } // Export mock functions for external access -export { defaultModalContext, mockUseModalContext, mockUseProviderContext } +export { defaultModalContext, mockUseModalContext } diff --git a/web/app/components/app/overview/app-chart.tsx b/web/app/components/app/overview/app-chart.tsx index 028753d41ca..7ea94024ff5 100644 --- a/web/app/components/app/overview/app-chart.tsx +++ b/web/app/components/app/overview/app-chart.tsx @@ -102,12 +102,12 @@ export type PeriodParamsWithTimeRange = { query?: TimeRange } -export type IBizChartProps = { +type IBizChartProps = { period: PeriodParams id: string } -export type IChartProps = { +type IChartProps = { className?: string basicInfo: { title: string, explanation: string, timePeriod: string } valueKey?: string @@ -508,5 +508,3 @@ export const AvgUserInteractions: FC = ({ id, period }) => { /> ) } - -export default Chart diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index db880839c98..cd50e7f8eeb 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -29,7 +29,7 @@ import Link from '@/next/link' import { AppModeEnum } from '@/types/app' import { cn } from '@/utils/classnames' -export type ISettingsModalProps = { +type ISettingsModalProps = { isChat: boolean appInfo: AppDetailResponse & Partial isShow: boolean diff --git a/web/app/components/app/overview/trigger-card.tsx b/web/app/components/app/overview/trigger-card.tsx index 11f08cf994a..53301a353a5 100644 --- a/web/app/components/app/overview/trigger-card.tsx +++ b/web/app/components/app/overview/trigger-card.tsx @@ -22,7 +22,7 @@ import { import { useAllTriggerPlugins } from '@/service/use-triggers' import { canFindTool } from '@/utils' -export type ITriggerCardProps = { +type ITriggerCardProps = { appInfo: AppDetailResponse & Partial onToggleResult?: (err: Error | null, message?: I18nKeysByPrefix<'common', 'actionMsg.'>) => void } diff --git a/web/app/components/app/text-generate/item/index.tsx b/web/app/components/app/text-generate/item/index.tsx index 62f1e5752ef..88599a5ef1b 100644 --- a/web/app/components/app/text-generate/item/index.tsx +++ b/web/app/components/app/text-generate/item/index.tsx @@ -38,7 +38,7 @@ import ResultTab from './result-tab' const MAX_DEPTH = 3 -export type IGenerationItemProps = { +type IGenerationItemProps = { isWorkflow?: boolean workflowProcessData?: WorkflowProcess className?: string @@ -67,12 +67,6 @@ export type IGenerationItemProps = { inSidePanel?: boolean } -export const copyIcon = ( - - - -) - const GenerationItem: FC = ({ isWorkflow, workflowProcessData, diff --git a/web/app/components/app/text-generate/saved-items/no-data/index.tsx b/web/app/components/app/text-generate/saved-items/no-data/index.tsx index e73a1db1df4..c6596c8ec35 100644 --- a/web/app/components/app/text-generate/saved-items/no-data/index.tsx +++ b/web/app/components/app/text-generate/saved-items/no-data/index.tsx @@ -8,7 +8,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' -export type INoDataProps = { +type INoDataProps = { onStartCreateContent: () => void } diff --git a/web/app/components/app/type-selector/index.tsx b/web/app/components/app/type-selector/index.tsx index 2b0923a6a01..cb4db155d42 100644 --- a/web/app/components/app/type-selector/index.tsx +++ b/web/app/components/app/type-selector/index.tsx @@ -11,7 +11,7 @@ import { import { AppModeEnum } from '@/types/app' import { cn } from '@/utils/classnames' -export type AppSelectorProps = { +type AppSelectorProps = { value: Array onChange: (value: AppSelectorProps['value']) => void } diff --git a/web/app/components/apps/app-card.tsx b/web/app/components/apps/app-card.tsx index 079e8fa8bc0..7227e412e73 100644 --- a/web/app/components/apps/app-card.tsx +++ b/web/app/components/apps/app-card.tsx @@ -62,7 +62,7 @@ const AccessControl = dynamic(() => import('@/app/components/app/app-access-cont ssr: false, }) -export type AppCardProps = { +type AppCardProps = { app: App onRefresh?: () => void } diff --git a/web/app/components/apps/new-app-card.tsx b/web/app/components/apps/new-app-card.tsx index 7741190b8ce..31a374f6f7a 100644 --- a/web/app/components/apps/new-app-card.tsx +++ b/web/app/components/apps/new-app-card.tsx @@ -25,7 +25,7 @@ const CreateFromDSLModal = dynamic(() => import('@/app/components/app/create-fro ssr: false, }) -export type CreateAppCardProps = { +type CreateAppCardProps = { className?: string isLoading?: boolean onSuccess?: () => void diff --git a/web/app/components/base/agent-log-modal/detail.tsx b/web/app/components/base/agent-log-modal/detail.tsx index 6550b305f87..45f34c97111 100644 --- a/web/app/components/base/agent-log-modal/detail.tsx +++ b/web/app/components/base/agent-log-modal/detail.tsx @@ -15,7 +15,7 @@ import { cn } from '@/utils/classnames' import ResultPanel from './result' import TracingPanel from './tracing' -export type AgentLogDetailProps = { +type AgentLogDetailProps = { activeTab?: 'DETAIL' | 'TRACING' conversationID: string log: IChatItem diff --git a/web/app/components/base/amplitude/index.ts b/web/app/components/base/amplitude/index.ts index 44cbf728e22..21152d12202 100644 --- a/web/app/components/base/amplitude/index.ts +++ b/web/app/components/base/amplitude/index.ts @@ -1,2 +1,2 @@ export { default } from './lazy-amplitude-provider' -export { resetUser, setUserId, setUserProperties, trackEvent } from './utils' +export { setUserId, setUserProperties, trackEvent } from './utils' diff --git a/web/app/components/base/answer-icon/index.tsx b/web/app/components/base/answer-icon/index.tsx index 56e932ad712..1ae1b4f0766 100644 --- a/web/app/components/base/answer-icon/index.tsx +++ b/web/app/components/base/answer-icon/index.tsx @@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames' init({ data }) -export type AnswerIconProps = { +type AnswerIconProps = { iconType?: AppIconType | null icon?: string | null background?: string | null diff --git a/web/app/components/base/app-icon/index.tsx b/web/app/components/base/app-icon/index.tsx index b3fe5f3c4f0..d4eaeb69d96 100644 --- a/web/app/components/base/app-icon/index.tsx +++ b/web/app/components/base/app-icon/index.tsx @@ -12,7 +12,7 @@ import { cn } from '@/utils/classnames' init({ data }) -export type AppIconProps = { +type AppIconProps = { size?: 'xs' | 'tiny' | 'small' | 'medium' | 'large' | 'xl' | 'xxl' rounded?: boolean iconType?: AppIconType | null diff --git a/web/app/components/base/auto-height-textarea/style.module.scss b/web/app/components/base/auto-height-textarea/style.module.scss deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/web/app/components/base/avatar/index.tsx b/web/app/components/base/avatar/index.tsx index f53e1f8985c..885022ddedc 100644 --- a/web/app/components/base/avatar/index.tsx +++ b/web/app/components/base/avatar/index.tsx @@ -24,11 +24,11 @@ export type AvatarProps = { onLoadingStatusChange?: (status: ImageLoadingStatus) => void } -export type AvatarRootProps = React.ComponentPropsWithRef & { +type AvatarRootProps = React.ComponentPropsWithRef & { size?: AvatarSize } -export function AvatarRoot({ +function AvatarRoot({ size = 'md', className, ...props @@ -45,9 +45,9 @@ export function AvatarRoot({ ) } -export type AvatarImageProps = React.ComponentPropsWithRef +type AvatarImageProps = React.ComponentPropsWithRef -export function AvatarImage({ +function AvatarImage({ className, ...props }: AvatarImageProps) { @@ -59,11 +59,11 @@ export function AvatarImage({ ) } -export type AvatarFallbackProps = React.ComponentPropsWithRef & { +type AvatarFallbackProps = React.ComponentPropsWithRef & { size?: AvatarSize } -export function AvatarFallback({ +function AvatarFallback({ size = 'md', className, ...props diff --git a/web/app/components/base/block-input/index.tsx b/web/app/components/base/block-input/index.tsx index 2a917306cdf..cf832d9f94b 100644 --- a/web/app/components/base/block-input/index.tsx +++ b/web/app/components/base/block-input/index.tsx @@ -29,7 +29,7 @@ export const getInputKeys = (value: string) => { return res } -export type IBlockInputProps = { +type IBlockInputProps = { value: string className?: string // wrapper class highLightClassName?: string // class for the highlighted text default is text-blue-500 diff --git a/web/app/components/base/chat/chat-with-history/index.tsx b/web/app/components/base/chat/chat-with-history/index.tsx index a6457759652..562502a573a 100644 --- a/web/app/components/base/chat/chat-with-history/index.tsx +++ b/web/app/components/base/chat/chat-with-history/index.tsx @@ -97,7 +97,7 @@ const ChatWithHistory: FC = ({ ) } -export type ChatWithHistoryWrapProps = { +type ChatWithHistoryWrapProps = { installedAppInfo?: InstalledApp className?: string } diff --git a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx index 66a5ad6a36e..e66ca351f2a 100644 --- a/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx +++ b/web/app/components/base/chat/chat-with-history/sidebar/rename-modal.tsx @@ -7,7 +7,7 @@ import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' import Modal from '@/app/components/base/modal' -export type IRenameModalProps = { +type IRenameModalProps = { isShow: boolean saveLoading: boolean name: string diff --git a/web/app/components/base/chat/chat/context.ts b/web/app/components/base/chat/chat/context.ts index ff0bd263366..c4fbf9dd3e5 100644 --- a/web/app/components/base/chat/chat/context.ts +++ b/web/app/components/base/chat/chat/context.ts @@ -26,5 +26,3 @@ export const ChatContext = createContext({ }) export const useChatContext = () => useContext(ChatContext) - -export default ChatContext diff --git a/web/app/components/base/chat/chat/loading-anim/index.tsx b/web/app/components/base/chat/chat/loading-anim/index.tsx index 74cc3444de2..6ba37288e7a 100644 --- a/web/app/components/base/chat/chat/loading-anim/index.tsx +++ b/web/app/components/base/chat/chat/loading-anim/index.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { cn } from '@/utils/classnames' import s from './style.module.css' -export type ILoadingAnimProps = { +type ILoadingAnimProps = { type: 'text' | 'avatar' } diff --git a/web/app/components/base/chat/chat/type.ts b/web/app/components/base/chat/chat/type.ts index 7bd4de5b058..6ddb4f958ee 100644 --- a/web/app/components/base/chat/chat/type.ts +++ b/web/app/components/base/chat/chat/type.ts @@ -29,8 +29,6 @@ export type SubmitAnnotationFunc = ( content: string, ) => Promise -export type DisplayScene = 'web' | 'console' - export type ToolInfoInThought = { name: string label: string @@ -151,15 +149,6 @@ export type MessageReplace = { conversation_id: string } -export type AnnotationReply = { - id: string - task_id: string - answer: string - conversation_id: string - annotation_id: string - annotation_author_name: string -} - export type InputForm = { type: InputVarType label: string diff --git a/web/app/components/base/chat/embedded-chatbot/header/index.tsx b/web/app/components/base/chat/embedded-chatbot/header/index.tsx index 9cca48b42ac..7b1fb46fa0f 100644 --- a/web/app/components/base/chat/embedded-chatbot/header/index.tsx +++ b/web/app/components/base/chat/embedded-chatbot/header/index.tsx @@ -16,7 +16,7 @@ import { } from '../context' import { CssTransform } from '../theme/utils' -export type IHeaderProps = { +type IHeaderProps = { isMobile?: boolean allowResetChat?: boolean customerIcon?: React.ReactNode diff --git a/web/app/components/base/chat/types.ts b/web/app/components/base/chat/types.ts index 1502a32e928..341dd3c6890 100644 --- a/web/app/components/base/chat/types.ts +++ b/web/app/components/base/chat/types.ts @@ -3,42 +3,16 @@ import type { FileEntity } from '@/app/components/base/file-uploader/types' import type { WorkflowRunningStatus } from '@/app/components/workflow/types' import type { ModelConfig, - VisionSettings, } from '@/types/app' import type { HumanInputFilledFormData, HumanInputFormData, NodeTracing } from '@/types/workflow' export type { Inputs, - PromptVariable, + } from '@/models/debug' -export type { VisionFile } from '@/types/app' + export { TransferMethod } from '@/types/app' -export type UserInputForm = { - default: string - label: string - required: boolean - variable: string -} - -export type UserInputFormTextInput = { - 'text-input': UserInputForm & { - max_length: number - } -} - -export type UserInputFormSelect = { - select: UserInputForm & { - options: string[] - } -} - -export type UserInputFormParagraph = { - paragraph: UserInputForm -} - -export type VisionConfig = VisionSettings - export type EnableType = { enabled: boolean } diff --git a/web/app/components/base/checkbox-list/index.tsx b/web/app/components/base/checkbox-list/index.tsx index 6eda2aebd0f..5fb5ca60282 100644 --- a/web/app/components/base/checkbox-list/index.tsx +++ b/web/app/components/base/checkbox-list/index.tsx @@ -9,13 +9,13 @@ import SearchMenu from '@/assets/search-menu.svg' import { cn } from '@/utils/classnames' import Button from '../button' -export type CheckboxListOption = { +type CheckboxListOption = { label: string value: string disabled?: boolean } -export type CheckboxListProps = { +type CheckboxListProps = { title?: string label?: string description?: string diff --git a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx index ac14d49ead4..46670b27b33 100644 --- a/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx +++ b/web/app/components/base/date-and-time-picker/calendar/days-of-week.tsx @@ -17,5 +17,3 @@ export const DaysOfWeek = () => {
) } - -export default React.memo(DaysOfWeek) diff --git a/web/app/components/base/date-and-time-picker/utils/dayjs.ts b/web/app/components/base/date-and-time-picker/utils/dayjs.ts index f1c77ecc579..3e20e51cf3d 100644 --- a/web/app/components/base/date-and-time-picker/utils/dayjs.ts +++ b/web/app/components/base/date-and-time-picker/utils/dayjs.ts @@ -126,7 +126,7 @@ export const convertTimezoneToOffsetStr = (timezone?: string) => { export const isDayjsObject = (value: unknown): value is Dayjs => dayjs.isDayjs(value) -export type ToDayjsOptions = { +type ToDayjsOptions = { timezone?: string format?: string formats?: string[] diff --git a/web/app/components/base/divider/index.tsx b/web/app/components/base/divider/index.tsx index d3693e9ffd9..b096844079d 100644 --- a/web/app/components/base/divider/index.tsx +++ b/web/app/components/base/divider/index.tsx @@ -21,7 +21,7 @@ const dividerVariants = cva('', { }, }) -export type DividerProps = { +type DividerProps = { className?: string style?: CSSProperties } & VariantProps diff --git a/web/app/components/base/file-uploader/index.ts b/web/app/components/base/file-uploader/index.ts index 1ab4fdae3b2..5f27f61d90a 100644 --- a/web/app/components/base/file-uploader/index.ts +++ b/web/app/components/base/file-uploader/index.ts @@ -1,7 +1,7 @@ export { default as FileTypeIcon } from './file-type-icon' export { default as FileUploaderInAttachmentWrapper } from './file-uploader-in-attachment' -export { default as FileItemInAttachment } from './file-uploader-in-attachment/file-item' + export { default as FileUploaderInChatInput } from './file-uploader-in-chat-input' -export { default as FileItem } from './file-uploader-in-chat-input/file-item' + export { FileListInChatInput } from './file-uploader-in-chat-input/file-list' export { FileList } from './file-uploader-in-chat-input/file-list' diff --git a/web/app/components/base/form/form-scenarios/demo/types.ts b/web/app/components/base/form/form-scenarios/demo/types.ts index 91ab1c77473..a8aa18b27d4 100644 --- a/web/app/components/base/form/form-scenarios/demo/types.ts +++ b/web/app/components/base/form/form-scenarios/demo/types.ts @@ -30,5 +30,3 @@ export const UserSchema = z.object({ preferredContactMethod: ContactMethod, }), }) - -export type User = z.infer diff --git a/web/app/components/base/form/index.tsx b/web/app/components/base/form/index.tsx index 6c60826c325..663b7f1fe84 100644 --- a/web/app/components/base/form/index.tsx +++ b/web/app/components/base/form/index.tsx @@ -14,9 +14,11 @@ import UploadMethodField from './components/field/upload-method' import VariableOrConstantInputField from './components/field/variable-selector' import Actions from './components/form/actions' -export const { fieldContext, useFieldContext, formContext, useFormContext } +const { fieldContext, useFieldContext, formContext, useFormContext } = createFormHookContexts() +export { formContext, useFieldContext, useFormContext } + export const { useAppForm, withForm } = createFormHook({ fieldComponents: { TextField, diff --git a/web/app/components/base/form/types.ts b/web/app/components/base/form/types.ts index a2b434f3cfa..4b83b9e4c97 100644 --- a/web/app/components/base/form/types.ts +++ b/web/app/components/base/form/types.ts @@ -82,8 +82,6 @@ export type FormSchema = { } } -export type FormValues = Record - export type GetValuesOptions = { needTransformWhenSecretFieldIsPristine?: boolean needCheckValidatedValues?: boolean diff --git a/web/app/components/base/ga/index.tsx b/web/app/components/base/ga/index.tsx index 3e19afd9744..79783c75cc7 100644 --- a/web/app/components/base/ga/index.tsx +++ b/web/app/components/base/ga/index.tsx @@ -9,16 +9,16 @@ export enum GaType { webapp = 'webapp', } -export const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V' -export const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT' -export const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js' +const GA_MEASUREMENT_ID_ADMIN = 'G-DM9497FN4V' +const GA_MEASUREMENT_ID_WEBAPP = 'G-2MFWXK7WYT' +const COOKIEYES_SCRIPT_SRC = 'https://cdn-cookieyes.com/client_data/2a645945fcae53f8e025a2b1/script.js' const gaIdMaps = { [GaType.admin]: GA_MEASUREMENT_ID_ADMIN, [GaType.webapp]: GA_MEASUREMENT_ID_WEBAPP, } -export type IGAProps = { +type IGAProps = { gaType: GaType } diff --git a/web/app/components/base/icons/IconBase.tsx b/web/app/components/base/icons/IconBase.tsx index 13ab7c816bc..2de0f3239ed 100644 --- a/web/app/components/base/icons/IconBase.tsx +++ b/web/app/components/base/icons/IconBase.tsx @@ -6,7 +6,7 @@ export type IconData = { icon: AbstractNode } -export type IconBaseProps = { +type IconBaseProps = { data: IconData className?: string onClick?: React.MouseEventHandler diff --git a/web/app/components/base/icons/src/image/llm/index.ts b/web/app/components/base/icons/src/image/llm/index.ts deleted file mode 100644 index 1b7f8c48ebb..00000000000 --- a/web/app/components/base/icons/src/image/llm/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export { default as BaichuanTextCn } from './BaichuanTextCn' -export { default as Minimax } from './Minimax' -export { default as MinimaxText } from './MinimaxText' -export { default as Tongyi } from './Tongyi' -export { default as TongyiText } from './TongyiText' -export { default as TongyiTextCn } from './TongyiTextCn' -export { default as Wxyy } from './Wxyy' -export { default as WxyyText } from './WxyyText' -export { default as WxyyTextCn } from './WxyyTextCn' diff --git a/web/app/components/base/icons/src/public/billing/index.ts b/web/app/components/base/icons/src/public/billing/index.ts index bd8fdc10dd3..c80933b0db6 100644 --- a/web/app/components/base/icons/src/public/billing/index.ts +++ b/web/app/components/base/icons/src/public/billing/index.ts @@ -1,12 +1,5 @@ -export { default as ArCube1 } from './ArCube1' -export { default as Asterisk } from './Asterisk' export { default as AwsMarketplaceDark } from './AwsMarketplaceDark' export { default as AwsMarketplaceLight } from './AwsMarketplaceLight' export { default as Azure } from './Azure' -export { default as Buildings } from './Buildings' -export { default as Diamond } from './Diamond' + export { default as GoogleCloud } from './GoogleCloud' -export { default as Group2 } from './Group2' -export { default as Keyframe } from './Keyframe' -export { default as Sparkles } from './Sparkles' -export { default as SparklesSoft } from './SparklesSoft' diff --git a/web/app/components/base/icons/src/public/common/index.ts b/web/app/components/base/icons/src/public/common/index.ts index c19ab569fa4..894570bc8f9 100644 --- a/web/app/components/base/icons/src/public/common/index.ts +++ b/web/app/components/base/icons/src/public/common/index.ts @@ -1,16 +1,9 @@ -export { default as D } from './D' -export { default as DiagonalDividingLine } from './DiagonalDividingLine' -export { default as Dify } from './Dify' -export { default as Gdpr } from './Gdpr' export { default as Github } from './Github' export { default as Highlight } from './Highlight' -export { default as Iso } from './Iso' + export { default as Line3 } from './Line3' -export { default as Lock } from './Lock' -export { default as MessageChatSquare } from './MessageChatSquare' -export { default as MultiPathRetrieval } from './MultiPathRetrieval' + export { default as Notion } from './Notion' -export { default as NTo1Retrieval } from './NTo1Retrieval' -export { default as Soc2 } from './Soc2' + export { default as SparklesSoft } from './SparklesSoft' export { default as SparklesSoftAccent } from './SparklesSoftAccent' diff --git a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts index 9f45717e731..50d6bac1ed8 100644 --- a/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts +++ b/web/app/components/base/icons/src/public/knowledge/dataset-card/index.ts @@ -1,5 +1,5 @@ export { default as ExternalKnowledgeBase } from './ExternalKnowledgeBase' export { default as General } from './General' -export { default as Graph } from './Graph' + export { default as ParentChild } from './ParentChild' export { default as Qa } from './Qa' diff --git a/web/app/components/base/icons/src/public/knowledge/index.ts b/web/app/components/base/icons/src/public/knowledge/index.ts index 4acde1663ba..c0d35e9ef3b 100644 --- a/web/app/components/base/icons/src/public/knowledge/index.ts +++ b/web/app/components/base/icons/src/public/knowledge/index.ts @@ -1,8 +1,6 @@ -export { default as File } from './File' export { default as OptionCardEffectBlue } from './OptionCardEffectBlue' export { default as OptionCardEffectBlueLight } from './OptionCardEffectBlueLight' export { default as OptionCardEffectOrange } from './OptionCardEffectOrange' export { default as OptionCardEffectPurple } from './OptionCardEffectPurple' export { default as OptionCardEffectTeal } from './OptionCardEffectTeal' export { default as SelectionMod } from './SelectionMod' -export { default as Watercrawl } from './Watercrawl' diff --git a/web/app/components/base/icons/src/public/llm/index.ts b/web/app/components/base/icons/src/public/llm/index.ts index 0c5cef4a363..6b77aefe519 100644 --- a/web/app/components/base/icons/src/public/llm/index.ts +++ b/web/app/components/base/icons/src/public/llm/index.ts @@ -1,50 +1,14 @@ -export { default as Anthropic } from './Anthropic' export { default as AnthropicDark } from './AnthropicDark' export { default as AnthropicLight } from './AnthropicLight' export { default as AnthropicShortLight } from './AnthropicShortLight' -export { default as AnthropicText } from './AnthropicText' -export { default as Azureai } from './Azureai' -export { default as AzureaiText } from './AzureaiText' -export { default as AzureOpenaiService } from './AzureOpenaiService' -export { default as AzureOpenaiServiceText } from './AzureOpenaiServiceText' -export { default as Baichuan } from './Baichuan' -export { default as BaichuanText } from './BaichuanText' -export { default as Chatglm } from './Chatglm' -export { default as ChatglmText } from './ChatglmText' -export { default as Cohere } from './Cohere' -export { default as CohereText } from './CohereText' + export { default as Deepseek } from './Deepseek' export { default as Gemini } from './Gemini' -export { default as Gpt3 } from './Gpt3' -export { default as Gpt4 } from './Gpt4' + export { default as Grok } from './Grok' -export { default as Huggingface } from './Huggingface' -export { default as HuggingfaceText } from './HuggingfaceText' -export { default as HuggingfaceTextHub } from './HuggingfaceTextHub' -export { default as IflytekSpark } from './IflytekSpark' -export { default as IflytekSparkText } from './IflytekSparkText' -export { default as IflytekSparkTextCn } from './IflytekSparkTextCn' -export { default as Jina } from './Jina' -export { default as JinaText } from './JinaText' -export { default as Localai } from './Localai' -export { default as LocalaiText } from './LocalaiText' -export { default as Microsoft } from './Microsoft' -export { default as OpenaiBlack } from './OpenaiBlack' -export { default as OpenaiBlue } from './OpenaiBlue' -export { default as OpenaiGreen } from './OpenaiGreen' + export { default as OpenaiSmall } from './OpenaiSmall' -export { default as OpenaiTeal } from './OpenaiTeal' -export { default as OpenaiText } from './OpenaiText' -export { default as OpenaiTransparent } from './OpenaiTransparent' -export { default as OpenaiViolet } from './OpenaiViolet' + export { default as OpenaiYellow } from './OpenaiYellow' -export { default as Openllm } from './Openllm' -export { default as OpenllmText } from './OpenllmText' -export { default as Replicate } from './Replicate' -export { default as ReplicateText } from './ReplicateText' + export { default as Tongyi } from './Tongyi' -export { default as XorbitsInference } from './XorbitsInference' -export { default as XorbitsInferenceText } from './XorbitsInferenceText' -export { default as Zhipuai } from './Zhipuai' -export { default as ZhipuaiText } from './ZhipuaiText' -export { default as ZhipuaiTextCn } from './ZhipuaiTextCn' diff --git a/web/app/components/base/icons/src/public/model/index.ts b/web/app/components/base/icons/src/public/model/index.ts deleted file mode 100644 index 719a6f0309a..00000000000 --- a/web/app/components/base/icons/src/public/model/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Checked } from './Checked' diff --git a/web/app/components/base/icons/src/public/other/index.ts b/web/app/components/base/icons/src/public/other/index.ts index 10987368fb5..a8f91dd98b7 100644 --- a/web/app/components/base/icons/src/public/other/index.ts +++ b/web/app/components/base/icons/src/public/other/index.ts @@ -1,5 +1,5 @@ export { default as DefaultToolIcon } from './DefaultToolIcon' -export { default as Icon3Dots } from './Icon3Dots' + export { default as Message3Fill } from './Message3Fill' export { default as RowStruct } from './RowStruct' export { default as Slack } from './Slack' diff --git a/web/app/components/base/icons/src/public/plugins/index.ts b/web/app/components/base/icons/src/public/plugins/index.ts deleted file mode 100644 index 87dc37167c6..00000000000 --- a/web/app/components/base/icons/src/public/plugins/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -export { default as Google } from './Google' -export { default as PartnerDark } from './PartnerDark' -export { default as PartnerLight } from './PartnerLight' -export { default as VerifiedDark } from './VerifiedDark' -export { default as VerifiedLight } from './VerifiedLight' -export { default as WebReader } from './WebReader' -export { default as Wikipedia } from './Wikipedia' diff --git a/web/app/components/base/icons/src/public/thought/index.ts b/web/app/components/base/icons/src/public/thought/index.ts index 8a45489dbf7..10f5e3f5c36 100644 --- a/web/app/components/base/icons/src/public/thought/index.ts +++ b/web/app/components/base/icons/src/public/thought/index.ts @@ -1,5 +1 @@ -export { default as DataSet } from './DataSet' export { default as Loading } from './Loading' -export { default as Search } from './Search' -export { default as ThoughtList } from './ThoughtList' -export { default as WebReader } from './WebReader' diff --git a/web/app/components/base/icons/src/vender/knowledge/index.ts b/web/app/components/base/icons/src/vender/knowledge/index.ts index 44055c49754..99a4f26ed50 100644 --- a/web/app/components/base/icons/src/vender/knowledge/index.ts +++ b/web/app/components/base/icons/src/vender/knowledge/index.ts @@ -3,7 +3,7 @@ export { default as ApiAggregate } from './ApiAggregate' export { default as ArrowShape } from './ArrowShape' export { default as Chunk } from './Chunk' export { default as Collapse } from './Collapse' -export { default as Divider } from './Divider' + export { default as Economic } from './Economic' export { default as FullTextSearch } from './FullTextSearch' export { default as GeneralChunk } from './GeneralChunk' diff --git a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts index 4e721d70eb9..27f8709bed7 100644 --- a/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts +++ b/web/app/components/base/icons/src/vender/line/alertsAndFeedback/index.ts @@ -1,4 +1,2 @@ -export { default as AlertTriangle } from './AlertTriangle' -export { default as ThumbsDown } from './ThumbsDown' export { default as ThumbsUp } from './ThumbsUp' export { default as Warning } from './Warning' diff --git a/web/app/components/base/icons/src/vender/line/arrows/index.ts b/web/app/components/base/icons/src/vender/line/arrows/index.ts index 174c69bd951..b27efc2e9c7 100644 --- a/web/app/components/base/icons/src/vender/line/arrows/index.ts +++ b/web/app/components/base/icons/src/vender/line/arrows/index.ts @@ -3,7 +3,5 @@ export { default as ArrowUpRight } from './ArrowUpRight' export { default as ChevronDownDouble } from './ChevronDownDouble' export { default as ChevronRight } from './ChevronRight' export { default as ChevronSelectorVertical } from './ChevronSelectorVertical' -export { default as IconR } from './IconR' + export { default as RefreshCcw01 } from './RefreshCcw01' -export { default as RefreshCw05 } from './RefreshCw05' -export { default as ReverseLeft } from './ReverseLeft' diff --git a/web/app/components/base/icons/src/vender/line/communication/index.ts b/web/app/components/base/icons/src/vender/line/communication/index.ts index a6844c2b696..45a762a1dde 100644 --- a/web/app/components/base/icons/src/vender/line/communication/index.ts +++ b/web/app/components/base/icons/src/vender/line/communication/index.ts @@ -1,6 +1,4 @@ -export { default as AiText } from './AiText' -export { default as ChatBot } from './ChatBot' export { default as ChatBotSlim } from './ChatBotSlim' -export { default as CuteRobot } from './CuteRobot' + export { default as MessageCheckRemove } from './MessageCheckRemove' export { default as MessageFastPlus } from './MessageFastPlus' diff --git a/web/app/components/base/icons/src/vender/line/development/index.ts b/web/app/components/base/icons/src/vender/line/development/index.ts index 93bb1956bb9..7c3c48aa5e9 100644 --- a/web/app/components/base/icons/src/vender/line/development/index.ts +++ b/web/app/components/base/icons/src/vender/line/development/index.ts @@ -1,14 +1,2 @@ -export { default as ArtificialBrain } from './ArtificialBrain' -export { default as BarChartSquare02 } from './BarChartSquare02' export { default as BracketsX } from './BracketsX' export { default as CodeBrowser } from './CodeBrowser' -export { default as Container } from './Container' -export { default as Database01 } from './Database01' -export { default as Database03 } from './Database03' -export { default as FileHeart02 } from './FileHeart02' -export { default as GitBranch01 } from './GitBranch01' -export { default as PromptEngineering } from './PromptEngineering' -export { default as PuzzlePiece01 } from './PuzzlePiece01' -export { default as TerminalSquare } from './TerminalSquare' -export { default as Variable } from './Variable' -export { default as Webhooks } from './Webhooks' diff --git a/web/app/components/base/icons/src/vender/line/editor/index.ts b/web/app/components/base/icons/src/vender/line/editor/index.ts index b31c42e390a..c968aa814cc 100644 --- a/web/app/components/base/icons/src/vender/line/editor/index.ts +++ b/web/app/components/base/icons/src/vender/line/editor/index.ts @@ -1,8 +1 @@ -export { default as AlignLeft } from './AlignLeft' -export { default as BezierCurve03 } from './BezierCurve03' -export { default as Collapse } from './Collapse' -export { default as Colors } from './Colors' export { default as ImageIndentLeft } from './ImageIndentLeft' -export { default as LeftIndent02 } from './LeftIndent02' -export { default as LetterSpacing01 } from './LetterSpacing01' -export { default as TypeSquare } from './TypeSquare' diff --git a/web/app/components/base/icons/src/vender/line/files/index.ts b/web/app/components/base/icons/src/vender/line/files/index.ts index 8455f7b56a7..afdc65cb24b 100644 --- a/web/app/components/base/icons/src/vender/line/files/index.ts +++ b/web/app/components/base/icons/src/vender/line/files/index.ts @@ -1,11 +1,10 @@ export { default as Copy } from './Copy' export { default as CopyCheck } from './CopyCheck' -export { default as File02 } from './File02' + export { default as FileArrow01 } from './FileArrow01' -export { default as FileCheck02 } from './FileCheck02' + export { default as FileDownload02 } from './FileDownload02' export { default as FilePlus01 } from './FilePlus01' export { default as FilePlus02 } from './FilePlus02' -export { default as FileText } from './FileText' -export { default as FileUpload } from './FileUpload' + export { default as Folder } from './Folder' diff --git a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts index 8a98a4612c3..736eeca4538 100644 --- a/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts +++ b/web/app/components/base/icons/src/vender/line/financeAndECommerce/index.ts @@ -1,7 +1,6 @@ export { default as Balance } from './Balance' -export { default as CoinsStacked01 } from './CoinsStacked01' + export { default as CreditsCoin } from './CreditsCoin' -export { default as GoldCoin } from './GoldCoin' -export { default as ReceiptList } from './ReceiptList' + export { default as Tag01 } from './Tag01' export { default as Tag03 } from './Tag03' diff --git a/web/app/components/base/icons/src/vender/line/general/index.ts b/web/app/components/base/icons/src/vender/line/general/index.ts index 24093672648..33f67f01a5d 100644 --- a/web/app/components/base/icons/src/vender/line/general/index.ts +++ b/web/app/components/base/icons/src/vender/line/general/index.ts @@ -1,30 +1,19 @@ -export { default as AtSign } from './AtSign' -export { default as Bookmark } from './Bookmark' export { default as Check } from './Check' -export { default as CheckDone01 } from './CheckDone01' -export { default as ChecklistSquare } from './ChecklistSquare' + export { default as CodeAssistant } from './CodeAssistant' -export { default as DotsGrid } from './DotsGrid' -export { default as Edit02 } from './Edit02' -export { default as Edit04 } from './Edit04' -export { default as Edit05 } from './Edit05' -export { default as Hash02 } from './Hash02' -export { default as InfoCircle } from './InfoCircle' + export { default as Link03 } from './Link03' export { default as LinkExternal02 } from './LinkExternal02' -export { default as LogIn04 } from './LogIn04' + export { default as LogOut01 } from './LogOut01' -export { default as LogOut04 } from './LogOut04' + export { default as MagicEdit } from './MagicEdit' -export { default as Menu01 } from './Menu01' -export { default as Pin01 } from './Pin01' + export { default as Pin02 } from './Pin02' export { default as Plus02 } from './Plus02' -export { default as Refresh } from './Refresh' + export { default as SearchMenu } from './SearchMenu' export { default as Settings01 } from './Settings01' export { default as Settings04 } from './Settings04' -export { default as Target04 } from './Target04' -export { default as Upload03 } from './Upload03' -export { default as UploadCloud01 } from './UploadCloud01' + export { default as X } from './X' diff --git a/web/app/components/base/icons/src/vender/line/layout/index.ts b/web/app/components/base/icons/src/vender/line/layout/index.ts index 7c12b1f58f4..a6aa205faa5 100644 --- a/web/app/components/base/icons/src/vender/line/layout/index.ts +++ b/web/app/components/base/icons/src/vender/line/layout/index.ts @@ -1,4 +1 @@ -export { default as AlignLeft01 } from './AlignLeft01' -export { default as AlignRight01 } from './AlignRight01' -export { default as Grid01 } from './Grid01' export { default as LayoutGrid02 } from './LayoutGrid02' diff --git a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts index 163c433ac85..35052d6564c 100644 --- a/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts +++ b/web/app/components/base/icons/src/vender/line/mediaAndDevices/index.ts @@ -1,6 +1,2 @@ -export { default as Microphone01 } from './Microphone01' -export { default as PlayCircle } from './PlayCircle' -export { default as SlidersH } from './SlidersH' -export { default as Speaker } from './Speaker' export { default as Stop } from './Stop' export { default as StopCircle } from './StopCircle' diff --git a/web/app/components/base/icons/src/vender/line/others/index.ts b/web/app/components/base/icons/src/vender/line/others/index.ts index 99db66b397b..0425327c6c0 100644 --- a/web/app/components/base/icons/src/vender/line/others/index.ts +++ b/web/app/components/base/icons/src/vender/line/others/index.ts @@ -1,10 +1,8 @@ export { default as BubbleX } from './BubbleX' -export { default as Colors } from './Colors' + export { default as DragHandle } from './DragHandle' export { default as Env } from './Env' export { default as GlobalVariable } from './GlobalVariable' export { default as Icon3Dots } from './Icon3Dots' export { default as LongArrowLeft } from './LongArrowLeft' export { default as LongArrowRight } from './LongArrowRight' -export { default as SearchMenu } from './SearchMenu' -export { default as Tools } from './Tools' diff --git a/web/app/components/base/icons/src/vender/line/shapes/index.ts b/web/app/components/base/icons/src/vender/line/shapes/index.ts deleted file mode 100644 index daf43bcaf7d..00000000000 --- a/web/app/components/base/icons/src/vender/line/shapes/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as CubeOutline } from './CubeOutline' diff --git a/web/app/components/base/icons/src/vender/line/time/index.ts b/web/app/components/base/icons/src/vender/line/time/index.ts index 7fd91f2b2e8..2187814bbff 100644 --- a/web/app/components/base/icons/src/vender/line/time/index.ts +++ b/web/app/components/base/icons/src/vender/line/time/index.ts @@ -1,4 +1,2 @@ export { default as ClockFastForward } from './ClockFastForward' export { default as ClockPlay } from './ClockPlay' -export { default as ClockPlaySlim } from './ClockPlaySlim' -export { default as ClockRefresh } from './ClockRefresh' diff --git a/web/app/components/base/icons/src/vender/line/users/index.ts b/web/app/components/base/icons/src/vender/line/users/index.ts deleted file mode 100644 index 9f8a35152fd..00000000000 --- a/web/app/components/base/icons/src/vender/line/users/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { default as User01 } from './User01' -export { default as Users01 } from './Users01' diff --git a/web/app/components/base/icons/src/vender/line/weather/index.ts b/web/app/components/base/icons/src/vender/line/weather/index.ts deleted file mode 100644 index 1a68bce7659..00000000000 --- a/web/app/components/base/icons/src/vender/line/weather/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Stars02 } from './Stars02' diff --git a/web/app/components/base/icons/src/vender/other/index.ts b/web/app/components/base/icons/src/vender/other/index.ts index 0ca5f22bcf7..493bac19316 100644 --- a/web/app/components/base/icons/src/vender/other/index.ts +++ b/web/app/components/base/icons/src/vender/other/index.ts @@ -1,4 +1,3 @@ -export { default as AnthropicText } from './AnthropicText' export { default as Generator } from './Generator' export { default as Group } from './Group' export { default as HourglassShape } from './HourglassShape' diff --git a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts index 777fe96845b..7770962bfad 100644 --- a/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts +++ b/web/app/components/base/icons/src/vender/solid/FinanceAndECommerce/index.ts @@ -1,2 +1 @@ -export { default as GoldCoin } from './GoldCoin' export { default as Scales02 } from './Scales02' diff --git a/web/app/components/base/icons/src/vender/solid/arrows/index.ts b/web/app/components/base/icons/src/vender/solid/arrows/index.ts index 58ce9aa8acb..d89a969bd44 100644 --- a/web/app/components/base/icons/src/vender/solid/arrows/index.ts +++ b/web/app/components/base/icons/src/vender/solid/arrows/index.ts @@ -1,5 +1,3 @@ export { default as ArrowDownDoubleLine } from './ArrowDownDoubleLine' export { default as ArrowDownRoundFill } from './ArrowDownRoundFill' export { default as ArrowUpDoubleLine } from './ArrowUpDoubleLine' -export { default as ChevronDown } from './ChevronDown' -export { default as HighPriority } from './HighPriority' diff --git a/web/app/components/base/icons/src/vender/solid/communication/index.ts b/web/app/components/base/icons/src/vender/solid/communication/index.ts index 7d2a3a5a95c..2da1ac57e81 100644 --- a/web/app/components/base/icons/src/vender/solid/communication/index.ts +++ b/web/app/components/base/icons/src/vender/solid/communication/index.ts @@ -1,12 +1,8 @@ -export { default as AiText } from './AiText' export { default as BubbleTextMod } from './BubbleTextMod' export { default as ChatBot } from './ChatBot' export { default as CuteRobot } from './CuteRobot' -export { default as EditList } from './EditList' + export { default as ListSparkle } from './ListSparkle' export { default as Logic } from './Logic' -export { default as MessageDotsCircle } from './MessageDotsCircle' + export { default as MessageFast } from './MessageFast' -export { default as MessageHeartCircle } from './MessageHeartCircle' -export { default as MessageSmileSquare } from './MessageSmileSquare' -export { default as Send03 } from './Send03' diff --git a/web/app/components/base/icons/src/vender/solid/development/index.ts b/web/app/components/base/icons/src/vender/solid/development/index.ts index f67d854beb9..25eb3d2736c 100644 --- a/web/app/components/base/icons/src/vender/solid/development/index.ts +++ b/web/app/components/base/icons/src/vender/solid/development/index.ts @@ -1,13 +1,5 @@ export { default as ApiConnection } from './ApiConnection' export { default as ApiConnectionMod } from './ApiConnectionMod' -export { default as BarChartSquare02 } from './BarChartSquare02' -export { default as Container } from './Container' -export { default as Database02 } from './Database02' -export { default as Database03 } from './Database03' -export { default as FileHeart02 } from './FileHeart02' -export { default as PatternRecognition } from './PatternRecognition' -export { default as PromptEngineering } from './PromptEngineering' -export { default as PuzzlePiece01 } from './PuzzlePiece01' -export { default as Semantic } from './Semantic' + export { default as TerminalSquare } from './TerminalSquare' export { default as Variable02 } from './Variable02' diff --git a/web/app/components/base/icons/src/vender/solid/editor/index.ts b/web/app/components/base/icons/src/vender/solid/editor/index.ts index 6b1a0a1afac..8b6debe736a 100644 --- a/web/app/components/base/icons/src/vender/solid/editor/index.ts +++ b/web/app/components/base/icons/src/vender/solid/editor/index.ts @@ -1,5 +1 @@ export { default as Brush01 } from './Brush01' -export { default as Citations } from './Citations' -export { default as Colors } from './Colors' -export { default as Paragraph } from './Paragraph' -export { default as TypeSquare } from './TypeSquare' diff --git a/web/app/components/base/icons/src/vender/solid/education/index.ts b/web/app/components/base/icons/src/vender/solid/education/index.ts index 2c8a3b6046c..e67b6313358 100644 --- a/web/app/components/base/icons/src/vender/solid/education/index.ts +++ b/web/app/components/base/icons/src/vender/solid/education/index.ts @@ -1,4 +1,4 @@ export { default as Beaker02 } from './Beaker02' export { default as BubbleText } from './BubbleText' -export { default as Heart02 } from './Heart02' + export { default as Unblur } from './Unblur' diff --git a/web/app/components/base/icons/src/vender/solid/files/index.ts b/web/app/components/base/icons/src/vender/solid/files/index.ts index fa93cd68dce..7677ba67616 100644 --- a/web/app/components/base/icons/src/vender/solid/files/index.ts +++ b/web/app/components/base/icons/src/vender/solid/files/index.ts @@ -1,4 +1,4 @@ export { default as File05 } from './File05' -export { default as FileSearch02 } from './FileSearch02' + export { default as FileZip } from './FileZip' export { default as Folder } from './Folder' diff --git a/web/app/components/base/icons/src/vender/solid/general/index.ts b/web/app/components/base/icons/src/vender/solid/general/index.ts index 4c4dd9a437a..273fb7e8762 100644 --- a/web/app/components/base/icons/src/vender/solid/general/index.ts +++ b/web/app/components/base/icons/src/vender/solid/general/index.ts @@ -1,18 +1,14 @@ -export { default as AnswerTriangle } from './AnswerTriangle' export { default as ArrowDownRoundFill } from './ArrowDownRoundFill' export { default as CheckCircle } from './CheckCircle' -export { default as CheckDone01 } from './CheckDone01' + export { default as Download02 } from './Download02' export { default as Edit03 } from './Edit03' -export { default as Edit04 } from './Edit04' + export { default as Eye } from './Eye' export { default as Github } from './Github' export { default as MessageClockCircle } from './MessageClockCircle' -export { default as PlusCircle } from './PlusCircle' -export { default as QuestionTriangle } from './QuestionTriangle' -export { default as SearchMd } from './SearchMd' + export { default as Target04 } from './Target04' export { default as Tool03 } from './Tool03' export { default as XCircle } from './XCircle' export { default as ZapFast } from './ZapFast' -export { default as ZapNarrow } from './ZapNarrow' diff --git a/web/app/components/base/icons/src/vender/solid/layout/index.ts b/web/app/components/base/icons/src/vender/solid/layout/index.ts deleted file mode 100644 index 73a2513d51f..00000000000 --- a/web/app/components/base/icons/src/vender/solid/layout/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Grid01 } from './Grid01' diff --git a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts index 7c313fecfb4..7d1bf786e93 100644 --- a/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts +++ b/web/app/components/base/icons/src/vender/solid/mediaAndDevices/index.ts @@ -1,12 +1,3 @@ -export { default as AudioSupportIcon } from './AudioSupportIcon' -export { default as DocumentSupportIcon } from './DocumentSupportIcon' export { default as MagicBox } from './MagicBox' -export { default as MagicEyes } from './MagicEyes' -export { default as MagicWand } from './MagicWand' -export { default as Microphone01 } from './Microphone01' -export { default as Play } from './Play' -export { default as Robot } from './Robot' -export { default as Sliders02 } from './Sliders02' -export { default as Speaker } from './Speaker' + export { default as StopCircle } from './StopCircle' -export { default as VideoSupportIcon } from './VideoSupportIcon' diff --git a/web/app/components/base/icons/src/vender/solid/shapes/index.ts b/web/app/components/base/icons/src/vender/solid/shapes/index.ts index 2768e3949a3..f25784ab023 100644 --- a/web/app/components/base/icons/src/vender/solid/shapes/index.ts +++ b/web/app/components/base/icons/src/vender/solid/shapes/index.ts @@ -1,3 +1 @@ export { default as Corner } from './Corner' -export { default as Star04 } from './Star04' -export { default as Star06 } from './Star06' diff --git a/web/app/components/base/icons/src/vender/solid/users/index.ts b/web/app/components/base/icons/src/vender/solid/users/index.ts index 4c969bffd78..1691fc84015 100644 --- a/web/app/components/base/icons/src/vender/solid/users/index.ts +++ b/web/app/components/base/icons/src/vender/solid/users/index.ts @@ -1,4 +1 @@ -export { default as User01 } from './User01' export { default as UserEdit02 } from './UserEdit02' -export { default as Users01 } from './Users01' -export { default as UsersPlus } from './UsersPlus' diff --git a/web/app/components/base/icons/src/vender/workflow/index.ts b/web/app/components/base/icons/src/vender/workflow/index.ts index c21e865a091..c2511d3816d 100644 --- a/web/app/components/base/icons/src/vender/workflow/index.ts +++ b/web/app/components/base/icons/src/vender/workflow/index.ts @@ -13,7 +13,7 @@ export { default as Http } from './Http' export { default as HumanInLoop } from './HumanInLoop' export { default as IfElse } from './IfElse' export { default as Iteration } from './Iteration' -export { default as IterationStart } from './IterationStart' + export { default as Jinja } from './Jinja' export { default as KnowledgeBase } from './KnowledgeBase' export { default as KnowledgeRetrieval } from './KnowledgeRetrieval' diff --git a/web/app/components/base/icons/utils.ts b/web/app/components/base/icons/utils.ts index 9a15a0816de..51a1d705689 100644 --- a/web/app/components/base/icons/utils.ts +++ b/web/app/components/base/icons/utils.ts @@ -8,7 +8,7 @@ export type AbstractNode = { children?: AbstractNode[] } -export type Attrs = { +type Attrs = { [key: string]: string | undefined } diff --git a/web/app/components/base/inline-delete-confirm/index.tsx b/web/app/components/base/inline-delete-confirm/index.tsx index 529dec479d4..a0e3b8eb966 100644 --- a/web/app/components/base/inline-delete-confirm/index.tsx +++ b/web/app/components/base/inline-delete-confirm/index.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import { cn } from '@/utils/classnames' -export type InlineDeleteConfirmProps = { +type InlineDeleteConfirmProps = { title?: string confirmText?: string cancelText?: string diff --git a/web/app/components/base/input-with-copy/index.tsx b/web/app/components/base/input-with-copy/index.tsx index 7c2177d5d26..e85a7bd6f4e 100644 --- a/web/app/components/base/input-with-copy/index.tsx +++ b/web/app/components/base/input-with-copy/index.tsx @@ -7,7 +7,7 @@ import { cn } from '@/utils/classnames' import ActionButton from '../action-button' import Tooltip from '../tooltip' -export type InputWithCopyProps = { +type InputWithCopyProps = { showCopyButton?: boolean copyValue?: string // Value to copy, defaults to input value onCopy?: (value: string) => void // Callback when copy is triggered diff --git a/web/app/components/base/markdown-blocks/index.ts b/web/app/components/base/markdown-blocks/index.ts index 73c9fdf13f5..10e98c9ad97 100644 --- a/web/app/components/base/markdown-blocks/index.ts +++ b/web/app/components/base/markdown-blocks/index.ts @@ -6,7 +6,7 @@ export { default as AudioBlock } from './audio-block' // Assuming these are also standalone components in this directory intended for Markdown rendering export { default as MarkdownButton } from './button' -export { default as CodeBlock } from './code-block' + export { default as MarkdownForm } from './form' export { default as Img } from './img' export { default as Link } from './link' diff --git a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts index 5e31a7afa9a..4e721b214eb 100644 --- a/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts +++ b/web/app/components/base/markdown-with-directive/components/markdown-with-directive-schema.ts @@ -15,12 +15,12 @@ export const withIconCardItemPropsSchema = z.object({ ), }).strict() -export const directivePropsSchemas = { +const directivePropsSchemas = { withiconcardlist: withIconCardListPropsSchema, withiconcarditem: withIconCardItemPropsSchema, } as const -export type DirectiveName = keyof typeof directivePropsSchemas +type DirectiveName = keyof typeof directivePropsSchemas function isDirectiveName(name: string): name is DirectiveName { return Object.hasOwn(directivePropsSchemas, name) diff --git a/web/app/components/base/node-status/index.tsx b/web/app/components/base/node-status/index.tsx index 3c39fa1fb31..1616f350b0c 100644 --- a/web/app/components/base/node-status/index.tsx +++ b/web/app/components/base/node-status/index.tsx @@ -32,7 +32,7 @@ const StatusIconMap: Record = React.createContext(defaultState) -export const PrevButton = ({ +const PrevButton = ({ className, children, dataTestId, @@ -61,7 +61,7 @@ export const PrevButton = ({ ) } -export const NextButton = ({ +const NextButton = ({ className, children, dataTestId, @@ -117,7 +117,7 @@ const TruncableElement = ({ prev }: ITruncableElementProps) => { : null } -export const PageButton = ({ +const PageButton = ({ as = , className, dataTestIdActive, diff --git a/web/app/components/base/portal-to-follow-elem/index.tsx b/web/app/components/base/portal-to-follow-elem/index.tsx index 7d4f6baa9bd..932eceee2b0 100644 --- a/web/app/components/base/portal-to-follow-elem/index.tsx +++ b/web/app/components/base/portal-to-follow-elem/index.tsx @@ -46,7 +46,7 @@ export type PortalToFollowElemOptions = { } /** @deprecated Use semantic overlay primitives instead. See #32767. */ -export function usePortalToFollowElem({ +function usePortalToFollowElem({ placement = 'bottom', open: controlledOpen, offset: offsetValue = 0, @@ -114,7 +114,7 @@ type ContextType = ReturnType | null const PortalToFollowElemContext = React.createContext(null) -export function usePortalToFollowElemContext() { +function usePortalToFollowElemContext() { const context = React.useContext(PortalToFollowElemContext) if (context == null) diff --git a/web/app/components/base/premium-badge/index.tsx b/web/app/components/base/premium-badge/index.tsx index 297e05fe428..1ffff2f7a9b 100644 --- a/web/app/components/base/premium-badge/index.tsx +++ b/web/app/components/base/premium-badge/index.tsx @@ -66,4 +66,3 @@ const PremiumBadge: React.FC = ({ PremiumBadge.displayName = 'PremiumBadge' export default PremiumBadge -export { PremiumBadge, PremiumBadgeVariants } diff --git a/web/app/components/base/prompt-editor/hooks.ts b/web/app/components/base/prompt-editor/hooks.ts index 6984d30ee8a..49fc6a8eb0f 100644 --- a/web/app/components/base/prompt-editor/hooks.ts +++ b/web/app/components/base/prompt-editor/hooks.ts @@ -35,7 +35,7 @@ import { DELETE_QUERY_BLOCK_COMMAND } from './plugins/query-block' import { $isQueryBlockNode } from './plugins/query-block/node' import { registerLexicalTextEntity } from './utils' -export type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => [RefObject, boolean] +type UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => [RefObject, boolean] export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, command?: LexicalCommand) => { const ref = useRef(null) const [editor] = useLexicalComposerContext() @@ -110,7 +110,7 @@ export const useSelectOrDelete: UseSelectOrDeleteHandler = (nodeKey: string, com return [ref, isSelected] } -export type UseTriggerHandler = () => [RefObject, boolean, Dispatch>] +type UseTriggerHandler = () => [RefObject, boolean, Dispatch>] export const useTrigger: UseTriggerHandler = () => { const triggerRef = useRef(null) const [open, setOpen] = useState(false) @@ -145,16 +145,16 @@ export function useLexicalTextEntity( }, [createNode, editor, getMatch, targetNode]) } -export type MenuTextMatch = { +type MenuTextMatch = { leadOffset: number matchingString: string replaceableString: string } -export type TriggerFn = ( +type TriggerFn = ( text: string, editor: LexicalEditor, ) => MenuTextMatch | null -export const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;' +const PUNCTUATION = '\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%\'"~=<>_:;' export function useBasicTypeaheadTriggerMatch( trigger: string, { minLength = 1, maxLength = 75 }: { minLength?: number, maxLength?: number }, diff --git a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx index 231a72ca140..958415d843d 100644 --- a/web/app/components/base/prompt-editor/plugins/context-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/context-block/node.tsx @@ -3,7 +3,7 @@ import type { Dataset } from './index' import { DecoratorNode } from 'lexical' import ContextBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean } +type SerializedNode = SerializedLexicalNode & { datasets: Dataset[], onAddContext: () => void, canNotAddContext: boolean } export class ContextBlockNode extends DecoratorNode { __datasets: Dataset[] diff --git a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx index 554bf1a2e9b..916e3b5169f 100644 --- a/web/app/components/base/prompt-editor/plugins/current-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/current-block/node.tsx @@ -3,7 +3,7 @@ import type { GeneratorType } from '@/app/components/app/configuration/config/au import { DecoratorNode } from 'lexical' import CurrentBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType } +type SerializedNode = SerializedLexicalNode & { generatorType: GeneratorType } export class CurrentBlockNode extends DecoratorNode { __generatorType: GeneratorType diff --git a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx index b8042e5e543..d253cf7ff38 100644 --- a/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/error-message-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import ErrorMessageBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class ErrorMessageBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx index a1d788c8cd5..f6fd01f0d9c 100644 --- a/web/app/components/base/prompt-editor/plugins/history-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/history-block/index.tsx @@ -24,13 +24,6 @@ export type RoleName = { assistant: string } -export type HistoryBlockProps = { - roleName: RoleName - onEditRole: () => void - onInsert?: () => void - onDelete?: () => void -} - const HistoryBlock = memo(({ history = { user: '', assistant: '' }, onEditRole = noop, diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx index 49b0e3d150f..2c10fdbd5a8 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/index.tsx @@ -22,11 +22,6 @@ import { export const INSERT_HITL_INPUT_BLOCK_COMMAND = createCommand('INSERT_HITL_INPUT_BLOCK_COMMAND') export const DELETE_HITL_INPUT_BLOCK_COMMAND = createCommand('DELETE_HITL_INPUT_BLOCK_COMMAND') export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP') - -export type HITLInputProps = { - onInsert?: () => void - onDelete?: () => void -} const HITLInputBlock = memo(({ onInsert, onDelete, diff --git a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx index bf3c44acf3e..9f2d25b4465 100644 --- a/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/hitl-input-block/node.tsx @@ -21,7 +21,7 @@ export type HITLNodeProps = { readonly?: boolean } -export type SerializedNode = SerializedLexicalNode & HITLNodeProps +type SerializedNode = SerializedLexicalNode & HITLNodeProps export class HITLInputNode extends DecoratorNode { __variableName: string diff --git a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx index 5f61c3138bd..0606adbe2e4 100644 --- a/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/last-run-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, NodeKey, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import LastRunBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class LastRunBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx index d5953d16c40..adabf0bc6e1 100644 --- a/web/app/components/base/prompt-editor/plugins/query-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/query-block/index.tsx @@ -17,11 +17,6 @@ import { export const INSERT_QUERY_BLOCK_COMMAND = createCommand('INSERT_QUERY_BLOCK_COMMAND') export const DELETE_QUERY_BLOCK_COMMAND = createCommand('DELETE_QUERY_BLOCK_COMMAND') - -export type QueryBlockProps = { - onInsert?: () => void - onDelete?: () => void -} const QueryBlock = memo(({ onInsert, onDelete, diff --git a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx index fc560451dda..519d6bab927 100644 --- a/web/app/components/base/prompt-editor/plugins/query-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/query-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import QueryBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class QueryBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx index b1e74aa3a6d..b24e653bbcf 100644 --- a/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/request-url-block/node.tsx @@ -2,7 +2,7 @@ import type { LexicalNode, SerializedLexicalNode } from 'lexical' import { DecoratorNode } from 'lexical' import RequestURLBlockComponent from './component' -export type SerializedNode = SerializedLexicalNode +type SerializedNode = SerializedLexicalNode export class RequestURLBlockNode extends DecoratorNode { static getType(): string { diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx index c8cac64d19d..dfbd238dbf6 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/index.tsx @@ -1,5 +1,4 @@ -import type { GetVarType, WorkflowVariableBlockType } from '../../types' -import type { Node } from '@/app/components/workflow/types' +import type { WorkflowVariableBlockType } from '../../types' import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext' import { mergeRegister } from '@lexical/utils' import { @@ -19,13 +18,6 @@ import { export const INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('INSERT_WORKFLOW_VARIABLE_BLOCK_COMMAND') export const DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND = createCommand('DELETE_WORKFLOW_VARIABLE_BLOCK_COMMAND') export const UPDATE_WORKFLOW_NODES_MAP = createCommand('UPDATE_WORKFLOW_NODES_MAP') - -export type WorkflowVariableBlockProps = { - getWorkflowNode: (nodeId: string) => Node - onInsert?: () => void - onDelete?: () => void - getVarType: GetVarType -} const WorkflowVariableBlock = memo(({ workflowNodesMap, onInsert, diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx index a241e752334..743937d8a67 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/node.tsx @@ -6,7 +6,7 @@ import WorkflowVariableBlockComponent from './component' export type WorkflowNodesMap = WorkflowVariableBlockType['workflowNodesMap'] -export type SerializedNode = SerializedLexicalNode & { +type SerializedNode = SerializedLexicalNode & { variables: string[] workflowNodesMap: WorkflowNodesMap getVarType?: GetVarType diff --git a/web/app/components/base/radio/component/group/index.tsx b/web/app/components/base/radio/component/group/index.tsx index 53ccd5e8333..aff9e5e3c6d 100644 --- a/web/app/components/base/radio/component/group/index.tsx +++ b/web/app/components/base/radio/component/group/index.tsx @@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames' import RadioGroupContext from '../../context' import s from '../../style.module.css' -export type TRadioGroupProps = { +type TRadioGroupProps = { children?: ReactNode | ReactNode[] value?: string | number | boolean className?: string diff --git a/web/app/components/base/select/index.tsx b/web/app/components/base/select/index.tsx index 2cfdcf74bc0..70ed726c38f 100644 --- a/web/app/components/base/select/index.tsx +++ b/web/app/components/base/select/index.tsx @@ -37,7 +37,7 @@ export type Item = { extra?: React.ReactNode } & Record -export type ISelectProps = { +type ISelectProps = { className?: string wrapperClassName?: string renderTrigger?: (value: Item | null, isOpen: boolean) => React.JSX.Element | null diff --git a/web/app/components/base/sort/index.tsx b/web/app/components/base/sort/index.tsx index 69562e2f3ea..901d353ec2d 100644 --- a/web/app/components/base/sort/index.tsx +++ b/web/app/components/base/sort/index.tsx @@ -9,7 +9,7 @@ import { } from '@/app/components/base/portal-to-follow-elem' import { cn } from '@/utils/classnames' -export type Item = { +type Item = { value: number | string name: string } & Record diff --git a/web/app/components/base/tag/index.tsx b/web/app/components/base/tag/index.tsx index 21e2a9c9821..dee85c998cc 100644 --- a/web/app/components/base/tag/index.tsx +++ b/web/app/components/base/tag/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { cn } from '@/utils/classnames' -export type ITagProps = { +type ITagProps = { children: string | React.ReactNode color?: keyof typeof COLOR_MAP className?: string diff --git a/web/app/components/base/text-generation/types.ts b/web/app/components/base/text-generation/types.ts index d7c03ab3eb5..62a401c3cb8 100644 --- a/web/app/components/base/text-generation/types.ts +++ b/web/app/components/base/text-generation/types.ts @@ -2,41 +2,11 @@ import type { ExternalDataTool } from '@/models/common' import type { ModelConfig, VisionFile, - VisionSettings, } from '@/types/app' export type { VisionFile } from '@/types/app' export { TransferMethod } from '@/types/app' -export type UserInputForm = { - default: string - label: string - required: boolean - variable: string -} - -export type UserInputFormTextInput = { - 'text-input': UserInputForm & { - max_length: number - } -} - -export type UserInputFormSelect = { - select: UserInputForm & { - options: string[] - } -} - -export type UserInputFormParagraph = { - paragraph: UserInputForm -} - -export type VisionConfig = VisionSettings - -export type EnableType = { - enabled: boolean -} - export type TextGenerationConfig = Omit & { external_data_tools: ExternalDataTool[] } diff --git a/web/app/components/base/textarea/index.tsx b/web/app/components/base/textarea/index.tsx index 73c6865903d..d991acb28b5 100644 --- a/web/app/components/base/textarea/index.tsx +++ b/web/app/components/base/textarea/index.tsx @@ -58,4 +58,4 @@ const Textarea = React.forwardRef( Textarea.displayName = 'Textarea' export default Textarea -export { Textarea, textareaVariants } +export { textareaVariants } diff --git a/web/app/components/base/theme-switcher.tsx b/web/app/components/base/theme-switcher.tsx index 91fb5ff2c9a..a6b69722104 100644 --- a/web/app/components/base/theme-switcher.tsx +++ b/web/app/components/base/theme-switcher.tsx @@ -2,7 +2,7 @@ import { useTheme } from 'next-themes' import { cn } from '@/utils/classnames' -export type Theme = 'light' | 'dark' | 'system' +type Theme = 'light' | 'dark' | 'system' export default function ThemeSwitcher() { const { theme, setTheme } = useTheme() diff --git a/web/app/components/base/timezone-label/index.tsx b/web/app/components/base/timezone-label/index.tsx index bb4355f338d..385e4c782a7 100644 --- a/web/app/components/base/timezone-label/index.tsx +++ b/web/app/components/base/timezone-label/index.tsx @@ -3,7 +3,7 @@ import { useMemo } from 'react' import { convertTimezoneToOffsetStr } from '@/app/components/base/date-and-time-picker/utils/dayjs' import { cn } from '@/utils/classnames' -export type TimezoneLabelProps = { +type TimezoneLabelProps = { /** IANA timezone identifier (e.g., 'Asia/Shanghai', 'America/New_York') */ timezone: string /** Additional CSS classes to apply */ diff --git a/web/app/components/base/tooltip/content.tsx b/web/app/components/base/tooltip/content.tsx index a5a31a2a5c6..191ee933f14 100644 --- a/web/app/components/base/tooltip/content.tsx +++ b/web/app/components/base/tooltip/content.tsx @@ -1,6 +1,6 @@ import type { FC, PropsWithChildren, ReactNode } from 'react' -export type ToolTipContentProps = { +type ToolTipContentProps = { title?: ReactNode action?: ReactNode } & PropsWithChildren diff --git a/web/app/components/base/tooltip/index.tsx b/web/app/components/base/tooltip/index.tsx index 1588c998122..da373dea830 100644 --- a/web/app/components/base/tooltip/index.tsx +++ b/web/app/components/base/tooltip/index.tsx @@ -14,7 +14,7 @@ import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigge import { cn } from '@/utils/classnames' import { tooltipManager } from './TooltipManager' -export type TooltipProps = { +type TooltipProps = { position?: Placement triggerMethod?: 'hover' | 'click' triggerClassName?: string diff --git a/web/app/components/base/ui/context-menu/index.tsx b/web/app/components/base/ui/context-menu/index.tsx index 5a0f580ca4c..4e164b08b9b 100644 --- a/web/app/components/base/ui/context-menu/index.tsx +++ b/web/app/components/base/ui/context-menu/index.tsx @@ -17,8 +17,6 @@ import { cn } from '@/utils/classnames' export const ContextMenu = BaseContextMenu.Root export const ContextMenuTrigger = BaseContextMenu.Trigger -export const ContextMenuPortal = BaseContextMenu.Portal -export const ContextMenuBackdrop = BaseContextMenu.Backdrop export const ContextMenuSub = BaseContextMenu.SubmenuRoot export const ContextMenuGroup = BaseContextMenu.Group export const ContextMenuRadioGroup = BaseContextMenu.RadioGroup @@ -175,26 +173,6 @@ export function ContextMenuCheckboxItem({ ) } -type ContextMenuIndicatorProps = Omit, 'children'> & { - children?: React.ReactNode -} - -export function ContextMenuItemIndicator({ - className, - children, - ...props -}: ContextMenuIndicatorProps) { - return ( - - {children ?? } - - ) -} - export function ContextMenuCheckboxItemIndicator({ className, ...props @@ -239,7 +217,7 @@ export function ContextMenuSubTrigger({ {...props} > {children} - + ) } diff --git a/web/app/components/base/ui/dropdown-menu/index.tsx b/web/app/components/base/ui/dropdown-menu/index.tsx index 13c2dab626d..5db5833fd7d 100644 --- a/web/app/components/base/ui/dropdown-menu/index.tsx +++ b/web/app/components/base/ui/dropdown-menu/index.tsx @@ -15,7 +15,6 @@ import { parsePlacement } from '@/app/components/base/ui/placement' import { cn } from '@/utils/classnames' export const DropdownMenu = Menu.Root -export const DropdownMenuPortal = Menu.Portal export const DropdownMenuTrigger = Menu.Trigger export const DropdownMenuSub = Menu.SubmenuRoot export const DropdownMenuGroup = Menu.Group diff --git a/web/app/components/base/ui/number-field/index.tsx b/web/app/components/base/ui/number-field/index.tsx index ac2ae0c7c63..924250ca223 100644 --- a/web/app/components/base/ui/number-field/index.tsx +++ b/web/app/components/base/ui/number-field/index.tsx @@ -113,7 +113,7 @@ export function NumberFieldUnit({ ) } -export const numberFieldControlsVariants = cva( +const numberFieldControlsVariants = cva( 'flex shrink-0 flex-col items-stretch border-l border-divider-subtle bg-transparent text-text-tertiary', ) @@ -131,7 +131,7 @@ export function NumberFieldControls({ ) } -export const numberFieldControlButtonVariants = cva( +const numberFieldControlButtonVariants = cva( [ 'flex touch-manipulation select-none items-center justify-center px-1.5 text-text-tertiary outline-hidden transition-colors', 'hover:bg-components-input-bg-hover focus-visible:bg-components-input-bg-hover', diff --git a/web/app/components/base/ui/scroll-area/index.tsx b/web/app/components/base/ui/scroll-area/index.tsx index 195f9b4e81b..053d9e684a7 100644 --- a/web/app/components/base/ui/scroll-area/index.tsx +++ b/web/app/components/base/ui/scroll-area/index.tsx @@ -6,18 +6,17 @@ import { cn } from '@/utils/classnames' import styles from './index.module.css' export const ScrollAreaRoot = BaseScrollArea.Root -export type ScrollAreaRootProps = React.ComponentPropsWithRef +type ScrollAreaRootProps = React.ComponentPropsWithRef export const ScrollAreaContent = BaseScrollArea.Content -export type ScrollAreaContentProps = React.ComponentPropsWithRef -export type ScrollAreaSlotClassNames = { +type ScrollAreaSlotClassNames = { viewport?: string content?: string scrollbar?: string } -export type ScrollAreaProps = Omit & { +type ScrollAreaProps = Omit & { children: React.ReactNode orientation?: 'vertical' | 'horizontal' slotClassNames?: ScrollAreaSlotClassNames @@ -25,7 +24,7 @@ export type ScrollAreaProps = Omit & { labelledBy?: string } -export const scrollAreaScrollbarClassName = cn( +const scrollAreaScrollbarClassName = cn( styles.scrollbar, 'flex touch-none select-none overflow-clip p-1 opacity-100 transition-opacity motion-reduce:transition-none', 'pointer-events-none data-hovering:pointer-events-auto', @@ -34,20 +33,20 @@ export const scrollAreaScrollbarClassName = cn( 'data-[orientation=horizontal]:absolute data-[orientation=horizontal]:inset-x-0 data-[orientation=horizontal]:h-3 data-[orientation=horizontal]:items-center', ) -export const scrollAreaThumbClassName = cn( +const scrollAreaThumbClassName = cn( 'shrink-0 radius-xs bg-state-base-handle transition-[background-color] motion-reduce:transition-none', 'data-[orientation=vertical]:w-1', 'data-[orientation=horizontal]:h-1', ) -export const scrollAreaViewportClassName = cn( +const scrollAreaViewportClassName = cn( 'size-full min-h-0 min-w-0 outline-hidden', 'focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-components-input-border-hover', ) -export const scrollAreaCornerClassName = 'bg-transparent' +const scrollAreaCornerClassName = 'bg-transparent' -export type ScrollAreaViewportProps = React.ComponentPropsWithRef +type ScrollAreaViewportProps = React.ComponentPropsWithRef export function ScrollAreaViewport({ className, @@ -61,7 +60,7 @@ export function ScrollAreaViewport({ ) } -export type ScrollAreaScrollbarProps = React.ComponentPropsWithRef +type ScrollAreaScrollbarProps = React.ComponentPropsWithRef export function ScrollAreaScrollbar({ className, @@ -75,7 +74,7 @@ export function ScrollAreaScrollbar({ ) } -export type ScrollAreaThumbProps = React.ComponentPropsWithRef +type ScrollAreaThumbProps = React.ComponentPropsWithRef export function ScrollAreaThumb({ className, @@ -89,7 +88,7 @@ export function ScrollAreaThumb({ ) } -export type ScrollAreaCornerProps = React.ComponentPropsWithRef +type ScrollAreaCornerProps = React.ComponentPropsWithRef export function ScrollAreaCorner({ className, diff --git a/web/app/components/base/ui/select/index.tsx b/web/app/components/base/ui/select/index.tsx index 83dfe817dc9..b9441b2d6b7 100644 --- a/web/app/components/base/ui/select/index.tsx +++ b/web/app/components/base/ui/select/index.tsx @@ -10,11 +10,8 @@ import { cn } from '@/utils/classnames' export const Select = BaseSelect.Root export const SelectValue = BaseSelect.Value -export const SelectGroup = BaseSelect.Group -export const SelectGroupLabel = BaseSelect.GroupLabel -export const SelectSeparator = BaseSelect.Separator -export const selectTriggerVariants = cva( +const selectTriggerVariants = cva( '', { variants: { diff --git a/web/app/components/base/ui/slider/index.tsx b/web/app/components/base/ui/slider/index.tsx index d44f5532545..b0a8c2f3767 100644 --- a/web/app/components/base/ui/slider/index.tsx +++ b/web/app/components/base/ui/slider/index.tsx @@ -24,7 +24,7 @@ type UncontrolledSliderProps = SliderBaseProps & { defaultValue?: number } -export type SliderProps = ControlledSliderProps | UncontrolledSliderProps +type SliderProps = ControlledSliderProps | UncontrolledSliderProps const sliderRootClassName = 'group/slider relative inline-flex w-full data-disabled:opacity-30' const sliderControlClassName = cn( diff --git a/web/app/components/base/ui/toast/index.tsx b/web/app/components/base/ui/toast/index.tsx index 0307e14dbca..abb71d371e4 100644 --- a/web/app/components/base/ui/toast/index.tsx +++ b/web/app/components/base/ui/toast/index.tsx @@ -35,28 +35,28 @@ const TOAST_TONE_STYLES = { }, } satisfies Record -export type ToastType = keyof typeof TOAST_TONE_STYLES +type ToastType = keyof typeof TOAST_TONE_STYLES -export type ToastAddOptions = Omit, 'data' | 'positionerProps' | 'type'> & { +type ToastAddOptions = Omit, 'data' | 'positionerProps' | 'type'> & { type?: ToastType } -export type ToastUpdateOptions = Omit, 'data' | 'positionerProps' | 'type'> & { +type ToastUpdateOptions = Omit, 'data' | 'positionerProps' | 'type'> & { type?: ToastType } -export type ToastOptions = Omit -export type TypedToastOptions = Omit +type ToastOptions = Omit +type TypedToastOptions = Omit type ToastPromiseResultOption = string | ToastUpdateOptions | ((value: Value) => string | ToastUpdateOptions) -export type ToastPromiseOptions = { +type ToastPromiseOptions = { loading: string | ToastUpdateOptions success: ToastPromiseResultOption error: ToastPromiseResultOption } -export type ToastHostProps = { +type ToastHostProps = { timeout?: number limit?: number } @@ -65,7 +65,7 @@ type ToastDismiss = (toastId?: string) => void type ToastCall = (title: ReactNode, options?: ToastOptions) => string type TypedToastCall = (title: ReactNode, options?: TypedToastOptions) => string -export type ToastApi = { +type ToastApi = { (title: ReactNode, options?: ToastOptions): string success: TypedToastCall error: TypedToastCall diff --git a/web/app/components/base/ui/tooltip/index.tsx b/web/app/components/base/ui/tooltip/index.tsx index b100c594c63..693a61ca1fd 100644 --- a/web/app/components/base/ui/tooltip/index.tsx +++ b/web/app/components/base/ui/tooltip/index.tsx @@ -8,7 +8,7 @@ import { cn } from '@/utils/classnames' type TooltipContentVariant = 'default' | 'plain' -export type TooltipContentProps = { +type TooltipContentProps = { children: React.ReactNode placement?: Placement sideOffset?: number diff --git a/web/app/components/base/zendesk/utils.ts b/web/app/components/base/zendesk/utils.ts index 961f4b96f65..35f3da74113 100644 --- a/web/app/components/base/zendesk/utils.ts +++ b/web/app/components/base/zendesk/utils.ts @@ -1,6 +1,6 @@ import { IS_CE_EDITION } from '@/config' -export type ConversationField = { +type ConversationField = { id: string value: any } diff --git a/web/app/components/billing/type.ts b/web/app/components/billing/type.ts index e3eb8b67996..15eda0bbf67 100644 --- a/web/app/components/billing/type.ts +++ b/web/app/components/billing/type.ts @@ -37,22 +37,6 @@ export enum SelfHostedPlan { enterprise = 'enterprise', } -export type SelfHostedPlanInfo = { - level: number - price: number - modelProviders: string - teamWorkspace: number - teamMembers: number - buildApps: number - documents: number - vectorSpace: string - documentsRequestQuota: number - documentProcessingPriority: Priority - logHistory: number - messageRequest: number - annotatedResponse: number -} - export type UsagePlanInfo = Pick & { vectorSpace: number } export type UsageResetInfo = { @@ -121,11 +105,6 @@ export type CurrentPlanInfoBackend = { human_input_email_delivery_enabled: boolean } -export type SubscriptionItem = { - plan: Plan - url: string -} - export type SubscriptionUrlsBackend = { url: string } diff --git a/web/app/components/billing/upgrade-btn/style.module.css b/web/app/components/billing/upgrade-btn/style.module.css deleted file mode 100644 index ab8c30ebd52..00000000000 --- a/web/app/components/billing/upgrade-btn/style.module.css +++ /dev/null @@ -1,9 +0,0 @@ -.upgradeBtn { - background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #00B2FF 12.96%, #132BFF 90.95%); - box-shadow: 0px 2px 4px -2px rgba(16, 24, 40, 0.06), 0px 4px 8px -2px rgba(0, 162, 253, 0.12); - -} -.upgradeBtn:hover { - background: linear-gradient(99deg, rgba(255, 255, 255, 0.12) 7.16%, rgba(255, 255, 255, 0.00) 85.47%), linear-gradient(280deg, #02C2FF 12.96%, #001AFF 90.95%); - box-shadow: 0px 4px 6px -2px rgba(16, 18, 40, 0.08), 0px 12px 16px -4px rgba(0, 209, 255, 0.08); -} diff --git a/web/app/components/custom/custom-web-app-brand/style.module.css b/web/app/components/custom/custom-web-app-brand/style.module.css deleted file mode 100644 index bdc7d7cfbfe..00000000000 --- a/web/app/components/custom/custom-web-app-brand/style.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.mask { - background: linear-gradient(273deg, rgba(255, 255, 255, 0.00) 51.75%, rgba(255, 255, 255, 0.80) 115.32%); -} diff --git a/web/app/components/datasets/chunk.tsx b/web/app/components/datasets/chunk.tsx index 74184c8d07b..e0d820a4f3a 100644 --- a/web/app/components/datasets/chunk.tsx +++ b/web/app/components/datasets/chunk.tsx @@ -2,7 +2,7 @@ import type { FC, PropsWithChildren } from 'react' import type { QA } from '@/models/datasets' import { SelectionMod } from '../base/icons/src/public/knowledge' -export type ChunkLabelProps = { +type ChunkLabelProps = { label: string characterCount: number } @@ -27,7 +27,7 @@ export const ChunkLabel: FC = (props) => { ) } -export type ChunkContainerProps = ChunkLabelProps & PropsWithChildren +type ChunkContainerProps = ChunkLabelProps & PropsWithChildren export const ChunkContainer: FC = (props) => { const { label, characterCount, children } = props @@ -41,7 +41,7 @@ export const ChunkContainer: FC = (props) => { ) } -export type QAPreviewProps = { +type QAPreviewProps = { qa: QA } diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx index 17ff348c648..ba2ede9f081 100644 --- a/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx +++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-chunk/index.tsx @@ -72,7 +72,7 @@ const ImageUploaderInChunk = ({ ) } -export type ImageUploaderInChunkWrapperProps = { +type ImageUploaderInChunkWrapperProps = { value?: FileEntity[] onChange: (files: FileEntity[]) => void } & ImageUploaderInChunkProps diff --git a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx index 5f395f3e54c..0c4da5a7e48 100644 --- a/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx +++ b/web/app/components/datasets/common/image-uploader/image-uploader-in-retrieval-testing/index.tsx @@ -110,7 +110,7 @@ const ImageUploaderInRetrievalTesting = ({ ) } -export type ImageUploaderInRetrievalTestingWrapperProps = { +type ImageUploaderInRetrievalTestingWrapperProps = { value?: FileEntity[] onChange: (files: FileEntity[]) => void } & ImageUploaderInRetrievalTestingProps diff --git a/web/app/components/datasets/common/image-uploader/store.tsx b/web/app/components/datasets/common/image-uploader/store.tsx index 93470190a41..45c338d8bcd 100644 --- a/web/app/components/datasets/common/image-uploader/store.tsx +++ b/web/app/components/datasets/common/image-uploader/store.tsx @@ -30,7 +30,7 @@ export const createFileStore = ( } type FileStore = ReturnType -export const FileContext = createContext(null) +const FileContext = createContext(null) export function useFileStoreWithSelector(selector: (state: Shape) => T): T { const store = useContext(FileContext) diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts index 19023ccfe3a..992d0526bee 100644 --- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts +++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/hooks/use-dsl-import.ts @@ -12,13 +12,13 @@ export enum CreateFromDSLModalTab { FROM_FILE = 'from-file', FROM_URL = 'from-url', } -export type UseDSLImportOptions = { +type UseDSLImportOptions = { activeTab?: CreateFromDSLModalTab dslUrl?: string onSuccess?: () => void onClose?: () => void } -export type DSLVersions = { +type DSLVersions = { importedVersion: string systemVersion: string } diff --git a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx index 74a51d488a4..7089c8293a5 100644 --- a/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx +++ b/web/app/components/datasets/create-from-pipeline/create-options/create-from-dsl-modal/uploader.tsx @@ -9,7 +9,7 @@ import { toast } from '@/app/components/base/ui/toast' import { cn } from '@/utils/classnames' import { formatFileSize } from '@/utils/format' -export type Props = { +type Props = { file: File | undefined updateFile: (file?: File) => void className?: string diff --git a/web/app/components/datasets/create/embedding-process/index.module.css b/web/app/components/datasets/create/embedding-process/index.module.css deleted file mode 100644 index 74251cacd20..00000000000 --- a/web/app/components/datasets/create/embedding-process/index.module.css +++ /dev/null @@ -1,91 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.progressContainer { - @apply relative pb-4 w-full; - border-bottom: 0.5px solid #EAECF0; -} -.sourceItem { - position: relative; - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 4px; - padding: 0 4px; - height: 24px; - background: #EFF4FF; - border-radius: 6px; - overflow: hidden; -} - -.sourceItem .info .name { - font-weight: 500; - font-size: 12px; - line-height: 18px; - color: #101828; -} -.sourceItem.success .info .name { - color: #05603A; -} -.sourceItem .percent { - font-weight: 500; - font-size: 12px; - line-height: 18px; - color: #344054; - z-index: 1; -} -.sourceItem .error { - color: #D92D20; -} -.sourceItem .success { - color: #05603A; -} - -.commonIcon { - @apply w-3 h-3 mr-1 inline-block align-middle; -} -.highIcon { - mask-image: url(../assets/star.svg); - @apply bg-orange-500; -} -.economyIcon { - background-color: #444ce7; - mask-image: url(../assets/normal.svg); -} -.tokens { - @apply text-xs font-medium px-1; -} -.price { - color: #f79009; - @apply text-xs font-medium; -} - -.unknownFileIcon { - background-image: url(../assets/unknown.svg); -} -.csv { - background-image: url(../assets/csv.svg); -} -.docx { - background-image: url(../assets/docx.svg); -} -.xlsx, -.xls { - background-image: url(../assets/xlsx.svg); -} -.pdf { - background-image: url(../assets/pdf.svg); -} -.html, -.htm { - background-image: url(../assets/html.svg); -} -.md, -.markdown { - background-image: url(../assets/md.svg); -} -.txt { - background-image: url(../assets/txt.svg); -} -.json { - background-image: url(../assets/json.svg); -} diff --git a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts index a202d85b61f..05827d0a9ec 100644 --- a/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts +++ b/web/app/components/datasets/create/file-uploader/hooks/use-file-upload.ts @@ -19,7 +19,7 @@ export type FileUploadConfig = { file_upload_limit: number } -export type UseFileUploadOptions = { +type UseFileUploadOptions = { fileList: FileItem[] prepareFileList: (files: FileItem[]) => void onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void @@ -33,7 +33,7 @@ export type UseFileUploadOptions = { allowedExtensions?: string[] } -export type UseFileUploadReturn = { +type UseFileUploadReturn = { // Refs dropRef: RefObject dragRef: RefObject diff --git a/web/app/components/datasets/create/file-uploader/index.module.css b/web/app/components/datasets/create/file-uploader/index.module.css deleted file mode 100644 index a75274594d2..00000000000 --- a/web/app/components/datasets/create/file-uploader/index.module.css +++ /dev/null @@ -1,133 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.file { - @apply box-border relative flex items-center justify-between; - padding: 8px 12px 8px 8px; - max-width: 640px; - height: 40px; - background: #ffffff; - border: 0.5px solid #EAECF0; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); - border-radius: 8px; - overflow: hidden; - cursor: pointer; -} - -.progressbar { - position: absolute; - top: 0; - left: 0; - height: 100%; - background-color: #F2F4F7; -} - -.file.uploading, -.file.uploading:hover { - background: #FCFCFD; - border: 0.5px solid #EAECF0; -} - -.file.active { - background: #F5F8FF; - border: 1px solid #D1E0FF; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); -} - -.file:hover { - background: #F5F8FF; - border: 1px solid #D1E0FF; - box-shadow: 0px 4px 8px -2px rgba(16, 24, 40, 0.1), 0px 2px 4px -2px rgba(16, 24, 40, 0.06); -} - -.fileIcon { - @apply shrink-0 w-6 h-6 mr-2 bg-center bg-no-repeat; - background-image: url(../assets/unknown.svg); - background-size: 24px; -} - -.fileIcon.csv { - background-image: url(../assets/csv.svg); -} - -.fileIcon.doc { - background-image: url(../assets/doc.svg); -} - -.fileIcon.docx { - background-image: url(../assets/docx.svg); -} - -.fileIcon.xlsx, -.fileIcon.xls { - background-image: url(../assets/xlsx.svg); -} - -.fileIcon.pdf { - background-image: url(../assets/pdf.svg); -} - -.fileIcon.html, -.fileIcon.htm { - background-image: url(../assets/html.svg); -} - -.fileIcon.md, -.fileIcon.markdown { - background-image: url(../assets/md.svg); -} - -.fileIcon.txt { - background-image: url(../assets/txt.svg); -} - -.fileIcon.json { - background-image: url(../assets/json.svg); -} - -.fileInfo { - @apply grow flex items-center; - z-index: 1; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.filename { - font-weight: 500; - font-size: 13px; - line-height: 18px; - color: #1D2939; -} - -.size { - @apply ml-3; - font-weight: 400; - font-size: 12px; - line-height: 18px; - color: #667085; -} - -.actionWrapper { - @apply flex items-center shrink-0; - z-index: 1; -} - -.actionWrapper .percent { - font-weight: 400; - font-size: 13px; - line-height: 18px; - color: #344054; -} - -.actionWrapper .remove { - display: none; - width: 24px; - height: 24px; - background: center no-repeat url(../assets/trash.svg); - background-size: 16px; - cursor: pointer; -} - -.file:hover .actionWrapper .remove { - display: block; -} diff --git a/web/app/components/datasets/create/index.module.css b/web/app/components/datasets/create/index.module.css deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/web/app/components/datasets/create/step-one/hooks/index.ts b/web/app/components/datasets/create/step-one/hooks/index.ts index bae5ce4fce3..bccd40e5426 100644 --- a/web/app/components/datasets/create/step-one/hooks/index.ts +++ b/web/app/components/datasets/create/step-one/hooks/index.ts @@ -1,2 +1 @@ export { default as usePreviewState } from './use-preview-state' -export type { PreviewActions, PreviewState, UsePreviewStateReturn } from './use-preview-state' diff --git a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts index 3984947ab1d..79249fd84dc 100644 --- a/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts +++ b/web/app/components/datasets/create/step-one/hooks/use-preview-state.ts @@ -4,13 +4,13 @@ import type { NotionPage } from '@/models/common' import type { CrawlResultItem } from '@/models/datasets' import { useCallback, useState } from 'react' -export type PreviewState = { +type PreviewState = { currentFile: File | undefined currentNotionPage: NotionPage | undefined currentWebsite: CrawlResultItem | undefined } -export type PreviewActions = { +type PreviewActions = { showFilePreview: (file: File) => void hideFilePreview: () => void showNotionPagePreview: (page: NotionPage) => void @@ -19,7 +19,7 @@ export type PreviewActions = { hideWebsitePreview: () => void } -export type UsePreviewStateReturn = PreviewState & PreviewActions +type UsePreviewStateReturn = PreviewState & PreviewActions /** * Custom hook for managing preview state across different data source types. diff --git a/web/app/components/datasets/create/step-three/index.module.css b/web/app/components/datasets/create/step-three/index.module.css deleted file mode 100644 index 221c77bb05c..00000000000 --- a/web/app/components/datasets/create/step-three/index.module.css +++ /dev/null @@ -1,77 +0,0 @@ -@reference "../../../../styles/globals.css"; - -.creationInfo { - padding-top: 42px; -} -.creationInfo .title { - @apply mb-2; - font-weight: 500; - font-size: 20px; - line-height: 30px; - color: #101828; -} -.creationInfo .content { - margin-bottom: 44px; - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #667085; -} -.creationInfo .label { - @apply mb-2; - font-weight: 500; - font-size: 14px; - line-height: 20px; - color: #101828; -} -.datasetName { - padding: 8px 12px; - background: #F9FAFB; - border-radius: 8px; - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #101828; - word-break: break-all; -} - -.dividerLine { - margin: 24px 0; - height: 1px; - background-color: #eaecf0; -} - -.sideTip { - @apply flex flex-col items-center shrink-0 ; - padding-top: 108px; - width: 524px; - border-left: 0.5px solid #F2F4F7; -} -.tipCard { - @apply flex flex-col items-start p-6; - width: 320px; - background-color: #F9FAFB; - box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05); - border-radius: 12px; -} -.tipCard .icon { - width: 32px; - height: 32px; - border: 1px solid #EAECF0; - border-radius: 6px; - background: center no-repeat url(../assets/book-open-01.svg); - background-size: 16px; -} -.tipCard .title { - margin: 12px 0; - font-weight: 500; - font-size: 16px; - line-height: 24px; - color: #344054; -} -.tipCard .content { - font-weight: 400; - font-size: 14px; - line-height: 20px; - color: #344054; -} diff --git a/web/app/components/datasets/create/step-two/hooks/index.ts b/web/app/components/datasets/create/step-two/hooks/index.ts index f16daaaea58..b216ead2e6b 100644 --- a/web/app/components/datasets/create/step-two/hooks/index.ts +++ b/web/app/components/datasets/create/step-two/hooks/index.ts @@ -1,14 +1,10 @@ export { useDocumentCreation } from './use-document-creation' -export type { DocumentCreation, ValidationParams } from './use-document-creation' export { IndexingType, useIndexingConfig } from './use-indexing-config' -export type { IndexingConfig } from './use-indexing-config' export { useIndexingEstimate } from './use-indexing-estimate' -export type { IndexingEstimate } from './use-indexing-estimate' export { usePreviewState } from './use-preview-state' -export type { PreviewState } from './use-preview-state' export { DEFAULT_MAXIMUM_CHUNK_LENGTH, DEFAULT_OVERLAP, DEFAULT_SEGMENT_IDENTIFIER, defaultParentChildConfig, MAXIMUM_CHUNK_TOKEN_LENGTH, useSegmentationState } from './use-segmentation-state' -export type { ParentChildConfig, SegmentationState } from './use-segmentation-state' +export type { ParentChildConfig } from './use-segmentation-state' diff --git a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts index eb1994276c1..1c80a188e5b 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-document-creation.ts @@ -14,7 +14,7 @@ import { useInvalidDatasetList } from '@/service/knowledge/use-dataset' import { IndexingType } from './use-indexing-config' import { MAXIMUM_CHUNK_TOKEN_LENGTH } from './use-segmentation-state' -export type UseDocumentCreationOptions = { +type UseDocumentCreationOptions = { datasetId?: string isSetting?: boolean documentDetail?: FullDocumentDetail @@ -34,7 +34,7 @@ export type UseDocumentCreationOptions = { onSave?: () => void mutateDatasetRes?: () => void } -export type ValidationParams = { +type ValidationParams = { segmentationType: string maxChunkLength: number limitMaxChunkLength: number @@ -197,4 +197,3 @@ export const useDocumentCreation = (options: UseDocumentCreationOptions) => { validatePreviewParams, } } -export type DocumentCreation = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts index 97fc9c260fd..a8dd5f22178 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-config.ts @@ -23,7 +23,7 @@ const DEFAULT_RETRIEVAL_CONFIG: RetrievalConfig = { score_threshold: 0.5, } -export type UseIndexingConfigOptions = { +type UseIndexingConfigOptions = { initialIndexType?: IndexingType initialEmbeddingModel?: DefaultModel initialRetrievalConfig?: RetrievalConfig @@ -139,5 +139,3 @@ export const useIndexingConfig = (options: UseIndexingConfigOptions) => { showMultiModalTip, } } - -export type IndexingConfig = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts index cc5a2bcf332..ea14ef2c993 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-indexing-estimate.ts @@ -10,7 +10,7 @@ import { useFetchFileIndexingEstimateForWeb, } from '@/service/knowledge/use-create-dataset' -export type UseIndexingEstimateOptions = { +type UseIndexingEstimateOptions = { dataSourceType: DataSourceType datasetId?: string // Document settings @@ -119,5 +119,3 @@ export const useIndexingEstimate = (options: UseIndexingEstimateOptions) => { reset: currentMutation.reset, } } - -export type IndexingEstimate = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts index 94171c59470..8ac1b7904d1 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-preview-state.ts @@ -3,7 +3,7 @@ import type { CrawlResultItem, CustomFile, DocumentItem, FullDocumentDetail } fr import { useCallback, useState } from 'react' import { DataSourceType } from '@/models/datasets' -export type UsePreviewStateOptions = { +type UsePreviewStateOptions = { dataSourceType: DataSourceType files: CustomFile[] notionPages: NotionPage[] @@ -123,5 +123,3 @@ export const usePreviewState = (options: UsePreviewStateOptions) => { handlePreviewChange, } } - -export type PreviewState = ReturnType diff --git a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts index abef8a98cb5..cdd2f61c0c3 100644 --- a/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts +++ b/web/app/components/datasets/create/step-two/hooks/use-segmentation-state.ts @@ -35,7 +35,7 @@ export const defaultParentChildConfig: ParentChildConfig = { }, } -export type UseSegmentationStateOptions = { +type UseSegmentationStateOptions = { initialSegmentationType?: ProcessMode initialSummaryIndexSetting?: SummaryIndexSettingType } @@ -230,5 +230,3 @@ export const useSegmentationState = (options: UseSegmentationStateOptions = {}) getProcessRule, } } - -export type SegmentationState = ReturnType diff --git a/web/app/components/datasets/documents/components/document-list/components/index.ts b/web/app/components/datasets/documents/components/document-list/components/index.ts index 377f64a27f4..9a279e410f5 100644 --- a/web/app/components/datasets/documents/components/document-list/components/index.ts +++ b/web/app/components/datasets/documents/components/document-list/components/index.ts @@ -1,4 +1,2 @@ -export { default as DocumentSourceIcon } from './document-source-icon' export { default as DocumentTableRow } from './document-table-row' export { default as SortHeader } from './sort-header' -export { renderTdValue } from './utils' diff --git a/web/app/components/datasets/documents/components/document-list/index.tsx b/web/app/components/datasets/documents/components/document-list/index.tsx deleted file mode 100644 index 46fd7a02d53..00000000000 --- a/web/app/components/datasets/documents/components/document-list/index.tsx +++ /dev/null @@ -1,3 +0,0 @@ -// Re-export from parent for backwards compatibility -export { default } from '../list' -export { renderTdValue } from './components' diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts index cda2dae868b..5714f4d8990 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/constants.ts @@ -1,3 +1,2 @@ export const PROGRESS_NOT_STARTED = -1 export const PROGRESS_ERROR = -2 -export const PROGRESS_COMPLETE = 100 diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts index 1f7c9ecfede..667010f661d 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/hooks/use-local-file-upload.ts @@ -4,7 +4,7 @@ import { useCallback, useRef } from 'react' import { useFileUpload } from '@/app/components/datasets/create/file-uploader/hooks/use-file-upload' import { useDataSourceStore, useDataSourceStoreWithSelector } from '../../store' -export type UseLocalFileUploadOptions = { +type UseLocalFileUploadOptions = { allowedExtensions: string[] supportBatchUpload?: boolean } diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx index cb3632ba9d1..93a48f6be7d 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/index.tsx @@ -3,7 +3,7 @@ import FileListItem from './components/file-list-item' import UploadDropzone from './components/upload-dropzone' import { useLocalFileUpload } from './hooks/use-local-file-upload' -export type LocalFileProps = { +type LocalFileProps = { allowedExtensions: string[] supportBatchUpload?: boolean } diff --git a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx index b0f25d94b7f..fc56e05b434 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/data-source/website-crawl/index.tsx @@ -31,7 +31,7 @@ import Options from './base/options' const I18N_PREFIX = 'stepOne.website' -export type WebsiteCrawlProps = { +type WebsiteCrawlProps = { nodeId: string nodeData: DataSourceNodeType onCredentialChange: (credentialId: string) => void diff --git a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx index 2e85dad26a8..7382d1abd1b 100644 --- a/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx +++ b/web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx @@ -16,7 +16,7 @@ import { useFileUploadConfig } from '@/service/use-common' import { Theme } from '@/types/app' import { cn } from '@/utils/classnames' -export type Props = { +type Props = { file: FileItem | undefined updateFile: (file?: FileItem) => void } diff --git a/web/app/components/datasets/documents/detail/batch-modal/index.tsx b/web/app/components/datasets/documents/detail/batch-modal/index.tsx index 1fc006831e4..ff43f5f67dc 100644 --- a/web/app/components/datasets/documents/detail/batch-modal/index.tsx +++ b/web/app/components/datasets/documents/detail/batch-modal/index.tsx @@ -11,7 +11,7 @@ import Modal from '@/app/components/base/modal' import CSVDownloader from './csv-downloader' import CSVUploader from './csv-uploader' -export type IBatchModalProps = { +type IBatchModalProps = { isShow: boolean docForm: ChunkingMode onCancel: () => void diff --git a/web/app/components/datasets/documents/detail/completed/hooks/index.ts b/web/app/components/datasets/documents/detail/completed/hooks/index.ts index 858b4485630..1a6ed8bd0e0 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/index.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/index.ts @@ -1,14 +1,9 @@ export { useChildSegmentData } from './use-child-segment-data' -export type { UseChildSegmentDataReturn } from './use-child-segment-data' export { useModalState } from './use-modal-state' -export type { CurrChildChunkType, CurrSegmentType, UseModalStateReturn } from './use-modal-state' export { useSearchFilter } from './use-search-filter' -export type { UseSearchFilterReturn } from './use-search-filter' export { useSegmentListData } from './use-segment-list-data' -export type { UseSegmentListDataReturn } from './use-segment-list-data' export { useSegmentSelection } from './use-segment-selection' -export type { UseSegmentSelectionReturn } from './use-segment-selection' diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts index 50a22fc71f6..fab8b160194 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-child-segment-data.ts @@ -8,7 +8,7 @@ import { useChildSegmentList, useChildSegmentListKey, useDeleteChildSegment, use import { useInvalid } from '@/service/use-base' import { useDocumentContext } from '../../context' -export type UseChildSegmentDataOptions = { +type UseChildSegmentDataOptions = { searchValue: string currentPage: number limit: number @@ -19,7 +19,7 @@ export type UseChildSegmentDataOptions = { refreshChunkListDataWithDetailChanged: () => void updateSegmentInCache: (segmentId: string, updater: (seg: SegmentDetailModel) => SegmentDetailModel) => void } -export type UseChildSegmentDataReturn = { +type UseChildSegmentDataReturn = { childSegments: ChildChunkDetail[] isLoadingChildSegmentList: boolean childChunkListData: ReturnType['data'] diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts index ecb45ac1ee3..fa314bec258 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-modal-state.ts @@ -1,18 +1,18 @@ import type { ChildChunkDetail, SegmentDetailModel } from '@/models/datasets' import { useCallback, useState } from 'react' -export type CurrSegmentType = { +type CurrSegmentType = { segInfo?: SegmentDetailModel showModal: boolean isEditMode?: boolean } -export type CurrChildChunkType = { +type CurrChildChunkType = { childChunkInfo?: ChildChunkDetail showModal: boolean } -export type UseModalStateReturn = { +type UseModalStateReturn = { // Segment detail modal currSegment: CurrSegmentType onClickCard: (detail: SegmentDetailModel, isEditMode?: boolean) => void diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts index e7fafa692d8..310e326fc1e 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-search-filter.ts @@ -3,13 +3,7 @@ import { useDebounceFn } from 'ahooks' import { useCallback, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' -export type SearchFilterState = { - inputValue: string - searchValue: string - selectedStatus: boolean | 'all' -} - -export type UseSearchFilterReturn = { +type UseSearchFilterReturn = { inputValue: string searchValue: string selectedStatus: boolean | 'all' diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts index fb5db4497e6..3a3c486070e 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-list-data.ts @@ -14,7 +14,7 @@ import { useDocumentContext } from '../../context' import { ProcessStatus } from '../../segment-add' const DEFAULT_LIMIT = 10 -export type UseSegmentListDataOptions = { +type UseSegmentListDataOptions = { searchValue: string selectedStatus: boolean | 'all' selectedSegmentIds: string[] @@ -24,7 +24,7 @@ export type UseSegmentListDataOptions = { onCloseSegmentDetail: () => void clearSelection: () => void } -export type UseSegmentListDataReturn = { +type UseSegmentListDataReturn = { segments: SegmentDetailModel[] isLoadingSegmentList: boolean segmentListData: ReturnType['data'] diff --git a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts index b1adeedaf4c..e0fb0b036f0 100644 --- a/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts +++ b/web/app/components/datasets/documents/detail/completed/hooks/use-segment-selection.ts @@ -1,7 +1,7 @@ import type { SegmentDetailModel } from '@/models/datasets' import { useCallback, useMemo, useState } from 'react' -export type UseSegmentSelectionReturn = { +type UseSegmentSelectionReturn = { selectedSegmentIds: string[] isAllSelected: boolean isSomeSelected: boolean diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts index 603c16dda53..2d0c4fa25eb 100644 --- a/web/app/components/datasets/documents/detail/embedding/hooks/index.ts +++ b/web/app/components/datasets/documents/detail/embedding/hooks/index.ts @@ -1,10 +1,7 @@ export { - calculatePercent, - isEmbeddingStatus, - isTerminalStatus, + useEmbeddingStatus, - useInvalidateEmbeddingStatus, + usePauseIndexing, useResumeIndexing, } from './use-embedding-status' -export type { EmbeddingStatusType } from './use-embedding-status' diff --git a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts index e55cd8f9aa6..5f9314e695e 100644 --- a/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts +++ b/web/app/components/datasets/documents/detail/embedding/hooks/use-embedding-status.ts @@ -10,8 +10,6 @@ import { const NAME_SPACE = 'embedding' -export type EmbeddingStatusType = 'indexing' | 'splitting' | 'parsing' | 'cleaning' | 'completed' | 'paused' | 'error' | 'waiting' | '' - const EMBEDDING_STATUSES = ['indexing', 'splitting', 'parsing', 'cleaning'] as const const TERMINAL_STATUSES = ['completed', 'error', 'paused'] as const diff --git a/web/app/components/datasets/documents/detail/embedding/style.module.css b/web/app/components/datasets/documents/detail/embedding/style.module.css deleted file mode 100644 index a60a583ebef..00000000000 --- a/web/app/components/datasets/documents/detail/embedding/style.module.css +++ /dev/null @@ -1,61 +0,0 @@ -@reference "../../../../../styles/globals.css"; - -.progressBar { - @apply absolute top-0 h-4; -} -.barPaused { - background: linear-gradient( - 270deg, - rgba(208, 213, 221, 0.8) -2.21%, - rgba(208, 213, 221, 0.5) 100% - ); -} -.barProcessing { - background: linear-gradient( - 90deg, - rgba(41, 112, 255, 0.9) 0%, - rgba(21, 94, 239, 0.9) 100% - ); -} -.opBtn { - @apply !h-6 !w-fit !px-2 !py-1 !text-xs !text-gray-700 rounded-md; -} -.opIcon { - @apply mr-1 stroke-current text-gray-700 w-3 h-3; -} -.progressContainer { - @apply relative flex mb-2 h-4 rounded-md w-full; -} -.progressBgItem { - @apply flex-1 border-r border-r-white first:rounded-l-md; -} -.progressBgItem:nth-last-child(2) { - @apply rounded-r-md; -} -.progressData { - @apply w-full flex items-center text-xs text-gray-700; -} -.previewTip { - @apply pb-1 pt-12 text-gray-900 text-sm font-medium; -} -.embeddingStatus { - @apply flex items-center justify-between text-gray-900 font-medium text-base mb-3; -} -.commonIcon { - @apply w-3 h-3 mr-1 inline-block align-middle; -} -.highIcon { - mask-image: url(../../assets/star.svg); - @apply bg-orange-500; -} -.economyIcon { - background-color: #444ce7; - mask-image: url(../../assets/normal.svg); -} -.tokens { - @apply text-xs font-medium px-1; -} -.price { - color: #f79009; - @apply text-xs font-medium; -} diff --git a/web/app/components/datasets/documents/detail/segment-add/index.tsx b/web/app/components/datasets/documents/detail/segment-add/index.tsx index 0abfda328b7..dbd9f0b5e5d 100644 --- a/web/app/components/datasets/documents/detail/segment-add/index.tsx +++ b/web/app/components/datasets/documents/detail/segment-add/index.tsx @@ -17,7 +17,7 @@ import { Plan } from '@/app/components/billing/type' import { useProviderContext } from '@/context/provider-context' import { cn } from '@/utils/classnames' -export type ISegmentAddProps = { +type ISegmentAddProps = { importStatus: ProcessStatus | string | undefined clearProcessStatus: () => void showNewSegmentModal: () => void diff --git a/web/app/components/datasets/formatted-text/flavours/shared.tsx b/web/app/components/datasets/formatted-text/flavours/shared.tsx index 77637f4bb24..4f68177ea39 100644 --- a/web/app/components/datasets/formatted-text/flavours/shared.tsx +++ b/web/app/components/datasets/formatted-text/flavours/shared.tsx @@ -3,7 +3,7 @@ import { cn } from '@/utils/classnames' const baseStyle = 'py-[3px]' -export type SliceContainerProps = ComponentProps<'span'> +type SliceContainerProps = ComponentProps<'span'> export const SliceContainer: FC = ( { @@ -22,7 +22,7 @@ export const SliceContainer: FC = ( } SliceContainer.displayName = 'SliceContainer' -export type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string } +type SliceLabelProps = ComponentProps<'span'> & { labelInnerClassName?: string } export const SliceLabel: FC = ( { @@ -45,7 +45,7 @@ export const SliceLabel: FC = ( } SliceLabel.displayName = 'SliceLabel' -export type SliceContentProps = ComponentProps<'span'> +type SliceContentProps = ComponentProps<'span'> export const SliceContent: FC = ( { @@ -66,7 +66,7 @@ export const SliceContent: FC = ( } SliceContent.displayName = 'SliceContent' -export type SliceDividerProps = ComponentProps<'span'> +type SliceDividerProps = ComponentProps<'span'> export const SliceDivider: FC = ( { diff --git a/web/app/components/datasets/formatted-text/formatted.tsx b/web/app/components/datasets/formatted-text/formatted.tsx index 0c1aad6d21d..21036ac6f31 100644 --- a/web/app/components/datasets/formatted-text/formatted.tsx +++ b/web/app/components/datasets/formatted-text/formatted.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC } from 'react' import { cn } from '@/utils/classnames' -export type FormattedTextProps = ComponentProps<'p'> +type FormattedTextProps = ComponentProps<'p'> export const FormattedText: FC = (props) => { const { className, ...rest } = props diff --git a/web/app/components/datasets/hit-testing/components/mask.tsx b/web/app/components/datasets/hit-testing/components/mask.tsx index 4568bce5a95..4510e38430c 100644 --- a/web/app/components/datasets/hit-testing/components/mask.tsx +++ b/web/app/components/datasets/hit-testing/components/mask.tsx @@ -5,7 +5,7 @@ type MaskProps = { className?: string } -export const Mask = ({ +const Mask = ({ className, }: MaskProps) => { return ( diff --git a/web/app/components/datasets/preview/container.tsx b/web/app/components/datasets/preview/container.tsx index 9bba6054a97..ed63bbc8c58 100644 --- a/web/app/components/datasets/preview/container.tsx +++ b/web/app/components/datasets/preview/container.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC, ReactNode } from 'react' import { cn } from '@/utils/classnames' -export type PreviewContainerProps = ComponentProps<'div'> & { +type PreviewContainerProps = ComponentProps<'div'> & { header: ReactNode mainClassName?: string ref?: React.Ref diff --git a/web/app/components/datasets/preview/header.tsx b/web/app/components/datasets/preview/header.tsx index 0124d03e881..2da4e497a4d 100644 --- a/web/app/components/datasets/preview/header.tsx +++ b/web/app/components/datasets/preview/header.tsx @@ -1,7 +1,7 @@ import type { ComponentProps, FC } from 'react' import { cn } from '@/utils/classnames' -export type PreviewHeaderProps = Omit, 'title'> & { +type PreviewHeaderProps = Omit, 'title'> & { title: string } diff --git a/web/app/components/datasets/settings/permission-selector/index.tsx b/web/app/components/datasets/settings/permission-selector/index.tsx index 5afb56f0a99..a83beffbb40 100644 --- a/web/app/components/datasets/settings/permission-selector/index.tsx +++ b/web/app/components/datasets/settings/permission-selector/index.tsx @@ -17,7 +17,7 @@ import { cn } from '@/utils/classnames' import MemberItem from './member-item' import Item from './permission-item' -export type RoleSelectorProps = { +type RoleSelectorProps = { disabled?: boolean permission?: DatasetPermission value: string[] diff --git a/web/app/components/devtools/react-grab/loader.tsx b/web/app/components/devtools/react-grab/loader.tsx deleted file mode 100644 index 4ee9ad1236f..00000000000 --- a/web/app/components/devtools/react-grab/loader.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { IS_DEV } from '@/config' -import Script from '@/next/script' - -export function ReactGrabLoader() { - if (!IS_DEV) - return null - - return ( - <> -