19 lines
764 B
TypeScript
19 lines
764 B
TypeScript
/**
|
||
* 纯文本节点的显示装配。外层复用节点变换与选择交互,内层使用文本编辑器的plain模式;不在此持有第二份文本数据。
|
||
*/
|
||
"use client";
|
||
|
||
import type { NodeProps } from "@xyflow/react";
|
||
import type { CanvasNode } from "@/lib/canvas";
|
||
import { TransformableNode } from "./transformable-node";
|
||
import { CanvasTextEditor } from "./canvas-text-editor";
|
||
|
||
/** NodeProps整体交给TransformableNode;文本编辑器取得同一个id/data/selected,plain决定其纯文本呈现方式。 */
|
||
export function PlainTextNode(props: NodeProps<CanvasNode>) {
|
||
return (
|
||
<TransformableNode {...props}>
|
||
<CanvasTextEditor id={props.id} data={props.data} selected={props.selected} plain />
|
||
</TransformableNode>
|
||
);
|
||
}
|