@next-bricks/diagram 0.24.0 → 0.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/5676.194219e1.js","mappings":"+PA8LWA,G,4XAhIL,cAAEC,GAAa,SAAEC,GAAUC,MAAK,UAAEC,KAAWC,EAAAA,GAAAA,oBAuBtCC,IAAqBC,EAAAA,GAAAA,YAAWC,IAE7CC,EAAA,CAICR,GAAc,aAAc,CAC3BS,WAAY,CAACC,GAAAA,MACbC,EAKCV,GAAS,CAAEW,KAAMC,SAASC,EAG1Bb,GAAS,CAAEc,WAAW,IAAQC,EAG9Bf,GAAS,CAAEc,WAAW,IAAQE,EAG9BhB,GAAS,CAAEc,WAAW,IAAQG,EAG9BjB,GAAS,CAAEc,WAAW,IAAQI,EAG9BlB,GAAS,CAAEc,WAAW,IAAQK,EAG9BnB,GAAS,CAAEc,WAAW,IAAQM,EAG9BpB,GAAS,CAAEW,KAAMU,UAAUC,EAG3BtB,GAAS,CAAEc,WAAW,IAAQS,EAG9BvB,GAAS,CAAEc,WAAW,IAAQU,EAG9BxB,GAAS,CAAEW,KAAMU,UAAUI,EAG3BzB,GAAS,CAAEW,KAAMU,UAAUK,EAG3B1B,GAAS,CAAEW,KAAMU,UAAUM,EAG3B3B,GAAS,CAAEc,WAAW,IAAQc,EAG9B3B,GAAM,CAAEU,KAAM,wBAAwBkB,EAOtC5B,GAAM,CAAEU,KAAM,gBAAgBmB,EAO9B7B,GAAM,CAAEU,KAAM,gBAAgBoB,EAO9B9B,GAAM,CAAEU,KAAM,eAAeqB,EAO7B/B,GAAM,CAAEU,KAAM,kBAAkBsB,GAOhChC,GAAM,CAAEU,KAAM,kBAAkBuB,GAehChC,KAAQ,IAAAiC,GAAA,IAAAC,QAAAC,GAAA,IAAAD,QAAAE,GAAA,IAAAF,QAAAG,GAAA,IAAAH,QAAAI,GAAA,IAAAJ,QAAAK,GAAA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ack:///./src/draw-canvas/index.tsx","webpack:///./src/experimental-node/index.tsx","webpack:///./src/editable-label/styles.shadow.css","webpack:///./src/experimental-node/styles.shadow.css"],"sourcesContent":["import React, {\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { EventEmitter, createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, zoom } from \"d3-zoom\";\nimport classNames from \"classnames\";\nimport { uniqueId } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type {\n DiagramEdge,\n DiagramNode,\n LayoutOptions,\n LineConf,\n NodeBrickConf,\n PositionTuple,\n RefRepository,\n RenderedLineLabel,\n TransformLiteral,\n LineTarget,\n ConnectLineDetail,\n ConnectNodesOptions,\n ConnectLineState,\n ActiveTarget,\n RangeTuple,\n LineLabel,\n LineLabelConf,\n TextOptions,\n DragNodesOptions,\n NodeMovement,\n ManualLayoutStatus,\n LineMaskRects,\n} from \"./interfaces\";\nimport { NodeComponentGroup } from \"./NodeComponent\";\nimport { handleKeyboard } from \"./processors/handleKeyboard\";\nimport { transformToCenter } from \"./processors/transformToCenter\";\nimport { getRenderedLines } from \"./processors/getRenderedLines\";\nimport { normalizeLinesAndMarkers } from \"./processors/normalizeLinesAndMarkers\";\nimport { LineLabelComponentGroup } from \"./LineLabelComponent\";\nimport { LineComponent } from \"./LineComponent\";\nimport { MarkerComponent } from \"./MarkerComponent\";\nimport { LineMaskComponent } from \"./LineMaskComponent\";\nimport { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { getRenderedLineLabels } from \"./processors/getRenderedLineLabels\";\nimport { handleNodesMouseDown } from \"./processors/handleNodesMouseDown\";\nimport { DEFAULT_SCALE_RANGE_MAX, DEFAULT_SCALE_RANGE_MIN } from \"./constants\";\nimport { useRenderedDiagram } from \"./hooks/useRenderedDiagram\";\nimport { adjustLineLabels } from \"./processors/adjustLineLabels\";\nimport styleText from \"./styles.shadow.css\";\nimport { useUserView } from \"./hooks/useUserView\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { getLineMaskRects } from \"./processors/getLineMaskRects\";\n\nconst { defineElement, property, event, method } = createDecorators();\n\nexport interface EoDiagramProps {\n layout?: \"dagre\" | \"force\";\n nodes?: DiagramNode[];\n edges?: DiagramEdge[];\n nodeBricks?: NodeBrickConf[];\n lines?: LineConf[];\n layoutOptions?: LayoutOptions;\n connectNodes?: ConnectNodesOptions;\n dragNodes?: DragNodesOptions;\n activeTarget?: ActiveTarget | null;\n disableKeyboardAction?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\nexport interface DiagramRef {\n callOnLineLabel(id: string, method: string, ...args: unknown[]): void;\n}\n\nexport const EoDiagramComponent = forwardRef(LegacyEoDiagramComponent);\n\n/**\n * 构件 `eo-diagram`\n */\nexport\n@defineElement(\"eo-diagram\", {\n styleTexts: [styleText],\n})\nclass EoDiagram extends ReactNextElement implements EoDiagramProps {\n /**\n * @required\n */\n @property({ type: String })\n accessor layout: \"dagre\" | \"force\" | undefined;\n\n @property({ attribute: false })\n accessor nodes: DiagramNode[] | undefined;\n\n @property({ attribute: false })\n accessor edges: DiagramEdge[] | undefined;\n\n @property({ attribute: false })\n accessor nodeBricks: NodeBrickConf[] | undefined;\n\n @property({ attribute: false })\n accessor lines: LineConf[] | undefined;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n @property({ type: Boolean })\n accessor disableKeyboardAction: boolean | undefined;\n\n @property({ attribute: false })\n accessor connectNodes: ConnectNodesOptions | undefined;\n\n @property({ attribute: false })\n accessor dragNodes: DragNodesOptions | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n @event({ type: \"node.delete\" })\n accessor #nodeDelete!: EventEmitter<DiagramNode>;\n\n #handleNodeDelete = (node: DiagramNode) => {\n this.#nodeDelete.emit(node);\n };\n\n @event({ type: \"edge.delete\" })\n accessor #edgeDelete!: EventEmitter<DiagramEdge>;\n\n #handleEdgeDelete = (edge: DiagramEdge) => {\n this.#edgeDelete.emit(edge);\n };\n\n @event({ type: \"line.click\" })\n accessor #lineClick!: EventEmitter<LineTarget>;\n\n #handleLineClick = (line: LineTarget) => {\n this.#lineClick.emit(line);\n };\n\n @event({ type: \"line.dblclick\" })\n accessor #lineDoubleClick!: EventEmitter<LineTarget>;\n\n #handleLineDoubleClick = (line: LineTarget) => {\n this.#lineDoubleClick.emit(line);\n };\n\n @event({ type: \"nodes.connect\" })\n accessor #connectNodes!: EventEmitter<ConnectLineDetail>;\n\n #handleNodesConnect = (detail: ConnectLineDetail) => {\n this.#connectNodes.emit(detail);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n #diagramRef = createRef<DiagramRef>();\n\n @method()\n callOnLineLabel(id: string, method: string, ...args: unknown[]) {\n this.#diagramRef.current?.callOnLineLabel(id, method, ...args);\n }\n\n render() {\n return (\n <EoDiagramComponent\n ref={this.#diagramRef}\n layout={this.layout}\n nodes={this.nodes}\n edges={this.edges}\n nodeBricks={this.nodeBricks}\n lines={this.lines}\n layoutOptions={this.layoutOptions}\n connectNodes={this.connectNodes}\n dragNodes={this.dragNodes}\n activeTarget={this.activeTarget}\n disableKeyboardAction={this.disableKeyboardAction}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onNodeDelete={this.#handleNodeDelete}\n onEdgeDelete={this.#handleEdgeDelete}\n onLineClick={this.#handleLineClick}\n onLineDoubleClick={this.#handleLineDoubleClick}\n onNodesConnect={this.#handleNodesConnect}\n />\n );\n }\n}\n\nexport interface EoDiagramComponentProps extends EoDiagramProps {\n onActiveTargetChange?(target: ActiveTarget | null): void;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n onNodeDelete?(node: DiagramNode): void;\n onEdgeDelete?(edge: DiagramEdge): void;\n onLineClick?(line: LineTarget): void;\n onLineDoubleClick?(line: LineTarget): void;\n onNodesConnect?(detail: ConnectLineDetail): void;\n}\n\nexport function LegacyEoDiagramComponent(\n {\n layout,\n nodes,\n edges,\n nodeBricks,\n lines,\n layoutOptions,\n connectNodes,\n dragNodes,\n activeTarget: _activeTarget,\n disableKeyboardAction,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onNodeDelete,\n onEdgeDelete,\n onLineClick,\n onLineDoubleClick,\n onNodesConnect,\n }: EoDiagramComponentProps,\n ref: React.Ref<DiagramRef>\n) {\n const [nodesReady, setNodesReady] = useState(false);\n const [nodesRenderId, setNodesRenderId] = useState(0);\n const [nodesRefRepository, setNodesRefRepository] =\n useState<RefRepository | null>(null);\n const [lineLabelsReady, setLineLabelsReady] = useState(false);\n const [lineLabelsRenderId, setLineLabelsRenderId] = useState(0);\n const [lineLabelsRefRepository, setLineLabelsRefRepository] =\n useState<RefRepository | null>(null);\n const [renderedLineLabels, setRenderedLineLabels] = useState<\n RenderedLineLabel[]\n >([]);\n\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n\n const linePathsRef = useRef(new Map<string, SVGPathElement | null>());\n\n const rootRef = useRef<HTMLDivElement>(null);\n const nodesRef = useRef<HTMLDivElement>(null);\n const [centered, setCentered] = useState(false);\n\n const { userViewReady, userViewNodesMap, saveUserView } = useUserView(\n dragNodes?.save\n );\n\n const [connectLineTo, setConnectLineTo] = useState<PositionTuple>([0, 0]);\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n const [manualLayoutStatus, setManualLayoutStatus] =\n useState<ManualLayoutStatus>(\"initial\");\n const [nodeMovement, setNodeMovement] = useState<NodeMovement | null>(null);\n\n useImperativeHandle(ref, () => ({\n callOnLineLabel(id, method, ...args) {\n (\n lineLabelsRefRepository?.get(id)\n ?.firstElementChild as unknown as Record<string, Function>\n )?.[method](...args);\n },\n }));\n\n useEffect(() => {\n const onNodesMouseDown = (event: MouseEvent) => {\n handleNodesMouseDown(event, {\n nodes,\n nodesRefRepository,\n connectNodes,\n dragNodes,\n scale: transform.k,\n setConnectLineState,\n setConnectLineTo,\n setManualLayoutStatus,\n setNodeMovement,\n onSwitchActiveTarget,\n onNodesConnect,\n });\n };\n // Bind mousedown event manually, since the React event handler can't work with\n // d3-zoom inside shadow DOM.\n const nodesContainer = nodesRef.current;\n nodesContainer?.addEventListener(\"mousedown\", onNodesMouseDown);\n return () => {\n nodesContainer?.removeEventListener(\"mousedown\", onNodesMouseDown);\n };\n }, [\n nodes,\n connectNodes,\n dragNodes,\n transform.k,\n nodesRefRepository,\n onNodesConnect,\n onSwitchActiveTarget,\n ]);\n\n const { normalizedLines, normalizedLinesMap, markers } = useMemo(\n () => normalizeLinesAndMarkers(edges, lines),\n [edges, lines]\n );\n\n const lineLabels = useMemo(() => {\n return normalizedLines.flatMap(({ line: { text, label, $id }, edge }) => {\n if (!text && !label) {\n return [] as LineLabel[];\n }\n\n let key: \"label\" | \"text\";\n let list: LineLabelConf[] | TextOptions[];\n if (label) {\n key = \"label\";\n list = ([] as LineLabelConf[]).concat(label);\n } else {\n key = \"text\";\n list = ([] as TextOptions[]).concat(text!);\n }\n\n return list.map<LineLabel>((item) => ({\n [key as \"label\"]: item as LineLabelConf,\n id: `${$id}-${item.placement ?? \"center\"}`,\n edge,\n }));\n });\n }, [normalizedLines]);\n\n const { nodes: renderedNodes, edges: renderedEdges } = useRenderedDiagram({\n layout,\n nodes,\n edges,\n manualLayoutStatus,\n userViewReady,\n userViewNodesMap,\n nodeMovement,\n nodesRefRepository,\n lineLabelsRefRepository,\n normalizedLinesMap,\n layoutOptions,\n nodesRenderId,\n lineLabelsRenderId,\n });\n\n useEffect(\n () => {\n if (manualLayoutStatus === \"finished\") {\n saveUserView(\n renderedNodes.map((node) => ({\n id: node.id,\n x: node.x,\n y: node.y,\n }))\n );\n }\n },\n // Only save user view when manual layout is just finished.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [manualLayoutStatus]\n );\n\n const renderedLines = useMemo(\n () => getRenderedLines(renderedEdges, renderedNodes, normalizedLines),\n [normalizedLines, renderedNodes, renderedEdges]\n );\n\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange?.(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || disableKeyboardAction) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => {\n const action = handleKeyboard(event, {\n renderedNodes,\n activeTarget,\n });\n\n if (action?.action === \"delete-node\") {\n onNodeDelete?.(action.node);\n } else if (action?.action === \"delete-edge\") {\n onEdgeDelete?.(action.edge);\n } else if (action?.action === \"switch-active-node\" && action.node) {\n onSwitchActiveTarget?.({ type: \"node\", nodeId: action.node.id });\n }\n };\n root.addEventListener(\"keydown\", onKeydown);\n return () => {\n root.removeEventListener(\"keydown\", onKeydown);\n };\n }, [\n activeTarget,\n renderedNodes,\n disableKeyboardAction,\n onSwitchActiveTarget,\n onNodeDelete,\n onEdgeDelete,\n ]);\n\n const handleNodesRendered = useCallback(\n (refRepository: RefRepository | null) => {\n if (refRepository) {\n setNodesRenderId((previous) => previous + 1);\n setNodesRefRepository(refRepository);\n }\n setNodesReady((previous) => previous || !!refRepository);\n },\n []\n );\n\n const handleLineLabelsRendered = useCallback(\n (refRepository: RefRepository | null) => {\n if (refRepository) {\n setLineLabelsRenderId((previous) => previous + 1);\n setLineLabelsRefRepository(refRepository);\n }\n setLineLabelsReady((previous) => previous || !!refRepository);\n },\n []\n );\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<HTMLDivElement, unknown>(), []);\n\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n });\n }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => e.preventDefault())\n .on(\"dblclick.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"mousedown.zoom\", null)\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, scrollable, zoomable, zoomer]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (renderedNodes.length === 0 || !root || centered) {\n return;\n }\n const { k, x, y } = transformToCenter(renderedNodes, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n setCentered(true);\n }, [centered, renderedNodes, scaleRange, zoomable, zoomer]);\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n const maskPrefix = `${defPrefix}mask-`;\n const activeLineMarkerPrefix = `${defPrefix}active-line-`;\n\n useEffect(() => {\n setRenderedLineLabels((previous) =>\n getRenderedLineLabels(previous, renderedLines, linePathsRef.current)\n );\n }, [renderedLines]);\n\n const [lineMaskRects, setLineMaskRects] = React.useState<LineMaskRects>(\n new Map()\n );\n\n useEffect(() => {\n if (!lineLabelsRefRepository) {\n return;\n }\n const updateLineMaskRects = () => {\n setLineMaskRects(\n getLineMaskRects(renderedLineLabels, lineLabelsRefRepository)\n );\n };\n\n adjustLineLabels(renderedLineLabels, lineLabelsRefRepository);\n\n const observer = new ResizeObserver(updateLineMaskRects);\n for (const lineLabel of lineLabelsRefRepository.values()) {\n observer.observe(lineLabel);\n }\n return () => {\n observer.disconnect();\n };\n }, [lineLabelsRenderId, lineLabelsRefRepository, renderedLineLabels]);\n\n if (layout !== \"dagre\" && layout !== \"force\") {\n return <div>{`Diagram layout not supported: \"${layout}\"`}</div>;\n }\n\n return (\n <div\n className={classNames(\"diagram\", {\n ready: nodesReady && centered,\n grabbing,\n pannable,\n })}\n tabIndex={-1}\n ref={rootRef}\n >\n <svg width=\"100%\" height=\"100%\" className=\"lines\">\n <defs>\n {markers.map(({ type, strokeColor }, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type={type}\n strokeColor={strokeColor}\n />\n ))}\n {[...lineMaskRects].map(([lineId, rects]) => (\n <LineMaskComponent\n key={lineId}\n lineId={lineId}\n rects={rects}\n maskPrefix={maskPrefix}\n renderedLineLabels={renderedLineLabels}\n />\n ))}\n <marker\n id={`${activeLineMarkerPrefix}start`}\n viewBox=\"0 0 8 8\"\n refX={4}\n refY={4}\n markerWidth={8}\n markerHeight={8}\n orient=\"auto\"\n >\n <path\n d=\"M 0.5 0.5 H 7.5 V 7.5 H 0.5 Z\"\n stroke=\"var(--palette-gray-7)\"\n strokeWidth={1}\n fill=\"var(--palette-gray-1)\"\n />\n </marker>\n <marker\n id={`${activeLineMarkerPrefix}end`}\n viewBox=\"0 0 14 8\"\n refX={3}\n refY={4}\n markerWidth={14}\n markerHeight={8}\n orient=\"auto\"\n >\n <path\n d=\"M 0.5 1.5 L 5.5 4 L 0.5 6.5 z\"\n stroke=\"var(--palette-blue-3)\"\n strokeWidth={1}\n fill=\"var(--palette-blue-3)\"\n />\n <path\n d=\"M 6.5 0.5 H 13.5 V 7.5 H 6.5 Z\"\n stroke=\"var(--palette-gray-7)\"\n strokeWidth={1}\n fill=\"var(--palette-gray-1)\"\n />\n </marker>\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n {renderedLines.map((line) => (\n <LineComponent\n key={line.line.$id}\n line={line}\n linePaths={linePathsRef.current}\n lineMaskRects={lineMaskRects}\n maskPrefix={maskPrefix}\n markerPrefix={markerPrefix}\n activeLineMarkerPrefix={activeLineMarkerPrefix}\n active={\n activeTarget?.type === \"edge\" &&\n activeTarget.edge.source === line.edge.source &&\n activeTarget.edge.target === line.edge.target\n }\n activeRelated={\n activeTarget?.type === \"node\" &&\n (line.edge.source === activeTarget.nodeId ||\n line.edge.target === activeTarget.nodeId)\n }\n onLineClick={onLineClick}\n onLineDoubleClick={onLineDoubleClick}\n />\n ))}\n </g>\n </svg>\n <div\n className={classNames(\"line-labels\", { ready: lineLabelsReady })}\n style={{\n left: transform.x,\n top: transform.y,\n transform: `scale(${transform.k})`,\n }}\n >\n <LineLabelComponentGroup\n labels={lineLabels}\n onRendered={handleLineLabelsRendered}\n />\n </div>\n <div\n className=\"nodes\"\n ref={nodesRef}\n style={{\n left: transform.x,\n top: transform.y,\n transform: `scale(${transform.k})`,\n }}\n >\n <NodeComponentGroup\n nodes={nodes}\n nodeBricks={nodeBricks}\n // nodePositions={nodePositions}\n onRendered={handleNodesRendered}\n />\n </div>\n <ConnectLineComponent\n connectLineState={connectLineState}\n connectLineTo={connectLineTo}\n markerPrefix={markerPrefix}\n />\n </div>\n );\n}\n","import React, {\n createRef,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from \"react\";\nimport { EventEmitter, createDecorators } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport classNames from \"classnames\";\nimport styleText from \"./styles.shadow.css\";\n\nconst { defineElement, property, event, method } = createDecorators();\n\nexport interface EditableLabelProps {\n label?: string;\n type?: LabelType;\n}\n\nexport type LabelType = \"line\" | \"default\";\n\nexport interface EditableLabelRef {\n enableEditing(): void;\n}\n\nexport const EditableLabelComponent = forwardRef(LegacyEditableLabelComponent);\n\n/**\n * 构件 `diagram.editable-label`\n */\nexport\n@defineElement(\"diagram.editable-label\", {\n styleTexts: [styleText],\n})\nclass EditableLabel extends ReactNextElement implements EditableLabelProps {\n @property()\n accessor label: string | undefined;\n\n @property({ render: false })\n accessor type: LabelType | undefined;\n\n @event({ type: \"label.editing.change\" })\n accessor #labelEditingChange!: EventEmitter<boolean>;\n\n #handleLabelEditingChange = (value: boolean) => {\n this.#labelEditingChange.emit(value);\n };\n\n @event({ type: \"label.change\" })\n accessor #labelChange!: EventEmitter<string>;\n\n #handleLabelChange = (value: string) => {\n this.#labelChange.emit(value);\n };\n\n @method()\n enableEditing() {\n this.#editableLabelRef.current?.enableEditing();\n }\n\n #editableLabelRef = createRef<EditableLabelRef>();\n\n render() {\n return (\n <EditableLabelComponent\n ref={this.#editableLabelRef}\n label={this.label}\n onLabelEditingChange={this.#handleLabelEditingChange}\n onLabelChange={this.#handleLabelChange}\n />\n );\n }\n}\n\nexport interface EditableLabelComponentProps extends EditableLabelProps {\n onLabelEditingChange?(value: boolean): void;\n onLabelChange?(value: string): void;\n}\n\nexport function LegacyEditableLabelComponent(\n {\n label: _label,\n onLabelChange,\n onLabelEditingChange,\n }: EditableLabelComponentProps,\n ref: React.Ref<EditableLabelRef>\n) {\n const label = _label ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const labelInputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(ref, () => ({\n enableEditing() {\n setEditingLabel(true);\n },\n }));\n\n useEffect(() => {\n setCurrentLabel(label);\n }, [label]);\n\n const handleEditLabel = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n }, []);\n\n useEffect(() => {\n if (editingLabel) {\n // Prevent scroll when focusing.\n // Otherwise the diagram svg may be clipped in Chrome.\n labelInputRef.current?.focus({ preventScroll: true });\n labelInputRef.current?.select();\n }\n }, [editingLabel]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onLabelEditingChange?.(editingLabel);\n } else {\n editingLabelInitialized.current = true;\n }\n }, [editingLabel, onLabelEditingChange]);\n\n const handleInputChange = useCallback(\n (event: React.ChangeEvent<HTMLInputElement>) => {\n setCurrentLabel(event.target.value);\n },\n []\n );\n\n const handleInputKeydown = useCallback((event: React.KeyboardEvent) => {\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n if (key === \"Enter\" || key === 13) {\n labelInputRef.current?.blur();\n }\n }, []);\n\n const handleInputBlur = useCallback(() => {\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, []);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onLabelChange?.(currentLabel);\n setShouldEmitLabelChange(false);\n }\n }, [currentLabel, onLabelChange, shouldEmitLabelChange]);\n\n const stopPropagation = useCallback((e: React.MouseEvent) => {\n e.stopPropagation();\n }, []);\n\n return (\n <div\n className={classNames(\"label\", {\n editing: editingLabel,\n empty: !currentLabel,\n })}\n onDoubleClick={stopPropagation}\n onMouseDown={stopPropagation}\n >\n <input\n className=\"label-input\"\n value={currentLabel}\n ref={labelInputRef}\n onChange={handleInputChange}\n onKeyDown={handleInputKeydown}\n onBlur={handleInputBlur}\n />\n <div className=\"label-text\" onDoubleClick={handleEditLabel}>\n {currentLabel}\n </div>\n </div>\n );\n}\n","import React, {\n createRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport type { UseSingleBrickConf } from \"@next-core/react-runtime\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, zoom } from \"d3-zoom\";\nimport classNames from \"classnames\";\nimport type { lockBodyScroll as _lockBodyScroll } from \"@next-bricks/basic/data-providers/lock-body-scroll/lock-body-scroll\";\nimport type {\n PositionTuple,\n RangeTuple,\n SizeTuple,\n TransformLiteral,\n} from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n Cell,\n EdgeCell,\n InitialCell,\n NodeBrickConf,\n NodeCell,\n NodeId,\n DecoratorCell,\n DecoratorType,\n CellContextMenuDetail,\n ConnectLineState,\n Deferred,\n ConnectNodesDetail,\n EdgeLineConf,\n DecoratorTextChangeDetail,\n NodeView,\n} from \"./interfaces\";\nimport { rootReducer } from \"./reducers\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport { isNodeCell } from \"./processors/asserts\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { handleKeyboard } from \"./processors/handleKeyboard\";\nimport { CellComponent } from \"./CellComponent\";\nimport styleText from \"./styles.shadow.css\";\nimport { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { initializeCells } from \"./processors/initializeCells\";\nimport { transformToCenter } from \"./processors/transformToCenter\";\nimport { updateCells } from \"./processors/updateCells\";\nimport { getUnrelatedCells } from \"./processors/getUnrelatedCells\";\n\nconst DEFAULT_NODE_SIZE = 20;\nconst DEFAULT_AREA_WIDTH = 100;\nconst DEFAULT_AREA_HEIGHT = 60;\nconst DEFAULT_SCALE_RANGE_MIN = 0.5;\nconst DEFAULT_SCALE_RANGE_MAX = 2;\n\nconst lockBodyScroll = unwrapProvider<typeof _lockBodyScroll>(\n \"basic.lock-body-scroll\"\n);\n\nconst { defineElement, property, method, event } = createDecorators();\n\nexport interface EoDrawCanvasProps {\n cells: InitialCell[] | undefined;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\nexport interface DropNodeInfo extends AddNodeInfo {\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n}\n\nexport interface DropDecoratorInfo {\n decorator: DecoratorType;\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n text?: string;\n}\n\nexport interface AddNodeInfo {\n id: NodeId;\n useBrick?: UseSingleBrickConf;\n data?: unknown;\n size?: SizeTuple;\n}\n\nexport interface AddEdgeInfo {\n source: NodeId;\n target: NodeId;\n data?: unknown;\n}\n\nexport interface UpdateCellsContext {\n reason: \"add-related-nodes\";\n parent: NodeId;\n}\n\nexport interface AddNodesContext {\n defaultNodeSize: SizeTuple;\n canvasHeight: number;\n}\n\nexport const EoDrawCanvasComponent = React.forwardRef(\n LegacyEoDrawCanvasComponent\n);\n\n/**\n * 用于手工绘图的画布。\n *\n * 注意:将配套另外一个用于展示的画布构件。\n */\nexport\n@defineElement(\"eo-draw-canvas\", {\n styleTexts: [styleText],\n})\nclass EoDrawCanvas extends ReactNextElement implements EoDrawCanvasProps {\n /**\n * 仅当初始化时使用,渲染后重新设置 `cells` 将无效。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ attribute: false })\n accessor defaultNodeSize: SizeTuple = [DEFAULT_NODE_SIZE, DEFAULT_NODE_SIZE];\n\n @property({ attribute: false })\n accessor defaultNodeBricks: NodeBrickConf[] | undefined;\n\n /**\n * 使用条件判断设置默认的边对应的连线。在 `if` 表达式中 `DATA` 为 `{ edge }`,例如:\n *\n * ```yaml\n * defaultEdgeLines:\n * - if: <% DATA.edge.data?.virtual %>\n * dashed: true\n * ```\n */\n @property({ attribute: false })\n accessor defaultEdgeLines: EdgeLineConf[] | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n @property({ type: Boolean })\n accessor fadeUnrelatedCells: boolean | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n /**\n * @deprecated Use `cell.move` instead.\n */\n @event({ type: \"node.move\" })\n accessor #nodeMoveEvent!: EventEmitter<MoveCellPayload>;\n\n @event({ type: \"cell.move\" })\n accessor #cellMoveEvent!: EventEmitter<MoveCellPayload>;\n\n #handleCellMove = (info: MoveCellPayload) => {\n this.#cellMoveEvent.emit(info);\n if (info.type === \"node\") {\n this.#nodeMoveEvent.emit(info);\n }\n };\n\n @event({ type: \"cell.resize\" })\n accessor #cellResizeEvent!: EventEmitter<ResizeCellPayload>;\n\n #handleCellResize = (info: ResizeCellPayload) => {\n this.#cellResizeEvent.emit(info);\n };\n\n /**\n * @deprecated Use `cell.delete` instead.\n */\n @event({ type: \"node.delete\" })\n accessor #nodeDelete!: EventEmitter<Cell>;\n\n @event({ type: \"cell.delete\" })\n accessor #cellDelete!: EventEmitter<Cell>;\n\n #handleCellDelete = (cell: Cell) => {\n this.#cellDelete.emit(cell);\n if (cell.type === \"node\") {\n this.#nodeDelete.emit(cell);\n }\n };\n\n @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n @event({ type: \"decorator.text.change\" })\n accessor #decoratorTextChange!: EventEmitter<DecoratorTextChangeDetail>;\n\n #handleDecoratorTextChange = (detail: DecoratorTextChangeDetail) => {\n this.#decoratorTextChange.emit(detail);\n };\n\n /**\n * 缩放变化后,从素材库拖拽元素进画布时,拖拽图像应设置对应的缩放比例。\n */\n @event({ type: \"scale.change\" })\n accessor #scaleChange!: EventEmitter<number>;\n\n #handleScaleChange = (scale: number) => {\n this.#scaleChange.emit(scale);\n };\n\n @method()\n async dropNode({\n id,\n position,\n size,\n data,\n useBrick,\n }: DropNodeInfo): Promise<NodeCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newNode: NodeCell = {\n type: \"node\",\n id,\n view: {\n x:\n (position[0] - boundingClientRect.left - transform.x) / transform.k,\n y: (position[1] - boundingClientRect.top - transform.y) / transform.k,\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n },\n data,\n useBrick,\n };\n this.#canvasRef.current?.dropNode(newNode);\n return newNode;\n }\n return null;\n }\n\n @method()\n async dropDecorator({\n position,\n decorator,\n text,\n }: DropDecoratorInfo): Promise<DecoratorCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newDecorator: DecoratorCell = {\n type: \"decorator\",\n decorator,\n id: uuidV4(),\n view: {\n x:\n (position[0] - boundingClientRect.left - transform.x) / transform.k,\n y: (position[1] - boundingClientRect.top - transform.y) / transform.k,\n width: DEFAULT_AREA_WIDTH,\n height: DEFAULT_AREA_HEIGHT,\n text,\n },\n };\n this.#canvasRef.current?.dropDecorator(newDecorator);\n return newDecorator;\n }\n return null;\n }\n\n @method()\n async addNodes(nodes: AddNodeInfo[]): Promise<NodeCell[]> {\n if (nodes.length === 0) {\n return [];\n }\n const newNodes = nodes.map<NodeCell>(({ size, useBrick, id, data }) => ({\n type: \"node\",\n id,\n data,\n view: {\n // x: Math.floor(index / rows) * (width + gap) + gap,\n // y: (index % rows) * (height + gap) + gap,\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n } as NodeView,\n useBrick,\n }));\n return this.#canvasRef.current!.addNodes(newNodes, {\n defaultNodeSize: this.defaultNodeSize,\n canvasHeight: this.clientHeight,\n });\n }\n\n @method()\n async addEdge({ source, target, data }: AddEdgeInfo): Promise<EdgeCell> {\n const newEdge: EdgeCell = {\n type: \"edge\",\n source,\n target,\n data,\n };\n this.#canvasRef.current?.addEdge(newEdge);\n return newEdge;\n }\n\n @method()\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail> {\n return this.#canvasRef.current!.manuallyConnectNodes(source);\n }\n\n @method()\n async updateCells(\n cells: InitialCell[],\n ctx?: UpdateCellsContext\n ): Promise<{ updated: Cell[] }> {\n const transform = this.#canvasRef.current!.getTransform();\n const { cells: newCells, updated } = updateCells({\n ...ctx,\n cells,\n defaultNodeSize: this.defaultNodeSize,\n canvasHeight: this.clientHeight,\n transform,\n });\n this.#canvasRef.current!.updateCells(newCells);\n return { updated };\n }\n\n #canvasRef = createRef<DrawCanvasRef>();\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n lockBodyScroll(this, false);\n }\n\n render() {\n return (\n <EoDrawCanvasComponent\n host={this}\n ref={this.#canvasRef}\n cells={this.cells}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n activeTarget={this.activeTarget}\n fadeUnrelatedCells={this.fadeUnrelatedCells}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onCellMove={this.#handleCellMove}\n onCellResize={this.#handleCellResize}\n onCellDelete={this.#handleCellDelete}\n onCellContextMenu={this.#handleCellContextMenu}\n onDecoratorTextChange={this.#handleDecoratorTextChange}\n onScaleChange={this.#handleScaleChange}\n />\n );\n }\n}\n\nexport interface EoDrawCanvasComponentProps extends EoDrawCanvasProps {\n host: HTMLElement;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellMove(info: MoveCellPayload): void;\n onCellResize(cell: ResizeCellPayload): void;\n onCellDelete(cell: Cell): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextChange(detail: DecoratorTextChangeDetail): void;\n onScaleChange(scale: number): void;\n}\n\nexport interface DrawCanvasRef {\n dropNode(node: NodeCell): void;\n dropDecorator(decorator: DecoratorCell): void;\n addNodes(nodes: NodeCell[], ctx: AddNodesContext): NodeCell[];\n addEdge(edge: EdgeCell): void;\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail>;\n updateCells(cells: Cell[]): void;\n getTransform(): TransformLiteral;\n}\n\nfunction LegacyEoDrawCanvasComponent(\n {\n host,\n cells: initialCells,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellMove,\n onCellResize,\n onCellDelete,\n onCellContextMenu,\n onDecoratorTextChange,\n onScaleChange,\n }: EoDrawCanvasComponentProps,\n ref: React.Ref<DrawCanvasRef>\n) {\n const [{ cells }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n })\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n const cellsRef = useRef<SVGGElement>(null);\n const manualConnectDeferredRef = useRef<Deferred<ConnectNodesDetail> | null>(\n null\n );\n const [editingTexts, setEditingTexts] = useState<string[]>([]);\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n onScaleChange(transform.k);\n }, [onScaleChange, transform.k]);\n\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<SVGSVGElement, unknown>(), []);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n });\n }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => e.preventDefault())\n .on(\"dblclick.zoom\", null)\n .on(\"mousedown.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, scrollable, zoomable, zoomer]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || centered) {\n return;\n }\n const { k, x, y } = transformToCenter(cells, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n // jsdom doesn't support svg baseVal yet.\n // https://github.com/jsdom/jsdom/issues/2531\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n }\n setCentered(true);\n }, [cells, centered, scaleRange, zoomable, zoomer]);\n\n useImperativeHandle(\n ref,\n () => ({\n dropNode(node) {\n dispatch({ type: \"drop-node\", payload: node });\n },\n dropDecorator(decorator) {\n dispatch({ type: \"drop-decorator\", payload: decorator });\n },\n addNodes(nodes, { defaultNodeSize, canvasHeight }: AddNodesContext) {\n const index =\n cells.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n const newCells = [\n ...cells.slice(0, index),\n ...nodes,\n ...cells.slice(index),\n ];\n const { cells: allCells, updated } = updateCells({\n cells: newCells,\n defaultNodeSize,\n canvasHeight,\n transform,\n });\n dispatch({ type: \"update-cells\", payload: allCells });\n return updated.filter((node) =>\n nodes.includes(node as NodeCell)\n ) as NodeCell[];\n },\n addEdge(edge) {\n dispatch({ type: \"add-edge\", payload: edge });\n },\n updateCells(cells) {\n dispatch({ type: \"update-cells\", payload: cells });\n },\n getTransform() {\n return transform;\n },\n manuallyConnectNodes(sourceId) {\n const source = cells.find(\n (cell) => isNodeCell(cell) && cell.id === sourceId\n ) as NodeCell | undefined;\n if (source) {\n const rect = rootRef.current!.getBoundingClientRect();\n setConnectLineState({\n source,\n from: [\n source.view.x + source.view.width / 2,\n source.view.y + source.view.height / 2,\n ],\n offset: [rect.left, rect.top],\n });\n const promise = new Promise<ConnectNodesDetail>((resolve, reject) => {\n manualConnectDeferredRef.current = { resolve, reject };\n });\n return promise;\n }\n return Promise.reject(null);\n },\n }),\n [cells, transform]\n );\n\n const handleConnect = useCallback(\n (state: ConnectLineState, to: PositionTuple) => {\n // Find the target node from top bo bottom,\n // detect whether the pointer is inside the target node.\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i];\n // Currently ignore connecting to self\n if (isNodeCell(cell) && cell.id !== state.source.id) {\n if (\n cell.view.x < to[0] &&\n cell.view.x + cell.view.width > to[0] &&\n cell.view.y < to[1] &&\n cell.view.y + cell.view.height > to[1]\n ) {\n manualConnectDeferredRef.current?.resolve({\n source: state.source,\n target: cell,\n });\n break;\n }\n }\n }\n manualConnectDeferredRef.current?.reject(null);\n setConnectLineState(null);\n },\n [cells]\n );\n\n useEffect(() => {\n lockBodyScroll(host, !!connectLineState);\n }, [connectLineState, host]);\n\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, activeTarget)\n : [];\n // Do not update the state when prev and next are both empty.\n setUnrelatedCells((prev) =>\n prev.length === 0 && nextUnrelated.length === 0 ? prev : nextUnrelated\n );\n }, [activeTarget, cells, fadeUnrelatedCells]);\n\n useEffect(() => {\n if (!activeTarget) {\n return;\n }\n const resetActiveTarget = (e: MouseEvent) => {\n const path = e.composedPath();\n const cellsContainerIndex = path.indexOf(cellsRef.current!);\n // Reset active target to null when clicking outside of the cells container,\n // Or inside the cells container but not on any cell.\n if (cellsContainerIndex <= 0) {\n setActiveTarget(null);\n }\n };\n document.addEventListener(\"click\", resetActiveTarget);\n return () => {\n document.removeEventListener(\"click\", resetActiveTarget);\n };\n }, [activeTarget]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || editingTexts.length > 0) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => {\n const action = handleKeyboard(event, {\n cells,\n activeTarget,\n });\n\n if (action?.action === \"delete-cell\") {\n onCellDelete(action.cell);\n }\n };\n root.addEventListener(\"keydown\", onKeydown);\n return () => {\n root.removeEventListener(\"keydown\", onKeydown);\n };\n }, [activeTarget, cells, editingTexts.length, onCellDelete]);\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n const markerEnd = `${markerPrefix}1`;\n\n const handleCellMoving = useCallback((info: MoveCellPayload) => {\n dispatch({ type: \"move-cell\", payload: info });\n }, []);\n\n const handleCellMoved = useCallback(\n (info: MoveCellPayload) => {\n dispatch({ type: \"move-cell\", payload: info });\n onCellMove(info);\n },\n [onCellMove]\n );\n\n const handleCellResizing = useCallback((info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n }, []);\n\n const handleCellResized = useCallback(\n (info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n onCellResize(info);\n },\n [onCellResize]\n );\n\n const handleDecoratorTextEditing = useCallback(\n ({ id, editing }: { id: string; editing: boolean }) => {\n if (editing) {\n setEditingTexts((texts) =>\n texts.includes(id) ? texts : [...texts, id]\n );\n } else {\n setEditingTexts((texts) => texts.filter((text) => text !== id));\n }\n },\n []\n );\n\n return (\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable })}\n tabIndex={-1}\n >\n <defs>\n <MarkerComponent id={markerEnd} type=\"arrow\" strokeColor=\"gray\" />\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n <g className=\"cells\" ref={cellsRef}>\n {cells.map((cell) => (\n <CellComponent\n key={`${cell.type}:${cell.type === \"edge\" ? `${cell.source}~${cell.target}` : cell.id}`}\n cell={cell}\n cells={cells}\n defaultNodeBricks={defaultNodeBricks}\n defaultEdgeLines={defaultEdgeLines}\n transform={transform}\n markerEnd={markerEnd}\n active={sameTarget(activeTarget, cell)}\n unrelatedCells={unrelatedCells}\n onCellMoving={handleCellMoving}\n onCellMoved={handleCellMoved}\n onCellResizing={handleCellResizing}\n onCellResized={handleCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onDecoratorTextChange={onDecoratorTextChange}\n onDecoratorTextEditing={handleDecoratorTextEditing}\n />\n ))}\n </g>\n <ConnectLineComponent\n connectLineState={connectLineState}\n transform={transform}\n markerEnd={markerEnd}\n onConnect={handleConnect}\n />\n </g>\n </svg>\n );\n}\n\nfunction uuidV4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n","// istanbul ignore file: experimental only\nimport React, { useCallback } from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport \"@next-core/theme\";\nimport type { PositionTuple } from \"../diagram/interfaces\";\nimport styleText from \"./styles.shadow.css\";\nimport type { DecoratorType } from \"../draw-canvas/interfaces\";\n\nconst { defineElement, property, event } = createDecorators();\n\ntype ExperimentalUsage = \"library\" | \"dragging\" | \"default\";\ntype NodeStatus = \"highlighted\" | \"faded\" | \"default\";\n\nexport interface ExperimentalNodeProps {\n usage?: ExperimentalUsage;\n status?: NodeStatus;\n}\n\n/**\n * 构件 `diagram.experimental-node`\n */\nexport\n@defineElement(\"diagram.experimental-node\", {\n styleTexts: [styleText],\n})\nclass ExperimentalNode\n extends ReactNextElement\n implements ExperimentalNodeProps\n{\n @property()\n accessor usage: ExperimentalUsage | undefined;\n\n // 最终节点应该统一实现这个字段,保持类型一致\n @property({ type: String, render: false })\n accessor status: NodeStatus | undefined;\n\n // 最终节点应该统一实现这个字段,保持类型一致\n @property({ type: String })\n accessor decorator: DecoratorType | undefined;\n\n @event({ type: \"drag.start\" })\n accessor #dragStartEvent!: EventEmitter<PositionTuple>;\n\n #handleDragStart = (position: PositionTuple) => {\n this.#dragStartEvent.emit(position);\n };\n\n @event({ type: \"drag.move\" })\n accessor #dragMoveEvent!: EventEmitter<PositionTuple>;\n\n #handleDragMove = (position: PositionTuple) => {\n this.#dragMoveEvent.emit(position);\n };\n\n @event({ type: \"drag.end\" })\n accessor #dragEndEvent!: EventEmitter<PositionTuple>;\n\n #handleDragEnd = (position: PositionTuple) => {\n this.#dragEndEvent.emit(position);\n };\n\n render() {\n return (\n <ExperimentalNodeComponent\n usage={this.usage}\n onDragStart={this.#handleDragStart}\n onDragMove={this.#handleDragMove}\n onDragEnd={this.#handleDragEnd}\n />\n );\n }\n}\n\nexport interface ExperimentalNodeComponentProps extends ExperimentalNodeProps {\n onDragStart?(position: PositionTuple): void;\n onDragMove?(position: PositionTuple): void;\n onDragEnd?(position: PositionTuple): void;\n}\n\nexport function ExperimentalNodeComponent({\n usage,\n onDragStart,\n onDragMove,\n onDragEnd,\n}: ExperimentalNodeComponentProps) {\n const handleMouseDown = useCallback(\n (event: React.MouseEvent) => {\n if (usage !== \"library\") {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n const from: PositionTuple = [event.clientX, event.clientY];\n let moved = false;\n const onMouseMove = (e: MouseEvent) => {\n if (!moved) {\n moved = (e.clientX - from[0]) ** 2 + (e.clientY - from[1]) ** 2 >= 9;\n if (moved) {\n onDragStart?.([e.clientX, e.clientY]);\n }\n }\n if (moved) {\n onDragMove?.([e.clientX, e.clientY]);\n }\n };\n const onMouseUp = (e: MouseEvent) => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n if (moved) {\n onDragEnd?.([e.clientX, e.clientY]);\n }\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n },\n [onDragEnd, onDragMove, onDragStart, usage]\n );\n\n return (\n <div onMouseDown={handleMouseDown}>\n <slot />\n </div>\n );\n}\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:host{display:block;--local-label-line-height:inherit;--local-label-font-size:inherit;--local-label-color:inherit;--local-label-font-weight:inherit}:host([hidden]){display:none}:host([type=\"line\"]){--local-label-line-height:18px;--local-label-font-size:11px;--local-label-color:var(--color-secondary-text);--local-label-font-weight:400}*{box-sizing:border-box}.label{max-width:168px;margin:-3px}.label-text,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:var(--local-label-line-height);font-size:var(--local-label-font-size);color:var(--local-label-color);font-weight:var(--local-label-font-weight);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.label-text{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.label.editing .label-text,\n.label.empty:not(.editing) .label-text,\n.label:not(.editing) .label-input{display:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;border:1px solid var(--palette-gray-5);cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}:host([hidden]){display:none}:host([usage=\"dragging\"]){opacity:0.75;position:fixed}:host(:not([usage=\"library\"])){background:var(--palette-gray-3);width:60px;height:60px}:host([usage=\"library\"]){width:180px;height:30px;margin-bottom:10px}div{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host([status=\"highlighted\"]){color:var(--palette-blue-5);background:var(--palette-blue-1);border-color:1px solid var(--palette-blue-4)}:host([status=\"faded\"]){opacity:0.3}:host([decorator=\"area\"]){width:100px;height:60px;background:rgba(119,141,195,0.1);border:none}:host([decorator=\"text\"]){width:auto;height:auto;background:none;border:none}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["_EoDiagram","defineElement","property","event","method","createDecorators","EoDiagramComponent","forwardRef","LegacyEoDiagramComponent","_classDecs","styleTexts","styleText","_dec","type","String","_dec2","attribute","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","Boolean","_dec9","_dec10","_dec11","_dec12","_dec13","_dec14","_dec15","_dec16","_dec17","_dec18","_dec19","_dec20","_dec21","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_activeTargetChangeEvent","_handleActiveTargetChange","_P","_nodeDelete","_handleNodeDelete","_Q","_edgeDelete","_handleEdgeDelete","_R","_lineClick","_handleLineClick","_S","_lineDoubleClick","_handleLineDoubleClick","_T","_connectNodes","_handleNodesConnect","_handleSwitchActiveTarget","_diagramRef","EoDiagram","ReactNextElement","constructor","arguments","_classPrivateFieldInitSpec","get","_get_connectNodes2","set","_set_connectNodes2","_get_lineDoubleClick2","_set_lineDoubleClick2","_get_lineClick2","_set_lineClick2","_get_edgeDelete2","_set_edgeDelete2","_get_nodeDelete2","_set_nodeDelete2","_get_activeTargetChangeEvent2","_set_activeTargetChangeEvent2","writable","value","_initProto","_init_layout","_init_nodes","_init_edges","_init_nodeBricks","_init_lines","_init_layoutOptions","_init_activeTarget","_init_disableKeyboardAction","_init_connectNodes","_init_dragNodes","_init_zoomable","_init_scrollable","_init_pannable","_init_scaleRange","_init_activeTargetChangeEvent","target","_classPrivateFieldGet","this","emit","_init_nodeDelete","node","_init_edgeDelete","edge","_init_lineClick","line","_init_lineDoubleClick","_init_connectNodes2","detail","sameTarget","activeTarget","createRef","layout","v","_classPrivateFieldSet","nodes","edges","nodeBricks","lines","layoutOptions","disableKeyboardAction","connectNodes","dragNodes","zoomable","scrollable","pannable","scaleRange","callOnLineLabel","id","_classPrivateFieldGet2","_len","length","args","Array","_key","current","render","React","ref","onActiveTargetChange","onSwitchActiveTarget","onNodeDelete","onEdgeDelete","onLineClick","onLineDoubleClick","onNodesConnect","_set_activeTargetChangeEvent","_get_activeTargetChangeEvent","_set_nodeDelete","_get_nodeDelete","_set_edgeDelete","_get_edgeDelete","_set_lineClick","_get_lineClick","_set_lineDoubleClick","_get_lineDoubleClick","_set_connectNodes","_get_connectNodes","_ref","_activeTarget","_scaleRange","nodesReady","setNodesReady","useState","nodesRenderId","setNodesRenderId","nodesRefRepository","setNodesRefRepository","lineLabelsReady","setLineLabelsReady","lineLabelsRenderId","setLineLabelsRenderId","lineLabelsRefRepository","setLineLabelsRefRepository","renderedLineLabels","setRenderedLineLabels","grabbing","setGrabbing","transform","setTransform","k","x","y","linePathsRef","useRef","Map","rootRef","nodesRef","centered","setCentered","userViewReady","userViewNodesMap","saveUserView","useUserView","save","connectLineTo","setConnectLineTo","connectLineState","setConnectLineState","manualLayoutStatus","setManualLayoutStatus","nodeMovement","setNodeMovement","useImperativeHandle","_lineLabelsRefReposit","_len2","_key2","firstElementChild","useEffect","onNodesMouseDown","handleNodesMouseDown","scale","nodesContainer","addEventListener","removeEventListener","normalizedLines","normalizedLinesMap","markers","useMemo","normalizeLinesAndMarkers","lineLabels","flatMap","_ref2","key","list","text","label","$id","concat","map","item","_item$placement","placement","renderedNodes","renderedEdges","useRenderedDiagram","renderedLines","getRenderedLines","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","root","onKeydown","action","handleKeyboard","nodeId","handleNodesRendered","useCallback","refRepository","handleLineLabelsRendered","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","zoomer","zoom","moved","scaleExtent","on","e","rootSelection","select","unsetZoom","ctrlKey","stopImmediatePropagation","preventDefault","translateBy","wheelDeltaX","wheelDeltaY","call","transformToCenter","canvasWidth","clientWidth","canvasHeight","clientHeight","undefined","ZoomTransform","defPrefix","uniqueId","markerPrefix","maskPrefix","activeLineMarkerPrefix","getRenderedLineLabels","lineMaskRects","setLineMaskRects","adjustLineLabels","observer","ResizeObserver","updateLineMaskRects","getLineMaskRects","lineLabel","values","observe","disconnect","className","classNames","ready","tabIndex","width","height","_ref3","index","strokeColor","MarkerComponent","_ref4","lineId","rects","LineMaskComponent","viewBox","refX","refY","markerWidth","markerHeight","orient","d","stroke","strokeWidth","fill","LineComponent","linePaths","active","source","activeRelated","style","left","top","LineLabelComponentGroup","labels","onRendered","NodeComponentGroup","ConnectLineComponent","_EoDiagram2","c","_initClass","_applyDecs","o","_","has","_checkInRHS","_EditableLabel","EditableLabelComponent","LegacyEditableLabelComponent","_labelEditingChange","_handleLabelEditingChange","_labelChange","_handleLabelChange","_editableLabelRef","EditableLabel","_get_labelChange2","_set_labelChange2","_get_labelEditingChange2","_set_labelEditingChange2","_init_label","_init_type","_init_labelEditingChange","_init_labelChange","enableEditing","onLabelEditingChange","onLabelChange","_set_labelEditingChange","_get_labelEditingChange","_set_labelChange","_get_labelChange","_label","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","labelInputRef","handleEditLabel","stopPropagation","_labelInputRef$curren","_labelInputRef$curren2","focus","preventScroll","handleInputChange","handleInputKeydown","_labelInputRef$curren3","keyCode","which","blur","handleInputBlur","editing","empty","onDoubleClick","onMouseDown","onChange","onKeyDown","onBlur","_EditableLabel2","_EoDrawCanvas","lockBodyScroll","unwrapProvider","EoDrawCanvasComponent","LegacyEoDrawCanvasComponent","_dec22","_dec23","_dec24","_dec25","_nodeMoveEvent","_cellMoveEvent","_handleCellMove","_cellResizeEvent","_handleCellResize","_cellDelete","_handleCellDelete","_cellContextMenu","_handleCellContextMenu","_decoratorTextChange","_handleDecoratorTextChange","_scaleChange","_handleScaleChange","_canvasRef","EoDrawCanvas","_get_scaleChange2","_set_scaleChange2","_get_decoratorTextChange2","_set_decoratorTextChange2","_get_cellContextMenu2","_set_cellContextMenu2","_get_cellDelete2","_set_cellDelete2","_get_cellResizeEvent2","_set_cellResizeEvent2","_get_cellMoveEvent2","_set_cellMoveEvent2","_get_nodeMoveEvent2","_set_nodeMoveEvent2","_init_cells","_init_defaultNodeSize","_init_defaultNodeBricks","_init_defaultEdgeLines","_init_fadeUnrelatedCells","_init_nodeMoveEvent","_init_cellMoveEvent","info","_init_cellResizeEvent","_init_cellDelete","cell","_init_cellContextMenu","_init_decoratorTextChange","_init_scaleChange","cells","defaultNodeSize","defaultNodeBricks","defaultEdgeLines","fadeUnrelatedCells","dropNode","_this","_asyncToGenerator","_document$elementsFro","_document","position","size","data","useBrick","document","elementsFromPoint","includes","_size$","_size$2","boundingClientRect","getBoundingClientRect","getTransform","newNode","view","dropDecorator","_this2","_document$elementsFro2","_document2","decorator","_classPrivateFieldGet3","newDecorator","replace","r","Math","random","toString","addNodes","_this3","newNodes","_size$3","_size$4","addEdge","_this4","_classPrivateFieldGet4","newEdge","manuallyConnectNodes","updateCells","ctx","_this5","newCells","updated","_objectSpread","disconnectedCallback","super","host","onCellMove","onCellResize","onCellDelete","onCellContextMenu","onDecoratorTextChange","onScaleChange","_set_nodeMoveEvent","_get_nodeMoveEvent","_set_cellMoveEvent","_get_cellMoveEvent","_set_cellResizeEvent","_get_cellResizeEvent","_set_cellDelete","_get_cellDelete","_set_cellContextMenu","_get_cellContextMenu","_set_decoratorTextChange","_get_decoratorTextChange","_set_scaleChange","_get_scaleChange","_ref5","initialCells","dispatch","useReducer","rootReducer","initializeCells","cellsRef","manualConnectDeferredRef","editingTexts","setEditingTexts","payload","_ref6","findLastIndex","slice","allCells","filter","sourceId","find","isNodeCell","rect","from","offset","Promise","resolve","reject","handleConnect","state","to","_manualConnectDeferre2","i","_manualConnectDeferre","unrelatedCells","setUnrelatedCells","nextUnrelated","getUnrelatedCells","prev","resetActiveTarget","composedPath","indexOf","markerEnd","handleCellMoving","handleCellMoved","handleCellResizing","handleCellResized","handleDecoratorTextEditing","_ref7","texts","CellComponent","onCellMoving","onCellMoved","onCellResizing","onCellResized","onDecoratorTextEditing","onConnect","_EoDrawCanvas2","_ExperimentalNode","_dragStartEvent","_handleDragStart","_dragMoveEvent","_handleDragMove","_dragEndEvent","_handleDragEnd","ExperimentalNode","_get_dragEndEvent2","_set_dragEndEvent2","_get_dragMoveEvent2","_set_dragMoveEvent2","_get_dragStartEvent2","_set_dragStartEvent2","_init_usage","_init_status","_init_decorator","_init_dragStartEvent","_init_dragMoveEvent","_init_dragEndEvent","usage","status","ExperimentalNodeComponent","onDragStart","onDragMove","onDragEnd","_set_dragStartEvent","_get_dragStartEvent","_set_dragMoveEvent","_get_dragMoveEvent","_set_dragEndEvent","_get_dragEndEvent","handleMouseDown","clientX","clientY","onMouseMove","onMouseUp","_ExperimentalNode2","___CSS_LOADER_EXPORT___","push","module"],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/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AAEiC,EAAK,OAAEC,GAAWuB,EAAO2L,QACrCN,EAAQK,EAAME,WACjBnP,GAASA,EAAKmD,OAASA,GAAQnD,EAAKF,KAAOA,IAE9C,IAAe,IAAX8O,EAAc,CAChB,IAAM1M,EAAO+M,EAAML,GACnB,MAAO,IACFK,EAAMH,MAAM,EAAGF,IAAMpH,EAAAA,EAAAA,IAAAA,EAAAA,EAAAA,GAAA,GACnBtF,GAAI,IAAEhB,MAAIsG,EAAAA,EAAAA,IAAAA,EAAAA,EAAAA,GAAA,GAAOtF,EAAKhB,MAAI,IAAEa,QAAOC,gBACrCiN,EAAMH,MAAMF,EAAQ,GAE3B,CACA,OAAOK,EAET,IAAK,eACH,OAAO1L,EAAO2L,QAElB,OAAOD,CAAK,GCjEJ,CAACA,EAAO1L,IACd6L,OAAOC,YACLD,OAAOE,QAAyBP,GAAUhE,KAAI5K,IAAA,IAAEsK,EAAKpI,GAAMlC,EAAA,MAAK,CAC9DsK,EACApI,EAAM4M,EAAMxE,GAAiBlH,GAC9B,K,mECbHgM,E,MAA0B,GAA4B,KAE1DA,EAAwBlF,KAAK,CAACmF,EAAO1P,GAAI,kkCAI6V,KAEtY,QAAeyP,EAAwBE,U","sources":["webpack:///./src/draw-canvas/processors/findNode.ts","webpack:///./src/draw-canvas/EdgeComponent.tsx","webpack:///./src/draw-canvas/NodeComponent.tsx","webpack:///./src/draw-canvas/processors/cellToTarget.ts","webpack:///./src/draw-canvas/processors/handleMouseDown.ts","webpack:///./src/draw-canvas/decorators/DecoratorArea.tsx","webpack:///./src/draw-canvas/decorators/DecoratorText.tsx","webpack:///./src/draw-canvas/decorators/index.tsx","webpack:///./src/draw-canvas/CellComponent.tsx","webpack:///./src/draw-canvas/ConnectLineComponent.tsx","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/getUnrelatedCells.ts","webpack:///./src/draw-canvas/processors/handleKeyboard.ts","webpack:///./src/draw-canvas/processors/initializeCells.ts","webpack:///./src/draw-canvas/processors/sameTarget.ts","webpack:///./src/draw-canvas/processors/transformToCenter.ts","webpack:///./src/draw-canvas/processors/updateCells.ts","webpack:///./src/draw-canvas/reducers/cells.ts","webpack:///./src/draw-canvas/reducers/index.ts","webpack:///./src/draw-canvas/styles.shadow.css"],"sourcesContent":["import type { Cell, NodeCell, NodeId } from \"../interfaces\";\nimport { isNodeCell } from \"./asserts\";\n\nexport function findNode(cells: Cell[], id: NodeId): NodeCell | undefined {\n return cells.find((cell) => isNodeCell(cell) && cell.id === id) as\n | NodeCell\n | undefined;\n}\n","import React, { useMemo } from \"react\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport classNames from \"classnames\";\nimport type { Cell, EdgeCell, EdgeLineConf, NodeView } from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { findNode } from \"./processors/findNode\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n markerEnd: string;\n defaultEdgeLines?: EdgeLineConf[];\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n markerEnd,\n defaultEdgeLines,\n}: EdgeComponentProps): JSX.Element | null {\n const sourceNode = useMemo(\n () => findNode(cells, edge.source),\n [cells, edge.source]\n );\n const targetNode = useMemo(\n () => findNode(cells, edge.target),\n [cells, edge.target]\n );\n const lineConf = useMemo(\n () => defaultEdgeLines?.find((item) => checkIfByTransform(item, { edge })),\n [defaultEdgeLines, edge]\n );\n\n const padding = 5;\n\n const line = useMemo(\n () =>\n sourceNode && targetNode\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding)\n )\n : null,\n [sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found\n return null;\n }\n\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\n\n return (\n <>\n <path\n // This `path` is made for expanding interaction area of graph lines.\n d={d}\n fill=\"none\"\n stroke=\"transparent\"\n strokeWidth={16}\n />\n <path\n className={classNames(\"line\", { dashed: lineConf?.dashed })}\n d={d}\n fill=\"none\"\n stroke=\"gray\"\n markerEnd={`url(#${markerEnd})`}\n />\n <path className=\"line-active-bg\" d={d} fill=\"none\" />\n </>\n );\n}\n\nfunction nodeViewToNodeRect(view: NodeView, padding: number): NodeRect {\n return {\n x: view.x + view.width / 2,\n y: view.y + view.height / 2,\n width: view.width + padding,\n height: view.height + padding,\n };\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n defaultNodeBricks?: NodeBrickConf[];\n}\n\nexport function NodeComponent({\n node,\n defaultNodeBricks,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n\n const useBrick = useMemo(() => {\n return (\n specifiedUseBrick ??\n defaultNodeBricks?.find((item) => checkIfByTransform(item, memoizedData))\n ?.useBrick\n );\n }, [defaultNodeBricks, specifiedUseBrick, memoizedData]);\n\n return useBrick ? (\n <foreignObject\n width={node.view.width}\n height={node.view.height}\n className=\"node\"\n >\n {useBrick && <ReactUseBrick useBrick={useBrick} data={memoizedData} />}\n </foreignObject>\n ) : null;\n}\n\nfunction useDeepMemo<T>(value: T): T {\n const [memoizedValue, setMemoizedValue] = useState(value);\n\n useEffect(() => {\n setMemoizedValue((prev) => (isEqual(prev, value) ? prev : value));\n }, [value]);\n\n return memoizedValue;\n}\n","import { pick } from \"lodash\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\n\nexport function cellToTarget(cell: Cell): ActiveTarget {\n return cell.type === \"edge\"\n ? pick(cell, [\"type\", \"source\", \"target\", \"data\"])\n : pick(cell, [\"type\", \"id\", \"data\"]);\n}\n","import type { PositionTuple } from \"../../diagram/interfaces\";\nimport type { ActiveTarget, Cell } from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport { cellToTarget } from \"./cellToTarget\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n onCellMoving?(info: MoveCellPayload): void;\n onCellMoved?(info: MoveCellPayload): void;\n onCellResizing?(info: ResizeCellPayload): void;\n onCellResized?(info: ResizeCellPayload): void;\n onSwitchActiveTarget(activeTarget: ActiveTarget | null): void;\n }\n) {\n event.stopPropagation();\n // Drag node\n onSwitchActiveTarget(cellToTarget(cell));\n\n if (cell.type === \"edge\") {\n return;\n }\n\n const from: PositionTuple = [event.clientX, event.clientY];\n const original =\n action === \"move\"\n ? [cell.view.x, cell.view.y]\n : [cell.view.width, cell.view.height];\n\n function getMovement(e: MouseEvent): PositionTuple {\n return [(e.clientX - from[0]) / scale, (e.clientY - from[1]) / scale];\n }\n\n let moved = false;\n\n const handleMove = (e: MouseEvent, finished?: boolean) => {\n // Respect the scale\n const movement = getMovement(e);\n if (!moved) {\n moved = movement[0] ** 2 + movement[1] ** 2 >= 9;\n }\n // const [x, y] = getNewPosition(movement);\n // adjustCellPosition(x, y);\n if (moved) {\n if (action === \"move\") {\n (finished ? onCellMoved : onCellMoving)?.({\n type: cell.type,\n id: cell.id,\n x: original[0] + movement[0],\n y: original[1] + movement[1],\n });\n } else {\n (finished ? onCellResized : onCellResizing)?.({\n type: cell.type,\n id: cell.id,\n width: original[0] + movement[0],\n height: original[1] + movement[1],\n });\n }\n }\n };\n\n const onMouseMove = (e: MouseEvent) => {\n handleMove(e);\n };\n const onMouseUp = (e: MouseEvent) => {\n handleMove(e, true);\n moved = false;\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", onMouseUp);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", onMouseUp);\n}\n","import React, { useEffect } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { handleMouseDown } from \"../processors/handleMouseDown\";\n\nexport function DecoratorArea({\n cell,\n transform,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n}: BasicDecoratorProps): JSX.Element {\n const resizeHandleRef = React.useRef<SVGGElement>(null);\n\n useEffect(() => {\n const resizeHandle = resizeHandleRef.current;\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"resize\",\n cell,\n scale: transform.k,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n });\n };\n resizeHandle?.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n resizeHandle?.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [cell, onCellResized, onCellResizing, onSwitchActiveTarget, transform.k]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n // x={cell.view.x}\n // y={cell.view.y}\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n <g\n ref={resizeHandleRef}\n className=\"resize-handle\"\n transform={`translate(${cell.view.width - 20} ${cell.view.height - 20})`}\n >\n <rect width={20} height={20} />\n <path d=\"M10 18L18 10 M15 18L18 15\" />\n </g>\n </g>\n );\n}\n","import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport classNames from \"classnames\";\n\nexport type DecoratorTextProps = Pick<\n BasicDecoratorProps,\n \"cell\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: DecoratorTextProps): JSX.Element {\n const label = cell.view.text ?? \"\";\n const [currentLabel, setCurrentLabel] = useState<string>(label);\n const [editingLabel, setEditingLabel] = useState(false);\n const editingLabelInitialized = useRef(false);\n const [shouldEmitLabelChange, setShouldEmitLabelChange] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n const handleEnableEdit = useCallback((e: React.MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n }, []);\n\n useEffect(() => {\n const element = ref.current;\n if (element && element.textContent !== currentLabel) {\n element.textContent = currentLabel;\n }\n }, [currentLabel]);\n\n useEffect(() => {\n if (editingLabel && ref.current) {\n ref.current.focus();\n selectAllText(ref.current);\n }\n onDecoratorTextEditing({ id: cell.id, editing: editingLabel });\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n useEffect(() => {\n if (editingLabelInitialized.current) {\n onDecoratorTextEditing?.({ id: cell.id, editing: editingLabel });\n } else {\n editingLabelInitialized.current = true;\n }\n }, [cell.id, editingLabel, onDecoratorTextEditing]);\n\n const handleInput = useCallback((event: React.FormEvent<HTMLDivElement>) => {\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n }, []);\n\n const handleBlur = useCallback(() => {\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, []);\n\n useEffect(() => {\n if (shouldEmitLabelChange) {\n onDecoratorTextChange?.({\n id: cell.id,\n view: { ...cell.view, text: currentLabel },\n });\n setShouldEmitLabelChange(false);\n }\n }, [cell, currentLabel, onDecoratorTextChange, shouldEmitLabelChange]);\n\n return (\n <foreignObject className=\"decorator-text\">\n <div\n className={classNames(\"text-container\", { editing: editingLabel })}\n onDoubleClick={handleEnableEdit}\n >\n <div\n className=\"text\"\n contentEditable={editingLabel}\n ref={ref}\n onInput={handleInput}\n onBlur={handleBlur}\n />\n </div>\n </foreignObject>\n );\n}\n\nfunction selectAllText(element: HTMLElement) {\n const range = document.createRange();\n range.selectNodeContents(element);\n const selection = window.getSelection()!;\n selection.removeAllRanges();\n selection.addRange(range);\n}\n","import React from \"react\";\nimport type { BasicDecoratorProps } from \"../interfaces\";\nimport { DecoratorArea } from \"./DecoratorArea\";\nimport { DecoratorText } from \"./DecoratorText\";\n\nexport function DecoratorComponent({\n cell,\n transform,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: BasicDecoratorProps): JSX.Element | null {\n let SpecifiedComponent: (props: BasicDecoratorProps) => JSX.Element | null;\n\n switch (cell.decorator) {\n case \"area\":\n SpecifiedComponent = DecoratorArea;\n break;\n case \"text\":\n SpecifiedComponent = DecoratorText;\n break;\n // istanbul ignore next\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown decorator: ${cell.decorator}`);\n return null;\n }\n\n return (\n <SpecifiedComponent\n cell={cell}\n transform={transform}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n );\n}\n","import React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n ActiveTarget,\n Cell,\n CellContextMenuDetail,\n DecoratorTextChangeDetail,\n EdgeLineConf,\n NodeBrickConf,\n} from \"./interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./processors/asserts\";\nimport { EdgeComponent } from \"./EdgeComponent\";\nimport { NodeComponent } from \"./NodeComponent\";\nimport { handleMouseDown } from \"./processors/handleMouseDown\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { DecoratorComponent } from \"./decorators\";\nimport { cellToTarget } from \"./processors/cellToTarget\";\nimport type { TransformLiteral } from \"../diagram/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\n\nexport interface CellComponentProps {\n cell: Cell;\n cells: Cell[];\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n transform: TransformLiteral;\n markerEnd: string;\n active: boolean;\n unrelatedCells: Cell[];\n onCellMoving(info: MoveCellPayload): void;\n onCellMoved(info: MoveCellPayload): void;\n onCellResizing(info: ResizeCellPayload): void;\n onCellResized(info: ResizeCellPayload): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange(detail: DecoratorTextChangeDetail): void;\n}\n\nexport function CellComponent({\n cell,\n cells,\n defaultNodeBricks,\n defaultEdgeLines,\n markerEnd,\n active,\n transform,\n unrelatedCells,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n}: CellComponentProps): JSX.Element | null {\n const gRef = useRef<SVGGElement>(null);\n\n const unrelated = useMemo(\n () => unrelatedCells.some((item) => sameTarget(item, cell)),\n [cell, unrelatedCells]\n );\n\n useEffect(() => {\n const g = gRef.current;\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n action: \"move\",\n cell,\n scale: transform.k,\n onCellMoving,\n onCellMoved,\n onSwitchActiveTarget,\n });\n };\n g?.addEventListener(\"mousedown\", onMouseDown);\n return () => {\n g?.removeEventListener(\"mousedown\", onMouseDown);\n };\n }, [cell, onCellMoved, onCellMoving, onSwitchActiveTarget, transform.k]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n event.preventDefault();\n onSwitchActiveTarget(cellToTarget(cell));\n onCellContextMenu({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellContextMenu, onSwitchActiveTarget]\n );\n\n return (\n <g\n className={classNames(\"cell\", { active, faded: unrelated })}\n ref={gRef}\n transform={\n cell.type === \"edge\"\n ? undefined\n : `translate(${cell.view.x} ${cell.view.y})`\n }\n onContextMenu={handleContextMenu}\n >\n {isNodeCell(cell) ? (\n <NodeComponent node={cell} defaultNodeBricks={defaultNodeBricks} />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent\n edge={cell}\n defaultEdgeLines={defaultEdgeLines}\n cells={cells}\n markerEnd={markerEnd}\n />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n transform={transform}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport classNames from \"classnames\";\nimport type { ConnectLineState } from \"./interfaces\";\nimport type { PositionTuple, TransformLiteral } from \"../diagram/interfaces\";\n\nexport interface ConnectLineComponentProps {\n connectLineState: ConnectLineState | null;\n transform: TransformLiteral;\n markerEnd: string;\n onConnect(state: ConnectLineState, to: PositionTuple): void;\n}\n\nexport function ConnectLineComponent({\n connectLineState,\n transform,\n markerEnd,\n onConnect,\n}: ConnectLineComponentProps): JSX.Element {\n const [connectLineTo, setConnectLineTo] = useState<PositionTuple | null>(\n null\n );\n\n useEffect(() => {\n if (connectLineState) {\n setConnectLineTo(connectLineState.from);\n }\n }, [connectLineState]);\n\n useEffect(() => {\n if (connectLineState) {\n const onMouseMove = (e: MouseEvent) => {\n // Set connect line to based on the mouse position and the transform\n setConnectLineTo([\n (e.clientX - transform.x - connectLineState.offset[0]) / transform.k,\n (e.clientY - transform.y - connectLineState.offset[1]) / transform.k,\n ]);\n };\n const onMouseDown = (e: MouseEvent) => {\n e.stopPropagation();\n };\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n reset();\n onConnect(connectLineState, [\n (e.clientX - transform.x - connectLineState.offset[0]) / transform.k,\n (e.clientY - transform.y - connectLineState.offset[1]) / transform.k,\n ]);\n };\n const reset = () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mousedown\", onMouseDown, {\n capture: true,\n });\n document.removeEventListener(\"click\", onClick, { capture: true });\n setConnectLineTo(null);\n };\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mousedown\", onMouseDown, { capture: true });\n document.addEventListener(\"click\", onClick, { capture: true });\n\n return reset;\n }\n }, [connectLineState, onConnect, transform]);\n\n return (\n <path\n className={classNames(\"connect-line\", {\n connecting:\n !!connectLineState &&\n connectLineTo &&\n // Do not show when the distance of mouse move is less than 5px\n (connectLineTo[0] - connectLineState.from[0]) ** 2 +\n (connectLineTo[1] - connectLineState.from[1]) ** 2 >\n 25,\n })}\n d={\n connectLineState && connectLineTo\n ? `M${connectLineState.from.join(\" \")}L${connectLineTo.join(\" \")}`\n : \"\"\n }\n fill=\"none\"\n stroke=\"gray\"\n strokeWidth={1}\n markerEnd={`url(#${markerEnd})`}\n />\n );\n}\n","import type {\n Cell,\n DecoratorCell,\n EdgeCell,\n InitialCell,\n InitialNodeCell,\n NodeCell,\n} from \"../interfaces\";\n\nexport function isNodeCell(cell: Cell): cell is NodeCell {\n return cell.type === \"node\";\n}\n\nexport function isDecoratorCell(cell: Cell): cell is DecoratorCell {\n return cell.type === \"decorator\";\n}\n\nexport function isInitialNodeCell(cell: InitialCell): cell is InitialNodeCell {\n return cell.type === \"node\";\n}\n\nexport function isEdgeCell(cell: Cell): cell is EdgeCell {\n return cell.type === \"edge\";\n}\n","import type { ActiveTarget, Cell } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function getUnrelatedCells(\n cells: Cell[],\n activeTarget: ActiveTarget | null\n): Cell[] {\n const unrelated: Cell[] = [];\n\n switch (activeTarget?.type) {\n case \"node\": {\n const nodesMap = new Map<string, Cell>();\n const relatedNodeIds = new Set<string>([activeTarget.id]);\n for (const cell of cells) {\n if (cell.type === \"node\") {\n nodesMap.set(cell.id, cell);\n } else if (cell.type === \"edge\") {\n if (cell.source === activeTarget.id) {\n relatedNodeIds.add(cell.target);\n } else if (cell.target === activeTarget.id) {\n relatedNodeIds.add(cell.source);\n } else {\n unrelated.push(cell);\n }\n } else {\n unrelated.push(cell);\n }\n }\n for (const [id, cell] of nodesMap) {\n if (!relatedNodeIds.has(id)) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n case \"edge\":\n for (const cell of cells) {\n if (\n !(cell.type === \"edge\"\n ? sameTarget(cell, activeTarget)\n : cell.type === \"node\" &&\n (cell.id === activeTarget.source ||\n cell.id === activeTarget.target))\n ) {\n unrelated.push(cell);\n }\n }\n break;\n\n case \"decorator\":\n for (const cell of cells) {\n if (cell.type !== \"decorator\" || cell.id !== activeTarget.id) {\n unrelated.push(cell);\n }\n }\n break;\n }\n\n return unrelated;\n}\n","import type { ActiveTarget, Cell } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport type KeyboardAction = KeyboardActionDeleteCell;\n\nexport interface KeyboardActionDeleteCell {\n action: \"delete-cell\";\n cell: Cell;\n}\n\nexport function handleKeyboard(\n event: KeyboardEvent,\n {\n cells,\n activeTarget,\n }: {\n cells: Cell[];\n activeTarget: ActiveTarget | null | undefined;\n }\n): KeyboardAction | undefined {\n const activeCell = cells.find((cell) => sameTarget(cell, activeTarget));\n\n if (!activeCell) {\n return;\n }\n\n const key =\n event.key ||\n /* istanbul ignore next: compatibility */ event.keyCode ||\n /* istanbul ignore next: compatibility */ event.which;\n\n switch (key) {\n case \"Backspace\":\n case 8:\n case \"Delete\":\n case 46: {\n event.preventDefault();\n event.stopPropagation();\n return {\n action: \"delete-cell\",\n cell: activeCell,\n };\n }\n }\n}\n","import type { SizeTuple } from \"../../diagram/interfaces\";\nimport type { Cell, InitialCell, NodeCell } from \"../interfaces\";\nimport { isInitialNodeCell } from \"./asserts\";\n\nexport function initializeCells(\n initialCells: InitialCell[] | undefined,\n {\n defaultNodeSize,\n }: {\n defaultNodeSize: SizeTuple;\n }\n): Cell[] {\n const originalCells = initialCells ?? [];\n const finalCells: Cell[] = originalCells.map<Cell>((cell) => {\n if (\n !isInitialNodeCell(cell) ||\n (cell.view?.width !== undefined && cell.view?.height !== undefined)\n ) {\n return cell as NodeCell;\n }\n return {\n ...cell,\n view: {\n width: defaultNodeSize[0],\n height: defaultNodeSize[1],\n ...cell.view,\n },\n } as NodeCell;\n });\n return finalCells;\n}\n","import type {\n ActiveTarget,\n ActiveTargetOfEdge,\n ActiveTargetOfNode,\n} from \"../interfaces\";\n\nexport function sameTarget(\n a: ActiveTarget | null | undefined,\n b: ActiveTarget | null | undefined\n): boolean {\n return a\n ? !!b &&\n a.type === b.type &&\n (a.type === \"node\" || a.type === \"decorator\"\n ? a.id === (b as ActiveTargetOfNode).id\n : a.source === (b as ActiveTargetOfEdge).source &&\n a.target === (b as ActiveTargetOfEdge).target)\n : !b;\n}\n","import type { TransformLiteral } from \"../../diagram/interfaces\";\nimport type { Cell } from \"../interfaces\";\nimport { isEdgeCell } from \"./asserts\";\n\nexport interface TransformToCenterOptions {\n canvasWidth: number;\n canvasHeight: number;\n scaleRange?: [min: number, max: number];\n}\n\nexport function transformToCenter(\n cells: Cell[],\n { canvasWidth, canvasHeight, scaleRange }: TransformToCenterOptions\n): TransformLiteral {\n let left = Infinity;\n let top = Infinity;\n let right = -Infinity;\n let bottom = -Infinity;\n let empty = true;\n for (const cell of cells) {\n if (!isEdgeCell(cell)) {\n empty = false;\n const { view } = cell;\n const r = view.x + view.width;\n const b = view.y + view.height;\n if (view.x < left) {\n left = view.x;\n }\n if (r > right) {\n right = r;\n }\n if (view.y < top) {\n top = view.y;\n }\n if (b > bottom) {\n bottom = b;\n }\n }\n }\n\n const width = right - left;\n const height = bottom - top;\n\n const scale =\n scaleRange && !empty && (width > canvasWidth || height > canvasHeight)\n ? Math.max(\n Math.min(canvasWidth / width, canvasHeight / height, scaleRange[1]),\n scaleRange[0]\n )\n : 1;\n\n const x = empty ? 0 : (canvasWidth - width * scale) / 2 - left * scale;\n const y = empty ? 0 : (canvasHeight - height * scale) / 2 - top * scale;\n\n return { x, y, k: scale };\n}\n","import type { SizeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport type {\n Cell,\n InitialCell,\n NodeCell,\n NodeId,\n NodeView,\n} from \"../interfaces\";\nimport { isEdgeCell, isNodeCell } from \"./asserts\";\nimport { initializeCells } from \"./initializeCells\";\n\nexport function updateCells({\n cells,\n defaultNodeSize,\n canvasHeight,\n transform,\n reason,\n parent,\n}: {\n cells: InitialCell[];\n defaultNodeSize: SizeTuple;\n canvasHeight: number;\n transform: TransformLiteral;\n reason?: \"add-related-nodes\";\n parent?: NodeId;\n}): {\n cells: Cell[];\n updated: Cell[];\n} {\n const newCells = initializeCells(cells, { defaultNodeSize });\n const updateCandidates: NodeCell[] = [];\n\n const nodesMap = new Map<string, NodeCell>();\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n nodesMap.set(cell.id, cell);\n }\n }\n\n let handled = false;\n\n if (reason === \"add-related-nodes\" && parent) {\n // Place these unpositioned downstream nodes below the parent node, and\n // on the right side of the positioned siblings.\n const downstreamNodeIds = new Set<string>();\n for (const cell of newCells) {\n if (\n isEdgeCell(cell) &&\n cell.source === parent &&\n cell.target !== parent\n ) {\n downstreamNodeIds.add(cell.target);\n }\n }\n const parentNode = nodesMap.get(parent);\n if (parentNode?.view.x !== undefined && parentNode.view.y !== undefined) {\n handled = true;\n const downstreamNodes = [...downstreamNodeIds]\n .map((id) => nodesMap.get(id))\n .filter(Boolean) as NodeCell[];\n let rightMostNode: NodeCell | undefined = undefined;\n for (const node of downstreamNodes) {\n if (node.view.x !== undefined && node.view.y !== undefined) {\n // Find the rightmost node that is below the parent node.\n if (\n (!rightMostNode || node.view.x > rightMostNode.view.x) &&\n node.view.y > parentNode.view.y\n ) {\n rightMostNode = node;\n }\n } else {\n // Unpositioned nodes\n updateCandidates.push(node);\n }\n }\n if (updateCandidates.length > 0) {\n const gap = 20;\n let nextX: number;\n let nextY: number;\n if (rightMostNode) {\n // Place unpositioned nodes on the right side of the rightmost positioned siblings.\n nextX = rightMostNode.view.x + rightMostNode.view.width + gap;\n nextY = rightMostNode.view.y;\n } else {\n // If there are no positioned siblings, just place them below the parent.\n const totalWidth = updateCandidates.reduce(\n (acc, node) => acc + node.view.width + gap,\n -gap\n );\n nextX =\n parentNode.view.x - totalWidth / 2 + parentNode.view.width / 2;\n nextY = parentNode.view.y + parentNode.view.height + gap;\n }\n for (const node of updateCandidates) {\n node.view.x = nextX;\n node.view.y = nextY;\n nextX += node.view.width + gap;\n }\n }\n }\n }\n\n if (!handled) {\n // By default, place unpositioned nodes in a grid.\n let maxWidth = defaultNodeSize[0];\n let maxHeight = defaultNodeSize[1];\n const gap = 20;\n const occupiedViews: NodeView[] = [];\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n if (cell.view.width > maxWidth) {\n maxWidth = cell.view.width;\n }\n if (cell.view.height > maxHeight) {\n maxHeight = cell.view.height;\n }\n if (cell.view.x === undefined || cell.view.y === undefined) {\n updateCandidates.push(cell);\n } else {\n occupiedViews.push(cell.view);\n }\n }\n }\n\n const deltaX = maxWidth + gap;\n const deltaY = maxHeight + gap;\n\n const occupiedIndexes = new Set<string>();\n for (const view of occupiedViews) {\n const x0 = Math.floor((view.x + transform.x / transform.k) / deltaX);\n const y0 = Math.floor((view.y + transform.y / transform.k) / deltaY);\n const x1 = Math.floor(\n (view.x + transform.x / transform.k + view.width) / deltaX\n );\n const y1 = Math.floor(\n (view.y + transform.y / transform.k + view.height) / deltaY\n );\n\n for (let i = x0; i <= x1; i++) {\n for (let j = y0; j <= y1; j++) {\n occupiedIndexes.add(`${i},${j}`);\n }\n }\n }\n\n const scaledDeltaX = deltaX * transform.k;\n const scaledDeltaY = deltaY * transform.k;\n const rows = Math.max(1, Math.floor(canvasHeight / scaledDeltaY));\n let i = 0;\n for (const node of updateCandidates) {\n let xIndex: number;\n let yIndex: number;\n do {\n xIndex = Math.floor(i / rows);\n yIndex = i % rows;\n i++;\n } while (occupiedIndexes.has(`${xIndex},${yIndex}`));\n\n node.view.x =\n (xIndex * scaledDeltaX - transform.x) / transform.k + gap / 2;\n node.view.y =\n (yIndex * scaledDeltaY - transform.y) / transform.k + gap / 2;\n }\n }\n\n return { cells: newCells, updated: updateCandidates };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\n\nexport const cells: Reducer<Cell[], DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"drop-node\":\n return insertCellAfter(\n state,\n action.payload,\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n );\n case \"drop-decorator\": {\n if (action.payload.decorator === \"text\") {\n return [...state, action.payload];\n }\n return insertCellAfter(\n state,\n action.payload,\n (cell) => cell.type === \"decorator\" && cell.decorator === \"area\"\n );\n }\n case \"add-nodes\": {\n const index =\n state.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n return [\n ...state.slice(0, index),\n ...action.payload,\n ...state.slice(index),\n ];\n }\n case \"add-edge\":\n // Add the edge to just next to the previous last edge or area decorator.\n // If not found, append to the start.\n return insertCellAfter(\n state,\n action.payload,\n (cell) =>\n cell.type === \"edge\" ||\n (cell.type === \"decorator\" && cell.decorator === \"area\")\n );\n case \"move-cell\": {\n const { type, id, x, y } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, x, y } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"resize-cell\": {\n const { type, id, width, height } = action.payload;\n const index = state.findIndex(\n (cell) => cell.type === type && cell.id === id\n );\n if (index !== -1) {\n const node = state[index] as NodeCell;\n return [\n ...state.slice(0, index),\n { ...node, view: { ...node.view, width, height } },\n ...state.slice(index + 1),\n ];\n }\n return state;\n }\n case \"update-cells\":\n return action.payload;\n }\n return state;\n};\n\nfunction insertCellAfter(\n cells: Cell[],\n newCell: Cell,\n after: (cell: Cell) => boolean\n) {\n const index = cells.findLastIndex(after) + 1;\n return [...cells.slice(0, index), newCell, ...cells.slice(index)];\n}\n","import { Reducer } from \"react\";\nimport type { DrawCanvasAction, DrawCanvasState } from \"./interfaces\";\nimport { cells } from \"./cells\";\n\ntype ReducersMapObject<S, A> = {\n [K in keyof S]: Reducer<S[K], A>;\n};\n\nfunction combineReducers<S, A>(\n reducers: ReducersMapObject<S, A>\n): Reducer<S, A> {\n return ((state, action) =>\n Object.fromEntries(\n Object.entries<Reducer<any, A>>(reducers).map(([key, value]) => [\n key,\n value(state[key as keyof S], action),\n ])\n )) as Reducer<S, A>;\n}\n\nexport const rootReducer = combineReducers<DrawCanvasState, DrawCanvasAction>({\n cells,\n});\n","// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `*{box-sizing:border-box}:host{display:block;position:relative;overflow:hidden}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root:focus{outline:none}.decorator-area .area{fill:rgba(119,141,195,0.1);stroke:none;stroke-width:0}.node,\n.decorator-text{overflow:visible}.cell.active .decorator-area .area,\n.cell.active .line-active-bg{stroke:var(--palette-blue-5);stroke-dasharray:4;stroke-width:1}.cell{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-handle{cursor:nwse-resize;opacity:0}.resize-handle rect{fill:transparent;stroke:none}.resize-handle path{fill:none;stroke:var(--palette-gray-5);stroke-width:1.5}.cell.active .decorator-area .resize-handle,\n.decorator-area:hover .resize-handle{opacity:1}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:4}.cell.active .decorator-text .text-container{outline:1px dashed var(--palette-blue-5)}.decorator-text .text-container{width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:0.5em}.decorator-text .text:focus{outline:none}.cell.faded{opacity:0.3}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\n"],"names":["findNode","cells","id","find","cell","isNodeCell","EdgeComponent","_ref","edge","markerEnd","defaultEdgeLines","sourceNode","useMemo","source","targetNode","target","lineConf","item","checkIfByTransform","line","getDirectLinePoints","nodeViewToNodeRect","view","d","concat","x","y","React","fill","stroke","strokeWidth","className","classNames","dashed","padding","width","height","NodeComponent","node","defaultNodeBricks","memoizedData","value","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","_defaultNodeBricks$fi","ReactUseBrick","cellToTarget","type","pick","handleMouseDown","event","action","scale","onCellMoving","onCellMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","from","clientX","clientY","original","moved","handleMove","e","finished","_ref2","_ref3","movement","getMovement","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","resizeHandleRef","resizeHandle","current","onMouseDown","k","ref","DecoratorText","_cell$view$text","onDecoratorTextEditing","onDecoratorTextChange","label","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","useRef","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","useCallback","preventDefault","element","textContent","focus","range","createRange","selectNodeContents","selection","window","getSelection","removeAllRanges","addRange","selectAllText","editing","handleInput","handleBlur","_objectSpread","onDoubleClick","contentEditable","onInput","onBlur","DecoratorComponent","SpecifiedComponent","decorator","console","error","CellComponent","active","unrelatedCells","onCellContextMenu","gRef","unrelated","some","sameTarget","g","handleContextMenu","faded","undefined","onContextMenu","isEdgeCell","isDecoratorCell","ConnectLineComponent","connectLineState","onConnect","connectLineTo","setConnectLineTo","offset","onClick","reset","capture","connecting","join","isInitialNodeCell","getUnrelatedCells","activeTarget","nodesMap","Map","relatedNodeIds","Set","set","add","push","has","handleKeyboard","activeCell","key","keyCode","which","initializeCells","initialCells","defaultNodeSize","map","_cell$view","_cell$view2","a","b","transformToCenter","canvasWidth","canvasHeight","scaleRange","left","Infinity","top","right","bottom","empty","r","Math","max","min","updateCells","reason","parent","newCells","updateCandidates","handled","downstreamNodeIds","parentNode","get","downstreamNodes","filter","Boolean","rightMostNode","length","nextX","nextY","totalWidth","reduce","acc","maxWidth","maxHeight","occupiedViews","deltaX","deltaY","occupiedIndexes","x0","floor","y0","x1","y1","i","j","scaledDeltaX","scaledDeltaY","rows","xIndex","yIndex","gap","updated","insertCellAfter","newCell","after","index","findLastIndex","slice","reducers","rootReducer","state","payload","findIndex","Object","fromEntries","entries","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunks/eo-draw-canvas.212c402d.js","mappings":"oKAYO,SAASA,EAAeC,GAIO,IAChCC,GAL0B,GAC9BC,EAAE,KACFC,EAAI,YACJC,GACqBJ,EAGrB,OAAQG,GACN,IAAK,OACHF,EAAYI,EACZ,MACF,IAAK,OACHJ,EAAYK,EACZ,MACF,QACEL,EAAYM,EAGhB,OAAOC,IAAAA,cAACP,EAAS,CAACC,GAAIA,EAAIE,YAAaA,GACzC,CAEA,SAASG,EAAWE,GAGsB,IAHrB,GACnBP,EAAE,YACFE,GACyBK,EACzB,OACED,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,UACRC,KAAM,EACNC,KAAM,EACNC,YAAa,EACbC,aAAc,EACdC,OAAO,qBACPC,eAAe,SAEfR,IAAAA,cAAA,QACES,EAAE,gCACFC,OAAQd,EACRe,YAAa,EACbC,KAAMhB,IAId,CAEA,SAASC,EAA6BgB,GAGI,IAHH,GACrCnB,EAAE,YACFE,GACyBiB,EACzB,OACEb,IAAAA,cAAA,UACEN,GAAIA,EACJQ,QAAQ,YACRC,KAAM,GACNC,KAAM,IACNC,YAAa,GACbC,aAAc,GACdC,OAAO,sBAEPP,IAAAA,cAAA,QACES,EAAE,yFACFC,OAAQd,EACRe,YAAa,EACbC,KAAK,SAIb,CAEA,SAASd,EAA8BgB,GAGG,IAHF,GACtC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C,GAAA,2BAAAC,GAAA,kBAAA7B,EAAA,GAAAsV,GAAAnR,GAAAoR,KAAAC,EAAAA,GAAAA,GAAAF,KAnR0BjR,GAAAA,mBAAgB8Q,G","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/draw-canvas/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { LineMarkerType } from \"./interfaces\";\n\nexport interface MarkerComponentProps extends BaseMarkerComponentProps {\n type: LineMarkerType;\n}\n\nexport interface BaseMarkerComponentProps {\n id: string;\n strokeColor?: string;\n}\n\nexport function MarkerComponent({\n id,\n type,\n strokeColor,\n}: MarkerComponentProps): JSX.Element {\n let Component: (props: BaseMarkerComponentProps) => JSX.Element;\n\n switch (type) {\n case \"0..1\":\n Component = EntityRelationZeroOrOneMarker;\n break;\n case \"0..N\":\n Component = EntityRelationZeroOrManyMarker;\n break;\n default:\n Component = ArrowMarker;\n }\n\n return <Component id={id} strokeColor={strokeColor} />;\n}\n\nfunction ArrowMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 6 6\"\n refX={5}\n refY={3}\n markerWidth={6}\n markerHeight={6}\n orient=\"auto-start-reverse\"\n strokeLinejoin=\"round\"\n >\n <path\n d=\"M 0.5 0.5 L 5.5 3 L 0.5 5.5 z\"\n stroke={strokeColor}\n strokeWidth={1}\n fill={strokeColor}\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrOneMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 15.5 0.5 V 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n\nfunction EntityRelationZeroOrManyMarker({\n id,\n strokeColor,\n}: BaseMarkerComponentProps): JSX.Element {\n return (\n <marker\n id={id}\n viewBox=\"0 0 21 11\"\n refX={0.5}\n refY={5.5}\n markerWidth={21}\n markerHeight={11}\n orient=\"auto-start-reverse\"\n >\n <path\n d=\"M 5.5 5.5 m 5 0 a 5 5 0 1 0 -10 0 a 5 5 0 1 0 10 0 M 20.5 0.5 L 10.5 5.5 L 20.5 10.5 M 10.5 5.5 H 20.5\"\n stroke={strokeColor}\n strokeWidth={1}\n fill=\"none\"\n />\n </marker>\n );\n}\n","import type { NodePosition, NodeRect } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect\n): NodePosition[] | null {\n // Ignore if two nodes are the same.\n // Ignore if two nodes overlap.\n if (source === target || doTwoNodesOverlap(source, target, 0, 0)) {\n return null;\n }\n\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n\n let x0: number, y0: number, x1: number, y1: number;\n const directionX = dx > 0 ? 1 : -1;\n if (dy !== 0) {\n const deltaRadio = Math.abs(dx / dy);\n const directionY = dy > 0 ? 1 : -1;\n const sourceRadio = source.width / source.height;\n if (deltaRadio < sourceRadio) {\n x0 = source.x + ((deltaRadio * source.height) / 2) * directionX;\n y0 = source.y + (source.height / 2) * directionY;\n } else {\n x0 = source.x + (source.width / 2) * directionX;\n y0 = source.y + (source.width / 2 / deltaRadio) * directionY;\n }\n const targetRadio = target.width / target.height;\n if (deltaRadio < targetRadio) {\n x1 = target.x - ((deltaRadio * target.height) / 2) * directionX;\n y1 = target.y - (target.height / 2) * directionY;\n } else {\n x1 = target.x - (target.width / 2) * directionX;\n y1 = target.y - (target.width / 2 / deltaRadio) * directionY;\n }\n } else {\n x0 = source.x + (source.width / 2) * directionX;\n x1 = target.x - (target.width / 2) * directionX;\n y0 = y1 = source.y;\n }\n\n return [\n { x: x0, y: y0 },\n { x: x1, y: y1 },\n ];\n}\n","import type { NodeRect } from \"../interfaces\";\n\nexport function doTwoNodesOverlap(\n a: NodeRect,\n b: NodeRect,\n paddingA: number,\n paddingB: number\n): boolean {\n const A = paddingA ? getNodesWithPadding(a, paddingA) : a;\n const B = paddingB ? getNodesWithPadding(b, paddingB) : b;\n const left = Math.min(A.x - A.width / 2, B.x - B.width / 2);\n const right = Math.max(A.x + A.width / 2, B.x + B.width / 2);\n const top = Math.min(A.y - A.height / 2, B.y - B.height / 2);\n const bottom = Math.max(A.y + A.height / 2, B.y + B.height / 2);\n return right - left < A.width + B.width && bottom - top < A.height + B.height;\n}\n\nfunction getNodesWithPadding(node: NodeRect, padding: number) {\n return {\n x: node.x - node.width / 2 - padding,\n y: node.y - node.height / 2 - padding,\n width: node.width + padding * 2,\n height: node.height + padding * 2,\n };\n}\n","import React, {\n createRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useReducer,\n useRef,\n useState,\n} from \"react\";\nimport { createDecorators, type EventEmitter } from \"@next-core/element\";\nimport { ReactNextElement } from \"@next-core/react-element\";\nimport type { UseSingleBrickConf } from \"@next-core/react-runtime\";\nimport { unwrapProvider } from \"@next-core/utils/general\";\nimport \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, zoom } from \"d3-zoom\";\nimport classNames from \"classnames\";\nimport type { lockBodyScroll as _lockBodyScroll } from \"@next-bricks/basic/data-providers/lock-body-scroll/lock-body-scroll\";\nimport type {\n PositionTuple,\n RangeTuple,\n SizeTuple,\n TransformLiteral,\n} from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n Cell,\n EdgeCell,\n InitialCell,\n NodeBrickConf,\n NodeCell,\n NodeId,\n DecoratorCell,\n DecoratorType,\n CellContextMenuDetail,\n ConnectLineState,\n Deferred,\n ConnectNodesDetail,\n EdgeLineConf,\n DecoratorTextChangeDetail,\n NodeView,\n} from \"./interfaces\";\nimport { rootReducer } from \"./reducers\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport { isNodeCell } from \"./processors/asserts\";\nimport type { MoveCellPayload, ResizeCellPayload } from \"./reducers/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\nimport { handleKeyboard } from \"./processors/handleKeyboard\";\nimport { CellComponent } from \"./CellComponent\";\nimport styleText from \"./styles.shadow.css\";\nimport { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { initializeCells } from \"./processors/initializeCells\";\nimport { transformToCenter } from \"./processors/transformToCenter\";\nimport { updateCells } from \"./processors/updateCells\";\nimport { getUnrelatedCells } from \"./processors/getUnrelatedCells\";\n\nconst DEFAULT_NODE_SIZE = 20;\nconst DEFAULT_AREA_WIDTH = 100;\nconst DEFAULT_AREA_HEIGHT = 60;\nconst DEFAULT_SCALE_RANGE_MIN = 0.5;\nconst DEFAULT_SCALE_RANGE_MAX = 2;\n\nconst lockBodyScroll = unwrapProvider<typeof _lockBodyScroll>(\n \"basic.lock-body-scroll\"\n);\n\nconst { defineElement, property, method, event } = createDecorators();\n\nexport interface EoDrawCanvasProps {\n cells: InitialCell[] | undefined;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\nexport interface DropNodeInfo extends AddNodeInfo {\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n}\n\nexport interface DropDecoratorInfo {\n decorator: DecoratorType;\n /** [PointerEvent::clientX, PointerEvent::clientY] */\n position: PositionTuple;\n text?: string;\n}\n\nexport interface AddNodeInfo {\n id: NodeId;\n useBrick?: UseSingleBrickConf;\n data?: unknown;\n size?: SizeTuple;\n}\n\nexport interface AddEdgeInfo {\n source: NodeId;\n target: NodeId;\n data?: unknown;\n}\n\nexport interface UpdateCellsContext {\n reason: \"add-related-nodes\";\n parent: NodeId;\n}\n\nexport interface AddNodesContext {\n defaultNodeSize: SizeTuple;\n canvasHeight: number;\n}\n\nexport const EoDrawCanvasComponent = React.forwardRef(\n LegacyEoDrawCanvasComponent\n);\n\n/**\n * 用于手工绘图的画布。\n *\n * 注意:将配套另外一个用于展示的画布构件。\n */\nexport\n@defineElement(\"eo-draw-canvas\", {\n styleTexts: [styleText],\n})\nclass EoDrawCanvas extends ReactNextElement implements EoDrawCanvasProps {\n /**\n * 仅当初始化时使用,渲染后重新设置 `cells` 将无效。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ attribute: false })\n accessor defaultNodeSize: SizeTuple = [DEFAULT_NODE_SIZE, DEFAULT_NODE_SIZE];\n\n @property({ attribute: false })\n accessor defaultNodeBricks: NodeBrickConf[] | undefined;\n\n /**\n * 使用条件判断设置默认的边对应的连线。在 `if` 表达式中 `DATA` 为 `{ edge }`,例如:\n *\n * ```yaml\n * defaultEdgeLines:\n * - if: <% DATA.edge.data?.virtual %>\n * dashed: true\n * ```\n */\n @property({ attribute: false })\n accessor defaultEdgeLines: EdgeLineConf[] | undefined;\n\n @property({ attribute: false })\n accessor activeTarget: ActiveTarget | null | undefined;\n\n @property({ type: Boolean })\n accessor fadeUnrelatedCells: boolean | undefined;\n\n @property({ type: Boolean })\n accessor zoomable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor scrollable: boolean | undefined = true;\n\n @property({ type: Boolean })\n accessor pannable: boolean | undefined = true;\n\n @property({ attribute: false })\n accessor scaleRange: RangeTuple | undefined;\n\n @event({ type: \"activeTarget.change\" })\n accessor #activeTargetChangeEvent!: EventEmitter<ActiveTarget | null>;\n\n #handleActiveTargetChange = (target: ActiveTarget | null) => {\n this.#activeTargetChangeEvent.emit(target);\n };\n\n #handleSwitchActiveTarget = (target: ActiveTarget | null) => {\n if (!sameTarget(target, this.activeTarget)) {\n this.activeTarget = target;\n }\n };\n\n /**\n * @deprecated Use `cell.move` instead.\n */\n @event({ type: \"node.move\" })\n accessor #nodeMoveEvent!: EventEmitter<MoveCellPayload>;\n\n @event({ type: \"cell.move\" })\n accessor #cellMoveEvent!: EventEmitter<MoveCellPayload>;\n\n #handleCellMove = (info: MoveCellPayload) => {\n this.#cellMoveEvent.emit(info);\n if (info.type === \"node\") {\n this.#nodeMoveEvent.emit(info);\n }\n };\n\n @event({ type: \"cell.resize\" })\n accessor #cellResizeEvent!: EventEmitter<ResizeCellPayload>;\n\n #handleCellResize = (info: ResizeCellPayload) => {\n this.#cellResizeEvent.emit(info);\n };\n\n /**\n * @deprecated Use `cell.delete` instead.\n */\n @event({ type: \"node.delete\" })\n accessor #nodeDelete!: EventEmitter<Cell>;\n\n @event({ type: \"cell.delete\" })\n accessor #cellDelete!: EventEmitter<Cell>;\n\n #handleCellDelete = (cell: Cell) => {\n this.#cellDelete.emit(cell);\n if (cell.type === \"node\") {\n this.#nodeDelete.emit(cell);\n }\n };\n\n @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n @event({ type: \"decorator.text.change\" })\n accessor #decoratorTextChange!: EventEmitter<DecoratorTextChangeDetail>;\n\n #handleDecoratorTextChange = (detail: DecoratorTextChangeDetail) => {\n this.#decoratorTextChange.emit(detail);\n };\n\n /**\n * 缩放变化后,从素材库拖拽元素进画布时,拖拽图像应设置对应的缩放比例。\n */\n @event({ type: \"scale.change\" })\n accessor #scaleChange!: EventEmitter<number>;\n\n #handleScaleChange = (scale: number) => {\n this.#scaleChange.emit(scale);\n };\n\n @method()\n async dropNode({\n id,\n position,\n size,\n data,\n useBrick,\n }: DropNodeInfo): Promise<NodeCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newNode: NodeCell = {\n type: \"node\",\n id,\n view: {\n x:\n (position[0] - boundingClientRect.left - transform.x) / transform.k,\n y: (position[1] - boundingClientRect.top - transform.y) / transform.k,\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n },\n data,\n useBrick,\n };\n this.#canvasRef.current?.dropNode(newNode);\n return newNode;\n }\n return null;\n }\n\n @method()\n async dropDecorator({\n position,\n decorator,\n text,\n }: DropDecoratorInfo): Promise<DecoratorCell | null> {\n // Drag and then drop a node\n const droppedInside = document\n .elementsFromPoint?.(position[0], position[1])\n ?.includes(this);\n if (droppedInside) {\n const boundingClientRect = this.getBoundingClientRect();\n const transform = this.#canvasRef.current!.getTransform();\n const newDecorator: DecoratorCell = {\n type: \"decorator\",\n decorator,\n id: uuidV4(),\n view: {\n x:\n (position[0] - boundingClientRect.left - transform.x) / transform.k,\n y: (position[1] - boundingClientRect.top - transform.y) / transform.k,\n width: DEFAULT_AREA_WIDTH,\n height: DEFAULT_AREA_HEIGHT,\n text,\n },\n };\n this.#canvasRef.current?.dropDecorator(newDecorator);\n return newDecorator;\n }\n return null;\n }\n\n @method()\n async addNodes(nodes: AddNodeInfo[]): Promise<NodeCell[]> {\n if (nodes.length === 0) {\n return [];\n }\n const newNodes = nodes.map<NodeCell>(({ size, useBrick, id, data }) => ({\n type: \"node\",\n id,\n data,\n view: {\n // x: Math.floor(index / rows) * (width + gap) + gap,\n // y: (index % rows) * (height + gap) + gap,\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n } as NodeView,\n useBrick,\n }));\n return this.#canvasRef.current!.addNodes(newNodes, {\n defaultNodeSize: this.defaultNodeSize,\n canvasHeight: this.clientHeight,\n });\n }\n\n @method()\n async addEdge({ source, target, data }: AddEdgeInfo): Promise<EdgeCell> {\n const newEdge: EdgeCell = {\n type: \"edge\",\n source,\n target,\n data,\n };\n this.#canvasRef.current?.addEdge(newEdge);\n return newEdge;\n }\n\n @method()\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail> {\n return this.#canvasRef.current!.manuallyConnectNodes(source);\n }\n\n @method()\n async updateCells(\n cells: InitialCell[],\n ctx?: UpdateCellsContext\n ): Promise<{ updated: Cell[] }> {\n const transform = this.#canvasRef.current!.getTransform();\n const { cells: newCells, updated } = updateCells({\n ...ctx,\n cells,\n defaultNodeSize: this.defaultNodeSize,\n canvasHeight: this.clientHeight,\n transform,\n });\n this.#canvasRef.current!.updateCells(newCells);\n return { updated };\n }\n\n #canvasRef = createRef<DrawCanvasRef>();\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n lockBodyScroll(this, false);\n }\n\n render() {\n return (\n <EoDrawCanvasComponent\n host={this}\n ref={this.#canvasRef}\n cells={this.cells}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n activeTarget={this.activeTarget}\n fadeUnrelatedCells={this.fadeUnrelatedCells}\n zoomable={this.zoomable}\n scrollable={this.scrollable}\n pannable={this.pannable}\n scaleRange={this.scaleRange}\n onActiveTargetChange={this.#handleActiveTargetChange}\n onSwitchActiveTarget={this.#handleSwitchActiveTarget}\n onCellMove={this.#handleCellMove}\n onCellResize={this.#handleCellResize}\n onCellDelete={this.#handleCellDelete}\n onCellContextMenu={this.#handleCellContextMenu}\n onDecoratorTextChange={this.#handleDecoratorTextChange}\n onScaleChange={this.#handleScaleChange}\n />\n );\n }\n}\n\nexport interface EoDrawCanvasComponentProps extends EoDrawCanvasProps {\n host: HTMLElement;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellMove(info: MoveCellPayload): void;\n onCellResize(cell: ResizeCellPayload): void;\n onCellDelete(cell: Cell): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onDecoratorTextChange(detail: DecoratorTextChangeDetail): void;\n onScaleChange(scale: number): void;\n}\n\nexport interface DrawCanvasRef {\n dropNode(node: NodeCell): void;\n dropDecorator(decorator: DecoratorCell): void;\n addNodes(nodes: NodeCell[], ctx: AddNodesContext): NodeCell[];\n addEdge(edge: EdgeCell): void;\n manuallyConnectNodes(source: NodeId): Promise<ConnectNodesDetail>;\n updateCells(cells: Cell[]): void;\n getTransform(): TransformLiteral;\n}\n\nfunction LegacyEoDrawCanvasComponent(\n {\n host,\n cells: initialCells,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellMove,\n onCellResize,\n onCellDelete,\n onCellContextMenu,\n onDecoratorTextChange,\n onScaleChange,\n }: EoDrawCanvasComponentProps,\n ref: React.Ref<DrawCanvasRef>\n) {\n const [{ cells }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n })\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n const cellsRef = useRef<SVGGElement>(null);\n const manualConnectDeferredRef = useRef<Deferred<ConnectNodesDetail> | null>(\n null\n );\n const [editingTexts, setEditingTexts] = useState<string[]>([]);\n const [grabbing, setGrabbing] = useState(false);\n const [transform, setTransform] = useState<TransformLiteral>({\n k: 1,\n x: 0,\n y: 0,\n });\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n onScaleChange(transform.k);\n }, [onScaleChange, transform.k]);\n\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n\n const scaleRange = useMemo(\n () =>\n _scaleRange ??\n ([DEFAULT_SCALE_RANGE_MIN, DEFAULT_SCALE_RANGE_MAX] as RangeTuple),\n [_scaleRange]\n );\n\n const zoomer = useMemo(() => zoom<SVGSVGElement, unknown>(), []);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n let moved = false;\n zoomer\n .scaleExtent(zoomable ? scaleRange : [1, 1])\n .on(\"start\", () => {\n moved = false;\n setGrabbing(true);\n })\n .on(\"zoom\", (e: { transform: TransformLiteral }) => {\n moved = true;\n setTransform(e.transform);\n })\n .on(\"end\", () => {\n setGrabbing(false);\n if (!moved) {\n onSwitchActiveTarget?.(null);\n }\n });\n }, [onSwitchActiveTarget, scaleRange, zoomable, zoomer]);\n\n // istanbul ignore next: d3-zoom currently hard to test\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n const rootSelection = select(root);\n\n const unsetZoom = () => {\n rootSelection\n .on(\".zoom\", null)\n .on(\".zoom.custom\", null)\n .on(\"wheel\", null);\n };\n\n if (!(zoomable || scrollable || pannable)) {\n unsetZoom();\n return;\n }\n\n if (zoomable || scrollable) {\n // Do not override default d3 zoom handler.\n // Only handles *panning*\n rootSelection.on(\n \"wheel.zoom.custom\",\n (e: WheelEvent & { wheelDeltaX: number; wheelDeltaY: number }) => {\n // Mac OS trackpad pinch event is emitted as a wheel.zoom and d3.event.ctrlKey set to true\n if (!e.ctrlKey) {\n // Stop immediate propagation for default d3 zoom handler\n e.stopImmediatePropagation();\n if (scrollable) {\n e.preventDefault();\n zoomer.translateBy(\n rootSelection,\n e.wheelDeltaX / 5,\n e.wheelDeltaY / 5\n );\n }\n }\n // zoomer.scaleBy(rootSelection, Math.pow(2, defaultWheelDelta(e)))\n }\n );\n }\n\n rootSelection\n .call(zoomer)\n .on(\"wheel\", (e: WheelEvent) => e.preventDefault())\n .on(\"dblclick.zoom\", null)\n .on(\"mousedown.zoom\", null);\n\n if (!pannable) {\n rootSelection\n .on(\"touchstart.zoom\", null)\n .on(\"touchmove.zoom\", null)\n .on(\"touchend.zoom\", null);\n }\n\n return unsetZoom;\n }, [pannable, scrollable, zoomable, zoomer]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || centered) {\n return;\n }\n const { k, x, y } = transformToCenter(cells, {\n canvasWidth: root.clientWidth,\n canvasHeight: root.clientHeight,\n scaleRange: zoomable ? scaleRange : undefined,\n });\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n // jsdom doesn't support svg baseVal yet.\n // https://github.com/jsdom/jsdom/issues/2531\n zoomer.transform(select(root), new ZoomTransform(k, x, y));\n }\n setCentered(true);\n }, [cells, centered, scaleRange, zoomable, zoomer]);\n\n useImperativeHandle(\n ref,\n () => ({\n dropNode(node) {\n dispatch({ type: \"drop-node\", payload: node });\n },\n dropDecorator(decorator) {\n dispatch({ type: \"drop-decorator\", payload: decorator });\n },\n addNodes(nodes, { defaultNodeSize, canvasHeight }: AddNodesContext) {\n const index =\n cells.findLastIndex(\n (cell) => !(cell.type === \"decorator\" && cell.decorator === \"text\")\n ) + 1;\n const newCells = [\n ...cells.slice(0, index),\n ...nodes,\n ...cells.slice(index),\n ];\n const { cells: allCells, updated } = updateCells({\n cells: newCells,\n defaultNodeSize,\n canvasHeight,\n transform,\n });\n dispatch({ type: \"update-cells\", payload: allCells });\n return updated.filter((node) =>\n nodes.includes(node as NodeCell)\n ) as NodeCell[];\n },\n addEdge(edge) {\n dispatch({ type: \"add-edge\", payload: edge });\n },\n updateCells(cells) {\n dispatch({ type: \"update-cells\", payload: cells });\n },\n getTransform() {\n return transform;\n },\n manuallyConnectNodes(sourceId) {\n const source = cells.find(\n (cell) => isNodeCell(cell) && cell.id === sourceId\n ) as NodeCell | undefined;\n if (source) {\n const rect = rootRef.current!.getBoundingClientRect();\n setConnectLineState({\n source,\n from: [\n source.view.x + source.view.width / 2,\n source.view.y + source.view.height / 2,\n ],\n offset: [rect.left, rect.top],\n });\n const promise = new Promise<ConnectNodesDetail>((resolve, reject) => {\n manualConnectDeferredRef.current = { resolve, reject };\n });\n return promise;\n }\n return Promise.reject(null);\n },\n }),\n [cells, transform]\n );\n\n const handleConnect = useCallback(\n (state: ConnectLineState, to: PositionTuple) => {\n // Find the target node from top bo bottom,\n // detect whether the pointer is inside the target node.\n for (let i = 0; i < cells.length; i++) {\n const cell = cells[i];\n // Currently ignore connecting to self\n if (isNodeCell(cell) && cell.id !== state.source.id) {\n if (\n cell.view.x < to[0] &&\n cell.view.x + cell.view.width > to[0] &&\n cell.view.y < to[1] &&\n cell.view.y + cell.view.height > to[1]\n ) {\n manualConnectDeferredRef.current?.resolve({\n source: state.source,\n target: cell,\n });\n break;\n }\n }\n }\n manualConnectDeferredRef.current?.reject(null);\n setConnectLineState(null);\n },\n [cells]\n );\n\n useEffect(() => {\n lockBodyScroll(host, !!connectLineState);\n }, [connectLineState, host]);\n\n const newActiveTarget = _activeTarget ?? null;\n const [activeTarget, setActiveTarget] = useState<ActiveTarget | null>(\n newActiveTarget\n );\n\n useEffect(() => {\n setActiveTarget((previous) =>\n sameTarget(previous, newActiveTarget) ? previous : newActiveTarget\n );\n }, [newActiveTarget]);\n\n const activeTargetChangeInitialized = useRef(false);\n useEffect(() => {\n if (!activeTargetChangeInitialized.current) {\n activeTargetChangeInitialized.current = true;\n return;\n }\n onActiveTargetChange(activeTarget);\n }, [activeTarget, onActiveTargetChange]);\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, activeTarget)\n : [];\n // Do not update the state when prev and next are both empty.\n setUnrelatedCells((prev) =>\n prev.length === 0 && nextUnrelated.length === 0 ? prev : nextUnrelated\n );\n }, [activeTarget, cells, fadeUnrelatedCells]);\n\n useEffect(() => {\n if (!activeTarget) {\n return;\n }\n const resetActiveTarget = (e: MouseEvent) => {\n const path = e.composedPath();\n const cellsContainerIndex = path.indexOf(cellsRef.current!);\n // Reset active target to null when clicking outside of the cells container,\n // Or inside the cells container but not on any cell.\n if (cellsContainerIndex <= 0) {\n setActiveTarget(null);\n }\n };\n document.addEventListener(\"click\", resetActiveTarget);\n return () => {\n document.removeEventListener(\"click\", resetActiveTarget);\n };\n }, [activeTarget]);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root || editingTexts.length > 0) {\n return;\n }\n const onKeydown = (event: KeyboardEvent) => {\n const action = handleKeyboard(event, {\n cells,\n activeTarget,\n });\n\n if (action?.action === \"delete-cell\") {\n onCellDelete(action.cell);\n }\n };\n root.addEventListener(\"keydown\", onKeydown);\n return () => {\n root.removeEventListener(\"keydown\", onKeydown);\n };\n }, [activeTarget, cells, editingTexts.length, onCellDelete]);\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n const markerEnd = `${markerPrefix}1`;\n\n const handleCellMoving = useCallback((info: MoveCellPayload) => {\n dispatch({ type: \"move-cell\", payload: info });\n }, []);\n\n const handleCellMoved = useCallback(\n (info: MoveCellPayload) => {\n dispatch({ type: \"move-cell\", payload: info });\n onCellMove(info);\n },\n [onCellMove]\n );\n\n const handleCellResizing = useCallback((info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n }, []);\n\n const handleCellResized = useCallback(\n (info: ResizeCellPayload) => {\n dispatch({ type: \"resize-cell\", payload: info });\n onCellResize(info);\n },\n [onCellResize]\n );\n\n const handleDecoratorTextEditing = useCallback(\n ({ id, editing }: { id: string; editing: boolean }) => {\n if (editing) {\n setEditingTexts((texts) =>\n texts.includes(id) ? texts : [...texts, id]\n );\n } else {\n setEditingTexts((texts) => texts.filter((text) => text !== id));\n }\n },\n []\n );\n\n return (\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable })}\n tabIndex={-1}\n >\n <defs>\n <MarkerComponent id={markerEnd} type=\"arrow\" strokeColor=\"gray\" />\n </defs>\n <g\n transform={`translate(${transform.x} ${transform.y}) scale(${transform.k})`}\n >\n <g className=\"cells\" ref={cellsRef}>\n {cells.map((cell) => (\n <CellComponent\n key={`${cell.type}:${cell.type === \"edge\" ? `${cell.source}~${cell.target}` : cell.id}`}\n cell={cell}\n cells={cells}\n defaultNodeBricks={defaultNodeBricks}\n defaultEdgeLines={defaultEdgeLines}\n transform={transform}\n markerEnd={markerEnd}\n active={sameTarget(activeTarget, cell)}\n unrelatedCells={unrelatedCells}\n onCellMoving={handleCellMoving}\n onCellMoved={handleCellMoved}\n onCellResizing={handleCellResizing}\n onCellResized={handleCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onDecoratorTextChange={onDecoratorTextChange}\n onDecoratorTextEditing={handleDecoratorTextEditing}\n />\n ))}\n </g>\n <ConnectLineComponent\n connectLineState={connectLineState}\n transform={transform}\n markerEnd={markerEnd}\n onConnect={handleConnect}\n />\n </g>\n </svg>\n );\n}\n\nfunction uuidV4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n"],"names":["MarkerComponent","_ref","Component","id","type","strokeColor","EntityRelationZeroOrOneMarker","EntityRelationZeroOrManyMarker","ArrowMarker","React","_ref2","viewBox","refX","refY","markerWidth","markerHeight","orient","strokeLinejoin","d","stroke","strokeWidth","fill","_ref3","_ref4","getDirectLinePoints","source","target","doTwoNodesOverlap","x0","y0","x1","y1","dx","x","dy","y","directionX","deltaRadio","Math","abs","directionY","width","height","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","node","padding","_EoDrawCanvas","lockBodyScroll","unwrapProvider","defineElement","property","method","event","createDecorators","EoDrawCanvasComponent","LegacyEoDrawCanvasComponent","_classDecs","styleTexts","styleText","_dec","attribute","_dec2","_dec3","_dec4","_dec5","_dec6","Boolean","_dec7","_dec8","_dec9","_dec10","_dec11","_dec12","_dec13","_dec14","_dec15","_dec16","_dec17","_dec18","_dec19","_dec20","_dec21","_dec22","_dec23","_dec24","_dec25","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_activeTargetChangeEvent","_handleActiveTargetChange","_handleSwitchActiveTarget","_L","_nodeMoveEvent","_M","_cellMoveEvent","_handleCellMove","_N","_cellResizeEvent","_handleCellResize","_O","_nodeDelete","_P","_cellDelete","_handleCellDelete","_Q","_cellContextMenu","_handleCellContextMenu","_R","_decoratorTextChange","_handleDecoratorTextChange","_S","_scaleChange","_handleScaleChange","_canvasRef","EoDrawCanvas","ReactNextElement","constructor","arguments","_classPrivateFieldInitSpec","get","_get_scaleChange2","set","_set_scaleChange2","_get_decoratorTextChange2","_set_decoratorTextChange2","_get_cellContextMenu2","_set_cellContextMenu2","_get_cellDelete2","_set_cellDelete2","_get_nodeDelete2","_set_nodeDelete2","_get_cellResizeEvent2","_set_cellResizeEvent2","_get_cellMoveEvent2","_set_cellMoveEvent2","_get_nodeMoveEvent2","_set_nodeMoveEvent2","_get_activeTargetChangeEvent2","_set_activeTargetChangeEvent2","writable","value","_initProto","_init_cells","_init_defaultNodeSize","_init_defaultNodeBricks","_init_defaultEdgeLines","_init_activeTarget","_init_fadeUnrelatedCells","_init_zoomable","_init_scrollable","_init_pannable","_init_scaleRange","_init_activeTargetChangeEvent","_classPrivateFieldGet","this","emit","sameTarget","activeTarget","_init_nodeMoveEvent","_init_cellMoveEvent","info","_init_cellResizeEvent","_init_nodeDelete","_init_cellDelete","cell","_init_cellContextMenu","detail","_init_decoratorTextChange","_init_scaleChange","scale","createRef","cells","v","_classPrivateFieldSet","defaultNodeSize","defaultNodeBricks","defaultEdgeLines","fadeUnrelatedCells","zoomable","scrollable","pannable","scaleRange","dropNode","_this","_asyncToGenerator","_document$elementsFro","_document","position","size","data","useBrick","document","elementsFromPoint","call","includes","_size$","_size$2","_classPrivateFieldGet2","boundingClientRect","getBoundingClientRect","transform","current","getTransform","newNode","view","k","dropDecorator","_this2","_document$elementsFro2","_document2","decorator","text","_classPrivateFieldGet3","newDecorator","replace","c","r","random","toString","addNodes","nodes","_this3","length","newNodes","map","_size$3","_size$4","canvasHeight","clientHeight","addEdge","_this4","_classPrivateFieldGet4","newEdge","manuallyConnectNodes","updateCells","ctx","_this5","newCells","updated","_objectSpread","disconnectedCallback","super","render","host","ref","onActiveTargetChange","onSwitchActiveTarget","onCellMove","onCellResize","onCellDelete","onCellContextMenu","onDecoratorTextChange","onScaleChange","_set_activeTargetChangeEvent","_get_activeTargetChangeEvent","_set_nodeMoveEvent","_get_nodeMoveEvent","_set_cellMoveEvent","_get_cellMoveEvent","_set_cellResizeEvent","_get_cellResizeEvent","_set_nodeDelete","_get_nodeDelete","_set_cellDelete","_get_cellDelete","_set_cellContextMenu","_get_cellContextMenu","_set_decoratorTextChange","_get_decoratorTextChange","_set_scaleChange","_get_scaleChange","_ref5","initialCells","_activeTarget","_scaleRange","dispatch","useReducer","rootReducer","initializeCells","rootRef","useRef","cellsRef","manualConnectDeferredRef","editingTexts","setEditingTexts","useState","grabbing","setGrabbing","setTransform","centered","setCentered","useEffect","connectLineState","setConnectLineState","useMemo","zoomer","zoom","moved","scaleExtent","on","e","root","rootSelection","select","unsetZoom","ctrlKey","stopImmediatePropagation","preventDefault","translateBy","wheelDeltaX","wheelDeltaY","transformToCenter","canvasWidth","clientWidth","undefined","ZoomTransform","useImperativeHandle","payload","_ref6","index","findLastIndex","slice","allCells","filter","edge","sourceId","find","isNodeCell","rect","from","offset","Promise","resolve","reject","handleConnect","useCallback","state","to","_manualConnectDeferre2","i","_manualConnectDeferre","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","unrelatedCells","setUnrelatedCells","nextUnrelated","getUnrelatedCells","prev","resetActiveTarget","composedPath","indexOf","addEventListener","removeEventListener","onKeydown","action","handleKeyboard","defPrefix","concat","uniqueId","markerPrefix","markerEnd","handleCellMoving","handleCellMoved","handleCellResizing","handleCellResized","handleDecoratorTextEditing","_ref7","editing","texts","className","classNames","tabIndex","CellComponent","key","active","onCellMoving","onCellMoved","onCellResizing","onCellResized","onDecoratorTextEditing","ConnectLineComponent","onConnect","_EoDrawCanvas2","_initClass","_applyDecs","o","_","has","_checkInRHS"],"sourceRoot":""}