From 06fe17c93edf5d8a73d144ffb0cbd42c349d7222 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 9 Jan 2025 13:45:21 +0800 Subject: [PATCH 1/4] chore: enchance fold into anim --- web/app/components/header/plugins-nav/index.tsx | 2 +- .../plugins/install-plugin/hooks/use-fold-anim-into.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/header/plugins-nav/index.tsx b/web/app/components/header/plugins-nav/index.tsx index b2c6eba1a6..ab742c98cf 100644 --- a/web/app/components/header/plugins-nav/index.tsx +++ b/web/app/components/header/plugins-nav/index.tsx @@ -27,7 +27,7 @@ const PluginsNav = ({ return (
void) => { const foldIntoAnim = async () => { clearCountDown() const modalElem = document.querySelector(`.${modalClassName}`) as HTMLElement - const pluginTaskTriggerElem = document.getElementById('plugin-task-trigger') + const pluginTaskTriggerElem = document.getElementById('plugin-task-trigger') || document.querySelector('.plugins-nav-button') if (!modalElem || !pluginTaskTriggerElem) { onClose() From dc9675d2d86095dce53c8f5a071a4787ab002244 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 9 Jan 2025 13:53:07 +0800 Subject: [PATCH 2/4] fix: plugin tool width in agent app --- web/app/components/workflow/block-selector/all-tools.tsx | 1 + .../workflow/block-selector/market-place-plugin/list.tsx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow/block-selector/all-tools.tsx b/web/app/components/workflow/block-selector/all-tools.tsx index 9f0596d9b1..0100d4ede8 100644 --- a/web/app/components/workflow/block-selector/all-tools.tsx +++ b/web/app/components/workflow/block-selector/all-tools.tsx @@ -144,6 +144,7 @@ const AllTools = ({ wrapElemRef={wrapElemRef} list={notInstalledPlugins as any} ref={pluginRef} searchText={searchText} + toolContentClassName={toolContentClassName} tags={tags} />
diff --git a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx index f177d1ac60..0c381c2a39 100644 --- a/web/app/components/workflow/block-selector/market-place-plugin/list.tsx +++ b/web/app/components/workflow/block-selector/market-place-plugin/list.tsx @@ -15,6 +15,7 @@ type Props = { list: Plugin[] searchText: string tags: string[] + toolContentClassName?: string disableMaxWidth?: boolean } @@ -23,6 +24,7 @@ const List = forwardRef<{ handleScroll: () => void }, Props>(({ searchText, tags, list, + toolContentClassName, disableMaxWidth = false, }, ref) => { const { t } = useTranslation() @@ -76,7 +78,7 @@ const List = forwardRef<{ handleScroll: () => void }, Props>(({ ) } - const maxWidthClassName = 'max-w-[300px]' + const maxWidthClassName = toolContentClassName || 'max-w-[300px]' return ( <> From d7ec013665c78be0da347e1d83cbd1e4521ecfc6 Mon Sep 17 00:00:00 2001 From: JzoNg Date: Thu, 9 Jan 2025 14:03:15 +0800 Subject: [PATCH 3/4] modals of app overview --- .../app/overview/customize/index.tsx | 36 ++++++------ .../app/overview/embedded/index.tsx | 43 +++++++++------ .../app/overview/settings/index.tsx | 55 ++++++++++--------- .../app/overview/settings/style.module.css | 18 ------ 4 files changed, 73 insertions(+), 79 deletions(-) delete mode 100644 web/app/components/app/overview/settings/style.module.css diff --git a/web/app/components/app/overview/customize/index.tsx b/web/app/components/app/overview/customize/index.tsx index d53aa00a6f..2925ba41ee 100644 --- a/web/app/components/app/overview/customize/index.tsx +++ b/web/app/components/app/overview/customize/index.tsx @@ -21,7 +21,7 @@ type IShareLinkProps = { } const StepNum: FC<{ children: React.ReactNode }> = ({ children }) => -
+
{children}
@@ -54,27 +54,27 @@ const CustomizeModal: FC = ({ className='!max-w-2xl w-[640px]' closable={true} > -
- {t(`${prefixCustomize}.way`)} 1 -

{t(`${prefixCustomize}.way1.name`)}

+
+ {t(`${prefixCustomize}.way`)} 1 +

{t(`${prefixCustomize}.way1.name`)}

1
-
{t(`${prefixCustomize}.way1.step1`)}
-
{t(`${prefixCustomize}.way1.step1Tip`)}
+
{t(`${prefixCustomize}.way1.step1`)}
+
{t(`${prefixCustomize}.way1.step1Tip`)}
- +
2
-
{t(`${prefixCustomize}.way1.step3`)}
-
{t(`${prefixCustomize}.way1.step2Tip`)}
+
{t(`${prefixCustomize}.way1.step3`)}
+
{t(`${prefixCustomize}.way1.step2Tip`)}
@@ -83,9 +83,9 @@ const CustomizeModal: FC = ({
3
-
{t(`${prefixCustomize}.way1.step3`)}
-
{t(`${prefixCustomize}.way1.step3Tip`)}
-
+          
{t(`${prefixCustomize}.way1.step3`)}
+
{t(`${prefixCustomize}.way1.step3Tip`)}
+
             NEXT_PUBLIC_APP_ID={`'${appId}'`} 
NEXT_PUBLIC_APP_KEY={'\'\''}
NEXT_PUBLIC_API_URL={`'${api_base_url}'`} @@ -94,9 +94,9 @@ const CustomizeModal: FC = ({
-
- {t(`${prefixCustomize}.way`)} 2 -

{t(`${prefixCustomize}.way2.name`)}

+
+ {t(`${prefixCustomize}.way`)} 2 +

{t(`${prefixCustomize}.way2.name`)}

diff --git a/web/app/components/app/overview/embedded/index.tsx b/web/app/components/app/overview/embedded/index.tsx index 1e8fb68e49..06b06e28a8 100644 --- a/web/app/components/app/overview/embedded/index.tsx +++ b/web/app/components/app/overview/embedded/index.tsx @@ -1,15 +1,19 @@ import React, { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' +import { + RiClipboardFill, + RiClipboardLine, +} from '@remixicon/react' import copy from 'copy-to-clipboard' import style from './style.module.css' -import cn from '@/utils/classnames' import Modal from '@/app/components/base/modal' -import copyStyle from '@/app/components/base/copy-btn/style.module.css' import Tooltip from '@/app/components/base/tooltip' import { useAppContext } from '@/context/app-context' import { IS_CE_EDITION } from '@/config' import type { SiteInfo } from '@/models/share' import { useThemeContext } from '@/app/components/base/chat/embedded-chatbot/theme/theme-context' +import ActionButton from '@/app/components/base/action-button' +import cn from '@/utils/classnames' type Props = { siteInfo?: SiteInfo @@ -119,7 +123,7 @@ const Embedded = ({ siteInfo, isShow, onClose, appBaseUrl, accessToken, classNam wrapperClassName={className} closable={true} > -
+
{t(`${prefixEmbedded}.explanation`)}
@@ -143,30 +147,37 @@ const Embedded = ({ siteInfo, isShow, onClose, appBaseUrl, accessToken, classNam {option === 'chromePlugin' && (
+ 'bg-primary-600 hover:bg-primary-600/75 cursor-pointer text-white hover:shadow-sm flex-shrink-0')}>
{t(`${prefixEmbedded}.chromePlugin`)}
)} -
-
-
+
+
{t(`${prefixEmbedded}.${option}`)}
-
- -
-
+ + +
+ {isCopied[option] && } + {!isCopied[option] && }
-
-
+ +
-
+
{OPTION_MAP[option].getContent(appBaseUrl, accessToken, themeBuilder.theme?.primaryColor ?? '#1C64F2', isTestEnv)}
diff --git a/web/app/components/app/overview/settings/index.tsx b/web/app/components/app/overview/settings/index.tsx index f23100a796..7e80c83312 100644 --- a/web/app/components/app/overview/settings/index.tsx +++ b/web/app/components/app/overview/settings/index.tsx @@ -5,7 +5,6 @@ import { ChevronRightIcon } from '@heroicons/react/20/solid' import Link from 'next/link' import { Trans, useTranslation } from 'react-i18next' import { useContextSelector } from 'use-context-selector' -import s from './style.module.css' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' import Input from '@/app/components/base/input' @@ -21,6 +20,8 @@ import Tooltip from '@/app/components/base/tooltip' import AppContext, { useAppContext } from '@/context/app-context' import type { AppIconSelection } from '@/app/components/base/app-icon-picker' import AppIconPicker from '@/app/components/base/app-icon-picker' +import Divider from '@/app/components/base/divider' +import cn from '@/utils/classnames' export type ISettingsModalProps = { isChat: boolean @@ -195,9 +196,9 @@ const SettingsModal: FC = ({ title={t(`${prefixSettings}.title`)} isShow={isShow} onClose={onHide} - className={`${s.settingsModal}`} + className='max-w-[520px]' > -
{t(`${prefixSettings}.webName`)}
+
{t(`${prefixSettings}.webName`)}
{ setShowAppIconPicker(true) }} @@ -214,8 +215,8 @@ const SettingsModal: FC = ({ placeholder={t('app.appNamePlaceholder') || ''} />
-
{t(`${prefixSettings}.webDesc`)}
-

{t(`${prefixSettings}.webDescTip`)}

+
{t(`${prefixSettings}.webDesc`)}
+

{t(`${prefixSettings}.webDescTip`)}