@next-bricks/diagram 0.32.5 → 0.32.6
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.
- package/dist/bricks.json +1 -1
- package/dist/chunks/5576.625d55cf.js +2 -0
- package/dist/chunks/5576.625d55cf.js.map +1 -0
- package/dist/chunks/6833.a04f5d72.js +2 -0
- package/dist/chunks/6833.a04f5d72.js.map +1 -0
- package/dist/chunks/eo-display-canvas.ec84d0d0.js +2 -0
- package/dist/chunks/eo-display-canvas.ec84d0d0.js.map +1 -0
- package/dist/chunks/eo-draw-canvas.5c219114.js +2 -0
- package/dist/chunks/eo-draw-canvas.5c219114.js.map +1 -0
- package/dist/chunks/{main.1d8c61f6.js → main.54839ea8.js} +2 -2
- package/dist/chunks/{main.1d8c61f6.js.map → main.54839ea8.js.map} +1 -1
- package/dist/{index.ace36ee2.js → index.daccca53.js} +2 -2
- package/dist/{index.ace36ee2.js.map → index.daccca53.js.map} +1 -1
- package/dist/manifest.json +1 -1
- package/dist-types/display-canvas/index.d.ts +1 -1
- package/dist-types/draw-canvas/processors/updateCells.d.ts +1 -1
- package/package.json +2 -2
- package/dist/chunks/1728.7f4bd058.js +0 -2
- package/dist/chunks/1728.7f4bd058.js.map +0 -1
- package/dist/chunks/6974.e97f2976.js +0 -2
- package/dist/chunks/6974.e97f2976.js.map +0 -1
- package/dist/chunks/eo-display-canvas.8feea548.js +0 -2
- package/dist/chunks/eo-display-canvas.8feea548.js.map +0 -1
- package/dist/chunks/eo-draw-canvas.d92e78e9.js +0 -2
- package/dist/chunks/eo-draw-canvas.d92e78e9.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/6833.a04f5d72.js","mappings":"oKAYO,SAASA,EAAeC,GAIO,IAChCC,GAL0B,GAC9BC,EAAE,KACFC,EAAI,YACJC,GACqBJ,EAGrB,OAAQG,GACN,IAAK,OACHF,EAAYI,EACZ,MACF,IAAK,OACHJ,EAAY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E,MAA0B,GAA4B,KAE1DA,EAAwBlc,KAAK,CAACmc,EAAOtf,GAAI,q7DAOO,KAEhD,QAAeqf,EAAwBE,U","sources":["webpack:///./src/diagram/MarkerComponent.tsx","webpack:///./src/diagram/lines/getDirectLinePoints.ts","webpack:///./src/diagram/processors/doTwoNodesOverlap.ts","webpack:///./src/diagram/processors/extractPartialRectTuple.ts","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/constants.ts","webpack:///./src/draw-canvas/processors/asserts.ts","webpack:///./src/draw-canvas/processors/getUnrelatedCells.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/reducers/layoutKey.ts","webpack:///./src/shared/canvas/icons/center.svg","webpack:///./src/shared/canvas/icons/zoom-in.svg","webpack:///./src/shared/canvas/icons/zoom-out.svg","webpack:///./src/shared/canvas/ZoomBarComponent.tsx","webpack:///./src/shared/canvas/dagreLayout.ts","webpack:///./src/shared/canvas/forceLayout.ts","webpack:///./src/shared/canvas/useActiveTarget.ts","webpack:///./src/shared/canvas/useLayout.ts","webpack:///./src/shared/canvas/useAutoCenter.ts","webpack:///./src/shared/canvas/useLineMarkers.ts","webpack:///./src/shared/canvas/useReady.ts","webpack:///./src/shared/canvas/useZoom.ts","webpack:///./src/shared/canvas/ZoomBarComponent.shadow.css","webpack:///./src/shared/canvas/styles.shadow.css"],"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, PositionTuple } from \"../interfaces\";\nimport { doTwoNodesOverlap } from \"../processors/doTwoNodesOverlap\";\n\ntype LineTuple = [start: PositionTuple, end: PositionTuple];\n\nexport function getDirectLinePoints(\n source: NodeRect,\n target: NodeRect,\n parallelGap?: number\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 let p0: PositionTuple;\n let p1: PositionTuple;\n\n let xDiff = 0;\n let yDiff = 0;\n\n if (parallelGap) {\n const dx = target.x - source.x;\n const dy = target.y - source.y;\n const angle = Math.atan2(dy, dx);\n xDiff = (parallelGap / 2) * Math.cos(angle + Math.PI / 2);\n yDiff = (parallelGap / 2) * Math.sin(angle + Math.PI / 2);\n }\n\n const line: LineTuple = [\n [source.x + xDiff, source.y + yDiff],\n [target.x + xDiff, target.y + yDiff],\n ];\n const sourceIntersections = getIntersections(source, line);\n const targetIntersections = getIntersections(target, line);\n\n // Todo: handle when more than one intersection\n if (sourceIntersections.length > 0) {\n p0 = sourceIntersections[0];\n } else {\n p0 = [source.x, source.y];\n }\n if (targetIntersections.length > 0) {\n p1 = targetIntersections[0];\n } else {\n p1 = [target.x, target.y];\n }\n\n return [\n { x: p0[0], y: p0[1] },\n { x: p1[0], y: p1[1] },\n ];\n}\n\nfunction getIntersections(rect: NodeRect, line: LineTuple) {\n const vertices: PositionTuple[] = [\n [rect.x - rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y - rect.height / 2],\n [rect.x + rect.width / 2, rect.y + rect.height / 2],\n [rect.x - rect.width / 2, rect.y + rect.height / 2],\n ];\n const possibleLines: [start: PositionTuple, end: PositionTuple][] = [];\n for (let i = 0; i < 4; i++) {\n possibleLines.push([vertices[i], vertices[(i + 1) % 4]]);\n }\n const intersections: PositionTuple[] = [];\n for (const item of possibleLines) {\n const intersection = intersect(line[0], line[1], item[0], item[1]);\n if (intersection) {\n intersections.push(intersection);\n }\n }\n return intersections;\n}\n\n// https://paulbourke.net/geometry/pointlineplane/javascript.txt\nfunction intersect(\n [x1, y1]: PositionTuple,\n [x2, y2]: PositionTuple,\n [x3, y3]: PositionTuple,\n [x4, y4]: PositionTuple\n): null | PositionTuple {\n // Check if none of the lines are of length 0\n if ((x1 === x2 && y1 === y2) || (x3 === x4 && y3 === y4)) {\n return null;\n }\n\n const denominator = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);\n\n // Lines are parallel\n if (denominator === 0) {\n return null;\n }\n\n const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denominator;\n const ub = ((x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3)) / denominator;\n\n // is the intersection along the segments\n if (ua < 0 || ua > 1 || ub < 0 || ub > 1) {\n return null;\n }\n\n // Return a object with the x and y coordinates of the intersection\n const x = x1 + ua * (x2 - x1);\n const y = y1 + ua * (y2 - y1);\n\n return [x, y];\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 type { FullRectTuple, PartialRectTuple } from \"../interfaces\";\n\nexport function extractPartialRectTuple(\n value: PartialRectTuple\n): FullRectTuple {\n if (Array.isArray(value)) {\n const v0 = value[0];\n const v1 = value.length > 1 ? value[1]! : v0;\n const v2 = value.length > 2 ? value[2]! : v0;\n const v3 = value.length > 3 ? value[3]! : v1;\n return [v0, v1, v2, v3];\n }\n return new Array(4).fill(value) as FullRectTuple;\n}\n","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, useRef } from \"react\";\nimport classNames from \"classnames\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n NodeView,\n} from \"./interfaces\";\nimport { getDirectLinePoints } from \"../diagram/lines/getDirectLinePoints\";\nimport type { NodeRect } from \"../diagram/interfaces\";\nimport { findNode } from \"./processors/findNode\";\nimport { isEdgeCell } from \"./processors/asserts\";\nimport { DEFAULT_LINE_INTERACT_ANIMATE_DURATION } from \"./constants\";\n\nexport interface EdgeComponentProps {\n edge: EdgeCell;\n cells: Cell[];\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n}\n\nexport function EdgeComponent({\n edge,\n cells,\n lineConfMap,\n}: EdgeComponentProps): JSX.Element | null {\n const pathRef = useRef<SVGPathElement>(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(() => lineConfMap.get(edge)!, [edge, lineConfMap]);\n\n const parallelGap = useMemo(() => {\n const hasOppositeEdge = cells.some(\n (cell) =>\n isEdgeCell(cell) &&\n cell.source === edge.target &&\n cell.target === edge.source\n );\n return hasOppositeEdge ? lineConf.parallelGap : 0;\n }, [cells, edge, lineConf.parallelGap]);\n\n const padding = 5;\n\n const line = useMemo(\n () =>\n sourceNode &&\n targetNode &&\n sourceNode.view.x != null &&\n targetNode.view.x != null\n ? getDirectLinePoints(\n nodeViewToNodeRect(sourceNode.view, padding),\n nodeViewToNodeRect(targetNode.view, padding),\n parallelGap\n )\n : null,\n [parallelGap, sourceNode, targetNode]\n );\n\n if (!line) {\n // This happens when source or target is not found,\n // or when source or target has not been positioned yet.\n return null;\n }\n const d = `M${line[0].x} ${line[0].y}L${line[1].x} ${line[1].y}`;\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={lineConf.interactStrokeWidth}\n />\n <path\n ref={pathRef}\n className={classNames(\"line\", {\n dashed: lineConf.dashed,\n [`${lineConf.dashed ? \"dashed\" : \"solid\"}-animation`]:\n lineConf.animate.useAnimate,\n })}\n style={\n {\n \"--time\": `${lineConf.animate.duration ?? DEFAULT_LINE_INTERACT_ANIMATE_DURATION}s`,\n \"--solid-length\": pathRef.current?.getTotalLength?.(),\n } as React.CSSProperties\n }\n d={d}\n fill=\"none\"\n stroke={lineConf.strokeColor}\n strokeWidth={lineConf.strokeWidth}\n markerStart={lineConf.showStartArrow ? lineConf.markerArrow : \"\"}\n markerEnd={lineConf.showEndArrow ? lineConf.markerArrow : \"\"}\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, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { ReactUseBrick } from \"@next-core/react-runtime\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { isEqual } from \"lodash\";\nimport ResizeObserver from \"resize-observer-polyfill\";\nimport type { NodeBrickCell, NodeBrickConf, NodeCell } from \"./interfaces\";\nimport type { SizeTuple } from \"../diagram/interfaces\";\n\nexport interface NodeComponentProps {\n node: NodeCell;\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n onResize(id: string, size: SizeTuple | null): void;\n}\n\nexport function NodeComponent({\n node,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n onResize,\n}: NodeComponentProps): JSX.Element | null {\n const memoizedData = useDeepMemo({ node: { id: node.id, data: node.data } });\n const specifiedUseBrick = (node as NodeBrickCell).useBrick;\n const observerRef = useRef<ResizeObserver | null>(null);\n\n const useBrick = useMemo(() => {\n return degraded\n ? null\n : specifiedUseBrick ??\n defaultNodeBricks?.find((item) =>\n checkIfByTransform(item, memoizedData)\n )?.useBrick;\n }, [degraded, specifiedUseBrick, defaultNodeBricks, memoizedData]);\n\n const label = useMemo<string>(\n () =>\n degraded\n ? String(\n __secret_internals.legacyDoTransform(\n memoizedData,\n degradedNodeLabel ?? \"<% DATA.node.id %>\"\n )\n )\n : \"\",\n [degraded, degradedNodeLabel, memoizedData]\n );\n\n const refCallback = useCallback(\n (element: HTMLElement | null) => {\n const prevObserver = observerRef.current;\n if (prevObserver) {\n prevObserver.disconnect();\n observerRef.current = null;\n }\n if (element) {\n // Todo: correctly wait for `useBrick` in v3 to be rendered (after layout)\n // Wait a macro task to let `useBrick` to be rendered.\n setTimeout(() => {\n const observer = new ResizeObserver(() => {\n onResize(node.id, [element.offsetWidth, element.offsetHeight]);\n });\n observer.observe(element);\n observerRef.current = observer;\n });\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n const degradedRefCallBack = useCallback(\n (g: SVGGElement | null) => {\n if (g) {\n // istanbul ignore next\n const size =\n process.env.NODE_ENV === \"test\"\n ? { width: 60, height: 60 }\n : g.getBBox();\n onResize(node.id, [size.width, size.height]);\n } else {\n onResize(node.id, null);\n }\n },\n [node.id, onResize]\n );\n\n return useBrick ? (\n <foreignObject\n // Make a large size to avoid the brick inside to be clipped by the foreignObject.\n width={9999}\n height={9999}\n className=\"node\"\n >\n {useBrick && (\n <ReactUseBrick\n useBrick={useBrick}\n data={memoizedData}\n refCallback={refCallback}\n />\n )}\n </foreignObject>\n ) : degraded ? (\n <g className=\"degraded\" ref={degradedRefCallBack}>\n <circle cx={8} cy={8} r={8} />\n <text x={8} y={32}>\n {label}\n </text>\n </g>\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, LayoutType } from \"../interfaces\";\nimport type {\n MoveCellPayload,\n ResizeCellPayload,\n} from \"../reducers/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"./asserts\";\nimport { cellToTarget } from \"./cellToTarget\";\n\nexport function handleMouseDown(\n event: MouseEvent,\n {\n action,\n cell,\n scale,\n layout,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n }: {\n action: \"move\" | \"resize\";\n cell: Cell;\n scale: number;\n layout?: LayoutType;\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 (\n isEdgeCell(cell) ||\n ((layout === \"force\" || layout === \"dagre\") && isNodeCell(cell))\n ) {\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 readOnly,\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 if (!resizeHandle || readOnly) {\n return;\n }\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 }, [\n cell,\n onCellResized,\n onCellResizing,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n return (\n <g className=\"decorator-area\">\n <rect\n width={cell.view.width}\n height={cell.view.height}\n className=\"area\"\n />\n {!readOnly && (\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 )}\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\" | \"readOnly\" | \"onDecoratorTextEditing\" | \"onDecoratorTextChange\"\n>;\n\nexport function DecoratorText({\n cell,\n readOnly,\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(\n (e: React.MouseEvent) => {\n if (readOnly) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n setEditingLabel(true);\n },\n [readOnly]\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(\n (event: React.FormEvent<HTMLDivElement>) => {\n if (readOnly) {\n return;\n }\n setCurrentLabel((event.target as HTMLDivElement).textContent!);\n },\n [readOnly]\n );\n\n const handleBlur = useCallback(() => {\n if (readOnly) {\n return;\n }\n setEditingLabel(false);\n setShouldEmitLabelChange(true);\n }, [readOnly]);\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 readOnly,\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 readOnly={readOnly}\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 ComputedEdgeLineConf,\n DecoratorTextChangeDetail,\n EdgeCell,\n LayoutType,\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 { SizeTuple, TransformLiteral } from \"../diagram/interfaces\";\nimport { sameTarget } from \"./processors/sameTarget\";\n\nexport interface CellComponentProps {\n layout: LayoutType;\n cell: Cell;\n cells: Cell[];\n degraded: boolean;\n degradedNodeLabel?: string;\n defaultNodeBricks?: NodeBrickConf[];\n transform: TransformLiteral;\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>;\n active: boolean;\n readOnly?: 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 onCellClick?(detail: CellContextMenuDetail): void;\n onDecoratorTextEditing?(detail: { id: string; editing: boolean }): void;\n onDecoratorTextChange?(detail: DecoratorTextChangeDetail): void;\n onNodeBrickResize(id: string, size: SizeTuple | null): void;\n onCellMouseEnter?(cell: Cell): void;\n onCellMouseLeave?(cell: Cell): void;\n}\n\nexport function CellComponent({\n layout,\n cell,\n cells,\n degraded,\n degradedNodeLabel,\n defaultNodeBricks,\n lineConfMap,\n active,\n readOnly,\n transform,\n unrelatedCells,\n onCellMoving,\n onCellMoved,\n onCellResizing,\n onCellResized,\n onSwitchActiveTarget,\n onCellContextMenu,\n onCellClick,\n onDecoratorTextEditing,\n onDecoratorTextChange,\n onNodeBrickResize,\n onCellMouseEnter,\n onCellMouseLeave,\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 if (!g || readOnly) {\n return;\n }\n const onMouseDown = (event: MouseEvent) => {\n handleMouseDown(event, {\n layout,\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 }, [\n layout,\n cell,\n onCellMoved,\n onCellMoving,\n onSwitchActiveTarget,\n readOnly,\n transform.k,\n ]);\n\n const handleContextMenu = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (readOnly && cell.type === \"decorator\") {\n return;\n }\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, readOnly]\n );\n\n const handleCellClick = useCallback(\n (event: React.MouseEvent<SVGGElement>) => {\n if (!onCellClick || cell.type === \"decorator\") {\n return;\n }\n onCellClick({\n cell,\n clientX: event.clientX,\n clientY: event.clientY,\n });\n },\n [cell, onCellClick]\n );\n\n const handleMouseEnter = useCallback(() => {\n onCellMouseEnter?.(cell);\n }, [cell, onCellMouseEnter]);\n\n const handleMouseLeave = useCallback(() => {\n onCellMouseLeave?.(cell);\n }, [cell, onCellMouseLeave]);\n\n return (\n <g\n className={classNames(\"cell\", {\n active,\n faded: unrelated,\n \"read-only\": readOnly,\n })}\n ref={gRef}\n transform={\n cell.type === \"edge\" || cell.view.x == null\n ? undefined\n : `translate(${cell.view.x} ${cell.view.y})`\n }\n onContextMenu={handleContextMenu}\n onClick={handleCellClick}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n >\n {isNodeCell(cell) ? (\n <NodeComponent\n node={cell}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n onResize={onNodeBrickResize}\n />\n ) : isEdgeCell(cell) ? (\n <EdgeComponent edge={cell} cells={cells} lineConfMap={lineConfMap} />\n ) : isDecoratorCell(cell) ? (\n <DecoratorComponent\n cell={cell}\n transform={transform}\n readOnly={readOnly}\n onCellResizing={onCellResizing}\n onCellResized={onCellResized}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onDecoratorTextEditing={onDecoratorTextEditing}\n onDecoratorTextChange={onDecoratorTextChange}\n />\n ) : null}\n </g>\n );\n}\n","export const SYMBOL_FOR_SIZE_INITIALIZED = Symbol.for(\"size-initialized\");\nexport const SYMBOL_FOR_LAYOUT_INITIALIZED = Symbol.for(\"layout-initialized\");\nexport const DEFAULT_NODE_SIZE = 20;\nexport const DEFAULT_NODE_GAP = 36;\nexport const DEFAULT_AREA_WIDTH = 100;\nexport const DEFAULT_AREA_HEIGHT = 60;\nexport const DEFAULT_SCALE_RANGE_MIN = 0.5;\nexport const DEFAULT_SCALE_RANGE_MAX = 2;\nexport const DEFAULT_LINE_STROKE_COLOR = \"gray\";\nexport const DEFAULT_LINE_STROKE_WIDTH = 1;\nexport const DEFAULT_LINE_INTERACT_STROKE_WIDTH = 15;\nexport const DEFAULT_LINE_INTERACT_SHOW_START_ARROW = false;\nexport const DEFAULT_LINE_INTERACT_SHOW_END_ARROW = true;\nexport const DEFAULT_LINE_INTERACT_ANIMATE_DURATION = 1;\nexport const DEFAULT_DEGRADED_THRESHOLD = 500;\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\nexport function isNodeOrEdgeCell(cell: Cell): cell is NodeCell | EdgeCell {\n return cell.type === \"node\" || cell.type === \"edge\";\n}\n","import type { ActiveTarget, Cell, ConnectLineState } from \"../interfaces\";\nimport { sameTarget } from \"./sameTarget\";\n\nexport function getUnrelatedCells(\n cells: Cell[],\n connectLineState: ConnectLineState | null,\n activeTarget: ActiveTarget | null\n): Cell[] {\n const unrelated: Cell[] = [];\n\n if (connectLineState) {\n const existedTargets = new Set<string>();\n for (const cell of cells) {\n if (cell.type === \"edge\" && cell.source === connectLineState.source.id) {\n existedTargets.add(cell.target);\n }\n }\n for (const cell of cells) {\n switch (cell.type) {\n case \"node\":\n if (existedTargets.has(cell.id)) {\n unrelated.push(cell);\n }\n break;\n default:\n unrelated.push(cell);\n }\n }\n } else {\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 }\n\n return unrelated;\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 { without } from \"lodash\";\nimport type {\n RangeTuple,\n SizeTuple,\n TransformLiteral,\n} from \"../../diagram/interfaces\";\nimport { DEFAULT_NODE_GAP, SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\nimport type {\n Cell,\n InitialCell,\n LayoutType,\n NodeCell,\n NodeId,\n NodeView,\n} from \"../interfaces\";\nimport { isDecoratorCell, isEdgeCell, isNodeCell } from \"./asserts\";\nimport { initializeCells } from \"./initializeCells\";\nimport { transformToCenter } from \"./transformToCenter\";\nimport { forceLayout } from \"../../shared/canvas/forceLayout\";\nimport { dagreLayout } from \"../../shared/canvas/dagreLayout\";\n\nexport function updateCells({\n cells,\n layout,\n previousCells,\n defaultNodeSize,\n canvasWidth,\n canvasHeight,\n scaleRange,\n transform,\n reason,\n parent,\n}: {\n cells: InitialCell[] | undefined;\n layout?: LayoutType;\n previousCells: Cell[];\n defaultNodeSize: SizeTuple;\n canvasWidth: number;\n canvasHeight: number;\n scaleRange: RangeTuple;\n transform: TransformLiteral;\n reason?: \"add-related-nodes\";\n parent?: NodeId;\n}): {\n cells: Cell[];\n updated: Cell[];\n shouldReCenter: boolean;\n} {\n const isManualLayout = layout !== \"force\" && layout !== \"dagre\";\n const newCells = initializeCells(cells, { defaultNodeSize });\n const updateCandidates: NodeCell[] = [];\n let shouldReCenter = false;\n\n const previousSizeInitializedNodes = new Map<string, NodeCell>();\n let previousShouldCentered = false;\n for (const cell of previousCells) {\n if (isDecoratorCell(cell)) {\n previousShouldCentered = true;\n } else if (isNodeCell(cell)) {\n previousShouldCentered = true;\n if (cell[SYMBOL_FOR_SIZE_INITIALIZED]) {\n previousSizeInitializedNodes.set(cell.id, cell);\n }\n }\n }\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 const previousNode = previousSizeInitializedNodes.get(cell.id);\n if (previousNode) {\n cell.view.width = previousNode.view.width;\n cell.view.height = previousNode.view.height;\n cell[SYMBOL_FOR_SIZE_INITIALIZED] = true;\n }\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 && isManualLayout) {\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 =\n rightMostNode.view.x + rightMostNode.view.width + DEFAULT_NODE_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 + DEFAULT_NODE_GAP,\n -DEFAULT_NODE_GAP\n );\n nextX =\n parentNode.view.x - totalWidth / 2 + parentNode.view.width / 2;\n nextY = parentNode.view.y + parentNode.view.height + DEFAULT_NODE_GAP;\n }\n for (const node of updateCandidates) {\n node.view.x = nextX;\n node.view.y = nextY;\n nextX += node.view.width + DEFAULT_NODE_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 let positionedNodesCount = 0;\n let hasDecorators = false;\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 positionedNodesCount++;\n }\n } else if (isDecoratorCell(cell)) {\n hasDecorators = true;\n }\n }\n\n if (isManualLayout) {\n if (!previousShouldCentered) {\n // If the previous cells are not centered, use the centered transform instead.\n transform = transformToCenter(without(newCells, ...updateCandidates), {\n canvasWidth,\n canvasHeight,\n scaleRange,\n });\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n\n // If there is no positioned nodes, or only one while without decorators,\n // then there is no relative positions, we can place the nodes with dagre layout.\n // Otherwise, use the force layout.\n if (\n positionedNodesCount === 0 ||\n (positionedNodesCount === 1 && !hasDecorators)\n ) {\n ({ getNodeView } = dagreLayout({ cells: newCells }));\n shouldReCenter = true;\n } else {\n ({ getNodeView } = forceLayout({\n cells: newCells,\n fixedPosition: true,\n center: [\n (canvasWidth / 2 - transform.x) / transform.k,\n (canvasHeight / 2 - transform.y) / transform.k,\n ],\n }));\n }\n\n for (const cell of newCells) {\n if (isNodeCell(cell)) {\n const view = getNodeView(cell.id);\n cell.view.x = view.x;\n cell.view.y = view.y;\n }\n }\n }\n }\n\n return { cells: newCells, updated: updateCandidates, shouldReCenter };\n}\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\nimport type { Cell, NodeCell } from \"../interfaces\";\nimport { isNodeCell } from \"../processors/asserts\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../constants\";\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 case \"update-node-size\":\n return state.map((cell) =>\n isNodeCell(cell) && cell.id === action.payload.id\n ? {\n ...cell,\n [SYMBOL_FOR_SIZE_INITIALIZED]: true,\n view: action.payload.size\n ? {\n ...cell.view,\n width: action.payload.size[0],\n height: action.payload.size[1],\n }\n : cell.view,\n }\n : cell\n );\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\";\nimport { layoutKey } from \"./layoutKey\";\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 layoutKey,\n});\n","import type { Reducer } from \"react\";\nimport type { DrawCanvasAction } from \"./interfaces\";\n\nexport const layoutKey: Reducer<number, DrawCanvasAction> = (state, action) => {\n switch (action.type) {\n case \"update-node-size\":\n return action.layoutKey;\n default:\n return state;\n }\n};\n","import * as React from \"react\";\nconst SvgCenter = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={24} height={24} viewBox=\"0 0 24 24\" {...props}><path d=\"M12 0a.5.5 0 0 1 .5.5v2.013a9.5 9.5 0 0 1 8.987 8.988L23.5 11.5a.5.5 0 0 1 0 1h-2.013a9.5 9.5 0 0 1-8.987 8.987V23.5a.5.5 0 0 1-1 0v-2.013A9.5 9.5 0 0 1 2.514 12.5H.5a.5.5 0 0 1 0-1h2.013A9.5 9.5 0 0 1 11.5 2.514V.5A.5.5 0 0 1 12 0M3.514 11.5H7.5a.5.5 0 0 1 0 1H3.514a8.5 8.5 0 0 0 7.987 7.986L11.5 16.5a.5.5 0 0 1 1 0v3.986a8.5 8.5 0 0 0 7.986-7.986H16.5a.5.5 0 0 1 0-1h3.986A8.5 8.5 0 0 0 12.5 3.515V7.5a.5.5 0 0 1-1 0V3.514a8.5 8.5 0 0 0-7.986 7.987zm8.486-1a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3\" /></svg>;\nexport default SvgCenter;","import * as React from \"react\";\nconst SvgZoomIn = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4h-204.8V281.6a25.6 25.6 0 1 0-51.2 0v204.8h-204.8a25.6 25.6 0 0 0 0 51.2h204.8v204.8a25.6 25.6 0 0 0 51.2 0V537.6h204.8a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomIn;","import * as React from \"react\";\nconst SvgZoomOut = props => <svg xmlns=\"http://www.w3.org/2000/svg\" width={128} height={128} className=\"icon\" viewBox=\"0 0 1024 1024\" {...props}><path d=\"M512 76.8A435.2 435.2 0 1 0 947.2 512 435.71 435.71 0 0 0 512 76.8m0 819.2a384 384 0 1 1 384-384 384 384 0 0 1-384 384\" /><path d=\"M744.448 486.4H280.064a25.6 25.6 0 1 0 0 51.2h464.384a25.6 25.6 0 0 0 0-51.2\" /></svg>;\nexport default SvgZoomOut;","import React, { useCallback, useMemo, useRef } from \"react\";\nimport { ConfigProvider, Slider, theme } from \"antd\";\nimport { StyleProvider, createCache } from \"@ant-design/cssinjs\";\nimport { useCurrentTheme } from \"@next-core/react-runtime\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport CenterSVG from \"./icons/center.svg\";\nimport ZoomInSVG from \"./icons/zoom-in.svg\";\nimport ZoomOutSVG from \"./icons/zoom-out.svg\";\n\nexport interface ZoomBarComponentProps {\n shadowRoot: ShadowRoot;\n scale: number;\n scaleRange: RangeTuple;\n onZoomChange(value: number): void;\n onReCenter(): void;\n}\n\nexport function ZoomBarComponent({\n shadowRoot,\n scale,\n scaleRange,\n onZoomChange,\n onReCenter,\n}: ZoomBarComponentProps): JSX.Element | null {\n const currentTheme = useCurrentTheme();\n const cache = useMemo(() => createCache(), []);\n const zoomBarRef = useRef<HTMLDivElement | null>(null);\n const min = scaleRange[0] * 100;\n const max = scaleRange[1] * 100;\n const value = scale * 100;\n const step = 5;\n\n const tooltip = useMemo(() => {\n return {\n formatter: (value: number | undefined) => `${value}%`,\n placement: \"left\" as const,\n getPopupContainer: () => zoomBarRef.current!,\n };\n }, []);\n\n const onZoomIn = useCallback(() => {\n onZoomChange(Math.min(value + step, max));\n }, [max, onZoomChange, value]);\n\n const onZoomOut = useCallback(() => {\n onZoomChange(Math.max(value - step, min));\n }, [min, onZoomChange, value]);\n\n return (\n <ConfigProvider\n theme={{\n algorithm:\n currentTheme === \"dark-v2\"\n ? theme.darkAlgorithm\n : theme.defaultAlgorithm,\n }}\n >\n <StyleProvider\n container={shadowRoot}\n // Auto clear injected styles after unmount\n autoClear\n cache={cache}\n // Set hashPriority to \"high\" to disable `:where()` usage for compatibility\n hashPriority=\"high\"\n >\n <div className=\"zoom-bar\" ref={zoomBarRef}>\n <div className=\"center-button\" onClick={onReCenter} role=\"button\">\n <CenterSVG />\n </div>\n <div className=\"zoom-slider\">\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomIn}>\n <ZoomInSVG />\n </div>\n <Slider\n min={min}\n max={max}\n value={value}\n step={step}\n vertical\n included={false}\n tooltip={tooltip}\n onChange={onZoomChange}\n />\n <div className=\"zoom-button\" role=\"button\" onClick={onZoomOut}>\n <ZoomOutSVG />\n </div>\n </div>\n </div>\n </StyleProvider>\n </ConfigProvider>\n );\n}\n","import { pick } from \"lodash\";\nimport dagre from \"@dagrejs/dagre\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type {\n Cell,\n ForceNode,\n LayoutOptionsDagre,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport type { FullRectTuple } from \"../../diagram/interfaces\";\n\nexport interface DagreLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsDagre;\n}\n\nexport function dagreLayout({ cells, layoutOptions }: DagreLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, ...dagreGraphOptions } = {\n nodePadding: 0,\n rankdir: \"TB\",\n ranksep: 50,\n edgesep: 10,\n nodesep: 50,\n // align: undefined,\n ...pick(layoutOptions, [\n \"nodePadding\",\n \"rankdir\",\n \"ranksep\",\n \"edgesep\",\n \"nodesep\",\n \"align\",\n ]),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n\n if (!cells.some(isNodeCell)) {\n // Dagre cannot render empty nodes\n return {\n getNodeView: () => null!,\n nodePaddings,\n };\n }\n\n const graph = new dagre.graphlib.Graph<ForceNode>();\n graph.setGraph(dagreGraphOptions);\n // Default to assigning a new object as a label for each new edge.\n graph.setDefaultEdgeLabel(function () {\n return {};\n });\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n graph.setNode(cell.id, {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n });\n } else if (isEdgeCell(cell)) {\n graph.setEdge(cell.source, cell.target);\n }\n }\n dagre.layout(graph);\n\n return {\n getNodeView: (id: NodeId) => graph.node(id),\n nodePaddings,\n };\n}\n","import { pick } from \"lodash\";\nimport {\n forceCollide,\n forceLink,\n forceManyBody,\n forceSimulation,\n forceX,\n forceY,\n type Simulation,\n} from \"d3-force\";\nimport type {\n Cell,\n ForceCollideOptions,\n ForceLink,\n ForceNode,\n LayoutOptionsForce,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell, isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport { extractPartialRectTuple } from \"../../diagram/processors/extractPartialRectTuple\";\nimport type { FullRectTuple, PositionTuple } from \"../../diagram/interfaces\";\n\nexport interface ForceLayoutOptions {\n cells: Cell[];\n layoutOptions?: LayoutOptionsForce;\n center?: PositionTuple;\n fixedPosition?: boolean;\n}\n\nexport function forceLayout({\n cells,\n layoutOptions,\n center,\n fixedPosition,\n}: ForceLayoutOptions): {\n getNodeView: (id: NodeId) => NodeView;\n nodePaddings: FullRectTuple;\n} {\n const { nodePadding, collide } = {\n nodePadding: 0,\n ...pick(layoutOptions, [\"nodePadding\"]),\n collide:\n layoutOptions?.collide !== false\n ? ({\n radiusDiff: 18,\n strength: 1,\n iterations: 1,\n ...(layoutOptions?.collide === true\n ? null\n : (layoutOptions?.collide as ForceCollideOptions)),\n } as Required<ForceCollideOptions>)\n : (false as const),\n };\n const nodePaddings = extractPartialRectTuple(nodePadding);\n const forceNodes: ForceNode[] = [];\n const forceLinks: ForceLink[] = [];\n const nodesMap = new Map<NodeId, ForceNode>();\n for (const cell of cells) {\n if (isNodeCell(cell)) {\n const node: ForceNode = {\n id: cell.id,\n width: cell.view.width + nodePaddings[1] + nodePaddings[3],\n height: cell.view.height + nodePaddings[0] + nodePaddings[2],\n ...(fixedPosition ? { fx: cell.view.x, fy: cell.view.y } : null),\n };\n forceNodes.push(node);\n nodesMap.set(node.id, node);\n } else if (isEdgeCell(cell)) {\n forceLinks.push({ source: cell.source, target: cell.target });\n }\n }\n\n const linkSimulation = forceLink<ForceNode, ForceLink>(forceLinks).id(\n (d) => d.id\n );\n const simulation = forceSimulation<ForceNode, ForceLink>(forceNodes)\n .force(\"link\", linkSimulation)\n .force(\"x\", forceX(center?.[0]))\n .force(\"y\", forceY(center?.[1]))\n .force(\"charge\", forceManyBody());\n\n if (collide) {\n simulation.force(\n \"collide\",\n forceCollide<ForceNode>()\n .radius(\n (d) =>\n Math.sqrt(d.width ** 2 + d.height ** 2) / 2 + collide.radiusDiff\n )\n .strength(collide.strength)\n .iterations(collide.iterations)\n );\n }\n\n simulation.stop();\n manuallyTickToTheEnd(simulation);\n\n return {\n getNodeView: (id: NodeId) => nodesMap.get(id) as NodeView,\n nodePaddings,\n };\n}\n\nfunction manuallyTickToTheEnd(\n simulation: Simulation<ForceNode, ForceLink>\n): void {\n // Manually tick to the end.\n simulation.tick(\n Math.ceil(\n Math.log(simulation.alphaMin()) / Math.log(1 - simulation.alphaDecay())\n )\n );\n}\n","import React, { useEffect, useRef, useState } from \"react\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\nimport { sameTarget } from \"../../draw-canvas/processors/sameTarget\";\n\nexport interface UseActiveTargetOptions {\n cellsRef: React.RefObject<SVGGElement>;\n activeTarget?: ActiveTarget | null;\n onActiveTargetChange(target: ActiveTarget | null): void;\n}\n\nexport type UseActiveTargetResult = ActiveTarget | null;\n\nexport function useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n}: UseActiveTargetOptions): UseActiveTargetResult {\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 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, cellsRef]);\n\n return activeTarget;\n}\n","import { useCallback, useEffect, useRef, useState } from \"react\";\nimport type { ZoomBehavior } from \"d3-zoom\";\nimport type {\n Cell,\n LayoutOptions,\n LayoutOptionsForce,\n LayoutOptionsDagre,\n LayoutType,\n NodeId,\n NodeView,\n} from \"../../draw-canvas/interfaces\";\nimport type { FullRectTuple, RangeTuple } from \"../../diagram/interfaces\";\nimport { useAutoCenter } from \"./useAutoCenter\";\nimport {\n isNodeCell,\n isNodeOrEdgeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\nimport type { DrawCanvasAction } from \"../../draw-canvas/reducers/interfaces\";\nimport { forceLayout } from \"./forceLayout\";\nimport { dagreLayout } from \"./dagreLayout\";\n\nexport interface UseLayoutOptions {\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n layoutKey: number;\n dispatch: (value: DrawCanvasAction) => void;\n}\n\nexport function useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n dispatch,\n}: UseLayoutOptions) {\n const [layoutInitialized, setLayoutInitialized] = useState(\n layout !== \"force\" && layout !== \"dagre\"\n );\n\n const layoutKeyRef = useRef(layoutKey);\n\n const getNextLayoutKey = useCallback(() => {\n return ++layoutKeyRef.current;\n }, []);\n\n const [centered, setCentered] = useAutoCenter({\n rootRef,\n layoutInitialized,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n });\n\n const previousLayoutRef = useRef<Cell[] | null>(null);\n\n useEffect(() => {\n // Wait for all nodes to be size-initialized before layout.\n if (\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\n return;\n }\n\n if (layout !== \"force\" && layout !== \"dagre\") {\n setLayoutInitialized(true);\n return;\n }\n\n // DO NOT re-layout if layout key mismatched.\n // DO NOT re-layout if nodes and edges not changed.\n if (\n layoutKeyRef.current !== layoutKey ||\n isSameArray(previousLayoutRef.current, cells.filter(isNodeOrEdgeCell))\n ) {\n // Layout key mismatch happens when this effect is performed after\n // update-node-size dispatched but not yet applied.\n // If didn't ignore mismatched layout, it will cause the update-cells\n // action overwrites those update-node-size actions.\n return;\n }\n\n let getNodeView: (id: NodeId) => NodeView;\n let nodePaddings: FullRectTuple;\n\n if (layout === \"force\") {\n ({ getNodeView, nodePaddings } = forceLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsForce,\n }));\n } else {\n ({ getNodeView, nodePaddings } = dagreLayout({\n cells,\n layoutOptions: layoutOptions as LayoutOptionsDagre,\n }));\n }\n\n const newCells: Cell[] = cells.map((cell) => {\n if (isNodeCell(cell)) {\n const nodeView = getNodeView(cell.id);\n return {\n ...cell,\n view: {\n ...cell.view,\n x: nodeView.x! - nodeView.width / 2 + nodePaddings[3],\n y: nodeView.y! - nodeView.height / 2 + nodePaddings[0],\n },\n [SYMBOL_FOR_LAYOUT_INITIALIZED]: true,\n };\n }\n return cell;\n });\n previousLayoutRef.current = newCells.filter(isNodeOrEdgeCell);\n\n dispatch({ type: \"update-cells\", payload: newCells });\n setCentered(false);\n setLayoutInitialized(true);\n }, [cells, dispatch, layout, layoutKey, layoutOptions, setCentered]);\n\n return { centered, setCentered, getNextLayoutKey };\n}\n\nfunction isSameArray<T = unknown>(a: T[] | null, b: T[]): boolean {\n return a?.length === b.length && a.every((v, i) => v === b[i]);\n}\n","import React, { useEffect, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { ZoomTransform, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple } from \"../../diagram/interfaces\";\nimport { SYMBOL_FOR_SIZE_INITIALIZED } from \"../../draw-canvas/constants\";\nimport type { Cell } from \"../../draw-canvas/interfaces\";\nimport {\n isDecoratorCell,\n isNodeCell,\n} from \"../../draw-canvas/processors/asserts\";\nimport { transformToCenter } from \"../../draw-canvas/processors/transformToCenter\";\n\nexport interface UseAutoCenterOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n cells: Cell[];\n layoutInitialized: boolean;\n zoomable?: boolean;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n scaleRange: RangeTuple;\n}\n\nexport type UseAutoCenterResult = [\n centered: boolean,\n setCentered: React.Dispatch<React.SetStateAction<boolean>>,\n];\n\nexport function useAutoCenter({\n rootRef,\n cells,\n layoutInitialized,\n zoomable,\n zoomer,\n scaleRange,\n}: UseAutoCenterOptions): UseAutoCenterResult {\n const [centered, setCentered] = useState(false);\n\n useEffect(() => {\n const root = rootRef.current;\n if (\n !root ||\n !layoutInitialized ||\n centered ||\n !cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell)) ||\n cells.some(\n (cell) => isNodeCell(cell) && !cell[SYMBOL_FOR_SIZE_INITIALIZED]\n )\n ) {\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 }, [\n cells,\n centered,\n layoutInitialized,\n rootRef,\n scaleRange,\n zoomable,\n zoomer,\n ]);\n\n useEffect(() => {\n // Reset auto centering when nodes and decorators are all removed.\n if (!cells.some((cell) => isNodeCell(cell) || isDecoratorCell(cell))) {\n setCentered(false);\n }\n }, [cells]);\n\n return [centered, setCentered];\n}\n","import { useMemo } from \"react\";\nimport { __secret_internals, checkIfByTransform } from \"@next-core/runtime\";\nimport { findIndex, isUndefined, omitBy } from \"lodash\";\nimport type {\n Cell,\n ComputedEdgeLineConf,\n EdgeCell,\n EdgeLineConf,\n LineMarker,\n} from \"../../draw-canvas/interfaces\";\nimport { isEdgeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n DEFAULT_LINE_STROKE_COLOR,\n DEFAULT_LINE_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseLineMarkersOptions {\n cells: Cell[];\n defaultEdgeLines: EdgeLineConf[] | undefined;\n markerPrefix: string;\n}\n\nexport function useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n}: UseLineMarkersOptions): [\n lineConfMap: WeakMap<EdgeCell, ComputedEdgeLineConf>,\n markers: LineMarker[],\n] {\n return useMemo(() => {\n // Always put the default stroke marker at the first position,\n // since the connecting line will use it.\n const markers: LineMarker[] = [{ strokeColor: DEFAULT_LINE_STROKE_COLOR }];\n const map = new WeakMap<EdgeCell, ComputedEdgeLineConf>();\n for (const cell of cells) {\n if (isEdgeCell(cell)) {\n const computedLineConf =\n __secret_internals.legacyDoTransform(\n { edge: cell },\n defaultEdgeLines?.find((item) =>\n checkIfByTransform(item, { edge: cell })\n )\n ) ?? {};\n const lineConf = {\n dashed: false,\n strokeColor: DEFAULT_LINE_STROKE_COLOR,\n strokeWidth: DEFAULT_LINE_STROKE_WIDTH,\n interactStrokeWidth: DEFAULT_LINE_INTERACT_STROKE_WIDTH,\n showStartArrow: DEFAULT_LINE_INTERACT_SHOW_START_ARROW,\n showEndArrow: DEFAULT_LINE_INTERACT_SHOW_END_ARROW,\n animate: {\n useAnimate: false,\n duration: DEFAULT_LINE_INTERACT_ANIMATE_DURATION,\n },\n ...omitBy(computedLineConf, isUndefined),\n } as ComputedEdgeLineConf;\n if (lineConf.parallelGap === undefined) {\n lineConf.parallelGap = lineConf.interactStrokeWidth;\n }\n const markerEndIndex = addMarker(\n { strokeColor: lineConf.strokeColor },\n markers\n );\n lineConf.markerArrow = `url(#${markerPrefix}${markerEndIndex})`;\n map.set(cell, lineConf);\n }\n }\n return [map, markers];\n }, [cells, defaultEdgeLines, markerPrefix]);\n}\n\nfunction addMarker(marker: LineMarker, markers: LineMarker[]): number {\n let markerIndex = findIndex(markers, marker);\n if (markerIndex === -1) {\n markerIndex = markers.push(marker) - 1;\n }\n return markerIndex;\n}\n","import { useMemo } from \"react\";\nimport type { Cell, LayoutType } from \"../../draw-canvas/interfaces\";\nimport { isNodeCell } from \"../../draw-canvas/processors/asserts\";\nimport {\n SYMBOL_FOR_LAYOUT_INITIALIZED,\n SYMBOL_FOR_SIZE_INITIALIZED,\n} from \"../../draw-canvas/constants\";\n\nexport interface UseReadyOptions {\n cells: Cell[];\n layout: LayoutType;\n centered: boolean;\n}\n\nexport function useReady({ cells, layout, centered }: UseReadyOptions) {\n const ready = useMemo(\n () =>\n centered &&\n cells.every(\n (cell) =>\n !isNodeCell(cell) ||\n (cell[SYMBOL_FOR_SIZE_INITIALIZED] &&\n ((layout !== \"force\" && layout !== \"dagre\") ||\n cell[SYMBOL_FOR_LAYOUT_INITIALIZED]))\n ),\n [cells, centered, layout]\n );\n return ready;\n}\n","import React, { useEffect, useMemo, useState } from \"react\";\nimport { select } from \"d3-selection\";\nimport { zoom, type ZoomBehavior } from \"d3-zoom\";\nimport type { RangeTuple, TransformLiteral } from \"../../diagram/interfaces\";\nimport {\n DEFAULT_SCALE_RANGE_MIN,\n DEFAULT_SCALE_RANGE_MAX,\n} from \"../../draw-canvas/constants\";\nimport type { ActiveTarget } from \"../../draw-canvas/interfaces\";\n\nexport interface UseZoomOptions {\n rootRef: React.RefObject<SVGSVGElement>;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n onSwitchActiveTarget?(target: ActiveTarget | null): void;\n}\n\nexport interface UseZoomResult {\n grabbing: boolean;\n transform: TransformLiteral;\n scaleRange: RangeTuple;\n zoomer: ZoomBehavior<SVGSVGElement, unknown>;\n}\n\nexport function useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n}: UseZoomOptions): UseZoomResult {\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 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, rootRef, scrollable, zoomable, zoomer]);\n\n return { grabbing, transform, zoomer, scaleRange };\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, `.zoom-bar{position:absolute;bottom:20px;right:20px;width:40px}.zoom-slider,\n.center-button{width:100%;display:flex;align-items:center;border:1px solid var(--antd-background-color-base);border-radius:var(--larger-border-radius);box-shadow:var(--connected-overlay-shadow);background-color:var(--color-fill-bg-container-4)}.zoom-slider{height:140px;padding:8px 0;flex-direction:column}[role=\"button\"]{cursor:pointer}.center-button{justify-content:center;margin-bottom:8px;height:40px}.center-button:hover{border-color:var(--antd-btn-default-hover-border-color)}.center-button path{fill:var(--antd-link-hover-color)}.center-button:hover path{fill:var(--palette-blue-7)}.zoom-button{font-size:16px;line-height:0}.zoom-button svg{width:1em;height:1em;fill:var(--antd-link-hover-color)}.zoom-slider .ant-slider-vertical{padding-inline:5px}.zoom-slider .ant-slider-vertical .ant-slider-rail{width:2px}.zoom-slider .ant-slider-vertical .ant-slider-handle{width:6px;height:6px;inset-inline-start:3px}.zoom-slider .ant-slider .ant-slider-handle:hover::before,\n.zoom-slider .ant-slider .ant-slider-handle:focus::before,\n.zoom-slider .ant-slider .ant-slider-handle::before{width:10px;height:10px;inset-inline-start:-2px}.zoom-slider .ant-slider .ant-slider-handle:hover::after,\n.zoom-slider .ant-slider .ant-slider-handle:focus::after,\n.zoom-slider .ant-slider .ant-slider-handle::after{width:6px;height:6px;inset-block-start:0;inset-inline-start:0}`, \"\"]);\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;position:relative;overflow:hidden;--animation-dasharray:48;--stroke-dashoffset:96;--dasharray:4}:host,\n.root{width:100%;height:100%}:host([hidden]){display:none}.root{opacity:0}.root.ready{opacity:1}.root:focus{outline:none}@keyframes dashedAnimation{0%{stroke-dashoffset:var(--stroke-dashoffset)}to{stroke-dashoffset:0}}@keyframes solidAnimation{to{stroke-dashoffset:0}}.solid-animation{stroke-dasharray:var(--solid-length);stroke-dashoffset:var(--solid-length);animation:solidAnimation var(--time) linear infinite}.dashed-animation{animation:dashedAnimation var(--time) linear infinite}.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:var(--dasharray);stroke-width:1}.cell:not(.read-only){-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{pointer-events:none}.connect-line:not(.connecting){display:none}.line.dashed{stroke-dasharray:var(--dasharray)}.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}.cell .node{pointer-events:none}.cell .node > *{pointer-events:auto}.degraded{pointer-events:bounding-box}.degraded circle{fill:rgb(119,141,195)}.degraded text{text-anchor:middle;fill:var(--antd-text-color)}.cell.active .degraded circle,\n.cell.active .degraded text,\n.degraded:hover circle,\n.degraded:hover text{fill:var(--color-brand)}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___.toString();\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","parallelGap","doTwoNodesOverlap","p0","p1","xDiff","yDiff","dx","x","dy","y","angle","Math","atan2","cos","PI","sin","line","sourceIntersections","getIntersections","targetIntersections","length","rect","vertices","width","height","possibleLines","i","push","intersections","item","intersection","intersect","x1","y1","x2","y2","x3","y3","x4","y4","denominator","ua","ub","a","b","paddingA","paddingB","A","getNodesWithPadding","B","left","min","right","max","top","bottom","node","padding","extractPartialRectTuple","value","Array","isArray","v0","v1","findNode","cells","find","cell","isNodeCell","EdgeComponent","_lineConf$animate$dur","_pathRef$current","_pathRef$current$getT","edge","lineConfMap","pathRef","useRef","sourceNode","useMemo","targetNode","lineConf","get","some","isEdgeCell","view","nodeViewToNodeRect","concat","interactStrokeWidth","ref","className","classNames","dashed","animate","useAnimate","style","duration","DEFAULT_LINE_INTERACT_ANIMATE_DURATION","current","getTotalLength","call","markerStart","showStartArrow","markerArrow","markerEnd","showEndArrow","NodeComponent","degraded","degradedNodeLabel","defaultNodeBricks","onResize","memoizedData","memoizedValue","setMemoizedValue","useState","useEffect","prev","isEqual","useDeepMemo","data","specifiedUseBrick","useBrick","observerRef","_defaultNodeBricks$fi","checkIfByTransform","label","String","__secret_internals","legacyDoTransform","refCallback","useCallback","element","prevObserver","disconnect","setTimeout","observer","ResizeObserver","offsetWidth","offsetHeight","observe","degradedRefCallBack","g","size","getBBox","ReactUseBrick","cx","cy","r","cellToTarget","pick","handleMouseDown","event","action","scale","layout","onCellMoving","onCellMoved","onCellResizing","onCellResized","onSwitchActiveTarget","stopPropagation","from","clientX","clientY","original","moved","handleMove","e","finished","movement","getMovement","onMouseMove","onMouseUp","document","removeEventListener","addEventListener","DecoratorArea","transform","readOnly","resizeHandleRef","resizeHandle","onMouseDown","k","DecoratorText","_cell$view$text","onDecoratorTextEditing","onDecoratorTextChange","text","currentLabel","setCurrentLabel","editingLabel","setEditingLabel","editingLabelInitialized","shouldEmitLabelChange","setShouldEmitLabelChange","handleEnableEdit","preventDefault","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","onCellClick","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","gRef","unrelated","sameTarget","handleContextMenu","handleCellClick","handleMouseEnter","handleMouseLeave","faded","undefined","onContextMenu","onClick","onMouseEnter","onMouseLeave","isDecoratorCell","SYMBOL_FOR_SIZE_INITIALIZED","Symbol","for","SYMBOL_FOR_LAYOUT_INITIALIZED","DEFAULT_NODE_SIZE","DEFAULT_NODE_GAP","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","DEFAULT_SCALE_RANGE_MIN","DEFAULT_SCALE_RANGE_MAX","DEFAULT_LINE_STROKE_COLOR","DEFAULT_LINE_STROKE_WIDTH","DEFAULT_LINE_INTERACT_STROKE_WIDTH","DEFAULT_LINE_INTERACT_SHOW_START_ARROW","DEFAULT_LINE_INTERACT_SHOW_END_ARROW","DEFAULT_DEGRADED_THRESHOLD","isInitialNodeCell","isNodeOrEdgeCell","getUnrelatedCells","connectLineState","activeTarget","existedTargets","Set","add","has","nodesMap","Map","relatedNodeIds","set","initializeCells","initialCells","defaultNodeSize","map","_cell$view","_cell$view2","transformToCenter","canvasWidth","canvasHeight","scaleRange","Infinity","empty","updateCells","previousCells","reason","parent","isManualLayout","newCells","updateCandidates","shouldReCenter","previousSizeInitializedNodes","previousShouldCentered","previousNode","handled","downstreamNodeIds","parentNode","downstreamNodes","filter","Boolean","rightMostNode","nextX","nextY","totalWidth","reduce","acc","getNodeView","maxWidth","maxHeight","positionedNodesCount","hasDecorators","without","dagreLayout","forceLayout","fixedPosition","center","updated","insertCellAfter","newCell","after","index","findLastIndex","slice","reducers","rootReducer","state","payload","findIndex","layoutKey","Object","fromEntries","entries","key","props","_extends","xmlns","ZoomBarComponent","shadowRoot","onZoomChange","onReCenter","currentTheme","useCurrentTheme","cache","createCache","zoomBarRef","tooltip","formatter","placement","getPopupContainer","onZoomIn","onZoomOut","ConfigProvider","theme","algorithm","darkAlgorithm","defaultAlgorithm","StyleProvider","container","autoClear","hashPriority","role","CenterSVG","ZoomInSVG","Slider","step","vertical","included","onChange","ZoomOutSVG","layoutOptions","_nodePadding$rankdir$","nodePadding","rankdir","ranksep","edgesep","nodesep","dagreGraphOptions","_objectWithoutProperties","_excluded","nodePaddings","graph","dagre","Graph","setGraph","setDefaultEdgeLabel","setNode","setEdge","collide","radiusDiff","strength","iterations","forceNodes","forceLinks","fx","fy","linkSimulation","forceLink","simulation","forceSimulation","force","forceX","forceY","forceManyBody","forceCollide","radius","sqrt","stop","tick","ceil","log","alphaMin","alphaDecay","manuallyTickToTheEnd","useActiveTarget","cellsRef","_activeTarget","onActiveTargetChange","newActiveTarget","setActiveTarget","previous","activeTargetChangeInitialized","resetActiveTarget","composedPath","indexOf","useLayout","rootRef","zoomable","zoomer","dispatch","layoutInitialized","setLayoutInitialized","layoutKeyRef","getNextLayoutKey","centered","setCentered","root","clientWidth","clientHeight","select","ZoomTransform","useAutoCenter","previousLayoutRef","every","v","nodeView","useLineMarkers","defaultEdgeLines","markerPrefix","markers","WeakMap","_loop","_secret_internals$le","computedLineConf","omitBy","isUndefined","markerEndIndex","marker","markerIndex","addMarker","useReady","useZoom","scrollable","pannable","_scaleRange","grabbing","setGrabbing","setTransform","zoom","scaleExtent","on","rootSelection","unsetZoom","ctrlKey","stopImmediatePropagation","translateBy","wheelDeltaX","wheelDeltaY","___CSS_LOADER_EXPORT___","module","toString"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[9823],{6094:(e,t,a)=>{a.r(t),a.d(t,{EoDisplayCanvas:()=>Ee});var n,s,l,i,r,o,c,u,d,h,g,f,p,b,y,m,v,k,w,C,A,N,E,M,T,R,W,z,S,L,x,B,O,j,P,U,_,H,K,D,I,Y,q=a(4635),F=a(918),J=a(1369),Z=a(8449),G=a(4521),Q=a(8769),V=a.n(Q),X=a(9929),$=a(9938),ee=(a(330),a(1030)),te=a(3373),ae=a.n(te),ne=a(7566),se=a(3739),le=a(8185),ie=a(2830),re=a(3783),oe=a(3033),ce=a(8091),ue=a(1819),de=a(5748),he=a(227),ge=a(531),fe=a(7099),pe=a(2361),be=a(8197),ye=a(7531),me=a(2098),ve=a(3012),ke=a(8618);function we(e,t,a){return a(Ne(e,t))}function Ce(e,t,a){return e.set(Ne(e,t),a),a}function Ae(e,t){return e.get(Ne(e,t))}function Ne(e,t,a){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:a;throw new TypeError("Private element is not present on this object")}var Ee,{defineElement:Me,property:Te,event:Re}=(0,X.createDecorators)(),We=new WeakMap,ze=new WeakMap,Se=new WeakMap,Le=new WeakMap,xe=new WeakMap,Be=new WeakMap,Oe=new WeakMap,je=new WeakMap,Pe=new WeakMap,Ue=new WeakMap,_e=new WeakMap,He=new WeakMap,Ke=new WeakMap,De=new WeakMap,Ie=new WeakMap,Ye=new WeakSet,qe=new WeakMap,Fe=new WeakMap,Je=new WeakMap,Ze=new WeakMap,Ge=new WeakMap,Qe=new WeakMap;class Ve extends $.ReactNextElement{constructor(){super(...arguments),(0,q.A)(this,Ye),(0,F.A)(this,We,s(this)),(0,F.A)(this,ze,(l(this),i(this))),(0,F.A)(this,Se,(r(this),o(this))),(0,F.A)(this,Le,(c(this),u(this,[oe.HP,oe.HP]))),(0,F.A)(this,xe,(d(this),h(this))),(0,F.A)(this,Be,(g(this),f(this))),(0,F.A)(this,Oe,(p(this),b(this))),(0,F.A)(this,je,(y(this),m(this))),(0,F.A)(this,Pe,(v(this),k(this))),(0,F.A)(this,Ue,(w(this),C(this))),(0,F.A)(this,_e,(A(this),N(this,!0))),(0,F.A)(this,He,(E(this),M(this,!0))),(0,F.A)(this,Ke,(T(this),R(this,!0))),(0,F.A)(this,De,(W(this),z(this))),(0,F.A)(this,Ie,(S(this),L(this))),(0,F.A)(this,qe,(O(this),e=>{we(Ye,this,x).emit(e)})),(0,F.A)(this,Fe,(e=>{(0,le.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,F.A)(this,Je,j(this)),(0,F.A)(this,Ze,(_(this),e=>{we(Ye,this,P).emit(e)})),(0,F.A)(this,Ge,H(this)),(0,F.A)(this,Qe,(I(this),e=>{we(Ye,this,K).emit(e)}))}get cells(){return Ae(We,this)}set cells(e){Ce(We,this,e)}get layout(){return Ae(ze,this)}set layout(e){Ce(ze,this,e)}get layoutOptions(){return Ae(Se,this)}set layoutOptions(e){Ce(Se,this,e)}get defaultNodeSize(){return Ae(Le,this)}set defaultNodeSize(e){Ce(Le,this,e)}get defaultNodeBricks(){return Ae(xe,this)}set defaultNodeBricks(e){Ce(xe,this,e)}get degradedThreshold(){return Ae(Be,this)}set degradedThreshold(e){Ce(Be,this,e)}get degradedNodeLabel(){return Ae(Oe,this)}set degradedNodeLabel(e){Ce(Oe,this,e)}get defaultEdgeLines(){return Ae(je,this)}set defaultEdgeLines(e){Ce(je,this,e)}get activeTarget(){return Ae(Pe,this)}set activeTarget(e){Ce(Pe,this,e)}get fadeUnrelatedCells(){return Ae(Ue,this)}set fadeUnrelatedCells(e){Ce(Ue,this,e)}get zoomable(){return Ae(_e,this)}set zoomable(e){Ce(_e,this,e)}get scrollable(){return Ae(He,this)}set scrollable(e){Ce(He,this,e)}get pannable(){return Ae(Ke,this)}set pannable(e){Ce(Ke,this,e)}get scaleRange(){return Ae(De,this)}set scaleRange(e){Ce(De,this,e)}render(){return V().createElement(Xe,{shadowRoot:this.shadowRoot,cells:this.cells,layout:this.layout,layoutOptions:this.layoutOptions,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:Ae(qe,this),onSwitchActiveTarget:Ae(Fe,this),onCellContextMenu:Ae(Ze,this),onCellClick:Ae(Qe,this)})}}function Xe(e){var{shadowRoot:t,cells:a,layout:n,layoutOptions:s,defaultNodeSize:l,defaultNodeBricks:i,defaultEdgeLines:r,degradedThreshold:o,degradedNodeLabel:c,activeTarget:u,fadeUnrelatedCells:d,zoomable:h,scrollable:g,pannable:f,scaleRange:p,onActiveTargetChange:b,onSwitchActiveTarget:y,onCellContextMenu:m,onCellClick:v}=e,[{cells:k,layoutKey:w},C]=(0,Q.useReducer)(de.d,a,(e=>({cells:(0,re.C)(e,{defaultNodeSize:l}),layoutKey:1}))),A=(0,Q.useMemo)((()=>k.filter(ge.N).length>=(null!=o?o:oe.pC)),[k,o]),N=(0,Q.useRef)(null),E=(0,Q.useRef)(null),{grabbing:M,transform:T,zoomer:R,scaleRange:W}=(0,ce.f)({rootRef:N,zoomable:h,scrollable:g,pannable:f,scaleRange:p,onSwitchActiveTarget:y}),{centered:z,setCentered:S,getNextLayoutKey:L}=(0,pe.g)({layout:n,layoutOptions:s,rootRef:N,cells:k,zoomable:h,zoomer:R,scaleRange:W,layoutKey:w,dispatch:C}),x=(0,Q.useCallback)((()=>{S(!1)}),[S]),B=(0,Q.useRef)(a);(0,Q.useEffect)((()=>{if(a!==B.current){B.current=a;var e=(0,me.L)({canvasWidth:t.host.clientWidth,canvasHeight:t.host.clientHeight,defaultNodeSize:l,layout:n,previousCells:k,cells:a,scaleRange:W,transform:T});C({type:"update-cells",payload:e.cells})}}),[k,l,a,n,W,t,T]);var O=(0,ue.J)({cellsRef:E,activeTarget:u,onActiveTargetChange:b}),j=(0,Q.useMemo)((()=>"".concat((0,ee.uniqueId)("diagram-"),"-")),[]),P="".concat(j,"line-arrow-"),U=(0,Q.useCallback)(((e,t)=>{C({type:"update-node-size",payload:{id:e,size:t},layoutKey:L()})}),[L]),[_,H]=(0,Q.useState)(null),K=(0,Q.useCallback)((e=>{H(e)}),[]),D=(0,Q.useCallback)((e=>{H((t=>t===e?null:t))}),[]),[I,Y]=(0,Q.useState)([]);(0,Q.useEffect)((()=>{var e=d?(0,he.Y)(k,null,_):[];Y((t=>0===t.length&&0===e.length?t:e))}),[k,d,_]);var q=(0,Q.useCallback)((e=>{R.scaleTo((0,ne.A)(N.current),e/100)}),[R]),[F,J]=(0,ye.d)({cells:k,defaultEdgeLines:r,markerPrefix:P}),Z=(0,be.H)({cells:k,layout:n,centered:z});return V().createElement(V().Fragment,null,V().createElement("svg",{width:"100%",height:"100%",ref:N,className:ae()("root",{grabbing:M,pannable:f,ready:Z}),tabIndex:-1},V().createElement("defs",null,J.map(((e,t)=>V().createElement(se.c,{key:t,id:"".concat(P).concat(t),type:"arrow",strokeColor:e.strokeColor})))),V().createElement("g",{transform:"translate(".concat(T.x," ").concat(T.y,") scale(").concat(T.k,")")},V().createElement("g",{className:"cells",ref:E},k.map((e=>V().createElement(ie.m,{key:"".concat(e.type,":").concat((0,ge.WW)(e)?"".concat(e.source,"~").concat(e.target):e.id),layout:void 0,cell:e,cells:k,degraded:A,degradedNodeLabel:c,defaultNodeBricks:i,lineConfMap:F,transform:T,active:(0,le.c)(O,e),readOnly:!0,unrelatedCells:I,onSwitchActiveTarget:y,onCellContextMenu:m,onCellClick:v,onNodeBrickResize:U,onCellMouseEnter:d&&(0,ge.N)(e)?K:void 0,onCellMouseLeave:d&&(0,ge.N)(e)?D:void 0})))))),V().createElement(fe.Y,{shadowRoot:t,scale:T.k,scaleRange:W,onZoomChange:q,onReCenter:x}))}Y=Ve,({e:[s,l,i,r,o,c,u,d,h,g,f,p,b,y,m,v,k,w,C,A,N,E,M,T,R,W,z,S,L,x,B,O,j,P,U,_,H,K,D,I],c:[Ee,n]}=function(e,t,a,n,s,l){var i,r,o,c,u,d,h,g=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,p=Object.create,b=[p(null),p(null)],y=t.length;function m(t,a,n){return function(s,l){a&&(l=s,s=e);for(var i=0;i<t.length;i++)l=t[i].apply(s,n?[l]:[]);return n?l:s}}function v(e,t,a,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(a||"be")+" a function"+(n?"":" or undefined"));return e}function k(e,t,a,n,s,l,o,c,u,d,h){function g(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var p=[].concat(t[0]),y=t[3],k=!o,w=1===s,C=3===s,A=4===s,N=2===s;function E(t,a,n){return function(s,l){return a&&(l=s,s=e),n&&n(s),M[t].call(s,l)}}if(!k){var M={},T=[],R=C?"get":A||w?"set":"value";if(u?(d||w?M={get:(0,Z.A)((function(){return y(this)}),n,"get"),set:function(e){t[4](this,e)}}:M[R]=y,d||(0,Z.A)(M[R],n,N?"":R)):d||(M=Object.getOwnPropertyDescriptor(e,n)),!d&&!u){if((r=b[+c][n])&&7!=(r^s))throw new Error("Decorating two elements with the same name ("+M[R].name+") is not supported yet");b[+c][n]=s<3?1:s}}for(var W=e,z=p.length-1;z>=0;z-=a?2:1){var S=p[z],L=a?p[z-1]:void 0,x={},B={kind:["field","accessor","method","getter","setter","class"][s],name:n,metadata:i,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");v(t,"An initializer","be",!0),l.push(t)}.bind(null,x)};if(k)r=S.call(L,W,B),x.v=1,v(r,"class decorators","return")&&(W=r);else if(B.static=c,B.private=u,r=B.access={has:u?h.bind():function(e){return n in e}},A||(r.get=u?N?function(e){return g(e),M.value}:E("get",0,g):function(e){return e[n]}),N||C||(r.set=u?E("set",0,g):function(e,t){e[n]=t}),W=S.call(L,w?{get:M.get,set:M.set}:M[R],B),x.v=1,w){if("object"==typeof W&&W)(r=v(W.get,"accessor.get"))&&(M.get=r),(r=v(W.set,"accessor.set"))&&(M.set=r),(r=v(W.init,"accessor.init"))&&T.unshift(r);else if(void 0!==W)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else v(W,(d?"field":"method")+" decorators","return")&&(d?T.unshift(W):M[R]=W)}return s<2&&o.push(m(T,c,1),m(l,c,0)),d||k||(u?w?o.splice(-1,0,E("get",c),E("set",c)):o.push(N?M[R]:v.call.bind(M[R])):f(e,n,M)),W}function w(e){return f(e,g,{configurable:!0,enumerable:!0,value:i})}return void 0!==l&&(i=l[g]),i=p(null==i?null:i),u=[],d=function(e){e&&u.push(m(e))},(h=function(t,n){for(var l=0;l<a.length;l++){var i=a[l],r=i[1],d=7&r;if((8&r)==t&&!d==n){var h=i[2],g=!!i[3],f=16&r;k(t?e:e.prototype,i,f,g?"#"+h:(0,J.A)(h),d,d<2?[]:t?c=c||[]:o=o||[],u,!!t,g,n,t&&g?function(t){return(0,G.A)(t)===e}:s)}}})(8,0),h(0,0),h(8,1),h(0,1),d(o),d(c),r=u,y||w(e),{e:r,get c(){var a=[];return y&&[w(e=k(e,[t],0,e.name,5,a)),m(a,1)]}}}(Y,[Me("eo-display-canvas",{styleTexts:[ve.A,ke.A]})],[[Te({attribute:!1}),1,"cells"],[Te({type:String}),1,"layout"],[Te({attribute:!1}),1,"layoutOptions"],[Te({attribute:!1}),1,"defaultNodeSize"],[Te({attribute:!1}),1,"defaultNodeBricks"],[Te({type:Number}),1,"degradedThreshold"],[Te({attribute:!1}),1,"degradedNodeLabel"],[Te({attribute:!1}),1,"defaultEdgeLines"],[Te({attribute:!1}),1,"activeTarget"],[Te({type:Boolean}),1,"fadeUnrelatedCells"],[Te({type:Boolean}),1,"zoomable"],[Te({type:Boolean}),1,"scrollable"],[Te({type:Boolean}),1,"pannable"],[Te({attribute:!1}),1,"scaleRange"],[Re({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>Ae(Ie,e),(e,t)=>Ce(Ie,e,t)],[Re({type:"cell.contextmenu"}),1,"cellContextMenu",e=>Ae(Je,e),(e,t)=>Ce(Je,e,t)],[Re({type:"cell.click"}),1,"cellClick",e=>Ae(Ge,e),(e,t)=>Ce(Ge,e,t)]],0,(e=>Qe.has((0,G.A)(e))),$.ReactNextElement)),n()}}]);
|
|
2
|
+
//# sourceMappingURL=eo-display-canvas.ec84d0d0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/eo-display-canvas.ec84d0d0.js","mappings":"u1BA8CA,IAA8DA,IAAxD,cAAEC,GAAa,SAAEC,GAAQ,MAAEC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,CAAE6I,KAAMwE,UAAU,eAG3BrN,GAAS,CAAE6I,KAAMwE,UAAU,iBAG3BrN,GAAS,CAAE6I,KAAMwE,UAAU,eAG3BrN,GAAS,CAAEkN,WAAW,IAAQ,iBAG9BjN,GAAM,CAAE4I,KAAM,wBAAwB,4BAAAyE,GAAAvI,GAAA7D,GAAAoM,GAAA,CAAAA,EAAAtI,IAAAC,GAAA/D,GAAAoM,EAAAtI,IAAA,CAatC/E,GAAM,CAAE4I,KAAM,qBAAqB,oBAAAyE,GAAAvI,GAAAxD,GAAA+L,GAAA,CAAAA,EAAAtI,IAAAC,GAAA1D,GAAA+L,EAAAtI,IAAA,CAOnC/E,GAAM,CAAE4I,KAAM,eAAe,cAAAyE,GAAAvI,GAAAtD,GAAA6L,GAAA,CAAAA,EAAAtI,IAAAC,GAAAxD,GAAA6L,EAAAtI,KAAA,GAAAuI,GAAA7L,GAAA8L,KAAAC,EAAAA,EAAAA,GAAAF,KA3FF3L,EAAAA,mBAAgBiL,G","sources":["webpack:///./src/display-canvas/index.tsx"],"sourcesContent":["import React, {\n useCallback,\n useEffect,\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 \"@next-core/theme\";\nimport { uniqueId } from \"lodash\";\nimport classNames from \"classnames\";\nimport { select } from \"d3-selection\";\nimport type { RangeTuple, SizeTuple } from \"../diagram/interfaces\";\nimport type {\n ActiveTarget,\n InitialCell,\n NodeBrickConf,\n CellContextMenuDetail,\n EdgeLineConf,\n Cell,\n LayoutType,\n LayoutOptions,\n} from \"../draw-canvas/interfaces\";\nimport { MarkerComponent } from \"../diagram/MarkerComponent\";\nimport { sameTarget } from \"../draw-canvas/processors/sameTarget\";\nimport { CellComponent } from \"../draw-canvas/CellComponent\";\nimport { initializeCells } from \"../draw-canvas/processors/initializeCells\";\nimport {\n DEFAULT_DEGRADED_THRESHOLD,\n DEFAULT_NODE_SIZE,\n} from \"../draw-canvas/constants\";\nimport { useZoom } from \"../shared/canvas/useZoom\";\nimport { useActiveTarget } from \"../shared/canvas/useActiveTarget\";\nimport { rootReducer } from \"../draw-canvas/reducers\";\nimport { getUnrelatedCells } from \"../draw-canvas/processors/getUnrelatedCells\";\nimport { isEdgeCell, isNodeCell } from \"../draw-canvas/processors/asserts\";\nimport { ZoomBarComponent } from \"../shared/canvas/ZoomBarComponent\";\nimport { useLayout } from \"../shared/canvas/useLayout\";\nimport { useReady } from \"../shared/canvas/useReady\";\nimport { useLineMarkers } from \"../shared/canvas/useLineMarkers\";\nimport { updateCells } from \"../draw-canvas/processors/updateCells\";\nimport styleText from \"../shared/canvas/styles.shadow.css\";\nimport zoomBarStyleText from \"../shared/canvas/ZoomBarComponent.shadow.css\";\n\nconst { defineElement, property, event } = createDecorators();\n\nexport interface EoDisplayCanvasProps {\n cells: InitialCell[] | undefined;\n layout: LayoutType;\n layoutOptions?: LayoutOptions;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n degradedThreshold?: number;\n degradedNodeLabel?: string;\n activeTarget?: ActiveTarget | null;\n fadeUnrelatedCells?: boolean;\n zoomable?: boolean;\n scrollable?: boolean;\n pannable?: boolean;\n scaleRange?: RangeTuple;\n}\n\n/**\n * 用于展示查看的画布。\n */\nexport\n@defineElement(\"eo-display-canvas\", {\n styleTexts: [styleText, zoomBarStyleText],\n})\nclass EoDisplayCanvas extends ReactNextElement implements EoDisplayCanvasProps {\n /**\n * 用于查看的画布可以更新 `cells` 属性。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ type: String })\n accessor layout: LayoutType;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | 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 * 当节点数量达到或超过 `degradedThreshold` 时,节点将被降级展示。\n *\n * @default 500\n */\n @property({ type: Number })\n accessor degradedThreshold: number | undefined;\n\n // Set `attribute` to `false` event if it accepts string value.\n // Because when passing like \"<% DATA.node.data.name %>\", it will be\n // evaluated as object temporarily.\n /**\n * 设置节点将降级展示时显示的名称。\n *\n * @default \"<% DATA.node.id %>\"\n */\n @property({ attribute: false })\n accessor degradedNodeLabel: string | 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 /**\n * 当鼠标悬浮到某节点上时,隐藏其他跟该节点无关的元素。\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 @event({ type: \"cell.contextmenu\" })\n accessor #cellContextMenu!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellContextMenu = (detail: CellContextMenuDetail) => {\n this.#cellContextMenu.emit(detail);\n };\n\n @event({ type: \"cell.click\" })\n accessor #cellClick!: EventEmitter<CellContextMenuDetail>;\n\n #handleCellClick = (detail: CellContextMenuDetail) => {\n this.#cellClick.emit(detail);\n };\n\n render() {\n return (\n <EoDisplayCanvasComponent\n shadowRoot={this.shadowRoot!}\n cells={this.cells}\n layout={this.layout}\n layoutOptions={this.layoutOptions}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n degradedThreshold={this.degradedThreshold}\n degradedNodeLabel={this.degradedNodeLabel}\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 onCellContextMenu={this.#handleCellContextMenu}\n onCellClick={this.#handleCellClick}\n />\n );\n }\n}\n\nexport interface EoDisplayCanvasComponentProps extends EoDisplayCanvasProps {\n shadowRoot: ShadowRoot;\n onActiveTargetChange(target: ActiveTarget | null): void;\n onSwitchActiveTarget(target: ActiveTarget | null): void;\n onCellContextMenu(detail: CellContextMenuDetail): void;\n onCellClick(detail: CellContextMenuDetail): void;\n}\n\nfunction EoDisplayCanvasComponent({\n shadowRoot,\n cells: initialCells,\n layout,\n layoutOptions,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n degradedThreshold,\n degradedNodeLabel,\n activeTarget: _activeTarget,\n fadeUnrelatedCells,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onActiveTargetChange,\n onSwitchActiveTarget,\n onCellContextMenu,\n onCellClick,\n}: EoDisplayCanvasComponentProps) {\n const [{ cells, layoutKey }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n layoutKey: 1,\n })\n );\n\n // When nodes are greater or equal to threshold, the diagram will be degraded.\n // Thus all nodes will be displayed as simple svg elements instead of bricks.\n const degraded = useMemo(\n () =>\n cells.filter(isNodeCell).length >=\n (degradedThreshold ?? DEFAULT_DEGRADED_THRESHOLD),\n [cells, degradedThreshold]\n );\n\n const rootRef = useRef<SVGSVGElement>(null);\n const cellsRef = useRef<SVGGElement>(null);\n\n const { grabbing, transform, zoomer, scaleRange } = useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n });\n\n const { centered, setCentered, getNextLayoutKey } = useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n dispatch,\n });\n\n const reCenter = useCallback(() => {\n setCentered(false);\n }, [setCentered]);\n\n const previousCellsRef = useRef(initialCells);\n\n useEffect(() => {\n if (initialCells !== previousCellsRef.current) {\n previousCellsRef.current = initialCells;\n const result = updateCells({\n canvasWidth: shadowRoot.host.clientWidth,\n canvasHeight: shadowRoot.host.clientHeight,\n defaultNodeSize,\n layout,\n previousCells: cells,\n cells: initialCells,\n scaleRange,\n transform,\n });\n dispatch({ type: \"update-cells\", payload: result.cells });\n }\n }, [\n cells,\n defaultNodeSize,\n initialCells,\n layout,\n scaleRange,\n shadowRoot,\n transform,\n ]);\n\n const activeTarget = useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n });\n\n const defPrefix = useMemo(() => `${uniqueId(\"diagram-\")}-`, []);\n const markerPrefix = `${defPrefix}line-arrow-`;\n\n const handleNodeBrickResize = useCallback(\n (id: string, size: SizeTuple | null) => {\n dispatch({\n type: \"update-node-size\",\n payload: { id, size },\n layoutKey: getNextLayoutKey(),\n });\n },\n [getNextLayoutKey]\n );\n\n const [hoverCell, setHoverCell] = useState<Cell | null>(null);\n const handleCellMouseEnter = useCallback((cell: Cell) => {\n setHoverCell(cell);\n }, []);\n const handleCellMouseLeave = useCallback((cell: Cell) => {\n setHoverCell((prev) => (prev === cell ? null : prev));\n }, []);\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, null, hoverCell)\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 }, [cells, fadeUnrelatedCells, hoverCell]);\n\n const handleZoomSlide = useCallback(\n (value: number) => {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n zoomer.scaleTo(select(rootRef.current!), value / 100);\n }\n },\n [zoomer]\n );\n\n const [lineConfMap, markers] = useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n });\n\n const ready = useReady({ cells, layout, centered });\n\n return (\n <>\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable, ready })}\n tabIndex={-1}\n >\n <defs>\n {markers.map((marker, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type=\"arrow\"\n strokeColor={marker.strokeColor}\n />\n ))}\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}:${isEdgeCell(cell) ? `${cell.source}~${cell.target}` : cell.id}`}\n layout={undefined}\n cell={cell}\n cells={cells}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n lineConfMap={lineConfMap}\n transform={transform}\n active={sameTarget(activeTarget, cell)}\n readOnly\n unrelatedCells={unrelatedCells}\n onSwitchActiveTarget={onSwitchActiveTarget}\n onCellContextMenu={onCellContextMenu}\n onCellClick={onCellClick}\n onNodeBrickResize={handleNodeBrickResize}\n onCellMouseEnter={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseEnter\n : undefined\n }\n onCellMouseLeave={\n fadeUnrelatedCells && isNodeCell(cell)\n ? handleCellMouseLeave\n : undefined\n }\n />\n ))}\n </g>\n </g>\n </svg>\n <ZoomBarComponent\n shadowRoot={shadowRoot}\n scale={transform.k}\n scaleRange={scaleRange}\n onZoomChange={handleZoomSlide}\n onReCenter={reCenter}\n />\n </>\n );\n}\n"],"names":["_EoDisplayCanvas","defineElement","property","event","createDecorators","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_EoDisplayCanvas_brand","WeakSet","_handleActiveTargetChange","_handleSwitchActiveTarget","_P","_handleCellContextMenu","_Q","_handleCellClick","EoDisplayCanvas","ReactNextElement","constructor","arguments","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_init_cells","_init_extra_cells","_init_layout","_init_extra_layout","_init_layoutOptions","_init_extra_layoutOptions","_init_defaultNodeSize","DEFAULT_NODE_SIZE","_init_extra_defaultNodeSize","_init_defaultNodeBricks","_init_extra_defaultNodeBricks","_init_degradedThreshold","_init_extra_degradedThreshold","_init_degradedNodeLabel","_init_extra_degradedNodeLabel","_init_defaultEdgeLines","_init_extra_defaultEdgeLines","_init_activeTarget","_init_extra_activeTarget","_init_fadeUnrelatedCells","_init_extra_fadeUnrelatedCells","_init_zoomable","_init_extra_zoomable","_init_scrollable","_init_extra_scrollable","_init_pannable","_init_extra_pannable","_init_scaleRange","_init_extra_scaleRange","_init_activeTargetChangeEvent","_init_extra_activeTargetChangeEvent","target","_classPrivateGetter","this","_get_activeTargetChangeEvent","emit","sameTarget","activeTarget","_init_cellContextMenu","_init_extra_cellContextMenu","detail","_get_cellContextMenu","_init_cellClick","_init_extra_cellClick","_get_cellClick","cells","_classPrivateFieldGet","v","_classPrivateFieldSet","layout","layoutOptions","defaultNodeSize","defaultNodeBricks","degradedThreshold","degradedNodeLabel","defaultEdgeLines","fadeUnrelatedCells","zoomable","scrollable","pannable","scaleRange","render","React","EoDisplayCanvasComponent","shadowRoot","onActiveTargetChange","onSwitchActiveTarget","onCellContextMenu","onCellClick","_ref","initialCells","_activeTarget","_scaleRange","layoutKey","dispatch","useReducer","rootReducer","initializeCells","degraded","useMemo","filter","isNodeCell","length","DEFAULT_DEGRADED_THRESHOLD","rootRef","useRef","cellsRef","grabbing","transform","zoomer","useZoom","centered","setCentered","getNextLayoutKey","useLayout","reCenter","useCallback","previousCellsRef","useEffect","current","result","updateCells","canvasWidth","host","clientWidth","canvasHeight","clientHeight","previousCells","type","payload","useActiveTarget","defPrefix","concat","uniqueId","markerPrefix","handleNodeBrickResize","id","size","hoverCell","setHoverCell","useState","handleCellMouseEnter","cell","handleCellMouseLeave","prev","unrelatedCells","setUnrelatedCells","nextUnrelated","getUnrelatedCells","handleZoomSlide","value","scaleTo","select","lineConfMap","markers","useLineMarkers","ready","useReady","width","height","ref","className","classNames","tabIndex","map","marker","index","MarkerComponent","key","strokeColor","x","y","k","CellComponent","isEdgeCell","source","undefined","active","readOnly","onNodeBrickResize","onCellMouseEnter","onCellMouseLeave","ZoomBarComponent","scale","onZoomChange","onReCenter","_EoDisplayCanvas2","e","_set_activeTargetChangeEvent","_set_cellContextMenu","_set_cellClick","c","_initClass","_applyDecs","styleTexts","styleText","zoomBarStyleText","attribute","String","Number","Boolean","o","_","has","_checkInRHS"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_diagram=self.webpackChunk_next_bricks_diagram||[]).push([[8939],{3639:(e,t,a)=>{a.d(t,{w:()=>l});var n=a(8769),r=a.n(n),i=a(3373),o=a.n(i);function l(e){var{connectLineState:t,transform:a,markerEnd:i,onConnect:l}=e,[s,c]=(0,n.useState)(null);return(0,n.useEffect)((()=>{t&&c(t.from)}),[t]),(0,n.useEffect)((()=>{if(t){var e=e=>{c([(e.clientX-a.x-t.offset[0])/a.k,(e.clientY-a.y-t.offset[1])/a.k])},n=e=>{e.stopPropagation()},r=e=>{e.stopPropagation(),i(),l(t,[(e.clientX-a.x-t.offset[0])/a.k,(e.clientY-a.y-t.offset[1])/a.k])},i=()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mousedown",n,{capture:!0}),document.removeEventListener("click",r,{capture:!0}),c(null)};return document.addEventListener("mousemove",e),document.addEventListener("mousedown",n,{capture:!0}),document.addEventListener("click",r,{capture:!0}),i}}),[t,l,a]),r().createElement("path",{className:o()("connect-line",{connecting:!!t&&s&&(s[0]-t.from[0])**2+(s[1]-t.from[1])**2>25}),d:t&&s?"M".concat(t.from.join(" "),"L").concat(s.join(" ")):"",fill:"none",stroke:"gray",strokeWidth:1,markerEnd:"url(#".concat(i,")")})}},9068:(e,t,a)=>{a.r(t),a.d(t,{EoDrawCanvas:()=>nt,EoDrawCanvasComponent:()=>ct});var n,r,i,o,l,s,c,d,u,h,f,p,v,g,m,y,w,k,b,C,x,A,E,N,M,z,T,W,R,S,L,B,D,P,j,O,H,I,U,_,K,Y,F,X,q,J,Z,G,Q,V,$,ee,te,ae,ne,re,ie,oe,le,se,ce,de,ue,he,fe,pe,ve,ge=a(4223),me=a(9740),ye=a(6330),we=a(4635),ke=a(918),be=a(1369),Ce=a(8449),xe=a(4521),Ae=a(8769),Ee=a.n(Ae),Ne=a(9929),Me=a(9938),ze=a(8438),Te=(a(330),a(1030)),We=a(3373),Re=a.n(We),Se=a(7566),Le=a(5748),Be=a(3739),De=a(531),Pe=a(8185),je=a(5114),Oe=a(2830),He=a(3639),Ie=a(3783),Ue=a(2098),_e=a(227),Ke=a(3033),Ye=a(8091),Fe=a(1819),Xe=a(7099),qe=a(2361),Je=a(8197),Ze=a(7531),Ge=a(3012),Qe=a(8618),Ve=["shouldReCenter"];function $e(e,t,a){return a(at(e,t))}function et(e,t,a){return e.set(at(e,t),a),a}function tt(e,t){return e.get(at(e,t))}function at(e,t,a){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:a;throw new TypeError("Private element is not present on this object")}var nt,rt=(0,ze.unwrapProvider)("basic.lock-body-scroll"),{defineElement:it,property:ot,method:lt,event:st}=(0,Ne.createDecorators)(),ct=Ee().forwardRef(Ft),dt=new WeakMap,ut=new WeakMap,ht=new WeakMap,ft=new WeakMap,pt=new WeakMap,vt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,wt=new WeakMap,kt=new WeakMap,bt=new WeakMap,Ct=new WeakMap,xt=new WeakMap,At=new WeakMap,Et=new WeakSet,Nt=new WeakMap,Mt=new WeakMap,zt=new WeakMap,Tt=new WeakMap,Wt=new WeakMap,Rt=new WeakMap,St=new WeakMap,Lt=new WeakMap,Bt=new WeakMap,Dt=new WeakMap,Pt=new WeakMap,jt=new WeakMap,Ot=new WeakMap,Ht=new WeakMap,It=new WeakMap,Ut=new WeakMap,_t=new WeakMap;class Kt extends Me.ReactNextElement{constructor(){super(...arguments),(0,we.A)(this,Et),(0,ke.A)(this,dt,(n(this),i(this))),(0,ke.A)(this,ut,(o(this),l(this))),(0,ke.A)(this,ht,(s(this),c(this))),(0,ke.A)(this,ft,(d(this),u(this,[Ke.HP,Ke.HP]))),(0,ke.A)(this,pt,(h(this),f(this))),(0,ke.A)(this,vt,(p(this),v(this))),(0,ke.A)(this,gt,(g(this),m(this))),(0,ke.A)(this,mt,(y(this),w(this))),(0,ke.A)(this,yt,(k(this),b(this))),(0,ke.A)(this,wt,(C(this),x(this))),(0,ke.A)(this,kt,(A(this),E(this,!0))),(0,ke.A)(this,bt,(N(this),M(this,!0))),(0,ke.A)(this,Ct,(z(this),T(this,!0))),(0,ke.A)(this,xt,(W(this),R(this))),(0,ke.A)(this,At,(S(this),L(this))),(0,ke.A)(this,Nt,(P(this),e=>{$e(Et,this,B).emit(e)})),(0,ke.A)(this,Mt,(e=>{(0,Pe.c)(e,this.activeTarget)||(this.activeTarget=e)})),(0,ke.A)(this,zt,j(this)),(0,ke.A)(this,Tt,(I(this),U(this))),(0,ke.A)(this,Wt,(Y(this),e=>{$e(Et,this,_).emit(e),"node"===e.type&&$e(Et,this,O).emit(e)})),(0,ke.A)(this,Rt,F(this)),(0,ke.A)(this,St,(J(this),e=>{$e(Et,this,X).emit(e)})),(0,ke.A)(this,Lt,Z(this)),(0,ke.A)(this,Bt,(V(this),$(this))),(0,ke.A)(this,Dt,(ae(this),e=>{$e(Et,this,ee).emit(e),"node"===e.type&&$e(Et,this,G).emit(e)})),(0,ke.A)(this,Pt,ne(this)),(0,ke.A)(this,jt,(oe(this),e=>{$e(Et,this,re).emit(e)})),(0,ke.A)(this,Ot,le(this)),(0,ke.A)(this,Ht,(de(this),e=>{$e(Et,this,se).emit(e)})),(0,ke.A)(this,It,ue(this)),(0,ke.A)(this,Ut,(pe(this),e=>{$e(Et,this,he).emit(e)})),(0,ke.A)(this,_t,(0,Ae.createRef)())}get cells(){return tt(dt,this)}set cells(e){et(dt,this,e)}get layout(){return tt(ut,this)}set layout(e){et(ut,this,e)}get layoutOptions(){return tt(ht,this)}set layoutOptions(e){et(ht,this,e)}get defaultNodeSize(){return tt(ft,this)}set defaultNodeSize(e){et(ft,this,e)}get defaultNodeBricks(){return tt(pt,this)}set defaultNodeBricks(e){et(pt,this,e)}get degradedThreshold(){return tt(vt,this)}set degradedThreshold(e){et(vt,this,e)}get degradedNodeLabel(){return tt(gt,this)}set degradedNodeLabel(e){et(gt,this,e)}get defaultEdgeLines(){return tt(mt,this)}set defaultEdgeLines(e){et(mt,this,e)}get activeTarget(){return tt(yt,this)}set activeTarget(e){et(yt,this,e)}get fadeUnrelatedCells(){return tt(wt,this)}set fadeUnrelatedCells(e){et(wt,this,e)}get zoomable(){return tt(kt,this)}set zoomable(e){et(kt,this,e)}get scrollable(){return tt(bt,this)}set scrollable(e){et(bt,this,e)}get pannable(){return tt(Ct,this)}set pannable(e){et(Ct,this,e)}get scaleRange(){return tt(xt,this)}set scaleRange(e){et(xt,this,e)}dropNode(e){var t=this;return(0,ye.A)((function*(){var a,n,{id:r,position:i,size:o,data:l,useBrick:s}=e;if(null===(a=(n=document).elementsFromPoint)||void 0===a||null===(a=a.call(n,i[0],i[1]))||void 0===a?void 0:a.includes(t)){var c,d,u,h=t.getBoundingClientRect(),f=tt(_t,t).current.getTransform(),p={type:"node",id:r,view:(0,me.A)((0,me.A)({},"force"===t.layout||"dagre"===t.layout?null:{x:(i[0]-h.left-f.x)/f.k,y:(i[1]-h.top-f.y)/f.k}),{},{width:null!==(c=null==o?void 0:o[0])&&void 0!==c?c:t.defaultNodeSize[0],height:null!==(d=null==o?void 0:o[1])&&void 0!==d?d:t.defaultNodeSize[0]}),data:l,useBrick:s};return null===(u=tt(_t,t).current)||void 0===u||u.dropNode(p),p}return null}))()}dropDecorator(e){var t=this;return(0,ye.A)((function*(){var a,n,{position:r,decorator:i,text:o}=e;if(null===(a=(n=document).elementsFromPoint)||void 0===a||null===(a=a.call(n,r[0],r[1]))||void 0===a?void 0:a.includes(t)){var l,s=t.getBoundingClientRect(),c=tt(_t,t).current.getTransform(),d={type:"decorator",decorator:i,id:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})),view:{x:(r[0]-s.left-c.x)/c.k,y:(r[1]-s.top-c.y)/c.k,width:Ke.N8,height:Ke.w1,text:o}};return null===(l=tt(_t,t).current)||void 0===l||l.dropDecorator(d),d}return null}))()}addNodes(e){var t=this;return(0,ye.A)((function*(){if(0===e.length)return[];var a=e.map((e=>{var a,n,{size:r,useBrick:i,id:o,data:l}=e;return{type:"node",id:o,data:l,view:{width:null!==(a=null==r?void 0:r[0])&&void 0!==a?a:t.defaultNodeSize[0],height:null!==(n=null==r?void 0:r[1])&&void 0!==n?n:t.defaultNodeSize[0]},useBrick:i}}));return tt(_t,t).current.addNodes(a,{defaultNodeSize:t.defaultNodeSize,canvasWidth:t.clientWidth,canvasHeight:t.clientHeight})}))()}addEdge(e){var t=this;return(0,ye.A)((function*(){var a,{source:n,target:r,data:i}=e,o={type:"edge",source:n,target:r,data:i};return null===(a=tt(_t,t).current)||void 0===a||a.addEdge(o),o}))()}manuallyConnectNodes(e){return tt(_t,this).current.manuallyConnectNodes(e)}updateCells(e,t){var a=this;return(0,ye.A)((function*(){yield at(Et,a,Yt).call(a);var{updated:n}=tt(_t,a).current.updateCells(e,(0,me.A)((0,me.A)({},t),{},{defaultNodeSize:a.defaultNodeSize,canvasWidth:a.clientWidth,canvasHeight:a.clientHeight}));return{updated:n}}))()}disconnectedCallback(){super.disconnectedCallback(),rt(this,!1)}render(){return Ee().createElement(ct,{host:this,ref:tt(_t,this),layout:this.layout,layoutOptions:this.layoutOptions,cells:this.cells,defaultNodeSize:this.defaultNodeSize,defaultNodeBricks:this.defaultNodeBricks,defaultEdgeLines:this.defaultEdgeLines,degradedThreshold:this.degradedThreshold,degradedNodeLabel:this.degradedNodeLabel,activeTarget:this.activeTarget,fadeUnrelatedCells:this.fadeUnrelatedCells,zoomable:this.zoomable,scrollable:this.scrollable,pannable:this.pannable,scaleRange:this.scaleRange,onActiveTargetChange:tt(Nt,this),onSwitchActiveTarget:tt(Mt,this),onCellMove:tt(Wt,this),onCellResize:tt(St,this),onCellDelete:tt(Dt,this),onCellContextMenu:tt(jt,this),onDecoratorTextChange:tt(Ht,this),onScaleChange:tt(Ut,this)})}}function Yt(){return new Promise((e=>{var t=()=>{tt(_t,this).current?e():setTimeout(t,10)};t()}))}function Ft(e,t){var{host:a,layout:n,layoutOptions:r,cells:i,defaultNodeSize:o,defaultNodeBricks:l,defaultEdgeLines:s,degradedThreshold:c,degradedNodeLabel:d,activeTarget:u,fadeUnrelatedCells:h,zoomable:f,scrollable:p,pannable:v,scaleRange:g,onActiveTargetChange:m,onSwitchActiveTarget:y,onCellMove:w,onCellResize:k,onCellDelete:b,onCellContextMenu:C,onDecoratorTextChange:x,onScaleChange:A}=e,[{cells:E,layoutKey:N},M]=(0,Ae.useReducer)(Le.d,i,(e=>({cells:(0,Ie.C)(e,{defaultNodeSize:o}),layoutKey:0}))),z=(0,Ae.useMemo)((()=>E.filter(De.N).length>=(null!=c?c:Ke.pC)),[E,c]),T=(0,Ae.useRef)(null),W=(0,Ae.useRef)(null),R=(0,Ae.useRef)(null),[S,L]=(0,Ae.useState)([]),{grabbing:B,transform:D,zoomer:P,scaleRange:j}=(0,Ye.f)({rootRef:T,zoomable:f,scrollable:p,pannable:v,scaleRange:g,onSwitchActiveTarget:y});(0,Ae.useEffect)((()=>{A(D.k)}),[A,D.k]);var[O,H]=(0,Ae.useState)(null),{centered:I,setCentered:U,getNextLayoutKey:_}=(0,qe.g)({layout:n,layoutOptions:r,rootRef:T,cells:E,zoomable:f,zoomer:P,scaleRange:j,layoutKey:N,dispatch:M});(0,Ae.useImperativeHandle)(t,(()=>({dropNode(e){U(!0),M({type:"drop-node",payload:e})},dropDecorator(e){U(!0),M({type:"drop-decorator",payload:e})},addNodes(e,t){var{defaultNodeSize:a,canvasWidth:r,canvasHeight:i}=t,o=E.findLastIndex((e=>!("decorator"===e.type&&"text"===e.decorator)))+1,l=[...E.slice(0,o),...e,...E.slice(o)],{cells:s,updated:c,shouldReCenter:d}=(0,Ue.L)({cells:l,layout:n,previousCells:E,defaultNodeSize:a,canvasWidth:r,canvasHeight:i,scaleRange:j,transform:D});return d&&U(!1),M({type:"update-cells",payload:s}),c.filter((t=>e.includes(t)))},addEdge(e){M({type:"add-edge",payload:e})},updateCells(e,t){var a=(0,Ue.L)((0,me.A)((0,me.A)({},t),{},{layout:n,previousCells:E,cells:e,scaleRange:j,transform:D})),{shouldReCenter:r}=a,i=(0,ge.A)(a,Ve);return r&&U(!1),M({type:"update-cells",payload:i.cells}),i},getTransform:()=>D,manuallyConnectNodes(e){var t=E.find((t=>(0,De.N)(t)&&t.id===e));if(t){var a=T.current.getBoundingClientRect();return H({source:t,from:[t.view.x+t.view.width/2,t.view.y+t.view.height/2],offset:[a.left,a.top]}),new Promise(((e,t)=>{R.current={resolve:e,reject:t}}))}return Promise.reject(null)}})),[E,n,j,U,D]);var K=(0,Ae.useCallback)(((e,t)=>{for(var a,n=0;n<E.length;n++){var r=E[n];if((0,De.N)(r)&&r.id!==e.source.id&&r.view.x<t[0]&&r.view.x+r.view.width>t[0]&&r.view.y<t[1]&&r.view.y+r.view.height>t[1]){var i;null===(i=R.current)||void 0===i||i.resolve({source:e.source,target:r});break}}null===(a=R.current)||void 0===a||a.reject(null),H(null)}),[E]);(0,Ae.useEffect)((()=>{rt(a,!!O)}),[O,a]);var Y=(0,Fe.J)({cellsRef:W,activeTarget:u,onActiveTargetChange:m}),[F,X]=(0,Ae.useState)([]);(0,Ae.useEffect)((()=>{var e=h?(0,_e.Y)(E,O,Y):[];X((t=>0===t.length&&0===e.length?t:e))}),[Y,E,O,h]),(0,Ae.useEffect)((()=>{var e=T.current;if(e&&!(S.length>0)){var t=e=>{var t=(0,je.a)(e,{cells:E,activeTarget:Y});"delete-cell"===(null==t?void 0:t.action)&&b(t.cell)};return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}}),[Y,E,S.length,b]);var q=(0,Ae.useMemo)((()=>"".concat((0,Te.uniqueId)("diagram-"),"-")),[]),J="".concat(q,"line-arrow-"),Z=(0,Ae.useCallback)((e=>{M({type:"move-cell",payload:e})}),[]),G=(0,Ae.useCallback)((e=>{M({type:"move-cell",payload:e}),w(e)}),[w]),Q=(0,Ae.useCallback)((e=>{M({type:"resize-cell",payload:e})}),[]),V=(0,Ae.useCallback)((e=>{M({type:"resize-cell",payload:e}),k(e)}),[k]),$=(0,Ae.useCallback)((e=>{var{id:t,editing:a}=e;L(a?e=>e.includes(t)?e:[...e,t]:e=>e.filter((e=>e!==t)))}),[]),ee=(0,Ae.useCallback)(((e,t)=>{var a=_();M({type:"update-node-size",payload:{id:e,size:t},layoutKey:a})}),[_]),te=(0,Ae.useCallback)((e=>{P.scaleTo((0,Se.A)(T.current),e/100)}),[P]),ae=(0,Ae.useCallback)((()=>{U(!1)}),[U]),[ne,re]=(0,Ze.d)({cells:E,defaultEdgeLines:s,markerPrefix:J}),ie=(0,Je.H)({cells:E,layout:n,centered:I});return Ee().createElement(Ee().Fragment,null,Ee().createElement("svg",{width:"100%",height:"100%",ref:T,className:Re()("root",{grabbing:B,pannable:v,ready:ie}),tabIndex:-1},Ee().createElement("defs",null,re.map(((e,t)=>Ee().createElement(Be.c,{key:t,id:"".concat(J).concat(t),type:"arrow",strokeColor:e.strokeColor})))),Ee().createElement("g",{transform:"translate(".concat(D.x," ").concat(D.y,") scale(").concat(D.k,")")},Ee().createElement("g",{className:"cells",ref:W},E.map((e=>Ee().createElement(Oe.m,{key:"".concat(e.type,":").concat("edge"===e.type?"".concat(e.source,"~").concat(e.target):e.id),layout:n,cell:e,cells:E,degraded:z,degradedNodeLabel:d,defaultNodeBricks:l,transform:D,lineConfMap:ne,active:(0,Pe.c)(Y,e),unrelatedCells:F,onCellMoving:Z,onCellMoved:G,onCellResizing:Q,onCellResized:V,onSwitchActiveTarget:y,onCellContextMenu:C,onDecoratorTextChange:x,onDecoratorTextEditing:$,onNodeBrickResize:ee})))),Ee().createElement(He.w,{connectLineState:O,transform:D,markerEnd:"".concat(J,"0"),onConnect:K}))),Ee().createElement(Xe.Y,{shadowRoot:a.shadowRoot,scale:D.k,scaleRange:j,onZoomChange:te,onReCenter:ae}))}ve=Kt,({e:[i,o,l,s,c,d,u,h,f,p,v,g,m,y,w,k,b,C,x,A,E,N,M,z,T,W,R,S,L,B,D,P,j,O,H,I,U,_,K,Y,F,X,q,J,Z,G,Q,V,$,ee,te,ae,ne,re,ie,oe,le,se,ce,de,ue,he,fe,pe,n],c:[nt,r]}=function(e,t,a,n,r,i){var o,l,s,c,d,u,h,f=Symbol.metadata||Symbol.for("Symbol.metadata"),p=Object.defineProperty,v=Object.create,g=[v(null),v(null)],m=t.length;function y(t,a,n){return function(r,i){a&&(i=r,r=e);for(var o=0;o<t.length;o++)i=t[o].apply(r,n?[i]:[]);return n?i:r}}function w(e,t,a,n){if("function"!=typeof e&&(n||void 0!==e))throw new TypeError(t+" must "+(a||"be")+" a function"+(n?"":" or undefined"));return e}function k(e,t,a,n,r,i,s,c,d,u,h){function f(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var v=[].concat(t[0]),m=t[3],k=!s,b=1===r,C=3===r,x=4===r,A=2===r;function E(t,a,n){return function(r,i){return a&&(i=r,r=e),n&&n(r),N[t].call(r,i)}}if(!k){var N={},M=[],z=C?"get":x||b?"set":"value";if(d?(u||b?N={get:(0,Ce.A)((function(){return m(this)}),n,"get"),set:function(e){t[4](this,e)}}:N[z]=m,u||(0,Ce.A)(N[z],n,A?"":z)):u||(N=Object.getOwnPropertyDescriptor(e,n)),!u&&!d){if((l=g[+c][n])&&7!=(l^r))throw new Error("Decorating two elements with the same name ("+N[z].name+") is not supported yet");g[+c][n]=r<3?1:r}}for(var T=e,W=v.length-1;W>=0;W-=a?2:1){var R=v[W],S=a?v[W-1]:void 0,L={},B={kind:["field","accessor","method","getter","setter","class"][r],name:n,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");w(t,"An initializer","be",!0),i.push(t)}.bind(null,L)};if(k)l=R.call(S,T,B),L.v=1,w(l,"class decorators","return")&&(T=l);else if(B.static=c,B.private=d,l=B.access={has:d?h.bind():function(e){return n in e}},x||(l.get=d?A?function(e){return f(e),N.value}:E("get",0,f):function(e){return e[n]}),A||C||(l.set=d?E("set",0,f):function(e,t){e[n]=t}),T=R.call(S,b?{get:N.get,set:N.set}:N[z],B),L.v=1,b){if("object"==typeof T&&T)(l=w(T.get,"accessor.get"))&&(N.get=l),(l=w(T.set,"accessor.set"))&&(N.set=l),(l=w(T.init,"accessor.init"))&&M.unshift(l);else if(void 0!==T)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else w(T,(u?"field":"method")+" decorators","return")&&(u?M.unshift(T):N[z]=T)}return r<2&&s.push(y(M,c,1),y(i,c,0)),u||k||(d?b?s.splice(-1,0,E("get",c),E("set",c)):s.push(A?N[z]:w.call.bind(N[z])):p(e,n,N)),T}function b(e){return p(e,f,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[f]),o=v(null==o?null:o),d=[],u=function(e){e&&d.push(y(e))},(h=function(t,n){for(var i=0;i<a.length;i++){var o=a[i],l=o[1],u=7&l;if((8&l)==t&&!u==n){var h=o[2],f=!!o[3],p=16&l;k(t?e:e.prototype,o,p,f?"#"+h:(0,be.A)(h),u,u<2?[]:t?c=c||[]:s=s||[],d,!!t,f,n,t&&f?function(t){return(0,xe.A)(t)===e}:r)}}})(8,0),h(0,0),h(8,1),h(0,1),u(s),u(c),l=d,m||b(e),{e:l,get c(){var a=[];return m&&[b(e=k(e,[t],0,e.name,5,a)),y(a,1)]}}}(ve,[it("eo-draw-canvas",{styleTexts:[Ge.A,Qe.A]})],[[ot({attribute:!1}),1,"cells"],[ot({type:String}),1,"layout"],[ot({attribute:!1}),1,"layoutOptions"],[ot({attribute:!1}),1,"defaultNodeSize"],[ot({attribute:!1}),1,"defaultNodeBricks"],[ot({type:Number}),1,"degradedThreshold"],[ot({attribute:!1}),1,"degradedNodeLabel"],[ot({attribute:!1}),1,"defaultEdgeLines"],[ot({attribute:!1}),1,"activeTarget"],[ot({type:Boolean}),1,"fadeUnrelatedCells"],[ot({type:Boolean}),1,"zoomable"],[ot({type:Boolean}),1,"scrollable"],[ot({type:Boolean}),1,"pannable"],[ot({attribute:!1}),1,"scaleRange"],[st({type:"activeTarget.change"}),1,"activeTargetChangeEvent",e=>tt(At,e),(e,t)=>et(At,e,t)],[st({type:"node.move"}),1,"nodeMoveEvent",e=>tt(zt,e),(e,t)=>et(zt,e,t)],[st({type:"cell.move"}),1,"cellMoveEvent",e=>tt(Tt,e),(e,t)=>et(Tt,e,t)],[st({type:"cell.resize"}),1,"cellResizeEvent",e=>tt(Rt,e),(e,t)=>et(Rt,e,t)],[st({type:"node.delete"}),1,"nodeDelete",e=>tt(Lt,e),(e,t)=>et(Lt,e,t)],[st({type:"cell.delete"}),1,"cellDelete",e=>tt(Bt,e),(e,t)=>et(Bt,e,t)],[st({type:"cell.contextmenu"}),1,"cellContextMenu",e=>tt(Pt,e),(e,t)=>et(Pt,e,t)],[st({type:"decorator.text.change"}),1,"decoratorTextChange",e=>tt(Ot,e),(e,t)=>et(Ot,e,t)],[st({type:"scale.change"}),1,"scaleChange",e=>tt(It,e),(e,t)=>et(It,e,t)],[lt(),2,"dropNode"],[lt(),2,"dropDecorator"],[lt(),2,"addNodes"],[lt(),2,"addEdge"],[lt(),2,"manuallyConnectNodes"],[lt(),2,"updateCells"]],0,(e=>_t.has((0,xe.A)(e))),Me.ReactNextElement)),r()},5114:(e,t,a)=>{a.d(t,{a:()=>r});var n=a(8185);function r(e,t){var{cells:a,activeTarget:r}=t,i=a.find((e=>(0,n.c)(e,r)));if(i)switch(e.key||e.keyCode||e.which){case"Backspace":case 8:case"Delete":case 46:return e.preventDefault(),e.stopPropagation(),{action:"delete-cell",cell:i}}}},6330:(e,t,a)=>{function n(e,t,a,n,r,i,o){try{var l=e[i](o),s=l.value}catch(e){return void a(e)}l.done?t(s):Promise.resolve(s).then(n,r)}function r(e){return function(){var t=this,a=arguments;return new Promise((function(r,i){var o=e.apply(t,a);function l(e){n(o,r,i,l,s,"next",e)}function s(e){n(o,r,i,l,s,"throw",e)}l(void 0)}))}}a.d(t,{A:()=>r})}}]);
|
|
2
|
+
//# sourceMappingURL=eo-draw-canvas.5c219114.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunks/eo-draw-canvas.5c219114.js","mappings":"uLAYO,SAASA,EAAoBC,GAKO,IALN,iBACnCC,EAAgB,UAChBC,EAAS,UACTC,EAAS,UACTC,GAC0BJ,GACnBK,EAAeC,IAAoBC,EAAAA,EAAAA,UACxC,MA8CF,OA3CAC,EAAAA,EAAAA,YAAU,KACJP,GACFK,EAAiBL,EAAiBQ,KACpC,GACC,CAACR,KAEJO,EAAAA,EAAAA,YAAU,KACR,GAAIP,EAAkB,CACpB,IAAMS,EAAeC,IAEnBL,EAAiB,EACdK,EAAEC,QAAUV,EAAUW,EAAIZ,EAAiBa,OAAO,IAAMZ,EAAUa,GAClEJ,EAA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as/ConnectLineComponent.tsx","webpack:///./src/draw-canvas/index.tsx","webpack:///./src/draw-canvas/processors/handleKeyboard.ts","webpack:///../../node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"],"sourcesContent":["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 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 classNames from \"classnames\";\nimport { select } from \"d3-selection\";\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 LayoutType,\n LayoutOptions,\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 { ConnectLineComponent } from \"./ConnectLineComponent\";\nimport { initializeCells } from \"./processors/initializeCells\";\nimport { updateCells } from \"./processors/updateCells\";\nimport { getUnrelatedCells } from \"./processors/getUnrelatedCells\";\nimport {\n DEFAULT_NODE_SIZE,\n DEFAULT_AREA_WIDTH,\n DEFAULT_AREA_HEIGHT,\n DEFAULT_DEGRADED_THRESHOLD,\n} from \"./constants\";\nimport { useZoom } from \"../shared/canvas/useZoom\";\nimport { useActiveTarget } from \"../shared/canvas/useActiveTarget\";\nimport { ZoomBarComponent } from \"../shared/canvas/ZoomBarComponent\";\nimport { useLayout } from \"../shared/canvas/useLayout\";\nimport { useReady } from \"../shared/canvas/useReady\";\nimport { useLineMarkers } from \"../shared/canvas/useLineMarkers\";\nimport styleText from \"../shared/canvas/styles.shadow.css\";\nimport zoomBarStyleText from \"../shared/canvas/ZoomBarComponent.shadow.css\";\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 layout: LayoutType;\n layoutOptions?: LayoutOptions;\n defaultNodeSize: SizeTuple;\n defaultNodeBricks?: NodeBrickConf[];\n defaultEdgeLines?: EdgeLineConf[];\n degradedThreshold?: number;\n degradedNodeLabel?: string;\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 canvasWidth: number;\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, zoomBarStyleText],\n})\nclass EoDrawCanvas extends ReactNextElement implements EoDrawCanvasProps {\n /**\n * 仅当初始化时使用,渲染后重新设置 `cells` 将无效。\n */\n @property({ attribute: false })\n accessor cells: InitialCell[] | undefined;\n\n @property({ type: String })\n accessor layout: LayoutType;\n\n @property({ attribute: false })\n accessor layoutOptions: LayoutOptions | 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 * 当节点数量达到或超过 `degradedThreshold` 时,节点将被降级展示。\n *\n * @default 500\n */\n @property({ type: Number })\n accessor degradedThreshold: number | undefined;\n\n // Set `attribute` to `false` event if it accepts string value.\n // Because when passing like \"<% DATA.node.data.name %>\", it will be\n // evaluated as object temporarily.\n /**\n * 设置节点将降级展示时显示的名称。\n *\n * @default \"<% DATA.node.id %>\"\n */\n @property({ attribute: false })\n accessor degradedNodeLabel: string | 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 /**\n * 当 `activeTarget` 不为 `null` 时,隐藏其他跟该 `activeTarget` 无关的元素。\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 = {\n type: \"node\",\n id,\n view: {\n ...(this.layout === \"force\" || this.layout === \"dagre\"\n ? null\n : {\n x:\n (position[0] - boundingClientRect.left - transform.x) /\n transform.k,\n y:\n (position[1] - boundingClientRect.top - transform.y) /\n transform.k,\n }),\n width: size?.[0] ?? this.defaultNodeSize[0],\n height: size?.[1] ?? this.defaultNodeSize[0],\n },\n data,\n useBrick,\n } as NodeCell;\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 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 canvasWidth: this.clientWidth,\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 await this.#waitForCanvasRef();\n const { updated } = this.#canvasRef.current!.updateCells(cells, {\n ...ctx,\n defaultNodeSize: this.defaultNodeSize,\n canvasWidth: this.clientWidth,\n canvasHeight: this.clientHeight,\n });\n return { updated };\n }\n\n #waitForCanvasRef() {\n return new Promise<void>((resolve) => {\n const check = () => {\n if (this.#canvasRef.current) {\n resolve();\n } else {\n setTimeout(check, 10);\n }\n };\n check();\n });\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 layout={this.layout}\n layoutOptions={this.layoutOptions}\n cells={this.cells}\n defaultNodeSize={this.defaultNodeSize}\n defaultNodeBricks={this.defaultNodeBricks}\n defaultEdgeLines={this.defaultEdgeLines}\n degradedThreshold={this.degradedThreshold}\n degradedNodeLabel={this.degradedNodeLabel}\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(\n cells: InitialCell[],\n ctx: Partial<UpdateCellsContext> & {\n defaultNodeSize: SizeTuple;\n canvasWidth: number;\n canvasHeight: number;\n }\n ): {\n cells: Cell[];\n updated: Cell[];\n };\n getTransform(): TransformLiteral;\n}\n\nfunction LegacyEoDrawCanvasComponent(\n {\n host,\n layout,\n layoutOptions,\n cells: initialCells,\n defaultNodeSize,\n defaultNodeBricks,\n defaultEdgeLines,\n degradedThreshold,\n degradedNodeLabel,\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, layoutKey }, dispatch] = useReducer(\n rootReducer,\n initialCells,\n (initialCells) => ({\n cells: initializeCells(initialCells, { defaultNodeSize }),\n layoutKey: 0,\n })\n );\n\n // When nodes are greater or equal to threshold, the diagram will be degraded.\n // Thus all nodes will be displayed as simple svg elements instead of bricks.\n const degraded = useMemo(\n () =>\n cells.filter(isNodeCell).length >=\n (degradedThreshold ?? DEFAULT_DEGRADED_THRESHOLD),\n [cells, degradedThreshold]\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, transform, zoomer, scaleRange } = useZoom({\n rootRef,\n zoomable,\n scrollable,\n pannable,\n scaleRange: _scaleRange,\n onSwitchActiveTarget,\n });\n\n useEffect(() => {\n onScaleChange(transform.k);\n }, [onScaleChange, transform.k]);\n\n const [connectLineState, setConnectLineState] =\n useState<ConnectLineState | null>(null);\n\n const { centered, setCentered, getNextLayoutKey } = useLayout({\n layout,\n layoutOptions,\n rootRef,\n cells,\n zoomable,\n zoomer,\n scaleRange,\n layoutKey,\n dispatch,\n });\n\n useImperativeHandle(\n ref,\n () => ({\n dropNode(node) {\n // Do not apply auto centering when dropping a node.\n setCentered(true);\n dispatch({ type: \"drop-node\", payload: node });\n },\n dropDecorator(decorator) {\n // Do not apply auto centering when dropping a decorator.\n setCentered(true);\n dispatch({ type: \"drop-decorator\", payload: decorator });\n },\n addNodes(\n nodes,\n { defaultNodeSize, canvasWidth, canvasHeight }: AddNodesContext\n ) {\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 {\n cells: allCells,\n updated,\n shouldReCenter,\n } = updateCells({\n cells: newCells,\n layout,\n previousCells: cells,\n defaultNodeSize,\n canvasWidth,\n canvasHeight,\n scaleRange,\n transform,\n });\n if (shouldReCenter) {\n setCentered(false);\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(newCells, ctx) {\n const { shouldReCenter, ...result } = updateCells({\n ...ctx,\n layout,\n previousCells: cells,\n cells: newCells,\n scaleRange,\n transform,\n });\n if (shouldReCenter) {\n setCentered(false);\n }\n dispatch({ type: \"update-cells\", payload: result.cells });\n return result;\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, layout, scaleRange, setCentered, 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 activeTarget = useActiveTarget({\n cellsRef,\n activeTarget: _activeTarget,\n onActiveTargetChange,\n });\n\n const [unrelatedCells, setUnrelatedCells] = useState<Cell[]>([]);\n useEffect(() => {\n const nextUnrelated = fadeUnrelatedCells\n ? getUnrelatedCells(cells, connectLineState, 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, connectLineState, fadeUnrelatedCells]);\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\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 const handleNodeBrickResize = useCallback(\n (id: string, size: SizeTuple | null) => {\n const nextLayoutKey = getNextLayoutKey();\n dispatch({\n type: \"update-node-size\",\n payload: { id, size },\n layoutKey: nextLayoutKey,\n });\n },\n [getNextLayoutKey]\n );\n\n const handleZoomSlide = useCallback(\n (value: number) => {\n // istanbul ignore next\n if (process.env.NODE_ENV !== \"test\") {\n zoomer.scaleTo(select(rootRef.current!), value / 100);\n }\n },\n [zoomer]\n );\n\n const reCenter = useCallback(() => {\n setCentered(false);\n }, [setCentered]);\n const [lineConfMap, markers] = useLineMarkers({\n cells,\n defaultEdgeLines,\n markerPrefix,\n });\n\n const ready = useReady({ cells, layout, centered });\n\n return (\n <>\n <svg\n width=\"100%\"\n height=\"100%\"\n ref={rootRef}\n className={classNames(\"root\", { grabbing, pannable, ready })}\n tabIndex={-1}\n >\n <defs>\n {markers.map((marker, index) => (\n <MarkerComponent\n key={index}\n id={`${markerPrefix}${index}`}\n type=\"arrow\"\n strokeColor={marker.strokeColor}\n />\n ))}\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 layout={layout}\n cell={cell}\n cells={cells}\n degraded={degraded}\n degradedNodeLabel={degradedNodeLabel}\n defaultNodeBricks={defaultNodeBricks}\n transform={transform}\n lineConfMap={lineConfMap}\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 onNodeBrickResize={handleNodeBrickResize}\n />\n ))}\n </g>\n <ConnectLineComponent\n connectLineState={connectLineState}\n transform={transform}\n markerEnd={`${markerPrefix}0`}\n onConnect={handleConnect}\n />\n </g>\n </svg>\n <ZoomBarComponent\n shadowRoot={host.shadowRoot!}\n scale={transform.k}\n scaleRange={scaleRange}\n onZoomChange={handleZoomSlide}\n onReCenter={reCenter}\n />\n </>\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","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","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}"],"names":["ConnectLineComponent","_ref","connectLineState","transform","markerEnd","onConnect","connectLineTo","setConnectLineTo","useState","useEffect","from","onMouseMove","e","clientX","x","offset","k","clientY","y","onMouseDown","stopPropagation","onClick","reset","document","removeEventListener","capture","addEventListener","React","className","classNames","connecting","d","concat","join","fill","stroke","strokeWidth","_EoDrawCanvas","lockBodyScroll","unwrapProvider","defineElement","property","method","event","createDecorators","EoDrawCanvasComponent","LegacyEoDrawCanvasComponent","_A","WeakMap","_B","_C","_D","_E","_F","_G","_H","_I","_J","_K","_L","_M","_N","_O","_EoDrawCanvas_brand","WeakSet","_handleActiveTargetChange","_handleSwitchActiveTarget","_P","_Q","_handleCellMove","_R","_handleCellResize","_S","_T","_handleCellDelete","_U","_handleCellContextMenu","_V","_handleDecoratorTextChange","_W","_handleScaleChange","_canvasRef","EoDrawCanvas","ReactNextElement","constructor","arguments","_classPrivateMethodInitSpec","_classPrivateFieldInitSpec","_initProto","_init_cells","_init_extra_cells","_init_layout","_init_extra_layout","_init_layoutOptions","_init_extra_layoutOptions","_init_defaultNodeSize","DEFAULT_NODE_SIZE","_init_extra_defaultNodeSize","_init_defaultNodeBricks","_init_extra_defaultNodeBricks","_init_degradedThreshold","_init_extra_degradedThreshold","_init_degradedNodeLabel","_init_extra_degradedNodeLabel","_init_defaultEdgeLines","_init_extra_defaultEdgeLines","_init_activeTarget","_init_extra_activeTarget","_init_fadeUnrelatedCells","_init_extra_fadeUnrelatedCells","_init_zoomable","_init_extra_zoomable","_init_scrollable","_init_extra_scrollable","_init_pannable","_init_extra_pannable","_init_scaleRange","_init_extra_scaleRange","_init_activeTargetChangeEvent","_init_extra_activeTargetChangeEvent","target","_classPrivateGetter","this","_get_activeTargetChangeEvent","emit","sameTarget","activeTarget","_init_nodeMoveEvent","_init_extra_nodeMoveEvent","_init_cellMoveEvent","_init_extra_cellMoveEvent","info","_get_cellMoveEvent","type","_get_nodeMoveEvent","_init_cellResizeEvent","_init_extra_cellResizeEvent","_get_cellResizeEvent","_init_nodeDelete","_init_extra_nodeDelete","_init_cellDelete","_init_extra_cellDelete","cell","_get_cellDelete","_get_nodeDelete","_init_cellContextMenu","_init_extra_cellContextMenu","detail","_get_cellContextMenu","_init_decoratorTextChange","_init_extra_decoratorTextChange","_get_decoratorTextChange","_init_scaleChange","_init_extra_scaleChange","scale","_get_scaleChange","createRef","cells","_classPrivateFieldGet","v","_classPrivateFieldSet","layout","layoutOptions","defaultNodeSize","defaultNodeBricks","degradedThreshold","degradedNodeLabel","defaultEdgeLines","fadeUnrelatedCells","zoomable","scrollable","pannable","scaleRange","dropNode","_this","_asyncToGenerator","_document$elementsFro","_document","id","position","size","data","useBrick","elementsFromPoint","call","includes","_size$","_size$2","_classPrivateFieldGet2","boundingClientRect","getBoundingClientRect","current","getTransform","newNode","view","_objectSpread","left","top","width","height","dropDecorator","_ref2","_this2","_document$elementsFro2","_document2","decorator","text","_classPrivateFieldGet3","newDecorator","replace","c","r","Math","random","toString","DEFAULT_AREA_WIDTH","DEFAULT_AREA_HEIGHT","addNodes","nodes","_this3","length","newNodes","map","_ref3","_size$3","_size$4","canvasWidth","clientWidth","canvasHeight","clientHeight","addEdge","_ref4","_this4","_classPrivateFieldGet4","source","newEdge","manuallyConnectNodes","updateCells","ctx","_this5","_assertClassBrand","_waitForCanvasRef","updated","disconnectedCallback","super","render","host","ref","onActiveTargetChange","onSwitchActiveTarget","onCellMove","onCellResize","onCellDelete","onCellContextMenu","onDecoratorTextChange","onScaleChange","Promise","resolve","check","setTimeout","_ref5","initialCells","_activeTarget","_scaleRange","layoutKey","dispatch","useReducer","rootReducer","initializeCells","degraded","useMemo","filter","isNodeCell","DEFAULT_DEGRADED_THRESHOLD","rootRef","useRef","cellsRef","manualConnectDeferredRef","editingTexts","setEditingTexts","grabbing","zoomer","useZoom","setConnectLineState","centered","setCentered","getNextLayoutKey","useLayout","useImperativeHandle","node","payload","_ref6","index","findLastIndex","newCells","slice","allCells","shouldReCenter","previousCells","edge","_updateCells","result","_objectWithoutProperties","_excluded","sourceId","find","rect","reject","handleConnect","useCallback","state","to","_manualConnectDeferre2","i","_manualConnectDeferre","useActiveTarget","unrelatedCells","setUnrelatedCells","nextUnrelated","getUnrelatedCells","prev","root","onKeydown","action","handleKeyboard","defPrefix","uniqueId","markerPrefix","handleCellMoving","handleCellMoved","handleCellResizing","handleCellResized","handleDecoratorTextEditing","_ref7","editing","texts","handleNodeBrickResize","nextLayoutKey","handleZoomSlide","value","scaleTo","select","reCenter","lineConfMap","markers","useLineMarkers","ready","useReady","tabIndex","marker","MarkerComponent","key","strokeColor","CellComponent","active","onCellMoving","onCellMoved","onCellResizing","onCellResized","onDecoratorTextEditing","onNodeBrickResize","ZoomBarComponent","shadowRoot","onZoomChange","onReCenter","_EoDrawCanvas2","_set_activeTargetChangeEvent","_set_nodeMoveEvent","_set_cellMoveEvent","_set_cellResizeEvent","_set_nodeDelete","_set_cellDelete","_set_cellContextMenu","_set_decoratorTextChange","_set_scaleChange","_initClass","_applyDecs","styleTexts","styleText","zoomBarStyleText","attribute","String","Number","Boolean","o","_","has","_checkInRHS","activeCell","keyCode","which","preventDefault","asyncGeneratorStep","gen","_next","_throw","arg","error","done","then","fn","self","args","apply","err","undefined"],"sourceRoot":""}
|