chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -35,11 +35,11 @@ const PADDING = 12;
|
||||
export interface BezierLineProps {
|
||||
fromColor?: string;
|
||||
toColor?: string;
|
||||
color?: string; // 高亮颜色,优先级最高
|
||||
color?: string; // Highlight color, highest priority
|
||||
selected?: boolean;
|
||||
showControlPoints?: boolean;
|
||||
line: WorkflowLineEntity;
|
||||
version: string; // 用于控制 memo 刷新
|
||||
version: string; // Used to control memo refresh
|
||||
}
|
||||
|
||||
export const BezierLineRender = React.memo(
|
||||
@@ -48,14 +48,14 @@ export const BezierLineRender = React.memo(
|
||||
const renderData = line.getData(WorkflowLineRenderData);
|
||||
const { bounds: bbox } = renderData;
|
||||
const { position } = line;
|
||||
// 相对位置
|
||||
// relative position
|
||||
const toRelative = (p: IPoint) => ({
|
||||
x: p.x - bbox.x + PADDING,
|
||||
y: p.y - bbox.y + PADDING,
|
||||
});
|
||||
const fromPos = toRelative(position.from);
|
||||
const toPos = toRelative(position.to);
|
||||
// 真正连接线需要到的点的位置
|
||||
// The location of the point that the real connection line needs to go to
|
||||
const arrowToPos = {
|
||||
x: toPos.x - POINT_RADIUS,
|
||||
y: toPos.y,
|
||||
|
||||
@@ -28,14 +28,14 @@ import ArrowRenderer from '../arrow';
|
||||
import { STROKE_WIDTH, STROKE_WIDTH_SLECTED } from '../../../constants/points';
|
||||
|
||||
/**
|
||||
* 折叠线
|
||||
* fold line
|
||||
*/
|
||||
export const FoldLineRender = React.memo(
|
||||
WithPopover((props: BezierLineProps) => {
|
||||
const { selected, color, line } = props;
|
||||
const { to } = line.position;
|
||||
const strokeWidth = selected ? STROKE_WIDTH_SLECTED : STROKE_WIDTH;
|
||||
// 真正连接线需要到的点的位置
|
||||
// The location of the point that the real connection line needs to go to
|
||||
const arrowToPos = {
|
||||
x: to.x - POINT_RADIUS,
|
||||
y: to.y,
|
||||
|
||||
@@ -25,7 +25,7 @@ import { getSelectionBounds } from '../../utils/selection-utils';
|
||||
import styles from './index.module.less';
|
||||
|
||||
/**
|
||||
* 选择框
|
||||
* select box
|
||||
* @param props
|
||||
* @constructor
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ import React from 'react';
|
||||
|
||||
import styles from './index.module.less';
|
||||
|
||||
// demo 环境自绘 cross-hair,正式环境使用 IconAdd
|
||||
// The demo environment self-draws cross-hair, and the formal environment uses IconAdd.
|
||||
export default function CrossHair(): JSX.Element {
|
||||
return (
|
||||
<div className={styles.symbol}>
|
||||
|
||||
@@ -73,11 +73,11 @@ export const WorkflowPortRender: React.FC<WorkflowPortRenderProps> =
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
// useEffect 时序问题可能导致 port.hasError 非最新,需重新触发一次 validate
|
||||
// useEffect timing issue may cause port.hasError to be not up-to-date, and validate needs to be triggered again
|
||||
props.entity.validate();
|
||||
setHasError(props.entity.hasError);
|
||||
const dispose = props.entity.onEntityChange(() => {
|
||||
// 如果有挂载的节点,不需要更新位置信息
|
||||
// If there are mounted nodes, there is no need to update the location information
|
||||
if (entity.targetElement) {
|
||||
if (entity.targetElement !== targetElement) {
|
||||
setTargetElement(entity.targetElement);
|
||||
@@ -85,7 +85,7 @@ export const WorkflowPortRender: React.FC<WorkflowPortRenderProps> =
|
||||
return;
|
||||
}
|
||||
const newPos = props.entity.relativePosition;
|
||||
// 加上 round 避免点位抖动
|
||||
// Add round to avoid point jitter
|
||||
updatePosX(Math.round(newPos.x));
|
||||
updatePosY(Math.round(newPos.y));
|
||||
});
|
||||
@@ -108,11 +108,11 @@ export const WorkflowPortRender: React.FC<WorkflowPortRenderProps> =
|
||||
};
|
||||
}, [props.entity, hoverService, entity, targetElement, linesManager]);
|
||||
|
||||
// 监听变化
|
||||
// Monitor changes
|
||||
const className = classNames(styles.workflowPoint, {
|
||||
[styles.hovered]:
|
||||
!readonly && hovered && !disabled && portType !== 'input',
|
||||
// 有线条链接的时候深蓝色小圆点
|
||||
// Dark blue dots when there are line links.
|
||||
[styles.linked]: linked,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user