import { forwardRef, useEffect, useId, useRef, useState } from 'react'; import { Col } from '../components/Col'; import { Rect } from '../components/Rect'; import { Text } from '../components/Text'; import { Row } from '../components/Row'; import { SVG } from '../components/SVG'; import { Align } from '../components/Align'; import { BBoxWithChildren, Measure, useBluefishLayout, withBluefish, withBluefishComponent, useBluefishContext, } from '../bluefish'; import { Ref } from '../components/Ref'; import { Group } from '../components/Group'; import { Line } from '../components/Line'; import { Arrow } from '../components/Arrow'; import { Space } from '../components/Space'; import { Connector } from '../components/Connector'; import _ from 'lodash'; import { Align2 } from '../components/Align2'; export type TreeProps = { name: string; value: T; treeChildren?: TreeProps[]; }; // { /* */ } { /* */ } // export const Tree = forwardRef(function TreeFn({ name, value, treeChildren }: TreeProps, ref: any) { const tile = useRef(null); const leftHandle = useRef(null); const rightHandle = useRef(null); const letter = useRef(null); const opIdLabel = useRef(null); return ( , ]} /> , ]} /> {/* */} {(treeChildren ?? []).map((child, i) => ( ))} {treeChildren ? ( ) : null} {(treeChildren ?? []).map((child, i) => ( ))} {/* {treeChildren ? ( ) : null} */} ); }); export type MarkOpProps = { action: string; markType: string; backgroundColor: string; borderColor: string; opId: string; start: { opId: string }; end: { opId: string }; }; export type GoTreeProps = { tree: TreeProps; }; // TODO: put generic in the right place export const GoTree: React.FC> = ({ tree }) => { const charsRef = useRef(null); const markOpsRef = useRef(null); const context = useBluefishContext(); return ( {/* {chars.map((char) => ( ))} */} ); };