mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
feat(free-layout): line-color support css var (#349)
This commit is contained in:
parent
c320ab61e9
commit
1668d9f26e
@ -6,7 +6,7 @@ import { createMinimapPlugin } from '@flowgram.ai/minimap-plugin';
|
|||||||
import { createFreeSnapPlugin } from '@flowgram.ai/free-snap-plugin';
|
import { createFreeSnapPlugin } from '@flowgram.ai/free-snap-plugin';
|
||||||
import { createFreeNodePanelPlugin } from '@flowgram.ai/free-node-panel-plugin';
|
import { createFreeNodePanelPlugin } from '@flowgram.ai/free-node-panel-plugin';
|
||||||
import { createFreeLinesPlugin } from '@flowgram.ai/free-lines-plugin';
|
import { createFreeLinesPlugin } from '@flowgram.ai/free-lines-plugin';
|
||||||
import { FreeLayoutProps, WorkflowNodeLinesData, Form } from '@flowgram.ai/free-layout-editor';
|
import { FreeLayoutProps, WorkflowNodeLinesData } from '@flowgram.ai/free-layout-editor';
|
||||||
import { createFreeGroupPlugin } from '@flowgram.ai/free-group-plugin';
|
import { createFreeGroupPlugin } from '@flowgram.ai/free-group-plugin';
|
||||||
import { createContainerNodePlugin } from '@flowgram.ai/free-container-plugin';
|
import { createContainerNodePlugin } from '@flowgram.ai/free-container-plugin';
|
||||||
|
|
||||||
@ -76,12 +76,12 @@ export function useEditorProps(
|
|||||||
return json;
|
return json;
|
||||||
},
|
},
|
||||||
lineColor: {
|
lineColor: {
|
||||||
hidden: 'transparent',
|
hidden: 'var(--g-line-color-hidden,transparent)',
|
||||||
default: '#4d53e8',
|
default: 'var(--g-line-color-default,#4d53e8)',
|
||||||
drawing: '#5DD6E3',
|
drawing: 'var(--g-line-color-drawing, #5DD6E3)',
|
||||||
hovered: '#37d0ff',
|
hovered: 'var(--g-line-color-hover,#37d0ff)',
|
||||||
selected: '#37d0ff',
|
selected: 'var(--g-line-color-selected,#37d0ff)',
|
||||||
error: 'red',
|
error: 'var(--g-line-color-hover,red)',
|
||||||
},
|
},
|
||||||
/*
|
/*
|
||||||
* Check whether the line can be added
|
* Check whether the line can be added
|
||||||
|
|||||||
@ -24,11 +24,12 @@ export interface LineColor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum LineColors {
|
export enum LineColors {
|
||||||
HIDDEN = 'transparent', // 隐藏线条
|
HIDDEN = 'var(--g-line-color-hidden,transparent)', // 隐藏线条
|
||||||
DEFUALT = '#4d53e8',
|
DEFUALT = 'var(--g-line-color-default,#4d53e8)',
|
||||||
DRAWING = '#5DD6E3', // '#b5bbf8', // '#9197F1',
|
DRAWING = 'var(--g-line-color-drawing, #5DD6E3)', // '#b5bbf8', // '#9197F1',
|
||||||
HOVER = '#37d0ff',
|
HOVER = 'var(--g-line-color-hover,#37d0ff)',
|
||||||
ERROR = 'red',
|
SELECTED = 'var(--g-line-color-selected,#37d0ff)',
|
||||||
|
ERROR = 'var(--g-line-color-error,red)',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WorkflowLineRenderContribution {
|
export interface WorkflowLineRenderContribution {
|
||||||
|
|||||||
@ -85,7 +85,7 @@ export class WorkflowLinesManager {
|
|||||||
hidden: LineColors.HIDDEN,
|
hidden: LineColors.HIDDEN,
|
||||||
drawing: LineColors.DRAWING,
|
drawing: LineColors.DRAWING,
|
||||||
hovered: LineColors.HOVER,
|
hovered: LineColors.HOVER,
|
||||||
selected: LineColors.HOVER,
|
selected: LineColors.SELECTED,
|
||||||
};
|
};
|
||||||
if (this.options.lineColor) {
|
if (this.options.lineColor) {
|
||||||
Object.assign(color, this.options.lineColor);
|
Object.assign(color, this.options.lineColor);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user