From 4bcf7c09e5076a8a022488e39e01f094c16b63eb Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Wed, 22 Jan 2025 15:06:52 +0800 Subject: [PATCH 1/2] feat: prompt editor dark theme --- .../components/base/prompt-editor/index.tsx | 2 +- .../prompt-editor/plugins/placeholder.tsx | 2 +- .../workflow-variable-block/component.tsx | 21 ++++++++++++------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/web/app/components/base/prompt-editor/index.tsx b/web/app/components/base/prompt-editor/index.tsx index 4a718527b82231..b09109ef3f1ec6 100644 --- a/web/app/components/base/prompt-editor/index.tsx +++ b/web/app/components/base/prompt-editor/index.tsx @@ -149,7 +149,7 @@ const PromptEditor: FC = ({
} + contentEditable={} placeholder={} ErrorBoundary={LexicalErrorBoundary} /> diff --git a/web/app/components/base/prompt-editor/plugins/placeholder.tsx b/web/app/components/base/prompt-editor/plugins/placeholder.tsx index f5a45faa7796ee..2ad87917d2e0a7 100644 --- a/web/app/components/base/prompt-editor/plugins/placeholder.tsx +++ b/web/app/components/base/prompt-editor/plugins/placeholder.tsx @@ -16,7 +16,7 @@ const Placeholder = ({ return (
{value || t('common.promptEditor.placeholder')} diff --git a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx index 0073ac300b7a90..fc6e5898078019 100644 --- a/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx +++ b/web/app/components/base/prompt-editor/plugins/workflow-variable-block/component.tsx @@ -77,8 +77,8 @@ const WorkflowVariableBlockComponent = ({
@@ -88,25 +88,30 @@ const WorkflowVariableBlockComponent = ({ node?.type && (
) } -
{node?.title}
- +
)} -
+
{!isEnv && !isChatVar && } {isEnv && } {isChatVar && } -
{varName}
+
{varName}
{ !node && !isEnv && !isChatVar && ( - + ) }
From 052bdfc89eceb0435ebab853812caedee1c0db92 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Wed, 22 Jan 2025 15:46:52 +0800 Subject: [PATCH 2/2] feat: prompt editor dark theme --- .../plugins/component-picker-block/hooks.tsx | 10 +++++----- .../plugins/component-picker-block/index.tsx | 6 +++--- .../plugins/component-picker-block/prompt-option.tsx | 8 ++++---- .../plugins/component-picker-block/variable-option.tsx | 8 ++++---- .../plugins/variable-value-block/node.tsx | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/hooks.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/hooks.tsx index b14bf8112bdaaa..f39d56f72ba73c 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/hooks.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/hooks.tsx @@ -133,7 +133,7 @@ export const useVariableOptions = ( return ( } + icon={} queryString={queryString} isSelected={isSelected} onClick={onSelect} @@ -162,7 +162,7 @@ export const useVariableOptions = ( return ( } + icon={} queryString={queryString} isSelected={isSelected} onClick={onSelect} @@ -211,7 +211,7 @@ export const useExternalToolOptions = ( background={item.icon_background} /> } - extraElement={
{item.variableName}
} + extraElement={
{item.variableName}
} queryString={queryString} isSelected={isSelected} onClick={onSelect} @@ -240,8 +240,8 @@ export const useExternalToolOptions = ( return ( } - extraElement={< ArrowUpRight className='w-3 h-3 text-gray-400' />} + icon={} + extraElement={< ArrowUpRight className='w-3 h-3 text-text-tertiary' />} queryString={queryString} isSelected={isSelected} onClick={onSelect} diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx index a5cb39f38375f7..752458278b2083 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/index.tsx @@ -135,7 +135,7 @@ const ComponentPicker = ({ // See https://github.com/facebook/lexical/blob/ac97dfa9e14a73ea2d6934ff566282d7f758e8bb/packages/lexical-react/src/shared/LexicalMenu.ts#L493
+
) } {option.renderMenuOption({ @@ -169,7 +169,7 @@ const ComponentPicker = ({ <> { (!!options.length) && ( -
+
) }
diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/prompt-option.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/prompt-option.tsx index 7aabbe4b267274..985e1958482abf 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/prompt-option.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/prompt-option.tsx @@ -21,9 +21,9 @@ export const PromptMenuItem = memo(({ return (
{icon} -
{title}
+
{title}
) }) diff --git a/web/app/components/base/prompt-editor/plugins/component-picker-block/variable-option.tsx b/web/app/components/base/prompt-editor/plugins/component-picker-block/variable-option.tsx index 27a88ab6658d05..ae0cdfb44b63f7 100644 --- a/web/app/components/base/prompt-editor/plugins/component-picker-block/variable-option.tsx +++ b/web/app/components/base/prompt-editor/plugins/component-picker-block/variable-option.tsx @@ -38,8 +38,8 @@ export const VariableMenuItem = memo(({ return (
{icon}
-
+
{before} - {middle} + {middle} {after}
{extraElement} diff --git a/web/app/components/base/prompt-editor/plugins/variable-value-block/node.tsx b/web/app/components/base/prompt-editor/plugins/variable-value-block/node.tsx index 163d4bfac4af69..9dd76fc1fa0a59 100644 --- a/web/app/components/base/prompt-editor/plugins/variable-value-block/node.tsx +++ b/web/app/components/base/prompt-editor/plugins/variable-value-block/node.tsx @@ -24,7 +24,7 @@ export class VariableValueBlockNode extends TextNode { createDOM(config: EditorConfig): HTMLElement { const element = super.createDOM(config) - element.classList.add('inline-flex', 'items-center', 'px-0.5', 'h-[22px]', 'text-[#155EEF]', 'rounded-[5px]', 'align-middle') + element.classList.add('inline-flex', 'items-center', 'px-0.5', 'h-[22px]', 'text-text-accent', 'rounded-[5px]', 'align-middle') return element }