From 564aed18c4d93a290a6a08e1f36207e806e80772 Mon Sep 17 00:00:00 2001 From: afonso Date: Fri, 5 Aug 2022 16:20:30 +0100 Subject: [PATCH] #9 chore: Update todos --- dist/meta-diagram.cjs.development.js | 8 +++----- dist/meta-diagram.cjs.development.js.map | 2 +- dist/meta-diagram.cjs.production.min.js | 2 +- dist/meta-diagram.cjs.production.min.js.map | 2 +- dist/meta-diagram.esm.js | 8 +++----- dist/meta-diagram.esm.js.map | 2 +- src/index.tsx | 2 +- src/models/MetaNode.ts | 1 - 8 files changed, 11 insertions(+), 16 deletions(-) diff --git a/dist/meta-diagram.cjs.development.js b/dist/meta-diagram.cjs.development.js index adddb67..cb9d56e 100644 --- a/dist/meta-diagram.cjs.development.js +++ b/dist/meta-diagram.cjs.development.js @@ -108,7 +108,6 @@ class MetaNodeModel extends createEngine.NodeModel { } class MetaNode { - // TODO: Add private children attribute constructor(id, name, shape, position, parent, options) { this.parent = parent; this.position = position; @@ -636,8 +635,6 @@ class Graph { let height = this.getNode().height; let x = this.getNode().getX(); let y = this.getNode().getY(); - console.log(x, y, x + width, y + height); - console.log(this.node.getBoundingBox()); let left = x - width / 2; let right = x + width / 2; let top = y + height / 2; @@ -856,11 +853,12 @@ const MetaDiagram = ({ .registerFactory(new MetaNodeFactory(componentsMap.nodes)); engine.getLinkFactories() // @ts-ignore .registerFactory(new MetaLinkFactory(componentsMap.links)); - const metaGraph = generateMetaGraph(metaNodes); // TODO: Internally add children to metaNode + const metaGraph = generateMetaGraph(metaNodes); const repaintCanvas = event => { const node = event.entity; - metaGraph.handleNodePositionChanged(node); // TODO: We might not need the full canvas to be repainted + metaGraph.handleNodePositionChanged(node); // TODO: Add call application OnDiagramChange callback + // TODO: We might not need the full canvas to be repainted engine.repaintCanvas(); }; // set up the diagram model diff --git a/dist/meta-diagram.cjs.development.js.map b/dist/meta-diagram.cjs.development.js.map index 46d5cae..3c72716 100644 --- a/dist/meta-diagram.cjs.development.js.map +++ b/dist/meta-diagram.cjs.development.js.map @@ -1 +1 @@ -{"version":3,"file":"meta-diagram.cjs.development.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/models/MetaNode.ts","../src/react-diagrams/MetaLinkModel.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/helpers/nodesHelper.ts","../src/index.tsx"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n // TODO: Add private children attribute\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n console.log(x, y, x+width, y+height)\n console.log(this.node.getBoundingBox())\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n // TODO: Internally add children to metaNode\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaNode","id","shape","position","Map","set","getId","get","graphPath","push","getWorldPosition","getDepth","toModel","optionsMap","metaNodeModel","Object","fromEntries","setPosition","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","key","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getLinkModel","metaLink","metaGraph","link","source","getNodeDFS","target","setSourcePort","getPort","setTargetPort","undefined","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","left","top","transform","right","padding","node","margin","borderColor","border","borderTop","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","Cursor","toString","alt","Move","Divider","Node","disabled","Icon","Fullscreen","applicationTheme","params","components","MuiCssBaseline","styleOverrides","MuiList","alignItems","justifyContent","marginBottom","opacity","color","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","height","backgroundColor","customVariables","UnknownParent","Error","msg","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","children","getID","getNode","getChild","addChild","graph","getChildren","Array","from","values","map","g","getDescendancy","descendancy","dfs","found","getContainerBoundingBox","console","log","child","childBox","bb","MetaGraph","roots","addNode","length","pop","parentGraph","findNodeGraph","getNodes","getAncestors","oldestAncestor","getRoot","rootId","getParent","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","updateNodesContainerBoundingBoxes","generateMetaGraph","metaNodes","sort","a","b","mn","registerPositionListener","metaNodeModels","callback","registerListener","positionChanged","_","container","canvasContainer","MetaDiagram","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","repaintCanvas","entity","DiagramModel","ml","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAYA,qBAAZ;;AAAA,WAAYA;EACVA,kCAAA,mBAAA;EACAA,kCAAA,mBAAA;AACD,CAHD,EAAYA,qBAAqB,KAArBA,qBAAqB,KAAA,CAAjC;;MCAaC;EAKXC,YAAYC,GAAWC;IACrB,KAAKC,EAAL,GAAUF,CAAV;IACA,KAAKG,EAAL,GAAUF,CAAV;;;;EAIG,IAADD,CAAC;IACH,OAAO,KAAKE,EAAZ;;;;EAIG,IAADF,CAAC,CAACI,KAAD;IACH,KAAKF,EA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AAC;;IAERzL,SAAS,CAAC0J,iCAAV,CAA4CrK,KAAK,CAACqJ,QAAN,EAA5C,EAA8D1I,SAA9D;GAFO,EAGN,EAHM,CAAT;EAMA,MAAM0L,kBAAkB,GAAGf,gBAAgB,GACvCA,gBADuC,GAEvCrH,OAAO,CAACiH,SAFZ;EAIA,OACE1L,mBAAA,CAAC8M,sBAAD;IAAeC,KAAK,EAAEC,oBAAW,CAACD,KAAK,CAAChB,SAAD,oBAACA,SAAS,CAAEkB,oBAAZ,CAAN;GAAjC,EACEjN,mBAAA,CAACkN,WAAD,MAAA,CADF,EAEElN,mBAAA,CAAC0E,YAAD;IAAKC,SAAS,EAAEkI;GAAhB,EACE7M,mBAAA,CAACwE,OAAD,MAAA,CADF,EAEExE,mBAAA,CAACmN,4BAAD;IACExI,SAAS,KAAKF,OAAO,CAACkH,mBAAmBI,SAA9B,oBAA8BA,SAAS,CAAEqB;IACpDzM,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CA5ED;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"meta-diagram.cjs.development.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/models/MetaNode.ts","../src/react-diagrams/MetaLinkModel.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/helpers/nodesHelper.ts","../src/index.tsx"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: Add call application OnDiagramChange callback\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaNode","id","shape","position","Map","set","getId","get","graphPath","push","getWorldPosition","getDepth","toModel","optionsMap","metaNodeModel","Object","fromEntries","setPosition","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","key","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getLinkModel","metaLink","metaGraph","link","source","getNodeDFS","target","setSourcePort","getPort","setTargetPort","undefined","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","left","top","transform","right","padding","node","margin","borderColor","border","borderTop","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","Cursor","toString","alt","Move","Divider","Node","disabled","Icon","Fullscreen","applicationTheme","params","components","MuiCssBaseline","styleOverrides","MuiList","alignItems","justifyContent","marginBottom","opacity","color","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","height","backgroundColor","customVariables","UnknownParent","Error","msg","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","children","getID","getNode","getChild","addChild","graph","getChildren","Array","from","values","map","g","getDescendancy","descendancy","dfs","found","getContainerBoundingBox","child","childBox","bb","MetaGraph","roots","addNode","length","pop","parentGraph","findNodeGraph","getNodes","getAncestors","oldestAncestor","getRoot","rootId","getParent","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","updateNodesContainerBoundingBoxes","generateMetaGraph","metaNodes","sort","a","b","mn","registerPositionListener","metaNodeModels","callback","registerListener","positionChanged","_","container","canvasContainer","MetaDiagram","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","repaintCanvas","entity","DiagramModel","ml","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAYA,qBAAZ;;AAAA,WAAYA;EACVA,kCAAA,mBAAA;EACAA,kCAAA,mBAAA;AACD,CAHD,EAAYA,qBAAqB,KAArBA,qBAAqB,KAAA,CAAjC;;MCAaC;EAKXC,YAAYC,GAAWC;IACrB,KAAKC,EAAL,GAAUF,CAAV;IACA,KAAKG,EAAL,GAAUF,CAAV;;;;EAIG,IAADD,CAAC;IACH,OAAO,KAAKE,EAAZ;;;;EAIG,IAADF,CAAC,CAACI,KAAD;IACH,KAAKF,EAAL,GAAUE,KAAV;;;;EAIG,IAADH,CAAC;IACH,OAAO,KAAKE,EAAZ;;;;EAIG,IAADF,CAAC,CAACG,KAAD;IACH,KAAKD,EAAL,GAAUC,KAAV;;;EAGFC,GAAG,CAACC,aAAD;IACD,OAAO,IAAIR,QAAJ,CAAa,KAAKI,EAAL,GAASI,aAAa,CAACJ,EAApC,EAAwC,KAAKC,EAAL,GAAUG,aAAa,CAACH,EAAhE,CAAP;;;EAGFI,GAAG,CAACD,aAAD;IACD,OAAO,IAAIR,QAAJ,CAAa,KAAKI,EAAL,GAAUI,aAAa,CAACJ,EAArC,EAAyC,KAAKC,EAAL,GAAUG,aAAa,CAACH,EAAjE,CAAP;;;;;MC/BSK,sBAAsBC;EAC/BV,YAAYW,OAAO,GAAG;IAClB,MAAM,EACF,GAAGA,OADD;MAEFC,IAAI,EAAEd,qBAAqB,CAACe;KAFhC;;IAOA,KAAKC,OAAL,CACI,IAAIC,6BAAJ,CAAqB;MACjBC,EAAE,EAAE,IADa;MAEjBC,IAAI,EAAE;KAFV,CADJ;IAMA,KA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GsB,SAAS,CAACwI,QAAV,EAAd;EACAuB,wBAAwB,CAACrL,KAAD,EAAQqM,aAAR,CAAxB;EAEA,MAAMpM,KAAK,GAAG6L,SAAS,CACpBjD,GADW,CACP2D,EAAE,IAAIpL,YAAY,CAACoL,EAAD,EAAKlL,SAAL,CADX,EAEXmL,MAFW,CAEJC,GAAG,IAAIA,GAAG,KAAK5K,SAFX,CAAd;;EAKAnB,KAAK,CAACgM,MAAN,CAAa,GAAG3M,KAAhB,EAAuB,GAAGC,KAA1B;;EAGAa,MAAM,CAAC8L,QAAP,CAAgBjM,KAAhB;;;;EAMAkM,eAAS,CAAC;;IAERvL,SAAS,CAACwJ,iCAAV,CAA4CnK,KAAK,CAACmJ,QAAN,EAA5C,EAA8DxI,SAA9D;GAFO,EAGN,EAHM,CAAT;EAMA,MAAMwL,kBAAkB,GAAGf,gBAAgB,GACvCA,gBADuC,GAEvCnH,OAAO,CAAC+G,SAFZ;EAIA,OACExL,mBAAA,CAAC4M,sBAAD;IAAeC,KAAK,EAAEC,oBAAW,CAACD,KAAK,CAAChB,SAAD,oBAACA,SAAS,CAAEkB,oBAAZ,CAAN;GAAjC,EACE/M,mBAAA,CAACgN,WAAD,MAAA,CADF,EAEEhN,mBAAA,CAAC0E,YAAD;IAAKC,SAAS,EAAEgI;GAAhB,EACE3M,mBAAA,CAACwE,OAAD,MAAA,CADF,EAEExE,mBAAA,CAACiN,4BAAD;IACEtI,SAAS,KAAKF,OAAO,CAACgH,mBAAmBI,SAA9B,oBAA8BA,SAAS,CAAEqB;IACpDvM,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CA5ED;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/meta-diagram.cjs.production.min.js b/dist/meta-diagram.cjs.production.min.js index ec49cb7..8c6a791 100644 --- a/dist/meta-diagram.cjs.production.min.js +++ b/dist/meta-diagram.cjs.production.min.js @@ -1,2 +1,2 @@ -"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("react"),r=t(o),n=require("@projectstorm/react-diagrams"),i=t(n),s=require("@projectstorm/react-canvas-core"),a=require("@mui/styles"),l=require("@mui/system"),d=require("@mui/material"),h=require("@mui/material/styles"),g=t(require("@mui/material/CssBaseline"));!function(t){t.META_NODE="meta-node-type",t.META_LINK="meta-link-type"}(e||(e={}));class c{constructor(t,e){this._x=t,this._y=e}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}add(t){return new c(this._x+t._x,this._y+t._y)}sub(t){return new c(this._x-t._x,this._y-t._y)}}class u extends n.NodeModel{constructor(t={}){super({...t,type:e.META_NODE}),this.addPort(new n.DefaultPortModel({in:!0,name:"in"})),this.addPort(new n.DefaultPortModel({in:!1,name:"out"}))}getGraphPath(){return[...this.getOptions().graphPath]}getLocalPosition(){return this.getOptions().localPosition}isInsideParent(t){return!t||t.getBoundingBox().containsPoint(this.getPosition())}calculateLocalPosition(t){const e=new c(this.getX(),this.getY()),o=t?new c(t.getX(),t.getY()):new c(0,0);return e.sub(o)}updateLocalPosition(t){this.options.localPosition=this.calculateLocalPosition(t)}setContainerBoundingBox(t){this.options.containerBoundingBox=t}}class m extends n.DefaultLinkModel{constructor(t={}){super({...t,type:e.META_LINK})}}const p=()=>r.createElement("div",null,"Unknown Type");class C extends s.AbstractReactFactory{constructor(t){super(e.META_NODE),this.componentsMap=t}generateModel(){return new u}generateReactWidget(t){if(this.componentsMap.has(t.model.options.shape)){const e=this.componentsMap.get(t.model.options.shape);return r.createElement(e,{key:"node-factory-"+t.model.getOptions().id,engine:this.engine,model:t.model})}return r.createElement(p,null)}}class f extends n.DefaultLinkFactory{constructor(t){super(e.META_LINK),this.componentsMap=t}generateModel(){return new m}generateLinkSegment(t,e,o){var n;if(this.componentsMap.has(null==(n=t.getOptions())?void 0:n.shape)){const n=this.componentsMap.get(t.getOptions().shape);return r.createElement(n,{key:"link-factory-"+t.getOptions().id,engine:this.engine,model:t,path:o,selected:e})}return r.createElement(p,null)}}const w={fontFamily:"Inter, sans-serif",primaryBg:"#f1f1f1",textWhite:"#FFFFFF",chipTextColor:"#F2F2F7",chipBgColor:"rgba(60, 60, 67, 0.4)",chipPrimaryTextColor:"rgba(255, 255, 255, 0.8)",chipPrimaryBgColor:"rgba(0, 122, 255, 0.6)",breadcrumbLinkColor:"#A2A2A2",breadcrumbTextColor:"#292929",buttonPrimaryBgColor:"4353FF",buttonPrimaryBgHoverColor:"#3443E1",buttonPrimaryDisabledBgColor:"rgba(0, 122, 255, 0.4)",listItemActiveBg:"#007AFF",listSelectedTextColor:"#3C3C43",listBoxShadow:"0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)",listBorderColor:"rgba(0, 0, 0, 0.04)",dividerColor:"rgba(118, 120, 125, 0.12)",dropdownBg:"rgba(246, 246, 248, 0.8)",dropdownTextColor:"rgba(60, 60, 67, 0.6)",overlayColor:"rgba(0, 0, 0, 0.4)",progressBg:"#E5E5E5",progressBar:"#017AFF",progressShadow:"inset 0 0 0.0625rem #E3E3E3",switchShadow:"0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)"},{textWhite:y,dividerColor:x}=w,b=a.makeStyles(()=>({root:{zIndex:"5",width:"4rem",background:y,boxShadow:"0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)",borderRadius:"2rem",position:"fixed",left:"1rem",top:"50%",transform:"translateY(-50%)","&.right":{left:"auto",right:"1rem"},"& .MuiList-root":{padding:"0.75rem"}},node:{margin:"0.25rem 0","& .MuiDivider-root":{borderColor:x,width:"calc(100% - 1.5rem)",margin:"0 auto",border:"none",borderTop:"0.0625rem solid"},"& img":{display:"block",margin:"1rem 0"}}})),v=()=>{const t=b();return r.createElement(l.Box,{className:t.root+" left"},r.createElement(d.List,{disablePadding:!0,component:"nav"},r.createElement(d.ListItemButton,{selected:!0},r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"icon"}))),r.createElement(d.ListItemButton,null,r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"move"})))),r.createElement(l.Box,{className:t.node},r.createElement(d.Divider,null),r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n').toString("base64"),alt:"node"}),r.createElement(d.Divider,null)),r.createElement(d.List,{disablePadding:!0,component:"nav"},r.createElement(d.ListItemButton,{disabled:!0},r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"icon"}))),r.createElement(d.ListItemButton,null,r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"fullscreen"})))))};class B extends Error{constructor(t){super(`Root with id ${t} not found`),Object.setPrototypeOf(this,B.prototype)}}class M{constructor(t,e,o,r){this._left=t,this._top=e,this._right=o,this._bottom=r}get left(){return this._left}set left(t){this._left=t}get top(){return this._top}set top(t){this._top=t}get right(){return this._right}set right(t){this._right=t}get bottom(){return this._bottom}set bottom(t){this._bottom=t}getWidth(){return this._right-this._left}getHeight(){return this._top-this._bottom}}class P{constructor(t){this.node=t,this.children=new Map}getID(){return this.node.getID()}getNode(){return this.node}getChild(t){return this.children.get(t)}addChild(t){this.children.set(t.getID(),t)}getChildren(){return Array.from(this.children.values()).map(t=>t.getNode())}getDescendancy(){const t=this.getChildren();for(const e of Array.from(this.children.values()))t.push(...e.getDescendancy());return t}dfs(t){if(this.getID()==t)return this.node;for(let e of Array.from(this.children.values())){const o=e.dfs(t);if(o)return o}return!1}getContainerBoundingBox(){let t=this.getNode().width,e=this.getNode().height,o=this.getNode().getX(),r=this.getNode().getY();console.log(o,r,o+t,r+e),console.log(this.node.getBoundingBox());let n=o-t/2,i=o+t/2,s=r+e/2,a=r-e/2;for(let t of Array.from(this.children.values())){const e=t.getContainerBoundingBox();e.lefti&&(i=e.right),e.top>s&&(s=e.top),e.bottom0;){const e=t.shift();if(o=o.getChild(e),null==o)throw new B(e)}return o}handleNodePositionChanged(t){this.updateChildrenPosition(t),this.updateNodeLocalPosition(t)}updateChildrenPosition(t){this.getChildren(t).forEach(e=>{const o=e.getLocalPosition();e.setPosition(t.getX()+o.x,t.getY()+o.y)})}updateNodeLocalPosition(t){const e=this.getParent(t);t.updateLocalPosition(e)}updateNodesContainerBoundingBoxes(t){t.forEach(t=>t.setContainerBoundingBox(this.getNodeContainerBoundingBox(t)))}}const _=a.makeStyles(t=>({container:{height:"100%",width:"100%"},canvasContainer:{height:"100%",width:"100%",background:"#fffff"}}));exports.ComponentsMap=class{constructor(t,e){this.nodes=t,this.links=e}},exports.MetaLink=class{constructor(t,e,o,r,n,i,s,a){this.sourceId=r,this.sourcePortId=n,this.targetId=i,this.targetPortId=s,this.options=a,this.options.set("id",t),this.options.set("name",e),this.options.set("shape",o)}getSourceId(){return this.sourceId}getSourcePortId(){return this.sourcePortId}getTargetId(){return this.targetId}getTargetPortId(){return this.targetPortId}toModel(){return new m(Object.fromEntries(this.options))}},exports.MetaLinkModel=m,exports.MetaNode=class{constructor(t,e,o,r,n,i){this.parent=n,this.position=r,this.options=new Map(i),this.options.set("id",t),this.options.set("name",e),this.options.set("shape",o)}getId(){return this.options.get("id")}getGraphPath(){if(this.parent){const t=this.parent.getGraphPath();return t.push(this.getId()),t}return[this.getId()]}getWorldPosition(){var t;return this.parent?this.position.add(null==(t=this.parent)?void 0:t.getWorldPosition()):this.position}getDepth(){return this.parent?this.parent.getDepth()+1:0}toModel(){const t=new Map(this.options);t.set("graphPath",this.getGraphPath()),t.set("localPosition",this.position),t.set("depth",this.getDepth());const e=new u(Object.fromEntries(t)),o=this.getWorldPosition();return e.setPosition(o.x,o.y),e}},exports.MetaNodeModel=u,exports.Position=c,exports.default=({metaNodes:t,metaLinks:e,componentsMap:r,wrapperClassName:a,metaTheme:l})=>{const c=_(),u=i();u.getNodeFactories().registerFactory(new C(r.nodes)),u.getLinkFactories().registerFactory(new f(r.links));const m=function(t){const e=new L;t.sort((function(t,e){return t.getDepth()-e.getDepth()}));for(const o of t){const t=o.toModel();e.addNode(t)}return e}(t),p=new n.DiagramModel,y=m.getNodes();var x;x=t=>{m.handleNodePositionChanged(t.entity),u.repaintCanvas()},y.forEach(t=>t.registerListener({positionChanged:t=>x(t)}));const b=e.map(t=>function(t,e){const o=t.toModel(),r=e.getNodeDFS(t.getSourceId()),n=e.getNodeDFS(t.getTargetId());if(r&&n)return o.setSourcePort(r.getPort(t.getSourcePortId())),o.setTargetPort(n.getPort(t.getTargetPortId())),o}(t,m)).filter(t=>void 0!==t);p.addAll(...y,...b),u.setModel(p),o.useEffect(()=>{m.updateNodesContainerBoundingBoxes(p.getNodes(),m)},[]);const B=a||c.container;return o.createElement(h.ThemeProvider,{theme:h.createTheme((M=null==l?void 0:l.customThemeVariables,(t=>{const{primaryBg:e,fontFamily:o,chipTextColor:r,chipBgColor:n,textWhite:i,listItemActiveBg:s,listSelectedTextColor:a,listBoxShadow:l,listBorderColor:d}=t;return{components:{MuiCssBaseline:{styleOverrides:`\n html {\n background: ${e};\n font-family: ${o};\n }\n body {\n background-color:${e};\n font-family: ${o};\n font-size: 1rem;\n }\n `},MuiList:{styleOverrides:{root:{"&.customSwitch":{padding:"0.125rem",background:r,borderRadius:"0.5rem",display:"flex","& .MuiListItemButton-root":{padding:"0.25rem 0.75rem",borderRadius:"0.4375rem",width:"10.59375rem",display:"flex",alignItems:"center",justifyContent:"center","&:not(:last-child)":{marginBottom:"0"},"&.Mui-disabled":{opacity:1},"&.Mui-selected":{background:i,boxShadow:l,border:"0.03125rem solid "+d,"& .MuiTypography-root":{color:a}}},"& .MuiChip-root":{marginLeft:"0.25rem"},"& .MuiTypography-root":{fontWeight:500,fontSize:"0.8125rem",lineHeight:"1.25rem",letterSpacing:"-0.005rem",color:n,margin:0}}}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"inherit"}}},MuiListItemButton:{styleOverrides:{root:{padding:0,width:"2.5rem",height:"2.5rem",borderRadius:"50%",justifyContent:"center",backgroundColor:r,"&:hover":{backgroundColor:r},"&:not(:last-child)":{marginBottom:"0.75rem"},"&.Mui-selected":{backgroundColor:s,"&:hover":{backgroundColor:s}},"&.Mui-disabled":{opacity:.8}}}}}}})({...w,...M})))},o.createElement(g,null),o.createElement(d.Box,{className:B},o.createElement(v,null),o.createElement(s.CanvasWidget,{className:`${c.canvasContainer} ${null==l?void 0:l.canvasClassName}`,engine:u})));var M}; +"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e,o=require("react"),r=t(o),n=require("@projectstorm/react-diagrams"),i=t(n),s=require("@projectstorm/react-canvas-core"),a=require("@mui/styles"),l=require("@mui/system"),d=require("@mui/material"),h=require("@mui/material/styles"),g=t(require("@mui/material/CssBaseline"));!function(t){t.META_NODE="meta-node-type",t.META_LINK="meta-link-type"}(e||(e={}));class c{constructor(t,e){this._x=t,this._y=e}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}add(t){return new c(this._x+t._x,this._y+t._y)}sub(t){return new c(this._x-t._x,this._y-t._y)}}class u extends n.NodeModel{constructor(t={}){super({...t,type:e.META_NODE}),this.addPort(new n.DefaultPortModel({in:!0,name:"in"})),this.addPort(new n.DefaultPortModel({in:!1,name:"out"}))}getGraphPath(){return[...this.getOptions().graphPath]}getLocalPosition(){return this.getOptions().localPosition}isInsideParent(t){return!t||t.getBoundingBox().containsPoint(this.getPosition())}calculateLocalPosition(t){const e=new c(this.getX(),this.getY()),o=t?new c(t.getX(),t.getY()):new c(0,0);return e.sub(o)}updateLocalPosition(t){this.options.localPosition=this.calculateLocalPosition(t)}setContainerBoundingBox(t){this.options.containerBoundingBox=t}}class m extends n.DefaultLinkModel{constructor(t={}){super({...t,type:e.META_LINK})}}const p=()=>r.createElement("div",null,"Unknown Type");class C extends s.AbstractReactFactory{constructor(t){super(e.META_NODE),this.componentsMap=t}generateModel(){return new u}generateReactWidget(t){if(this.componentsMap.has(t.model.options.shape)){const e=this.componentsMap.get(t.model.options.shape);return r.createElement(e,{key:"node-factory-"+t.model.getOptions().id,engine:this.engine,model:t.model})}return r.createElement(p,null)}}class f extends n.DefaultLinkFactory{constructor(t){super(e.META_LINK),this.componentsMap=t}generateModel(){return new m}generateLinkSegment(t,e,o){var n;if(this.componentsMap.has(null==(n=t.getOptions())?void 0:n.shape)){const n=this.componentsMap.get(t.getOptions().shape);return r.createElement(n,{key:"link-factory-"+t.getOptions().id,engine:this.engine,model:t,path:o,selected:e})}return r.createElement(p,null)}}const w={fontFamily:"Inter, sans-serif",primaryBg:"#f1f1f1",textWhite:"#FFFFFF",chipTextColor:"#F2F2F7",chipBgColor:"rgba(60, 60, 67, 0.4)",chipPrimaryTextColor:"rgba(255, 255, 255, 0.8)",chipPrimaryBgColor:"rgba(0, 122, 255, 0.6)",breadcrumbLinkColor:"#A2A2A2",breadcrumbTextColor:"#292929",buttonPrimaryBgColor:"4353FF",buttonPrimaryBgHoverColor:"#3443E1",buttonPrimaryDisabledBgColor:"rgba(0, 122, 255, 0.4)",listItemActiveBg:"#007AFF",listSelectedTextColor:"#3C3C43",listBoxShadow:"0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)",listBorderColor:"rgba(0, 0, 0, 0.04)",dividerColor:"rgba(118, 120, 125, 0.12)",dropdownBg:"rgba(246, 246, 248, 0.8)",dropdownTextColor:"rgba(60, 60, 67, 0.6)",overlayColor:"rgba(0, 0, 0, 0.4)",progressBg:"#E5E5E5",progressBar:"#017AFF",progressShadow:"inset 0 0 0.0625rem #E3E3E3",switchShadow:"0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)"},{textWhite:y,dividerColor:x}=w,b=a.makeStyles(()=>({root:{zIndex:"5",width:"4rem",background:y,boxShadow:"0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)",borderRadius:"2rem",position:"fixed",left:"1rem",top:"50%",transform:"translateY(-50%)","&.right":{left:"auto",right:"1rem"},"& .MuiList-root":{padding:"0.75rem"}},node:{margin:"0.25rem 0","& .MuiDivider-root":{borderColor:x,width:"calc(100% - 1.5rem)",margin:"0 auto",border:"none",borderTop:"0.0625rem solid"},"& img":{display:"block",margin:"1rem 0"}}})),v=()=>{const t=b();return r.createElement(l.Box,{className:t.root+" left"},r.createElement(d.List,{disablePadding:!0,component:"nav"},r.createElement(d.ListItemButton,{selected:!0},r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"icon"}))),r.createElement(d.ListItemButton,null,r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"move"})))),r.createElement(l.Box,{className:t.node},r.createElement(d.Divider,null),r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n').toString("base64"),alt:"node"}),r.createElement(d.Divider,null)),r.createElement(d.List,{disablePadding:!0,component:"nav"},r.createElement(d.ListItemButton,{disabled:!0},r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"icon"}))),r.createElement(d.ListItemButton,null,r.createElement(d.ListItemIcon,null,r.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('\n\n').toString("base64"),alt:"fullscreen"})))))};class M extends Error{constructor(t){super(`Root with id ${t} not found`),Object.setPrototypeOf(this,M.prototype)}}class B{constructor(t,e,o,r){this._left=t,this._top=e,this._right=o,this._bottom=r}get left(){return this._left}set left(t){this._left=t}get top(){return this._top}set top(t){this._top=t}get right(){return this._right}set right(t){this._right=t}get bottom(){return this._bottom}set bottom(t){this._bottom=t}getWidth(){return this._right-this._left}getHeight(){return this._top-this._bottom}}class P{constructor(t){this.node=t,this.children=new Map}getID(){return this.node.getID()}getNode(){return this.node}getChild(t){return this.children.get(t)}addChild(t){this.children.set(t.getID(),t)}getChildren(){return Array.from(this.children.values()).map(t=>t.getNode())}getDescendancy(){const t=this.getChildren();for(const e of Array.from(this.children.values()))t.push(...e.getDescendancy());return t}dfs(t){if(this.getID()==t)return this.node;for(let e of Array.from(this.children.values())){const o=e.dfs(t);if(o)return o}return!1}getContainerBoundingBox(){let t=this.getNode().width,e=this.getNode().height,o=this.getNode().getX(),r=this.getNode().getY(),n=o-t/2,i=o+t/2,s=r+e/2,a=r-e/2;for(let t of Array.from(this.children.values())){const e=t.getContainerBoundingBox();e.lefti&&(i=e.right),e.top>s&&(s=e.top),e.bottom0;){const e=t.shift();if(o=o.getChild(e),null==o)throw new M(e)}return o}handleNodePositionChanged(t){this.updateChildrenPosition(t),this.updateNodeLocalPosition(t)}updateChildrenPosition(t){this.getChildren(t).forEach(e=>{const o=e.getLocalPosition();e.setPosition(t.getX()+o.x,t.getY()+o.y)})}updateNodeLocalPosition(t){const e=this.getParent(t);t.updateLocalPosition(e)}updateNodesContainerBoundingBoxes(t){t.forEach(t=>t.setContainerBoundingBox(this.getNodeContainerBoundingBox(t)))}}const _=a.makeStyles(t=>({container:{height:"100%",width:"100%"},canvasContainer:{height:"100%",width:"100%",background:"#fffff"}}));exports.ComponentsMap=class{constructor(t,e){this.nodes=t,this.links=e}},exports.MetaLink=class{constructor(t,e,o,r,n,i,s,a){this.sourceId=r,this.sourcePortId=n,this.targetId=i,this.targetPortId=s,this.options=a,this.options.set("id",t),this.options.set("name",e),this.options.set("shape",o)}getSourceId(){return this.sourceId}getSourcePortId(){return this.sourcePortId}getTargetId(){return this.targetId}getTargetPortId(){return this.targetPortId}toModel(){return new m(Object.fromEntries(this.options))}},exports.MetaLinkModel=m,exports.MetaNode=class{constructor(t,e,o,r,n,i){this.parent=n,this.position=r,this.options=new Map(i),this.options.set("id",t),this.options.set("name",e),this.options.set("shape",o)}getId(){return this.options.get("id")}getGraphPath(){if(this.parent){const t=this.parent.getGraphPath();return t.push(this.getId()),t}return[this.getId()]}getWorldPosition(){var t;return this.parent?this.position.add(null==(t=this.parent)?void 0:t.getWorldPosition()):this.position}getDepth(){return this.parent?this.parent.getDepth()+1:0}toModel(){const t=new Map(this.options);t.set("graphPath",this.getGraphPath()),t.set("localPosition",this.position),t.set("depth",this.getDepth());const e=new u(Object.fromEntries(t)),o=this.getWorldPosition();return e.setPosition(o.x,o.y),e}},exports.MetaNodeModel=u,exports.Position=c,exports.default=({metaNodes:t,metaLinks:e,componentsMap:r,wrapperClassName:a,metaTheme:l})=>{const c=_(),u=i();u.getNodeFactories().registerFactory(new C(r.nodes)),u.getLinkFactories().registerFactory(new f(r.links));const m=function(t){const e=new L;t.sort((function(t,e){return t.getDepth()-e.getDepth()}));for(const o of t){const t=o.toModel();e.addNode(t)}return e}(t),p=new n.DiagramModel,y=m.getNodes();var x;x=t=>{m.handleNodePositionChanged(t.entity),u.repaintCanvas()},y.forEach(t=>t.registerListener({positionChanged:t=>x(t)}));const b=e.map(t=>function(t,e){const o=t.toModel(),r=e.getNodeDFS(t.getSourceId()),n=e.getNodeDFS(t.getTargetId());if(r&&n)return o.setSourcePort(r.getPort(t.getSourcePortId())),o.setTargetPort(n.getPort(t.getTargetPortId())),o}(t,m)).filter(t=>void 0!==t);p.addAll(...y,...b),u.setModel(p),o.useEffect(()=>{m.updateNodesContainerBoundingBoxes(p.getNodes(),m)},[]);const M=a||c.container;return o.createElement(h.ThemeProvider,{theme:h.createTheme((B=null==l?void 0:l.customThemeVariables,(t=>{const{primaryBg:e,fontFamily:o,chipTextColor:r,chipBgColor:n,textWhite:i,listItemActiveBg:s,listSelectedTextColor:a,listBoxShadow:l,listBorderColor:d}=t;return{components:{MuiCssBaseline:{styleOverrides:`\n html {\n background: ${e};\n font-family: ${o};\n }\n body {\n background-color:${e};\n font-family: ${o};\n font-size: 1rem;\n }\n `},MuiList:{styleOverrides:{root:{"&.customSwitch":{padding:"0.125rem",background:r,borderRadius:"0.5rem",display:"flex","& .MuiListItemButton-root":{padding:"0.25rem 0.75rem",borderRadius:"0.4375rem",width:"10.59375rem",display:"flex",alignItems:"center",justifyContent:"center","&:not(:last-child)":{marginBottom:"0"},"&.Mui-disabled":{opacity:1},"&.Mui-selected":{background:i,boxShadow:l,border:"0.03125rem solid "+d,"& .MuiTypography-root":{color:a}}},"& .MuiChip-root":{marginLeft:"0.25rem"},"& .MuiTypography-root":{fontWeight:500,fontSize:"0.8125rem",lineHeight:"1.25rem",letterSpacing:"-0.005rem",color:n,margin:0}}}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"inherit"}}},MuiListItemButton:{styleOverrides:{root:{padding:0,width:"2.5rem",height:"2.5rem",borderRadius:"50%",justifyContent:"center",backgroundColor:r,"&:hover":{backgroundColor:r},"&:not(:last-child)":{marginBottom:"0.75rem"},"&.Mui-selected":{backgroundColor:s,"&:hover":{backgroundColor:s}},"&.Mui-disabled":{opacity:.8}}}}}}})({...w,...B})))},o.createElement(g,null),o.createElement(d.Box,{className:M},o.createElement(v,null),o.createElement(s.CanvasWidget,{className:`${c.canvasContainer} ${null==l?void 0:l.canvasClassName}`,engine:u})));var B}; //# sourceMappingURL=meta-diagram.cjs.production.min.js.map diff --git a/dist/meta-diagram.cjs.production.min.js.map b/dist/meta-diagram.cjs.production.min.js.map index 89d3176..0ed7997 100644 --- a/dist/meta-diagram.cjs.production.min.js.map +++ b/dist/meta-diagram.cjs.production.min.js.map @@ -1 +1 @@ -{"version":3,"file":"meta-diagram.cjs.production.min.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/react-diagrams/MetaLinkModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/index.tsx","../src/models/ComponentsMap.ts","../src/models/MetaLink.ts","../src/models/MetaNode.ts","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/theme.ts"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n console.log(x, y, x+width, y+height)\n console.log(this.node.getBoundingBox())\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n // TODO: Internally add children to metaNode\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n // TODO: Add private children attribute\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","this","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","super","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaLinkModel","DefaultLinkModel","META_LINK","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","shape","ReactComponentType","get","key","id","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","_model$getOptions","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","position","left","top","transform","&.right","right","& .MuiList-root","padding","node","margin","& .MuiDivider-root","borderColor","border","borderTop","& img","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","toString","alt","Divider","disabled","UnknownParent","Error","Object","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","metaNodeModel","children","Map","getID","getNode","getChild","addChild","graph","set","getChildren","Array","from","values","map","g","getDescendancy","descendancy","push","dfs","found","getContainerBoundingBox","height","console","log","child","childBox","MetaGraph","roots","addNode","length","pop","findNodeGraph","getNodes","nodes","getAncestors","oldestAncestor","getRoot","rootId","undefined","getParent","getNodeDFS","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","setPosition","updateNodesContainerBoundingBoxes","_","container","canvasContainer","nodesMap","linksMap","links","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","toModel","fromEntries","getId","graphPath","getWorldPosition","_this$parent","getDepth","optionsMap","metaNodes","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","metaGraph","sort","a","b","mn","generateMetaGraph","DiagramModel","callback","entity","repaintCanvas","registerListener","positionChanged","ml","metaLink","link","source","target","setSourcePort","getPort","setTargetPort","getLinkModel","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customVariables","customThemeVariables","params","components","MuiCssBaseline","styleOverrides","MuiList","&.customSwitch","& .MuiListItemButton-root","alignItems","justifyContent","&:not(:last-child)","marginBottom","&.Mui-disabled","opacity","&.Mui-selected","& .MuiTypography-root","color","& .MuiChip-root","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","backgroundColor","&:hover","applicationTheme","CssBaseline","CanvasWidget","canvasClassName"],"mappings":"8IAAYA,oRAAZ,SAAYA,GACVA,6BACAA,6BAFF,CAAYA,IAAAA,aCACC,EAKXC,YAAYC,EAAWC,GACrBC,KAAKC,GAAKH,EACVE,KAAKE,GAAKH,EAIPD,QACH,OAAOE,KAAKC,GAITH,MAACK,GACJH,KAAKC,GAAKE,EAIPJ,QACH,OAAOC,KAAKE,GAITH,MAACI,GACJH,KAAKE,GAAKC,EAGZC,IAAIC,GACF,OAAO,IAAIT,EAASI,KAAKC,GAAII,EAAcJ,GAAID,KAAKE,GAAKG,EAAcH,IAGzEI,IAAID,GACF,OAAO,IAAIT,EAASI,KAAKC,GAAKI,EAAc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BACC1K,aAAcF,EAAQmF,yBAAmBuB,SAAAA,EAAWmE,kBACpDtO,OAAQA,UMEFsM"} \ No newline at end of file +{"version":3,"file":"meta-diagram.cjs.production.min.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/react-diagrams/MetaLinkModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/index.tsx","../src/models/ComponentsMap.ts","../src/models/MetaLink.ts","../src/models/MetaNode.ts","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/theme.ts"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: Add call application OnDiagramChange callback\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","this","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","super","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaLinkModel","DefaultLinkModel","META_LINK","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","shape","ReactComponentType","get","key","id","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","_model$getOptions","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","position","left","top","transform","&.right","right","& .MuiList-root","padding","node","margin","& .MuiDivider-root","borderColor","border","borderTop","& img","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","toString","alt","Divider","disabled","UnknownParent","Error","Object","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","metaNodeModel","children","Map","getID","getNode","getChild","addChild","graph","set","getChildren","Array","from","values","map","g","getDescendancy","descendancy","push","dfs","found","getContainerBoundingBox","height","child","childBox","MetaGraph","roots","addNode","length","pop","findNodeGraph","getNodes","nodes","getAncestors","oldestAncestor","getRoot","rootId","undefined","getParent","getNodeDFS","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","setPosition","updateNodesContainerBoundingBoxes","_","container","canvasContainer","nodesMap","linksMap","links","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","toModel","fromEntries","getId","graphPath","getWorldPosition","_this$parent","getDepth","optionsMap","metaNodes","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","metaGraph","sort","a","b","mn","generateMetaGraph","DiagramModel","callback","entity","repaintCanvas","registerListener","positionChanged","ml","metaLink","link","source","target","setSourcePort","getPort","setTargetPort","getLinkModel","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customVariables","customThemeVariables","params","components","MuiCssBaseline","styleOverrides","MuiList","&.customSwitch","& .MuiListItemButton-root","alignItems","justifyContent","&:not(:last-child)","marginBottom","&.Mui-disabled","opacity","&.Mui-selected","& .MuiTypography-root","color","& .MuiChip-root","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","backgroundColor","&:hover","applicationTheme","CssBaseline","CanvasWidget","canvasClassName"],"mappings":"8IAAYA,oRAAZ,SAAYA,GACVA,6BACAA,6BAFF,CAAYA,IAAAA,aCACC,EAKXC,YAAYC,EAAWC,GACrBC,KAAKC,GAAKH,EACVE,KAAKE,GAAKH,EAIPD,QACH,OAAOE,KAAKC,GAITH,MAACK,GACJH,KAAKC,GAAKE,EAIPJ,QACH,OAAOC,KAAKE,GAITH,MAACI,GACJH,KAAKE,GAAKC,EAGZC,IAAIC,GACF,OAAO,IAAIT,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K,aAAcF,EAAQiF,yBAAmBuB,SAAAA,EAAWmE,kBACpDpO,OAAQA,UMEFoM"} \ No newline at end of file diff --git a/dist/meta-diagram.esm.js b/dist/meta-diagram.esm.js index 77a4523..ed561b4 100644 --- a/dist/meta-diagram.esm.js +++ b/dist/meta-diagram.esm.js @@ -100,7 +100,6 @@ class MetaNodeModel extends NodeModel { } class MetaNode { - // TODO: Add private children attribute constructor(id, name, shape, position, parent, options) { this.parent = parent; this.position = position; @@ -628,8 +627,6 @@ class Graph { let height = this.getNode().height; let x = this.getNode().getX(); let y = this.getNode().getY(); - console.log(x, y, x + width, y + height); - console.log(this.node.getBoundingBox()); let left = x - width / 2; let right = x + width / 2; let top = y + height / 2; @@ -848,11 +845,12 @@ const MetaDiagram = ({ .registerFactory(new MetaNodeFactory(componentsMap.nodes)); engine.getLinkFactories() // @ts-ignore .registerFactory(new MetaLinkFactory(componentsMap.links)); - const metaGraph = generateMetaGraph(metaNodes); // TODO: Internally add children to metaNode + const metaGraph = generateMetaGraph(metaNodes); const repaintCanvas = event => { const node = event.entity; - metaGraph.handleNodePositionChanged(node); // TODO: We might not need the full canvas to be repainted + metaGraph.handleNodePositionChanged(node); // TODO: Add call application OnDiagramChange callback + // TODO: We might not need the full canvas to be repainted engine.repaintCanvas(); }; // set up the diagram model diff --git a/dist/meta-diagram.esm.js.map b/dist/meta-diagram.esm.js.map index 819a048..50f2a5e 100644 --- a/dist/meta-diagram.esm.js.map +++ b/dist/meta-diagram.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"meta-diagram.esm.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/models/MetaNode.ts","../src/react-diagrams/MetaLinkModel.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/helpers/nodesHelper.ts","../src/index.tsx"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n // TODO: Add private children attribute\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n console.log(x, y, x+width, y+height)\n console.log(this.node.getBoundingBox())\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n // TODO: Internally add children to metaNode\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaNode","id","shape","position","Map","set","getId","get","graphPath","push","getWorldPosition","getDepth","toModel","optionsMap","metaNodeModel","Object","fromEntries","setPosition","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","key","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getLinkModel","metaLink","metaGraph","link","source","getNodeDFS","target","setSourcePort","getPort","setTargetPort","undefined","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","left","top","transform","right","padding","node","margin","borderColor","border","borderTop","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","Cursor","toString","alt","Move","Divider","Node","disabled","Icon","Fullscreen","applicationTheme","params","components","MuiCssBaseline","styleOverrides","MuiList","alignItems","justifyContent","marginBottom","opacity","color","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","height","backgroundColor","customVariables","UnknownParent","Error","msg","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","children","getID","getNode","getChild","addChild","graph","getChildren","Array","from","values","map","g","getDescendancy","descendancy","dfs","found","getContainerBoundingBox","console","log","child","childBox","bb","MetaGraph","roots","addNode","length","pop","parentGraph","findNodeGraph","getNodes","getAncestors","oldestAncestor","getRoot","rootId","getParent","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","updateNodesContainerBoundingBoxes","generateMetaGraph","metaNodes","sort","a","b","mn","registerPositionListener","metaNodeModels","callback","registerListener","positionChanged","_","container","canvasContainer","MetaDiagram","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","repaintCanvas","entity","DiagramModel","ml","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;AAAA,IAAYA,qBAAZ;;AAAA,WAAYA;EACVA,kCAAA,mBAAA;EACAA,kCAAA,mBAAA;AACD,CAHD,EAAYA,qBAAqB,KAArBA,qBAAqB,KAAA,CAAjC;;MCAaC;EAKXC,YAAYC,GAAWC;IACrB,KAAKC,EAAL,GAAUF,CAAV;IACA,KAAKG,EAAL,GAAUF,CAAV;;;;EAIG,IAADD,CAAC;IACH,OAAO,KAAKE,EAAZ;;;;EAIG,IAADF,CAAC,CAACI,KAAD;IACH,KAAKF,EAAL,GAAUE,KAAV;;;;EAIG,IAADH,CAAC;IACH,OAAO,KAAKE,EAAZ;;;;EAIG,IAADF,CAAC,CAACG,KAAD;IACH,KAAKD,EAAL,GAAUC,KAAV;;;EAGFC,GAAG,CAACC,aAAD;IACD,OAAO,IAAIR,QAAJ,CAAa,KAAKI,EAAL,GAASI,aAAa,CAACJ,EAApC,EAAwC,KAAKC,EAAL,GAAUG,aAAa,CAACH,EAAhE,CAAP;;;EAGFI,GAAG,CAACD,aAAD;IACD,OAAO,IAAIR,QA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,WAAD,MAAA,CADF,EAEElN,aAAA,CAAC0E,KAAD;IAAKC,SAAS,EAAEkI;GAAhB,EACE7M,aAAA,CAACwE,OAAD,MAAA,CADF,EAEExE,aAAA,CAACmN,YAAD;IACExI,SAAS,KAAKF,OAAO,CAACkH,mBAAmBI,SAA9B,oBAA8BA,SAAS,CAAEqB;IACpDzM,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CA5ED;;;;;"} \ No newline at end of file +{"version":3,"file":"meta-diagram.esm.js","sources":["../src/constants.ts","../src/models/Position.ts","../src/react-diagrams/MetaNodeModel.ts","../src/models/MetaNode.ts","../src/react-diagrams/MetaLinkModel.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Exceptions.ts","../src/models/BoundingBox.ts","../src/models/MetaGraph.ts","../src/helpers/nodesHelper.ts","../src/index.tsx"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","export class Position {\n\n private _x: number;\n private _y: number;\n\n constructor(x: number, y: number) {\n this._x = x;\n this._y = y;\n }\n\n // @ts-ignore\n get x(): number {\n return this._x;\n }\n\n // @ts-ignore\n set x(value: number) {\n this._x = value;\n }\n\n // @ts-ignore\n get y(): number {\n return this._y;\n }\n\n // @ts-ignore\n set y(value: number) {\n this._y = value;\n }\n\n add(otherPosition: Position) : Position {\n return new Position(this._x+ otherPosition._x, this._y + otherPosition._y)\n }\n\n sub(otherPosition: Position) : Position {\n return new Position(this._x - otherPosition._x, this._y - otherPosition._y)\n }\n\n}\n","import {DefaultPortModel, NodeModel} from '@projectstorm/react-diagrams';\nimport {ReactDiagramMetaTypes} from '../constants';\nimport {Position} from \"../models/Position\";\n\nexport class MetaNodeModel extends NodeModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_NODE,\n });\n\n // set up an in and out port\n\n this.addPort(\n new DefaultPortModel({\n in: true,\n name: 'in',\n })\n );\n this.addPort(\n new DefaultPortModel({\n in: false,\n name: 'out',\n })\n );\n }\n\n\n getGraphPath(): string[]{\n // @ts-ignore\n return [...this.getOptions()['graphPath']]\n }\n\n getLocalPosition(): Position{\n\n // @ts-ignore\n return this.getOptions()['localPosition']\n }\n\n // TODO: Change to consider mouse position; Currently considering top left corner\n isInsideParent(parent: MetaNodeModel | undefined): boolean {\n return parent ? parent.getBoundingBox().containsPoint(this.getPosition()) : true\n }\n\n private calculateLocalPosition(parent: MetaNodeModel | undefined): Position {\n const worldPosition = new Position(this.getX(), this.getY())\n const parentWorldPosition = parent ? new Position(parent.getX(), parent.getY()): new Position(0,0)\n return worldPosition.sub(parentWorldPosition)\n }\n\n updateLocalPosition(parent: MetaNodeModel | undefined): void {\n // @ts-ignore\n this.options['localPosition'] = this.calculateLocalPosition(parent)\n }\n\n setContainerBoundingBox(containerBoundingBox: {left: number, top: number, right: number, bottom: number}): void {\n // @ts-ignore\n this.options['containerBoundingBox'] = containerBoundingBox\n }\n\n\n}\n","import { Position } from './Position';\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\nexport class MetaNode {\n private readonly parent: MetaNode | undefined;\n private readonly position: Position;\n private readonly options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n parent: MetaNode | undefined,\n options: Map\n ) {\n this.parent = parent\n this.position = position\n this.options = new Map(options)\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n private getId() : string{\n return this.options.get('id')\n }\n\n private getGraphPath() : string[] {\n if(this.parent){\n const graphPath = this.parent.getGraphPath()\n graphPath.push(this.getId())\n return graphPath\n }\n return [this.getId()]\n }\n\n private getWorldPosition() : Position {\n return this.parent ? this.position.add(this.parent?.getWorldPosition()) : this.position\n }\n\n getDepth() : number {\n return this.parent ? this.parent.getDepth()+1 : 0\n }\n\n toModel() : MetaNodeModel {\n const optionsMap = new Map(this.options)\n optionsMap.set('graphPath', this.getGraphPath())\n optionsMap.set('localPosition', this.position)\n optionsMap.set('depth', this.getDepth())\n const metaNodeModel = new MetaNodeModel(Object.fromEntries(optionsMap))\n const worldPosition = this.getWorldPosition()\n metaNodeModel.setPosition(worldPosition.x, worldPosition.y)\n return metaNodeModel\n }\n\n}\n","import { DefaultLinkModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaLinkModel extends DefaultLinkModel {\n constructor(options = {}) {\n super({\n ...options,\n type: ReactDiagramMetaTypes.META_LINK,\n });\n }\n}\n","import { ILink } from './ILink';\nimport {MetaLinkModel} from \"../react-diagrams/MetaLinkModel\";\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n sourceId: string,\n sourcePortId: string,\n targetId: string,\n targetPortId: string,\n options: Map\n ) {\n this.sourceId = sourceId;\n this.sourcePortId = sourcePortId;\n this.targetId = targetId;\n this.targetPortId = targetPortId;\n this.options = options;\n this.options.set('id', id);\n this.options.set('name', name);\n this.options.set('shape', shape);\n }\n\n getSourceId(): string {\n return this.sourceId;\n }\n\n getSourcePortId(): string {\n return this.sourcePortId;\n }\n\n getTargetId(): string {\n return this.targetId;\n }\n\n getTargetPortId(): string {\n return this.targetPortId;\n }\n\n toModel(): MetaLinkModel {\n return new MetaLinkModel(Object.fromEntries(this.options))\n }\n}\n","import React from 'react';\n\nexport class ComponentsMap {\n nodes: Map;\n links: Map;\n\n constructor(\n nodesMap: Map,\n linksMap: Map\n ) {\n this.nodes = nodesMap;\n this.links = linksMap;\n }\n}\n","import React from 'react';\n\nexport const UnknownTypeWidget = () => {\n return
Unknown Type
;\n};\n","import { AbstractReactFactory } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './MetaNodeModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport React from 'react';\nimport { ReactDiagramMetaTypes } from '../constants';\n\nexport class MetaNodeFactory extends AbstractReactFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_NODE);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaNodeModel();\n }\n\n generateReactWidget(event: any): JSX.Element {\n if (this.componentsMap.has(event.model.options.shape)) {\n const ReactComponentType = this.componentsMap.get(\n event.model.options.shape\n );\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default node instead\n return ;\n }\n}\n","import { MetaLinkModel } from './MetaLinkModel';\nimport { UnknownTypeWidget } from '../components/UnknownTypeWidget';\nimport { ReactDiagramMetaTypes } from '../constants';\nimport React from 'react';\nimport { DefaultLinkFactory } from '@projectstorm/react-diagrams';\n\nexport class MetaLinkFactory extends DefaultLinkFactory {\n componentsMap: Map;\n\n constructor(componentsMap: Map) {\n super(ReactDiagramMetaTypes.META_LINK);\n this.componentsMap = componentsMap;\n }\n\n generateModel() {\n return new MetaLinkModel();\n }\n\n generateLinkSegment(\n model: MetaLinkModel,\n selected: boolean,\n path: string\n ): JSX.Element {\n // @ts-ignore\n if (this.componentsMap.has(model.getOptions()?.shape)) {\n const ReactComponentType = this.componentsMap.get(\n // @ts-ignore\n model.getOptions().shape\n );\n\n return (\n // @ts-ignore\n \n );\n }\n // TODO: Generate default link instead\n return ;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport {MetaGraph} from \"../models/MetaGraph\";\n\nexport function getLinkModel(\n metaLink: MetaLink,\n metaGraph: MetaGraph\n): MetaLinkModel | undefined {\n const link = metaLink.toModel();\n const source = metaGraph.getNodeDFS(metaLink.getSourceId());\n const target = metaGraph.getNodeDFS(metaLink.getTargetId());\n if (source && target) {\n link.setSourcePort(source.getPort(metaLink.getSourcePortId()));\n link.setTargetPort(target.getPort(metaLink.getTargetPortId()));\n return link;\n }\n return undefined;\n}\n","const vars = {\n fontFamily: 'Inter, sans-serif',\n primaryBg: '#f1f1f1',\n textWhite: '#FFFFFF',\n chipTextColor: '#F2F2F7',\n chipBgColor: 'rgba(60, 60, 67, 0.4)',\n\n chipPrimaryTextColor: 'rgba(255, 255, 255, 0.8)',\n chipPrimaryBgColor: 'rgba(0, 122, 255, 0.6)',\n\n breadcrumbLinkColor: '#A2A2A2',\n breadcrumbTextColor: '#292929',\n\n buttonPrimaryBgColor: '4353FF',\n buttonPrimaryBgHoverColor: '#3443E1',\n buttonPrimaryDisabledBgColor: 'rgba(0, 122, 255, 0.4)',\n\n listItemActiveBg: '#007AFF',\n listSelectedTextColor: '#3C3C43',\n listBoxShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.12), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.04)',\n listBorderColor: 'rgba(0, 0, 0, 0.04)',\n\n dividerColor: 'rgba(118, 120, 125, 0.12)',\n\n dropdownBg: 'rgba(246, 246, 248, 0.8)',\n dropdownTextColor: 'rgba(60, 60, 67, 0.6)',\n\n overlayColor: 'rgba(0, 0, 0, 0.4)',\n\n progressBg: '#E5E5E5',\n progressBar: '#017AFF',\n progressShadow: 'inset 0 0 0.0625rem #E3E3E3',\n\n switchShadow:\n '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',\n};\n\nexport default vars;\n","import React from 'react';\nimport { Box } from '@mui/system';\nimport { makeStyles } from '@mui/styles';\nimport vars from './assets/styles/variables';\nimport { Divider, List, ListItemButton, ListItemIcon } from '@mui/material';\nimport Move from './assets/svg/move.svg';\nimport Icon from './assets/svg/icon.svg';\nimport Node from './assets/svg/node.svg';\nimport Cursor from './assets/svg/cursor.svg';\nimport Fullscreen from './assets/svg/fullscreen.svg';\n\nconst { textWhite, dividerColor } = vars;\n\nconst useStyles = makeStyles(() => ({\n root: {\n zIndex: '5',\n width: '4rem',\n background: textWhite,\n boxShadow:\n '0 0 3.75rem rgba(0, 0, 0, 0.1), 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)',\n borderRadius: '2rem',\n position: 'fixed',\n left: '1rem',\n top: '50%',\n transform: 'translateY(-50%)',\n\n '&.right': {\n left: 'auto',\n right: '1rem',\n },\n\n '& .MuiList-root': {\n padding: '0.75rem',\n },\n },\n\n node: {\n margin: '0.25rem 0',\n '& .MuiDivider-root': {\n borderColor: dividerColor,\n width: 'calc(100% - 1.5rem)',\n margin: '0 auto',\n border: 'none',\n borderTop: '0.0625rem solid',\n },\n\n '& img': {\n display: 'block',\n margin: '1rem 0',\n },\n },\n}));\n\nconst Sidebar = () => {\n const classes = useStyles();\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n );\n};\n\nexport default Sidebar;\n","import vars from './components/assets/styles/variables';\n\ntype ThemeVars = {\n [key: string]: any;\n};\n\nconst applicationTheme = (params: ThemeVars) => {\n const {\n primaryBg,\n fontFamily,\n chipTextColor,\n chipBgColor,\n textWhite,\n listItemActiveBg,\n listSelectedTextColor,\n listBoxShadow,\n listBorderColor,\n } = params;\n return {\n components: {\n MuiCssBaseline: {\n styleOverrides: `\n html {\n background: ${primaryBg};\n font-family: ${fontFamily};\n }\n body {\n background-color:${primaryBg};\n font-family: ${fontFamily};\n font-size: 1rem;\n }\n `,\n },\n MuiList: {\n styleOverrides: {\n root: {\n '&.customSwitch': {\n padding: '0.125rem',\n background: chipTextColor,\n borderRadius: '0.5rem',\n display: 'flex',\n '& .MuiListItemButton-root': {\n padding: '0.25rem 0.75rem',\n borderRadius: '0.4375rem',\n width: '10.59375rem',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n '&:not(:last-child)': {\n marginBottom: '0',\n },\n '&.Mui-disabled': {\n opacity: 1,\n },\n '&.Mui-selected': {\n background: textWhite,\n boxShadow: listBoxShadow,\n border: `0.03125rem solid ${listBorderColor}`,\n '& .MuiTypography-root': {\n color: listSelectedTextColor,\n },\n },\n },\n '& .MuiChip-root': {\n marginLeft: '0.25rem',\n },\n '& .MuiTypography-root': {\n fontWeight: 500,\n fontSize: '0.8125rem',\n lineHeight: '1.25rem',\n letterSpacing: '-0.005rem',\n color: chipBgColor,\n margin: 0,\n },\n },\n },\n },\n },\n MuiListItemIcon: {\n styleOverrides: {\n root: {\n minWidth: 'inherit',\n },\n },\n },\n MuiListItemButton: {\n styleOverrides: {\n root: {\n padding: 0,\n width: '2.5rem',\n height: '2.5rem',\n borderRadius: '50%',\n justifyContent: 'center',\n backgroundColor: chipTextColor,\n '&:hover': {\n backgroundColor: chipTextColor,\n },\n '&:not(:last-child)': {\n marginBottom: '0.75rem',\n },\n '&.Mui-selected': {\n backgroundColor: listItemActiveBg,\n '&:hover': {\n backgroundColor: listItemActiveBg,\n },\n },\n '&.Mui-disabled': {\n opacity: 0.8,\n },\n },\n },\n },\n },\n };\n};\n\nexport default (customVariables: ThemeVars) =>\n applicationTheme({\n ...vars,\n ...customVariables,\n });\n","export class UnknownParent extends Error {\n constructor(id: string | undefined) {\n const msg = `Root with id ${id} not found`\n super(msg);\n Object.setPrototypeOf(this, UnknownParent.prototype);\n }\n}","//TODO: Not needed. Use react-diagrams rectangle instead\n\n\nexport class BoundingBox {\n private _left: number\n private _top: number\n private _right: number\n private _bottom: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n this._left = left;\n this._top = top;\n this._right = right;\n this._bottom = bottom;\n }\n\n\n // @ts-ignore\n get left(): number {\n return this._left;\n }\n // @ts-ignore\n set left(value: number) {\n this._left = value;\n }\n // @ts-ignore\n get top(): number {\n return this._top;\n }\n\n // @ts-ignore\n set top(value: number) {\n this._top = value;\n }\n\n // @ts-ignore\n get right(): number {\n return this._right;\n }\n\n // @ts-ignore\n set right(value: number) {\n this._right = value;\n }\n\n // @ts-ignore\n get bottom(): number {\n return this._bottom;\n }\n\n // @ts-ignore\n set bottom(value: number) {\n this._bottom = value;\n }\n\n getWidth() : number {\n return this._right - this._left\n }\n\n getHeight() : number {\n return this._top - this._bottom\n }\n}","import {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\nimport { UnknownParent } from \"./Exceptions\";\nimport {BoundingBox} from \"./BoundingBox\";\n\nclass Graph {\n private readonly node: MetaNodeModel;\n private readonly children: Map;\n\n constructor(metaNodeModel: MetaNodeModel) {\n this.node = metaNodeModel;\n this.children = new Map()\n }\n\n getID() : string{\n return this.node.getID()\n }\n\n getNode() : MetaNodeModel{\n return this.node\n }\n\n getChild(id:string) {\n return this.children.get(id)\n }\n\n addChild(graph: Graph) : void {\n this.children.set(graph.getID(), graph)\n }\n\n getChildren(): MetaNodeModel[] {\n return Array.from(this.children.values()).map(g => g.getNode())\n }\n\n getDescendancy(): MetaNodeModel[] {\n const descendancy = this.getChildren()\n for(const graph of Array.from(this.children.values())){\n descendancy.push(...graph.getDescendancy())\n }\n return descendancy\n }\n\n dfs(id: string): MetaNodeModel | boolean {\n if(this.getID() == id){\n return this.node\n }\n for (let node of Array.from(this.children.values())) {\n const found = node.dfs(id)\n if(found){\n return found\n }\n }\n return false\n }\n\n getContainerBoundingBox() : BoundingBox {\n // TODO: Refactor to use this.node.getBoundingBox()\n let width = this.getNode().width\n let height = this.getNode().height\n let x = this.getNode().getX()\n let y = this.getNode().getY()\n let left = x - width / 2\n let right = x + width / 2\n let top = y + height / 2\n let bottom = y - height / 2\n for (let child of Array.from(this.children.values())) {\n const childBox = child.getContainerBoundingBox()\n if(childBox.left < left){\n left = childBox.left\n }if(childBox.right > right){\n right = childBox.right\n }if(childBox.top > top){\n top = childBox.top\n }if(childBox.bottom < bottom){\n bottom = childBox.bottom\n }\n }\n const bb = new BoundingBox(left, top, right, bottom)\n // console.log(bb)\n return bb\n }\n\n}\n\n\nexport class MetaGraph {\n private readonly roots: Map;\n\n constructor() {\n this.roots = new Map()\n }\n\n addNode(metaNodeModel:MetaNodeModel): void {\n const path = metaNodeModel.getGraphPath()\n if(path.length == 1){\n this.roots.set(metaNodeModel.getID(), new Graph(metaNodeModel))\n }else{\n path.pop() // Removes own id from path\n const parentGraph = this.findNodeGraph(path)\n parentGraph.addChild(new Graph(metaNodeModel))\n }\n }\n\n\n getNodes() : MetaNodeModel[] {\n const nodes = []\n for(const graph of Array.from(this.roots.values())){\n nodes.push(graph.getNode())\n nodes.push(...graph.getDescendancy())\n }\n return nodes\n }\n\n getAncestors(node : MetaNodeModel): MetaNodeModel[] {\n const path = node.getGraphPath()\n const oldestAncestor = this.getRoot(path[0])\n return [oldestAncestor.getNode(), ...oldestAncestor.getChildren()]\n }\n\n getRoot(rootId: string) : Graph{\n const root = this.roots.get(rootId)\n if(root===undefined){\n throw new UnknownParent(rootId)\n }\n return root\n }\n\n getChildren(parent : MetaNodeModel): MetaNodeModel[] {\n const path = parent.getGraphPath()\n if (path.length == 1) {\n const root = this.getRoot(parent.getID())\n return root.getChildren()\n } else {\n const graph = this.findNodeGraph(path)\n return graph.getChildren()\n }\n }\n\n getParent(node : MetaNodeModel): MetaNodeModel | undefined {\n const path = node.getGraphPath()\n if (path.length == 1) {\n return undefined\n } else {\n path.pop() // removes own id from path\n const parentGraph = this.findNodeGraph(path)\n return parentGraph.getNode()\n }\n }\n\n getNodeDFS(nodeId: string): MetaNodeModel | undefined {\n for (let root of Array.from(this.roots.values())) {\n const found = root.dfs(nodeId)\n if(found){\n // @ts-ignore\n return found\n }\n }\n return undefined\n }\n\n getNodeContainerBoundingBox(node: MetaNodeModel) : BoundingBox {\n const graph = this.findNodeGraph(node.getGraphPath())\n return graph.getContainerBoundingBox()\n }\n\n private findNodeGraph(path: string[]) : Graph {\n const rootId = path.shift()\n // @ts-ignore\n let parent = this.getRoot(rootId)\n while(path.length > 0){\n const next = path.shift()\n // @ts-ignore\n parent = parent.getChild(next)\n if (parent == undefined){\n throw new UnknownParent(next)\n }\n }\n return parent\n }\n\n handleNodePositionChanged(metaNodeModel: MetaNodeModel){\n // TODO: Update node parent (add or remove parent)\n // update node graph path,\n // bounding boxes of parents\n\n // Update children position (children should move the same delta as node)\n this.updateChildrenPosition(metaNodeModel)\n // Update local position / relative position to the parent\n this.updateNodeLocalPosition(metaNodeModel)\n }\n\n private updateChildrenPosition(metaNodeModel: MetaNodeModel){\n const children = this.getChildren(metaNodeModel);\n\n children.forEach(n => {\n /*\n No need to explicitly call updateChildrenPosition for n children because it will happen automatically in\n the event listener\n */\n // @ts-ignore\n const localPosition = n.getLocalPosition()\n n.setPosition(metaNodeModel.getX() + localPosition.x, metaNodeModel.getY() + localPosition.y)\n\n })\n }\n\n private updateNodeLocalPosition(metaNodeModel: MetaNodeModel){\n const parent = this.getParent(metaNodeModel)\n metaNodeModel.updateLocalPosition(parent)\n }\n\n updateNodesContainerBoundingBoxes(nodes: MetaNodeModel[]): void {\n nodes.forEach(n => n.setContainerBoundingBox(this.getNodeContainerBoundingBox(n)))\n }\n}\n\n","import {MetaNode} from \"../models/MetaNode\";\nimport {BaseEntityEvent} from \"@projectstorm/react-canvas-core\";\nimport {NodeModel, NodeModelGenerics} from \"@projectstorm/react-diagrams\";\nimport {MetaGraph} from \"../models/MetaGraph\";\nimport {MetaNodeModel} from \"../react-diagrams/MetaNodeModel\";\n\n\nexport function generateMetaGraph(metaNodes: MetaNode[]) : MetaGraph {\n const metaGraph = new MetaGraph()\n metaNodes.sort(function(a, b) {\n return a.getDepth() - b.getDepth();\n });\n\n for(const mn of metaNodes){\n\n const metaNodeModel = mn.toModel()\n\n metaGraph.addNode(metaNodeModel)\n }\n return metaGraph\n}\n\nexport function registerPositionListener(metaNodeModels: MetaNodeModel[], callback: { (event: any): void; (arg0: BaseEntityEvent>): void; }){\n // @ts-ignore\n metaNodeModels.forEach(metaNodeModel => metaNodeModel.registerListener({positionChanged: (event => callback(event))}))\n}\n\n","import * as React from 'react';\nimport { MetaNode } from './models/MetaNode';\nimport { MetaLink } from './models/MetaLink';\nimport { ComponentsMap } from './models/ComponentsMap';\nimport createEngine, { DiagramModel } from '@projectstorm/react-diagrams';\nimport { MetaNodeFactory } from './react-diagrams/MetaNodeFactory';\nimport { MetaLinkFactory } from './react-diagrams/MetaLinkFactory';\nimport { CanvasWidget } from '@projectstorm/react-canvas-core';\nimport { MetaNodeModel } from './react-diagrams/MetaNodeModel';\nimport { getLinkModel } from './helpers/linksHelper';\nimport { makeStyles } from '@mui/styles';\nimport Sidebar from './components/Sidebar';\nimport { ThemeProvider, createTheme } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport theme from './theme';\nimport { Box } from '@mui/material';\nimport {generateMetaGraph, registerPositionListener} from \"./helpers/nodesHelper\";\nimport {useEffect} from \"react\";\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#fffff',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n metaTheme: {\n customThemeVariables: {};\n canvasClassName: string;\n };\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n metaTheme,\n}: MetaDiagramProps) => {\n const classes = useStyles();\n\n // set up the diagram engine\n const engine = createEngine();\n\n engine\n .getNodeFactories()\n // @ts-ignore\n .registerFactory(new MetaNodeFactory(componentsMap.nodes));\n\n engine\n .getLinkFactories()\n // @ts-ignore\n .registerFactory(new MetaLinkFactory(componentsMap.links));\n\n const metaGraph = generateMetaGraph(metaNodes)\n\n const repaintCanvas = (event: any) => {\n const node = event.entity\n metaGraph.handleNodePositionChanged(node)\n // TODO: Add call application OnDiagramChange callback\n // TODO: We might not need the full canvas to be repainted\n engine.repaintCanvas();\n }\n\n\n // set up the diagram model\n\n const model = new DiagramModel();\n\n const nodes = metaGraph.getNodes()\n registerPositionListener(nodes, repaintCanvas)\n\n const links = metaLinks\n .map(ml => getLinkModel(ml, metaGraph))\n .filter(mlm => mlm !== undefined);\n\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n // TODO: Update metagraph on prop changes\n // We can start by generating a completely new graph\n // Later on we can optimize to detect what changed\n\n useEffect(() => {\n // @ts-ignore\n metaGraph.updateNodesContainerBoundingBoxes(model.getNodes(), metaGraph)\n }, [])\n\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n\n return (\n \n \n \n \n \n \n \n );\n};\n\nexport default MetaDiagram;\nexport { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };\nexport { MetaLinkModel } from './react-diagrams/MetaLinkModel';\nexport { Position } from './models/Position';\n"],"names":["ReactDiagramMetaTypes","Position","constructor","x","y","_x","_y","value","add","otherPosition","sub","MetaNodeModel","NodeModel","options","type","META_NODE","addPort","DefaultPortModel","in","name","getGraphPath","getOptions","getLocalPosition","isInsideParent","parent","getBoundingBox","containsPoint","getPosition","calculateLocalPosition","worldPosition","getX","getY","parentWorldPosition","updateLocalPosition","setContainerBoundingBox","containerBoundingBox","MetaNode","id","shape","position","Map","set","getId","get","graphPath","push","getWorldPosition","getDepth","toModel","optionsMap","metaNodeModel","Object","fromEntries","setPosition","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","key","engine","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getLinkModel","metaLink","metaGraph","link","source","getNodeDFS","target","setSourcePort","getPort","setTargetPort","undefined","vars","fontFamily","primaryBg","textWhite","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","dividerColor","dropdownBg","dropdownTextColor","overlayColor","progressBg","progressBar","progressShadow","switchShadow","useStyles","makeStyles","root","zIndex","width","background","boxShadow","borderRadius","left","top","transform","right","padding","node","margin","borderColor","border","borderTop","display","Sidebar","classes","Box","className","List","disablePadding","component","ListItemButton","ListItemIcon","src","Buffer","Cursor","toString","alt","Move","Divider","Node","disabled","Icon","Fullscreen","applicationTheme","params","components","MuiCssBaseline","styleOverrides","MuiList","alignItems","justifyContent","marginBottom","opacity","color","marginLeft","fontWeight","fontSize","lineHeight","letterSpacing","MuiListItemIcon","minWidth","MuiListItemButton","height","backgroundColor","customVariables","UnknownParent","Error","msg","setPrototypeOf","prototype","BoundingBox","bottom","_left","_top","_right","_bottom","getWidth","getHeight","Graph","children","getID","getNode","getChild","addChild","graph","getChildren","Array","from","values","map","g","getDescendancy","descendancy","dfs","found","getContainerBoundingBox","child","childBox","bb","MetaGraph","roots","addNode","length","pop","parentGraph","findNodeGraph","getNodes","getAncestors","oldestAncestor","getRoot","rootId","getParent","nodeId","getNodeContainerBoundingBox","shift","next","handleNodePositionChanged","updateChildrenPosition","updateNodeLocalPosition","forEach","n","localPosition","updateNodesContainerBoundingBoxes","generateMetaGraph","metaNodes","sort","a","b","mn","registerPositionListener","metaNodeModels","callback","registerListener","positionChanged","_","container","canvasContainer","MetaDiagram","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","repaintCanvas","entity","DiagramModel","ml","filter","mlm","addAll","setModel","useEffect","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;AAAA,IAAYA,qBAAZ;;AAAA,WAAYA;EACVA,kCAAA,mBAAA;EACAA,kCAAA,mBAAA;AACD,CAHD,EAAYA,qBAAqB,KAArBA,qBAAqB,KAAA,CA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C;;IAERvL,SAAS,CAACwJ,iCAAV,CAA4CnK,KAAK,CAACmJ,QAAN,EAA5C,EAA8DxI,SAA9D;GAFO,EAGN,EAHM,CAAT;EAMA,MAAMwL,kBAAkB,GAAGf,gBAAgB,GACvCA,gBADuC,GAEvCnH,OAAO,CAAC+G,SAFZ;EAIA,OACExL,aAAA,CAAC4M,aAAD;IAAeC,KAAK,EAAEC,WAAW,CAACD,KAAK,CAAChB,SAAD,oBAACA,SAAS,CAAEkB,oBAAZ,CAAN;GAAjC,EACE/M,aAAA,CAACgN,WAAD,MAAA,CADF,EAEEhN,aAAA,CAAC0E,KAAD;IAAKC,SAAS,EAAEgI;GAAhB,EACE3M,aAAA,CAACwE,OAAD,MAAA,CADF,EAEExE,aAAA,CAACiN,YAAD;IACEtI,SAAS,KAAKF,OAAO,CAACgH,mBAAmBI,SAA9B,oBAA8BA,SAAS,CAAEqB;IACpDvM,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CA5ED;;;;;"} \ No newline at end of file diff --git a/src/index.tsx b/src/index.tsx index 212111f..82651a2 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -64,11 +64,11 @@ const MetaDiagram = ({ .registerFactory(new MetaLinkFactory(componentsMap.links)); const metaGraph = generateMetaGraph(metaNodes) - // TODO: Internally add children to metaNode const repaintCanvas = (event: any) => { const node = event.entity metaGraph.handleNodePositionChanged(node) + // TODO: Add call application OnDiagramChange callback // TODO: We might not need the full canvas to be repainted engine.repaintCanvas(); } diff --git a/src/models/MetaNode.ts b/src/models/MetaNode.ts index a6c3b07..1268f9b 100644 --- a/src/models/MetaNode.ts +++ b/src/models/MetaNode.ts @@ -6,7 +6,6 @@ export class MetaNode { private readonly position: Position; private readonly options: Map; - // TODO: Add private children attribute constructor( id: string, name: string,