From f1fcb92691ba1e37edc012dce8ec42d6df8c0a08 Mon Sep 17 00:00:00 2001 From: yessenia Date: Thu, 16 Oct 2025 18:28:55 +0800 Subject: [PATCH] feat(trigger): add category trigger --- .../icons/assets/vender/plugin/trigger.svg | 8 ++ .../base/icons/src/vender/plugin/Trigger.json | 73 +++++++++++++++++++ .../base/icons/src/vender/plugin/Trigger.tsx | 20 +++++ .../base/icons/src/vender/plugin/index.ts | 1 + .../marketplace/plugin-type-switch.tsx | 11 ++- web/i18n/en-US/plugin.ts | 3 +- web/i18n/zh-Hans/plugin.ts | 3 +- 7 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 web/app/components/base/icons/assets/vender/plugin/trigger.svg create mode 100644 web/app/components/base/icons/src/vender/plugin/Trigger.json create mode 100644 web/app/components/base/icons/src/vender/plugin/Trigger.tsx diff --git a/web/app/components/base/icons/assets/vender/plugin/trigger.svg b/web/app/components/base/icons/assets/vender/plugin/trigger.svg new file mode 100644 index 0000000000..261fcd02b7 --- /dev/null +++ b/web/app/components/base/icons/assets/vender/plugin/trigger.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/web/app/components/base/icons/src/vender/plugin/Trigger.json b/web/app/components/base/icons/src/vender/plugin/Trigger.json new file mode 100644 index 0000000000..409ef0e478 --- /dev/null +++ b/web/app/components/base/icons/src/vender/plugin/Trigger.json @@ -0,0 +1,73 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "16", + "height": "16", + "viewBox": "0 0 16 16", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M7.1499 6.35213L7.25146 6.38208L14.2248 9.03898L14.3172 9.08195C14.7224 9.30788 14.778 9.87906 14.424 10.179L14.342 10.2389L11.8172 11.817L10.2391 14.3417C9.96271 14.7839 9.32424 14.751 9.08219 14.317L9.03923 14.2245L6.38232 7.25122C6.18829 6.74188 6.64437 6.24196 7.1499 6.35213ZM9.81201 12.5084L10.7671 10.981L10.8114 10.9185C10.8589 10.8589 10.9163 10.8075 10.9813 10.7668L12.5086 9.81177L8.15251 8.15226L9.81201 12.5084Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M5.2124 10.3977L3.56266 12.0474L2.61995 11.1047L4.26969 9.455L5.2124 10.3977Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M3.66683 7.99992H1.3335V6.66659H3.66683V7.99992Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M5.2124 4.2688L4.26969 5.21151L2.61995 3.56177L3.56266 2.61906L5.2124 4.2688Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M12.0477 3.56177L10.3979 5.21151L9.45524 4.2688L11.105 2.61906L12.0477 3.56177Z", + "fill": "currentColor" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M8.00016 3.66659H6.66683V1.33325H8.00016V3.66659Z", + "fill": "currentColor" + }, + "children": [] + } + ] + }, + "name": "Trigger" +} diff --git a/web/app/components/base/icons/src/vender/plugin/Trigger.tsx b/web/app/components/base/icons/src/vender/plugin/Trigger.tsx new file mode 100644 index 0000000000..b8f6a56ca7 --- /dev/null +++ b/web/app/components/base/icons/src/vender/plugin/Trigger.tsx @@ -0,0 +1,20 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Trigger.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconData } from '@/app/components/base/icons/IconBase' + +const Icon = ( + { + ref, + ...props + }: React.SVGProps & { + ref?: React.RefObject>; + }, +) => + +Icon.displayName = 'Trigger' + +export default Icon diff --git a/web/app/components/base/icons/src/vender/plugin/index.ts b/web/app/components/base/icons/src/vender/plugin/index.ts index 943c764116..b345526eb7 100644 --- a/web/app/components/base/icons/src/vender/plugin/index.ts +++ b/web/app/components/base/icons/src/vender/plugin/index.ts @@ -1,2 +1,3 @@ export { default as BoxSparkleFill } from './BoxSparkleFill' export { default as LeftCorner } from './LeftCorner' +export { default as Trigger } from './Trigger' diff --git a/web/app/components/plugins/marketplace/plugin-type-switch.tsx b/web/app/components/plugins/marketplace/plugin-type-switch.tsx index eac35577a5..249be1ef83 100644 --- a/web/app/components/plugins/marketplace/plugin-type-switch.tsx +++ b/web/app/components/plugins/marketplace/plugin-type-switch.tsx @@ -1,4 +1,6 @@ 'use client' +import { Trigger as TriggerIcon } from '@/app/components/base/icons/src/vender/plugin' +import cn from '@/utils/classnames' import { RiArchive2Line, RiBrain2Line, @@ -7,14 +9,13 @@ import { RiPuzzle2Line, RiSpeakAiLine, } from '@remixicon/react' +import { useCallback, useEffect } from 'react' import { PluginCategoryEnum } from '../types' import { useMarketplaceContext } from './context' import { useMixedTranslation, useSearchBoxAutoAnimate, } from './hooks' -import cn from '@/utils/classnames' -import { useCallback, useEffect } from 'react' export const PLUGIN_TYPE_SEARCH_MAP = { all: 'all', @@ -23,6 +24,7 @@ export const PLUGIN_TYPE_SEARCH_MAP = { agent: PluginCategoryEnum.agent, extension: PluginCategoryEnum.extension, datasource: PluginCategoryEnum.datasource, + trigger: PluginCategoryEnum.trigger, bundle: 'bundle', } type PluginTypeSwitchProps = { @@ -63,6 +65,11 @@ const PluginTypeSwitch = ({ text: t('plugin.category.datasources'), icon: , }, + { + value: PLUGIN_TYPE_SEARCH_MAP.trigger, + text: t('plugin.category.triggers'), + icon: , + }, { value: PLUGIN_TYPE_SEARCH_MAP.agent, text: t('plugin.category.agents'), diff --git a/web/i18n/en-US/plugin.ts b/web/i18n/en-US/plugin.ts index 70079b1cd9..90086257a6 100644 --- a/web/i18n/en-US/plugin.ts +++ b/web/i18n/en-US/plugin.ts @@ -8,6 +8,7 @@ const translation = { tools: 'Tools', agents: 'Agent Strategies', extensions: 'Extensions', + triggers: 'Triggers', bundles: 'Bundles', datasources: 'Data Sources', }, @@ -16,9 +17,9 @@ const translation = { tool: 'Tool', agent: 'Agent Strategy', extension: 'Extension', + trigger: 'Trigger', bundle: 'Bundle', datasource: 'Data Source', - trigger: 'Trigger', }, search: 'Search', allCategories: 'All Categories', diff --git a/web/i18n/zh-Hans/plugin.ts b/web/i18n/zh-Hans/plugin.ts index 1a71f8a23b..7539f8224d 100644 --- a/web/i18n/zh-Hans/plugin.ts +++ b/web/i18n/zh-Hans/plugin.ts @@ -8,6 +8,7 @@ const translation = { tools: '工具', agents: 'Agent 策略', extensions: '扩展', + triggers: '触发器', bundles: '插件集', datasources: '数据源', }, @@ -16,9 +17,9 @@ const translation = { tool: '工具', agent: 'Agent 策略', extension: '扩展', + trigger: '触发器', bundle: '插件集', datasource: '数据源', - trigger: '触发器', }, search: '搜索', allCategories: '所有类别',