diff --git a/web/app/components/base/drawer-plus/index.tsx b/web/app/components/base/drawer-plus/index.tsx index 894bea20d8..51402572b7 100644 --- a/web/app/components/base/drawer-plus/index.tsx +++ b/web/app/components/base/drawer-plus/index.tsx @@ -58,15 +58,15 @@ const DrawerPlus: FC = ({ panelClassname={cn('mt-16 mx-2 sm:mr-2 mb-3 !p-0 rounded-xl', panelClassName, maxWidthClassName)} >
-
+
-
+
{title}
@@ -74,12 +74,12 @@ const DrawerPlus: FC = ({ onClick={onHide} className='flex justify-center items-center w-6 h-6 cursor-pointer' > - +
{titleDescription && ( -
+
{titleDescription}
)} diff --git a/web/app/components/base/drawer/index.tsx b/web/app/components/base/drawer/index.tsx index c2285b5c53..c1d7565882 100644 --- a/web/app/components/base/drawer/index.tsx +++ b/web/app/components/base/drawer/index.tsx @@ -49,18 +49,18 @@ export default function Drawer({ -
+
<> {title && {title} } {showClose && - + } - {description && {description}} + {description && {description}} {children} {footer || (footer === null diff --git a/web/app/components/base/emoji-picker/Inner.tsx b/web/app/components/base/emoji-picker/Inner.tsx index 3d1d1dbb14..26b85d130c 100644 --- a/web/app/components/base/emoji-picker/Inner.tsx +++ b/web/app/components/base/emoji-picker/Inner.tsx @@ -7,9 +7,10 @@ import { init } from 'emoji-mart' import { MagnifyingGlassIcon, } from '@heroicons/react/24/outline' -import cn from '@/utils/classnames' +import Input from '@/app/components/base/input' import Divider from '@/app/components/base/divider' import { searchEmoji } from '@/utils/emoji' +import cn from '@/utils/classnames' declare global { // eslint-disable-next-line ts/no-namespace @@ -72,12 +73,12 @@ const EmojiPickerInner: FC = ({
-
- ) => { if (e.target.value === '') { @@ -92,12 +93,12 @@ const EmojiPickerInner: FC = ({ />
- +
{isSearching && <>
-

Search

+

Search

{searchedEmojis.map((emoji: string, index: number) => { return
= ({ setSelectedEmoji(emoji) }} > -
+
@@ -118,7 +119,7 @@ const EmojiPickerInner: FC = ({ {categories.map((category, index: number) => { return
-

{category.id}

+

{category.id}

{category.emojis.map((emoji, index: number) => { return
= ({ setSelectedEmoji(emoji) }} > -
+
@@ -141,7 +142,7 @@ const EmojiPickerInner: FC = ({ {/* Color Select */}
-

Choose Style

+

Choose Style

{backgroundColors.map((color) => { return
= ({ 'cursor-pointer', 'hover:ring-1 ring-offset-1', 'inline-flex w-10 h-10 rounded-lg items-center justify-center', - color === selectedBackground ? 'ring-1 ring-gray-300' : '', + color === selectedBackground ? 'ring-1 ring-components-input-border-hover' : '', )} onClick={() => { setSelectedBackground(color) diff --git a/web/app/components/base/emoji-picker/index.tsx b/web/app/components/base/emoji-picker/index.tsx index 3add14879a..16b07eddaf 100644 --- a/web/app/components/base/emoji-picker/index.tsx +++ b/web/app/components/base/emoji-picker/index.tsx @@ -2,7 +2,6 @@ import type { FC } from 'react' import React, { useCallback, useState } from 'react' import { useTranslation } from 'react-i18next' -import s from './style.module.css' import EmojiPickerInner from './Inner' import cn from '@/utils/classnames' import Divider from '@/app/components/base/divider' @@ -37,12 +36,12 @@ const EmojiPicker: FC = ({ isShow closable={false} wrapperClassName={className} - className={cn(s.container, '!w-[362px] !p-0')} + className={cn('flex flex-col max-h-[552px] border-[0.5px] border-divider-subtle rounded-xl shadow-xl p-0')} > - +
{showImportFromUrl && ( -
+
- setImportUrl(e.target.value)} @@ -95,11 +96,11 @@ const GetSchema: FC = ({ className='space-x-1' onClick={() => { setShowExamples(!showExamples) }} > -
{t('tools.createTool.examples')}
+
{t('tools.createTool.examples')}
{showExamples && ( -
+
{examples.map(item => (
= ({ onChange(item.content) setShowExamples(false) }} - className='px-3 py-1.5 rounded-lg hover:bg-gray-50 leading-5 text-sm font-normal text-gray-700 cursor-pointer whitespace-nowrap' + className='px-3 py-1.5 rounded-lg hover:bg-components-panel-on-panel-item-bg-hover leading-5 system-sm-regular text-text-secondary cursor-pointer whitespace-nowrap' > {t(`tools.createTool.exampleOptions.${item.key}`)}
diff --git a/web/app/components/tools/edit-custom-collection-modal/index.tsx b/web/app/components/tools/edit-custom-collection-modal/index.tsx index 555fd0dd08..786d3a4625 100644 --- a/web/app/components/tools/edit-custom-collection-modal/index.tsx +++ b/web/app/components/tools/edit-custom-collection-modal/index.tsx @@ -3,8 +3,9 @@ import type { FC } from 'react' import React, { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import { useDebounce, useGetState } from 'ahooks' +import { RiSettings2Line } from '@remixicon/react' import produce from 'immer' -import { LinkExternal02, Settings01 } from '../../base/icons/src/vender/line/general' +import { LinkExternal02 } from '../../base/icons/src/vender/line/general' import type { Credential, CustomCollectionBackend, CustomParamSchema, Emoji } from '../types' import { AuthHeaderPrefix, AuthType } from '../types' import GetSchema from './get-schema' @@ -21,7 +22,6 @@ import { parseParamsSchema } from '@/service/tools' import LabelSelector from '@/app/components/tools/labels/selector' import Toast from '@/app/components/base/toast' -const fieldNameClassNames = 'py-2 leading-5 text-sm font-medium text-gray-900' type Props = { positionLeft?: boolean payload: any @@ -189,12 +189,12 @@ const EditCustomCollectionModal: FC = ({ panelClassName='mt-2 !w-[640px]' maxWidthClassName='!max-w-[640px]' height='calc(100vh - 16px)' - headerClassName='!border-b-black/5' + headerClassName='!border-b-divider-regular' body={
-
{t('tools.createTool.name')} *
+
{t('tools.createTool.name')} *
{ setShowEmojiPicker(true) }} className='cursor-pointer' icon={emoji.content} background={emoji.background} /> = ({
-
{t('tools.createTool.schema')}*
-
+
{t('tools.createTool.schema')}*
+
{t('tools.createTool.viewSchemaSpec')}
@@ -238,11 +238,11 @@ const EditCustomCollectionModal: FC = ({ {/* Available Tools */}
-
{t('tools.createTool.availableTools.title')}
-
- - - 0 && 'border-b', 'border-gray-200')}> +
{t('tools.createTool.availableTools.title')}
+
+
+ + 0 && 'border-b', 'border-divider-regular')}> @@ -252,9 +252,9 @@ const EditCustomCollectionModal: FC = ({ {paramsSchemas.map((item, index) => ( - + - +
{t('tools.createTool.availableTools.name')} {t('tools.createTool.availableTools.description')} {t('tools.createTool.availableTools.method')}
{item.operation_id}{item.summary}{item.summary} {item.method} {getPath(item.server_url)} @@ -277,22 +277,22 @@ const EditCustomCollectionModal: FC = ({ {/* Authorization method */}
-
{t('tools.createTool.authMethod.title')}
-
setCredentialsModalShow(true)}> -
{t(`tools.createTool.authMethod.types.${credential.auth_type}`)}
- +
{t('tools.createTool.authMethod.title')}
+
setCredentialsModalShow(true)}> +
{t(`tools.createTool.authMethod.types.${credential.auth_type}`)}
+
{/* Labels */}
-
{t('tools.createTool.toolInput.label')}
+
{t('tools.createTool.toolInput.label')}
{/* Privacy Policy */}
-
{t('tools.createTool.privacyPolicy')}
+
{t('tools.createTool.privacyPolicy')}
{ @@ -305,7 +305,7 @@ const EditCustomCollectionModal: FC = ({
-
{t('tools.createTool.customDisclaimer')}
+
{t('tools.createTool.customDisclaimer')}
{ @@ -318,10 +318,10 @@ const EditCustomCollectionModal: FC = ({
-
+
{ isEdit && ( - + ) }
diff --git a/web/app/components/tools/edit-custom-collection-modal/modal.tsx b/web/app/components/tools/edit-custom-collection-modal/modal.tsx index 099012b277..0b4447850c 100644 --- a/web/app/components/tools/edit-custom-collection-modal/modal.tsx +++ b/web/app/components/tools/edit-custom-collection-modal/modal.tsx @@ -21,7 +21,6 @@ import Toast from '@/app/components/base/toast' import Modal from '../../base/modal' import Button from '@/app/components/base/button' -const fieldNameClassNames = 'py-2 leading-5 text-sm font-medium text-gray-900' type Props = { positionLeft?: boolean payload: any @@ -187,12 +186,12 @@ const EditCustomCollectionModal: FC = ({ className='!p-0 !max-w-[630px] !h-[calc(100vh-16px)]' >
-
+
{t('tools.createTool.title')}
-
{t('tools.createTool.name')} *
+
{t('tools.createTool.name')} *
{ setShowEmojiPicker(true) }} className='cursor-pointer' icon={emoji.content} background={emoji.background} /> = ({
-
{t('tools.createTool.schema')}*
-
+
{t('tools.createTool.schema')}*
+
{t('tools.createTool.viewSchemaSpec')}
@@ -236,11 +235,11 @@ const EditCustomCollectionModal: FC = ({ {/* Available Tools */}
-
{t('tools.createTool.availableTools.title')}
-
- - - 0 && 'border-b', 'border-gray-200')}> +
{t('tools.createTool.availableTools.title')}
+
+
+ + 0 && 'border-b', 'border-divider-regular')}> @@ -250,9 +249,9 @@ const EditCustomCollectionModal: FC = ({ {paramsSchemas.map((item, index) => ( - + - +
{t('tools.createTool.availableTools.name')} {t('tools.createTool.availableTools.description')} {t('tools.createTool.availableTools.method')}
{item.operation_id}{item.summary}{item.summary} {item.method} {getPath(item.server_url)} @@ -275,22 +274,22 @@ const EditCustomCollectionModal: FC = ({ {/* Authorization method */}
-
{t('tools.createTool.authMethod.title')}
-
setCredentialsModalShow(true)}> -
{t(`tools.createTool.authMethod.types.${credential.auth_type}`)}
- +
{t('tools.createTool.authMethod.title')}
+
setCredentialsModalShow(true)}> +
{t(`tools.createTool.authMethod.types.${credential.auth_type}`)}
+
{/* Labels */}
-
{t('tools.createTool.toolInput.label')}
+
{t('tools.createTool.toolInput.label')}
{/* Privacy Policy */}
-
{t('tools.createTool.privacyPolicy')}
+
{t('tools.createTool.privacyPolicy')}
{ @@ -303,7 +302,7 @@ const EditCustomCollectionModal: FC = ({
-
{t('tools.createTool.customDisclaimer')}
+
{t('tools.createTool.customDisclaimer')}
{ @@ -316,10 +315,10 @@ const EditCustomCollectionModal: FC = ({
-
+
{ isEdit && ( - + ) }
diff --git a/web/app/components/tools/edit-custom-collection-modal/test-api.tsx b/web/app/components/tools/edit-custom-collection-modal/test-api.tsx index 80a08d07a9..3172110bf6 100644 --- a/web/app/components/tools/edit-custom-collection-modal/test-api.tsx +++ b/web/app/components/tools/edit-custom-collection-modal/test-api.tsx @@ -3,10 +3,11 @@ import type { FC } from 'react' import React, { useState } from 'react' import { useTranslation } from 'react-i18next' import { useContext } from 'use-context-selector' -import { Settings01 } from '../../base/icons/src/vender/line/general' +import { RiSettings2Line } from '@remixicon/react' import ConfigCredentials from './config-credentials' import { AuthType, type Credential, type CustomCollectionBackend, type CustomParamSchema } from '@/app/components/tools/types' import Button from '@/app/components/base/button' +import Input from '@/app/components/base/input' import Drawer from '@/app/components/base/drawer-plus' import I18n from '@/context/i18n' import { testAPIAvailable } from '@/service/tools' @@ -19,8 +20,6 @@ type Props = { onHide: () => void } -const keyClassNames = 'py-2 leading-5 text-sm font-medium text-gray-900' - const TestApi: FC = ({ positionCenter, customCollection, @@ -65,39 +64,40 @@ const TestApi: FC = ({ panelClassName='mt-2 !w-[600px]' maxWidthClassName='!max-w-[600px]' height='calc(100vh - 16px)' - headerClassName='!border-b-black/5' + headerClassName='!border-b-divider-regular' body={
-
{t('tools.createTool.authMethod.title')}
-
setCredentialsModalShow(true)}> -
{t(`tools.createTool.authMethod.types.${tempCredential.auth_type}`)}
- +
{t('tools.createTool.authMethod.title')}
+
setCredentialsModalShow(true)}> +
{t(`tools.createTool.authMethod.types.${tempCredential.auth_type}`)}
+
-
{t('tools.test.parametersValue')}
-
- - - +
{t('tools.test.parametersValue')}
+
+
+ + {parameters.map((item, index) => ( - + ))} @@ -110,11 +110,11 @@ const TestApi: FC = ({
-
{t('tools.test.testResult')}
+
{t('tools.test.testResult')}
-
- {result || {t('tools.test.testResultPlaceholder')}} +
+ {result || {t('tools.test.testResultPlaceholder')}}
diff --git a/web/app/components/tools/labels/filter.tsx b/web/app/components/tools/labels/filter.tsx index 8f6e954b92..87e65b5b4e 100644 --- a/web/app/components/tools/labels/filter.tsx +++ b/web/app/components/tools/labels/filter.tsx @@ -67,24 +67,23 @@ const LabelFilter: FC = ({ className='block' >
- +
-
+
{!value.length && t('common.tag.placeholder')} {!!value.length && currentLabel?.label}
{value.length > 1 && ( -
{`+${value.length - 1}`}
+
{`+${value.length - 1}`}
)} {!value.length && (
- +
)} {!!value.length && ( @@ -92,14 +91,14 @@ const LabelFilter: FC = ({ e.stopPropagation() onChange([]) }}> - +
)}
-
-
+
+
= ({ {filteredLabelList.map(label => (
selectLabel(label)} > -
{label.label}
- {value.includes(label.name) && } +
{label.label}
+ {value.includes(label.name) && }
))} {!filteredLabelList.length && (
- -
{t('common.tag.noTag')}
+ +
{t('common.tag.noTag')}
)}
diff --git a/web/app/components/tools/labels/selector.tsx b/web/app/components/tools/labels/selector.tsx index 88b910e87c..26cfc3ad9b 100644 --- a/web/app/components/tools/labels/selector.tsx +++ b/web/app/components/tools/labels/selector.tsx @@ -66,21 +66,21 @@ const LabelSelector: FC = ({ className='block' >
-
0 ? selectedLabels : ''} className={cn('grow text-[13px] leading-[18px] text-gray-700 truncate', !value.length && '!text-gray-400')}> +
0 ? selectedLabels : ''} className={cn('grow text-[13px] leading-[18px] text-text-secondary truncate', !value.length && '!text-text-quaternary')}> {!value.length && t('tools.createTool.toolInput.labelPlaceholder')} {!!value.length && selectedLabels}
-
+
-
-
+
+
= ({ {filteredLabelList.map(label => (
selectLabel(label)} > = ({ checked={value.includes(label.name)} onCheck={() => { }} /> -
{label.label}
+
{label.label}
))} {!filteredLabelList.length && (
- -
{t('common.tag.noTag')}
+ +
{t('common.tag.noTag')}
)}
diff --git a/web/app/components/tools/provider-list.tsx b/web/app/components/tools/provider-list.tsx index a4dc602351..148612bedc 100644 --- a/web/app/components/tools/provider-list.tsx +++ b/web/app/components/tools/provider-list.tsx @@ -63,13 +63,13 @@ const ProviderList = () => { return ( <> -
+
{ {(filteredCollectionList.length > 0 || activeTab !== 'builtin') && (
{activeTab === 'api' && } {filteredCollectionList.map(collection => ( diff --git a/web/app/components/tools/provider/custom-create-card.tsx b/web/app/components/tools/provider/custom-create-card.tsx index 424a077527..9ae1714a27 100644 --- a/web/app/components/tools/provider/custom-create-card.tsx +++ b/web/app/components/tools/provider/custom-create-card.tsx @@ -45,16 +45,16 @@ const Contribute = ({ onRefreshData }: Props) => { return ( <> {isCurrentWorkspaceManager && ( -
-
setIsShowEditCustomCollectionModal(true)}> +
+
setIsShowEditCustomCollectionModal(true)}>
-
- +
+
-
{t('tools.createCustomTool')}
+
{t('tools.createCustomTool')}
-
+
{t('tools.customToolTip')}
diff --git a/web/app/components/tools/provider/detail.tsx b/web/app/components/tools/provider/detail.tsx index 93b728e4c5..66f2df935d 100644 --- a/web/app/components/tools/provider/detail.tsx +++ b/web/app/components/tools/provider/detail.tsx @@ -260,14 +260,14 @@ const ProviderDetail = ({ {!!collection.description[language] && ( )} -
+
{collection.type === CollectionType.custom && !isDetailLoading && ( )} {collection.type === CollectionType.workflow && !isDetailLoading && customCollection && ( @@ -276,8 +276,8 @@ const ProviderDetail = ({ variant='primary' className={cn('shrink-0 my-3 w-[183px]')} > - -
{t('tools.openInStudio')}
+
+
{t('tools.openInStudio')}
@@ -286,7 +286,7 @@ const ProviderDetail = ({ onClick={() => setIsShowEditWorkflowToolModal(true)} disabled={!isCurrentWorkspaceManager} > -
{t('tools.createTool.editAction')}
+
{t('tools.createTool.editAction')}
)} @@ -319,7 +319,7 @@ const ProviderDetail = ({
{t('tools.includeToolNum', { num: toolList.length }).toLocaleUpperCase()} ยท - {t('tools.auth.setup').toLocaleUpperCase()} + {t('tools.auth.setup').toLocaleUpperCase()}
- +
diff --git a/web/app/components/tools/workflow-tool/confirm-modal/style.module.css b/web/app/components/tools/workflow-tool/confirm-modal/style.module.css deleted file mode 100644 index 14367ec575..0000000000 --- a/web/app/components/tools/workflow-tool/confirm-modal/style.module.css +++ /dev/null @@ -1,3 +0,0 @@ -.bg { - background: linear-gradient(180deg, rgba(247, 144, 9, 0.05) 0%, rgba(247, 144, 9, 0.00) 24.41%), #F9FAFB; -} diff --git a/web/app/components/tools/workflow-tool/index.tsx b/web/app/components/tools/workflow-tool/index.tsx index 47f72d1a75..c4eb07dfe6 100644 --- a/web/app/components/tools/workflow-tool/index.tsx +++ b/web/app/components/tools/workflow-tool/index.tsx @@ -17,7 +17,7 @@ import LabelSelector from '@/app/components/tools/labels/selector' import ConfirmModal from '@/app/components/tools/workflow-tool/confirm-modal' import Tooltip from '@/app/components/base/tooltip' -interface Props { +type Props = { isAdd?: boolean payload: any onHide: () => void @@ -124,13 +124,13 @@ const WorkflowToolAsModal: FC = ({ panelClassName='mt-2 !w-[640px]' maxWidthClassName='!max-w-[640px]' height='calc(100vh - 16px)' - headerClassName='!border-b-black/5' + headerClassName='!border-b-divider' body={
{/* name & icon */}
-
{t('tools.createTool.name')} *
+
{t('tools.createTool.name')} *
{ setShowEmojiPicker(true) }} className='cursor-pointer' iconType='emoji' icon={emoji.content} background={emoji.background} /> = ({
{/* name for tool call */}
-
+
{t('tools.createTool.nameForToolCall')} * = ({
{/* description */}
-
{t('tools.createTool.description')}
+
{t('tools.createTool.description')}
{t('tools.test.parameters')} {t('tools.test.value')}
{item.label[language]} - setParametersValue({ ...parametersValue, [item.name]: e.target.value })} - type='text' className='px-3 h-[34px] w-full outline-none focus:bg-gray-100' > + type='text' + className='!bg-transparent !border-transparent !hover:border-transparent !hover:bg-transparent !focus:border-transparent !focus:bg-transparent' />