diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/Tinyflow.ts b/easyflow-ui-admin/packages/tinyflow-ui/src/Tinyflow.ts index 0f4d26d..8d0527e 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/Tinyflow.ts +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/Tinyflow.ts @@ -1,6 +1,6 @@ -import {type useSvelteFlow} from '@xyflow/svelte'; +import type {useSvelteFlow} from '@xyflow/svelte'; import {componentName} from './consts'; -import type {TinyflowData, TinyflowOptions} from './types'; +import type {TinyflowData, TinyflowOptions, TinyflowTheme} from './types'; type FlowInstance = ReturnType; @@ -8,6 +8,10 @@ export class Tinyflow { private options!: TinyflowOptions; private rootEl!: Element; private svelteFlowInstance!: FlowInstance; + private tinyflowEl!: HTMLElement & { + options: TinyflowOptions; + onInit: (svelteFlowInstance: FlowInstance) => void; + }; constructor(options: TinyflowOptions) { if (typeof options.element !== 'string' && !(options.element instanceof Element)) { @@ -38,20 +42,13 @@ export class Tinyflow { tinyflowEl.style.display = 'block'; tinyflowEl.style.width = '100%'; tinyflowEl.style.height = '100%'; - tinyflowEl.classList.add('tf-theme-light'); + this._applyThemeClass(tinyflowEl, this.options.theme); tinyflowEl.options = this.options; tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => { this.svelteFlowInstance = svelteFlowInstance; }; - - this.rootEl.appendChild(tinyflowEl); - } - - private _setOptions(options: TinyflowOptions) { - this.options = { - ...options - }; + return tinyflowEl; } getOptions() { @@ -62,25 +59,20 @@ export class Tinyflow { return this.svelteFlowInstance.toObject(); } + setTheme(theme: TinyflowTheme) { + this.options.theme = theme; + if (this.tinyflowEl) { + this._applyThemeClass(this.tinyflowEl, theme); + } + } + setData(data: TinyflowData) { this.options.data = data; - const tinyflowEl = document.createElement(componentName) as HTMLElement & { - options: TinyflowOptions; - onInit: (svelteFlowInstance: FlowInstance) => void; - }; - tinyflowEl.style.display = 'block'; - tinyflowEl.style.width = '100%'; - tinyflowEl.style.height = '100%'; - tinyflowEl.classList.add('tf-theme-light'); - - tinyflowEl.options = this.options; - tinyflowEl.onInit = (svelteFlowInstance: FlowInstance) => { - this.svelteFlowInstance = svelteFlowInstance; - }; + this.tinyflowEl = this._createTinyflowElement(); this.destroy(); - this.rootEl.appendChild(tinyflowEl); + this.rootEl.appendChild(this.tinyflowEl); } destroy() { diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/TinyflowCore.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/TinyflowCore.svelte index 3f7c42d..6678ee1 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/TinyflowCore.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/TinyflowCore.svelte @@ -461,17 +461,18 @@ diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/collapse.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/collapse.svelte index 99fcc63..28753d8 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/collapse.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/collapse.svelte @@ -91,8 +91,8 @@ width: 16px; height: 16px; border-radius: 50%; - border: 1px solid #c6cfdd; - color: #64748b; + border: 1px solid var(--tf-border-color-strong); + color: var(--tf-text-secondary); display: inline-flex; align-items: center; justify-content: center; @@ -100,14 +100,14 @@ line-height: 1; cursor: default; user-select: none; - background: #fff; + background: var(--tf-bg-surface); position: relative; } .tf-collapse-item-title-help:hover { - border-color: #94a3b8; - color: #334155; - background: #f8fafc; + border-color: var(--tf-border-color-strong); + color: var(--tf-text-primary); + background: var(--tf-bg-hover); } .tf-collapse-item-title-help::after { @@ -119,13 +119,13 @@ min-width: 260px; max-width: 420px; white-space: pre-line; - background: #0f172a; - color: #f8fafc; + background: var(--tf-tip-bg); + color: var(--tf-tip-text); border-radius: 8px; padding: 10px 12px; font-size: 12px; line-height: 1.45; - box-shadow: 0 8px 22px rgba(2, 6, 23, 0.25); + box-shadow: var(--tf-shadow-medium); opacity: 0; visibility: hidden; pointer-events: none; @@ -140,7 +140,7 @@ transform: translateY(-50%); border-top: 6px solid transparent; border-bottom: 6px solid transparent; - border-right: 6px solid #0f172a; + border-right: 6px solid var(--tf-tip-bg); opacity: 0; visibility: hidden; z-index: 121; diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/menu-button.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/menu-button.svelte index 61bf99b..3dfe07d 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/menu-button.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/menu-button.svelte @@ -18,7 +18,7 @@ padding: 3px; &:hover { - background: #eee; + background: var(--tf-bg-hover); border: 1px solid transparent; } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/mixed-input.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/mixed-input.svelte index 6cea58d..202fb43 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/mixed-input.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/mixed-input.svelte @@ -227,8 +227,8 @@ } .tf-mixed-ref-box { - background-color: #ffffff; - border: 1px solid #d1d5db; + background-color: var(--tf-bg-input); + border: 1px solid var(--tf-border-color-strong); padding: 0 48px 0 12px; align-items: center; cursor: pointer; @@ -236,8 +236,8 @@ } .tf-mixed-text-box { - background-color: #ffffff; - border: 1px solid #d1d5db; + background-color: var(--tf-bg-input); + border: 1px solid var(--tf-border-color-strong); padding: 0 48px 0 12px; align-items: center; transition: all 0.2s; @@ -247,13 +247,13 @@ .tf-mixed-wrapper.is-focus .tf-mixed-text-box, .tf-mixed-ref-box:hover, .tf-mixed-text-box:hover { - border-color: #94a3b8; + border-color: var(--tf-border-color-strong); } .tf-mixed-wrapper.is-focus .tf-mixed-ref-box, .tf-mixed-wrapper.is-focus .tf-mixed-text-box { - border-color: #3b82f6; + border-color: var(--tf-primary-color); outline: none; - box-shadow: 0 0 0 2px rgba(59,130,246,0.1); + box-shadow: var(--tf-focus-shadow); } .tf-mixed-sel-val { @@ -272,8 +272,8 @@ align-items: center; justify-content: center; flex-shrink: 0; - color: #3474ff; - background: #cedafb; + color: var(--tf-icon-color); + background: var(--tf-icon-bg); border-radius: 4px; padding: 2px; box-sizing: border-box; @@ -281,9 +281,9 @@ :global(svg) { width: 12px; height: 12px; } } - .tf-mixed-val-name { color: #111827; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; } + .tf-mixed-val-name { color: var(--tf-text-primary); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; } .tf-mixed-placeholder { - color: #9ca3af; + color: var(--tf-text-muted); font-size: 13px; height: 100%; display: flex; @@ -301,12 +301,12 @@ align-items: center; justify-content: center; cursor: pointer; - color: #94a3b8; + color: var(--tf-text-muted); border-radius: 0 5px 5px 0; transition: all 0.2s; flex-shrink: 0; - &:hover { background: rgba(0,0,0,0.04); color: #64748b; } + &:hover { background: var(--tf-bg-tag); color: var(--tf-text-secondary); } } /* Keep the trigger in the same visual position in both text/ref modes */ @@ -330,10 +330,10 @@ height: 20px; top: 50%; transform: translateY(-50%); - background: #e2e8f0; + background: var(--tf-bg-active); border: none; border-radius: 50%; - color: #64748b; + color: var(--tf-text-secondary); display: flex; align-items: center; justify-content: center; @@ -343,7 +343,7 @@ padding: 3px; z-index: 10; } - .tf-mixed-clear-btn:hover { background: #ef4444; color: #fff; } + .tf-mixed-clear-btn:hover { background: var(--tf-danger-color); color: var(--tf-bg-surface); } .tf-mixed-wrapper:hover .tf-mixed-clear-btn { opacity: 1; } .tf-mixed-native-input { @@ -352,7 +352,7 @@ border: none; outline: none; background: transparent; - color: #111827; + color: var(--tf-text-primary); font-size: 13px; line-height: 32px; height: 32px; @@ -363,17 +363,17 @@ } .tf-mixed-native-input::placeholder { - color: #9ca3af; + color: var(--tf-text-muted); line-height: 32px; } /* Dropdown Styles matched perfectly to Select */ .tf-mixed-dropdown { display: flex; - background: #fff; + background: var(--tf-bg-surface); border-radius: 12px; - box-shadow: 0 10px 25px rgba(0,0,0,0.15); - border: 1px solid #e5e7eb; + box-shadow: var(--tf-shadow-medium); + border: 1px solid var(--tf-border-color); overflow: hidden; width: max-content; box-sizing: border-box; @@ -382,9 +382,9 @@ margin-top: 5px; } .tf-mixed-list { display: flex; flex-direction: column; padding: 8px; overflow-y: auto; } - .tf-mixed-primary-list { width: 100%; flex-shrink: 0; background: #f9fafb; } + .tf-mixed-primary-list { width: 100%; flex-shrink: 0; background: var(--tf-bg-surface-alt); } .tf-mixed-dropdown:has(.tf-mixed-secondary-list) .tf-mixed-primary-list { width: auto; min-width: 180px; } - .tf-mixed-secondary-list { min-width: 220px; background: #fff; padding: 12px; border-left: 1px solid #f3f4f6; animation: slideIn 0.2s ease-out; box-sizing: border-box; } + .tf-mixed-secondary-list { min-width: 220px; background: var(--tf-bg-surface); padding: 12px; border-left: 1px solid var(--tf-bg-muted); animation: slideIn 0.2s ease-out; box-sizing: border-box; } @keyframes slideIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } } @@ -398,28 +398,28 @@ cursor: pointer; text-align: left; font-size: 13px; - color: #374151; + color: var(--tf-text-primary); gap: 10px; width: 100%; transition: all 0.15s; margin-bottom: 2px; - &:hover { background: #f3f4f6; } - &.active { background: #eff6ff; color: #2563eb; font-weight: 500; } - &.has-children { background: #f8fafc; margin-bottom: 4px; &:hover { background: #f1f5f9; } } + &:hover { background: var(--tf-bg-muted); } + &.active { background: var(--tf-primary-soft-bg); color: var(--tf-primary-color); font-weight: 500; } + &.has-children { background: var(--tf-bg-hover); margin-bottom: 4px; &:hover { background: var(--tf-bg-active); } } } .tf-mixed-item-icon { - width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #3474ff; background: #cedafb; border-radius: 5px; padding: 3px; box-sizing: border-box; + width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--tf-icon-color); background: var(--tf-icon-bg); border-radius: 5px; padding: 3px; box-sizing: border-box; :global(svg) { width: 16px; height: 16px; } } .tf-mixed-item-label { flex-grow: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - .tf-mixed-item-arrow { width: 14px; height: 14px; color: #9ca3af; } + .tf-mixed-item-arrow { width: 14px; height: 14px; color: var(--tf-text-muted); } .tf-mixed-item-container { position: relative; width: 100%; } - .tf-mixed-item-children { position: relative; width: 100%; &::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: #f0f0f0; } } + .tf-mixed-item-children { position: relative; width: 100%; &::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 1px; background: var(--tf-border-color-soft); } } .tf-mixed-label { display: flex; justify-content: flex-start; align-items: center; width: 100%; gap: 8px; overflow: hidden;} .tf-mixed-name-wrapper { display: flex; align-items: center; gap: 6px; } .tf-mixed-expand-icon { width: 12px; height: 12px; color: currentColor; opacity: 0.6; } .tf-mixed-name { color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } - .tf-mixed-type { background: rgba(0,0,0,0.06); color: #6b7280; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; } + .tf-mixed-type { background: var(--tf-bg-tag); color: var(--tf-text-secondary); padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/select.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/select.svelte index 6031255..42f42b2 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/select.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/base/select.svelte @@ -309,9 +309,9 @@ .tf-select-default-wrapper { display: flex; flex-direction: column; - background: #fff; + background: var(--tf-bg-surface); margin-top: 5px; - border: 1px solid #e5e7eb; + border: 1px solid var(--tf-border-color); border-radius: 6px; padding: 4px; width: 100%; @@ -319,7 +319,7 @@ box-sizing: border-box; max-height: 220px; overflow: auto; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); + box-shadow: var(--tf-shadow-soft); } .tf-select-default-item { @@ -327,7 +327,7 @@ align-items: center; padding: 6px 12px; border: none; - background: #fff; + background: var(--tf-bg-surface); border-radius: 4px; cursor: pointer; line-height: 1.5; @@ -335,10 +335,10 @@ width: 100%; text-align: left; font-size: 13px; - color: #111827; + color: var(--tf-text-primary); &:hover { - background: #f5f5f7; + background: var(--tf-bg-hover); } } @@ -351,16 +351,16 @@ .tf-select-model-wrapper { display: flex; flex-direction: column; - background: #fff; + background: var(--tf-bg-surface); margin-top: 5px; - border: 1px solid #e5e7eb; + border: 1px solid var(--tf-border-color); border-radius: 10px; /* Removed fixed width to allow syncWidth to control it */ z-index: 99999; box-sizing: border-box; max-height: 400px; overflow: hidden; - box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12); + box-shadow: var(--tf-shadow-medium); } .tf-select-model-header { @@ -368,20 +368,20 @@ justify-content: space-between; align-items: center; padding: 10px 12px; - border-bottom: 1px solid #f3f4f6; - background: #fff; + border-bottom: 1px solid var(--tf-bg-muted); + background: var(--tf-bg-surface); } .tf-select-model-header-title { font-size: 13px; font-weight: 600; - color: #111827; + color: var(--tf-text-primary); } .tf-select-model-header-icon { width: 14px; height: 14px; - color: #6b7280; + color: var(--tf-text-secondary); cursor: pointer; } @@ -396,7 +396,7 @@ .tf-select-model-group-title { font-size: 12px; font-weight: 500; - color: #6b7280; + color: var(--tf-text-secondary); margin-top: 6px; margin-bottom: 2px; padding-left: 6px; @@ -438,11 +438,11 @@ } .tf-select-model-item:hover { - background: #f9fafb; + background: var(--tf-bg-surface-alt); } .tf-select-model-item.active { - background: #e0e7ff; + background: var(--tf-primary-soft-bg); } .tf-select-model-icon { @@ -454,7 +454,7 @@ display: flex; align-items: center; justify-content: center; - background: #f3f4f6; + background: var(--tf-bg-muted); margin-top: 2px; } @@ -467,7 +467,7 @@ .tf-select-model-avatar { font-size: 14px; font-weight: 600; - color: #9ca3af; + color: var(--tf-text-muted); } .tf-select-model-info { @@ -481,7 +481,7 @@ .tf-select-model-title { font-size: 13px; font-weight: 500; - color: #111827; + color: var(--tf-text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; @@ -494,8 +494,8 @@ } .tf-select-model-tag { - background: #f3f4f6; - color: #6b7280; + background: var(--tf-bg-muted); + color: var(--tf-text-secondary); font-size: 10px; padding: 1px 6px; border-radius: 4px; @@ -503,7 +503,7 @@ .tf-select-model-desc { font-size: 11px; - color: #6b7280; + color: var(--tf-text-secondary); line-height: 1.3; margin-top: 2px; display: -webkit-box; @@ -515,10 +515,10 @@ /* Reference Variant Styles */ .tf-select-wrapper { display: flex; - background: #fff; + background: var(--tf-bg-surface); border-radius: 12px; - box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); - border: 1px solid #e5e7eb; + box-shadow: var(--tf-shadow-medium); + border: 1px solid var(--tf-border-color); overflow: hidden; /* width expands naturally since createFloating sets minWidth, not width */ width: max-content; @@ -536,7 +536,7 @@ &.tf-select-primary-list { width: 100%; /* Default fills the wrapper, which is minWidth-constrained by the input */ flex-shrink: 0; - background: #f9fafb; + background: var(--tf-bg-surface-alt); } /* When a secondary list is open, we fix the primary list to 100% of the input's width (done via absolute positioning or just keeping it wide enough) */ @@ -548,9 +548,9 @@ &.tf-select-secondary-list { min-width: 220px; - background: #fff; + background: var(--tf-bg-surface); padding: 12px; - border-left: 1px solid #f3f4f6; + border-left: 1px solid var(--tf-bg-muted); animation: slideIn 0.2s ease-out; box-sizing: border-box; } @@ -572,7 +572,7 @@ top: 0; bottom: 0; width: 1px; - background: #f0f0f0; + background: var(--tf-border-color-soft); } } @@ -586,27 +586,27 @@ cursor: pointer; text-align: left; font-size: 13px; - color: #374151; + color: var(--tf-text-primary); gap: 10px; width: 100%; transition: all 0.15s; margin-bottom: 2px; &:hover { - background: #f3f4f6; + background: var(--tf-bg-muted); } &.active { - background: #eff6ff; - color: #2563eb; + background: var(--tf-primary-soft-bg); + color: var(--tf-primary-color); font-weight: 500; } &.has-children { - background: #f8fafc; + background: var(--tf-bg-hover); margin-bottom: 4px; &:hover { - background: #f1f5f9; + background: var(--tf-bg-active); } } @@ -617,8 +617,8 @@ align-items: center; justify-content: center; flex-shrink: 0; - color: #3474ff; - background: #cedafb; + color: var(--tf-icon-color); + background: var(--tf-icon-bg); border-radius: 5px; padding: 3px; box-sizing: border-box; @@ -639,7 +639,7 @@ &-arrow { width: 14px; height: 14px; - color: #9ca3af; + color: var(--tf-text-muted); } } @@ -656,8 +656,8 @@ align-items: center; justify-content: center; flex-shrink: 0; - color: #3474ff; - background: #cedafb; + color: var(--tf-icon-color); + background: var(--tf-icon-bg); border-radius: 4px; padding: 2px; box-sizing: border-box; @@ -712,8 +712,8 @@ } .tf-parameter-type { - background: rgba(0, 0, 0, 0.06); - color: #6b7280; + background: var(--tf-bg-tag); + color: var(--tf-text-secondary); padding: 2px 8px; border-radius: 4px; font-size: 11px; diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/CodeScriptEditor.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/CodeScriptEditor.svelte index 2125688..baf9f77 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/CodeScriptEditor.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/CodeScriptEditor.svelte @@ -10,7 +10,12 @@ } from '@codemirror/autocomplete'; import {defaultKeymap, history, historyKeymap, indentWithTab} from '@codemirror/commands'; import {javascript} from '@codemirror/lang-javascript'; - import {defaultHighlightStyle, indentOnInput, indentUnit, syntaxHighlighting} from '@codemirror/language'; + import { + defaultHighlightStyle, + indentOnInput, + indentUnit, + syntaxHighlighting + } from '@codemirror/language'; import {python} from '@codemirror/lang-python'; import { Decoration, @@ -25,8 +30,8 @@ import type {Parameter} from '#types'; import {flattenParameterCandidates} from '../utils/paramToken'; import { - createBusinessCompletionSource, type CodeEngine, + createBusinessCompletionSource, normalizeCodeEngine, shouldAutoAppendCallParens } from '../utils/codeCompletion'; @@ -230,18 +235,18 @@ function createEditorTheme() { return EditorView.theme({ '&': { - border: '1px solid #dcdfe6', + border: '1px solid var(--tf-border-color)', borderRadius: '6px', - backgroundColor: '#fff', + backgroundColor: 'var(--tf-bg-surface)', fontSize: '13px' }, '&.cm-focused': { outline: 'none', - borderColor: '#4c82f7', - boxShadow: '0 0 0 1px rgba(76, 130, 247, 0.25)' + borderColor: 'var(--tf-primary-color)', + boxShadow: '0 0 0 1px var(--tf-primary-ghost-bg)' }, '&.cm-editor.cm-disabled': { - backgroundColor: '#f5f7fa', + backgroundColor: 'var(--tf-bg-input-disabled)', opacity: 0.85 }, '.cm-scroller': { @@ -252,17 +257,17 @@ }, '.cm-content': { padding: '8px 38px 8px 10px', - caretColor: '#1f2937' + caretColor: 'var(--tf-text-primary)' }, '.cm-gutters': { border: 'none', background: 'transparent' }, '.cm-activeLine': { - background: 'rgba(76, 130, 247, 0.06)' + background: 'var(--tf-primary-ghost-bg)' }, '.cm-placeholder': { - color: '#c0c4cc' + color: 'var(--tf-text-muted)' } }); } @@ -687,8 +692,9 @@ padding: 0 4px; font-size: 10px; border-radius: 4px; - color: #666; - background: rgba(255, 255, 255, 0.9); + color: var(--tf-text-secondary); + background: var(--tf-bg-surface); + border-color: var(--tf-border-color); display: inline-flex; align-items: center; justify-content: center; @@ -704,9 +710,9 @@ min-width: 20px; padding: 0 4px; font-size: 10px; - border-color: #d3defd; - color: #1d4ed8; - background: #f5f8ff; + border-color: var(--tf-primary-soft-border); + color: var(--tf-primary-color); + background: var(--tf-primary-soft-bg); } @media (max-width: 900px) { @@ -719,9 +725,9 @@ } :global(.code-script-button:hover) { - background: #f0f3ff; - color: #2563eb; - border-color: #d3defd; + background: var(--tf-primary-soft-bg); + color: var(--tf-primary-color); + border-color: var(--tf-primary-soft-border); } .code-script-panel { @@ -729,10 +735,10 @@ max-width: 340px; max-height: 240px; overflow: auto; - background: #fff; - border: 1px solid #ddd; + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color-strong); border-radius: 5px; - box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); + box-shadow: var(--tf-shadow-medium); padding: 6px; display: flex; flex-direction: column; @@ -741,14 +747,14 @@ .code-script-item { border: none; - background: #fff; + background: var(--tf-bg-surface); padding: 6px 8px; text-align: left; cursor: pointer; border-radius: 4px; font-size: 12px; line-height: 1.3; - color: #333; + color: var(--tf-text-primary); display: flex; align-items: center; justify-content: space-between; @@ -756,13 +762,13 @@ } .code-script-item:hover { - background: #f5f7ff; - color: #2563eb; + background: var(--tf-bg-surface-alt); + color: var(--tf-primary-color); } .code-script-item.unresolved { - background: #fff8e6; - color: #92400e; + background: var(--tf-warning-soft-bg); + color: var(--tf-warning-soft-text); } .code-script-item-warn { @@ -772,8 +778,8 @@ align-items: center; justify-content: center; border-radius: 50%; - background: #d97706; - color: #fff; + background: var(--tf-warning-icon-color); + color: var(--tf-bg-surface); font-size: 10px; line-height: 1; flex-shrink: 0; @@ -782,38 +788,38 @@ .code-script-empty { padding: 8px; font-size: 12px; - color: #999; + color: var(--tf-text-muted); text-align: center; } .code-script-editor :global(.cm-special-result) { - color: #1d4ed8; + color: var(--tf-primary-color); font-weight: 700; } .code-script-editor :global(.cm-template-token-valid) { - color: #1e4ed8; - background: rgba(37, 99, 235, 0.12); + color: var(--tf-primary-color); + background: var(--tf-primary-ghost-bg); border-radius: 4px; } .code-script-editor :global(.cm-template-token-unresolved) { - color: #92400e; - background: rgba(217, 119, 6, 0.16); + color: var(--tf-warning-soft-text); + background: var(--tf-warning-soft-bg); border-radius: 4px; } .code-script-editor :global(.cm-template-token-invalid) { - color: #b42318; - background: rgba(217, 45, 32, 0.14); + color: var(--tf-danger-soft-text); + background: var(--tf-danger-soft-bg); border-radius: 4px; } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete) { - border: 1px solid #e6eaf2; - background: #ffffff; + border: 1px solid var(--tf-border-color); + background: var(--tf-bg-surface); border-radius: 10px; - box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); + box-shadow: var(--tf-shadow-medium); padding: 6px; min-width: 260px; max-width: 360px; @@ -838,29 +844,29 @@ display: flex; align-items: center; gap: 8px; - color: #1f2937; + color: var(--tf-text-primary); } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]) { - background: #eef4ff; - color: #1d4ed8; + background: var(--tf-primary-soft-bg); + color: var(--tf-primary-color); } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete > ul > li:hover) { - background: #f6f8fc; + background: var(--tf-bg-surface-alt); } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete .cm-completionIcon) { width: 16px; height: 16px; - color: #6b7280; + color: var(--tf-text-secondary); opacity: 1; font-size: 12px; margin-right: 0; } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected] .cm-completionIcon) { - color: #2563eb; + color: var(--tf-primary-color); } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete .cm-completionLabel) { @@ -870,14 +876,14 @@ .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete .cm-completionDetail) { margin-left: auto; - color: #94a3b8; + color: var(--tf-text-muted); font-style: normal; font-size: 12px; } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete .cm-completionMatchedText) { text-decoration: none; - color: #2563eb; + color: var(--tf-primary-color); font-weight: 700; } @@ -886,7 +892,7 @@ } .code-script-editor :global(.cm-tooltip.cm-tooltip-autocomplete > ul::-webkit-scrollbar-thumb) { - background: #d6dce8; + background: var(--tf-scrollbar-thumb); border-radius: 999px; } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterItem.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterItem.svelte index 836510a..31f3a14 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterItem.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterItem.svelte @@ -158,18 +158,18 @@ flex-direction: column; gap: 10px; padding: 10px; - background: #fff; - border: 1px solid #ddd; + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color-strong); border-radius: 5px; width: 200px; - box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + box-shadow: var(--tf-shadow-medium); .input-more-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterList.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterList.svelte index 0f77347..5a59a49 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterList.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ConfirmParameterList.svelte @@ -45,7 +45,7 @@ .none-params { font-size: 12px; - background: #f8f8f8; + background: var(--tf-bg-muted); height: 40px; display: flex; justify-content: center; @@ -57,7 +57,7 @@ .input-header { font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterItem.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterItem.svelte index ed2832e..3e15dcd 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterItem.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterItem.svelte @@ -156,7 +156,7 @@ display: flex; align-items: center; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } .input-more-setting { @@ -164,18 +164,18 @@ flex-direction: column; gap: 10px; padding: 10px; - background: #fff; - border: 1px solid #ddd; + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color-strong); border-radius: 5px; width: 200px; - box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + box-shadow: var(--tf-shadow-medium); .input-more-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterList.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterList.svelte index b4ca3e2..a7b0380 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterList.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/DefinedParameterList.svelte @@ -34,7 +34,7 @@ .none-params { font-size: 12px; - background: #f8f8f8; + background: var(--tf-bg-muted); height: 40px; display: flex; justify-content: center; @@ -46,7 +46,7 @@ .input-header { font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte index 0d3790e..68ea40b 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/NodeWrapper.svelte @@ -263,9 +263,9 @@ gap: 5px; padding: 5px; border-radius: 5px; - background: #fff; - border: 1px solid #eee; - box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color); + box-shadow: var(--tf-shadow-soft); } :global(.tf-node-toolbar-item) { @@ -277,25 +277,34 @@ flex-direction: column; gap: 10px; padding: 10px; - background: #fff; - border: 1px solid #ddd; + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color-strong); border-radius: 5px; width: 200px; - box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + box-shadow: var(--tf-shadow-medium); .input-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } .input-item-inline { display: flex; align-items: center; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); + } + + input[type='checkbox'] { + width: 14px; + height: 14px; + accent-color: var(--tf-primary-color); + background: var(--tf-bg-input); + border: 1px solid var(--tf-border-color-strong); + border-radius: 3px; } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefItem.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefItem.svelte index 46c8134..b06ea19 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefItem.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefItem.svelte @@ -205,21 +205,20 @@ flex-direction: column; gap: 10px; padding: 10px; - background: #fff; - border: 1px solid #ddd; + background: var(--tf-bg-surface); + border: 1px solid var(--tf-border-color-strong); border-radius: 5px; width: 200px; - box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1); + box-shadow: var(--tf-shadow-medium); .input-more-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } - diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefList.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefList.svelte index 5b604e0..4743e5b 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefList.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/OutputDefList.svelte @@ -55,7 +55,7 @@ .none-params { font-size: 12px; - background: #f8f8f8; + background: var(--tf-bg-muted); height: 40px; display: flex; justify-content: center; @@ -67,7 +67,7 @@ .input-header { font-size: 12px; - color: #666; + color: var(--tf-text-secondary); } } diff --git a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ParamTokenEditor.svelte b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ParamTokenEditor.svelte index 87c4cb2..23dceae 100644 --- a/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ParamTokenEditor.svelte +++ b/easyflow-ui-admin/packages/tinyflow-ui/src/components/core/ParamTokenEditor.svelte @@ -1,12 +1,12 @@