diff --git a/dist/components/Sidebar.d.ts b/dist/components/Sidebar.d.ts
index d743679..7367958 100644
--- a/dist/components/Sidebar.d.ts
+++ b/dist/components/Sidebar.d.ts
@@ -1,3 +1,2 @@
-///
declare const Sidebar: () => JSX.Element;
export default Sidebar;
diff --git a/dist/components/UnknownTypeWidget.d.ts b/dist/components/UnknownTypeWidget.d.ts
index 0875a34..0e6e356 100644
--- a/dist/components/UnknownTypeWidget.d.ts
+++ b/dist/components/UnknownTypeWidget.d.ts
@@ -1,2 +1 @@
-///
export declare const UnknownTypeWidget: () => JSX.Element;
diff --git a/dist/components/assets/styles/variables.d.ts b/dist/components/assets/styles/variables.d.ts
index aeb07db..abf9e97 100644
--- a/dist/components/assets/styles/variables.d.ts
+++ b/dist/components/assets/styles/variables.d.ts
@@ -23,5 +23,7 @@ declare const vars: {
progressBar: string;
progressShadow: string;
switchShadow: string;
+ sidebarBg: string;
+ sidebarShadow: string;
};
export default vars;
diff --git a/dist/index.d.ts b/dist/index.d.ts
index 95e4a32..66b0fd1 100644
--- a/dist/index.d.ts
+++ b/dist/index.d.ts
@@ -1,4 +1,3 @@
-///
import { MetaNode } from './models/MetaNode';
import { MetaLink } from './models/MetaLink';
import { ComponentsMap } from './models/ComponentsMap';
@@ -9,8 +8,12 @@ interface MetaDiagramProps {
componentsMap: ComponentsMap;
wrapperClassName?: string;
canvasClassName?: string;
+ metaTheme: {
+ customThemeVariables: {};
+ canvasClassName: string;
+ };
}
-declare const MetaDiagram: ({ metaNodes, metaLinks, componentsMap, wrapperClassName, canvasClassName, }: MetaDiagramProps) => JSX.Element;
+declare const MetaDiagram: ({ metaNodes, metaLinks, componentsMap, wrapperClassName, metaTheme, }: MetaDiagramProps) => JSX.Element;
export default MetaDiagram;
export { MetaNode, MetaLink, MetaNodeModel, ComponentsMap };
export { MetaLinkModel } from './react-diagrams/MetaLinkModel';
diff --git a/dist/meta-diagram.cjs.development.js b/dist/meta-diagram.cjs.development.js
index d596043..f8be34f 100644
--- a/dist/meta-diagram.cjs.development.js
+++ b/dist/meta-diagram.cjs.development.js
@@ -12,6 +12,8 @@ var reactCanvasCore = require('@projectstorm/react-canvas-core');
var styles = require('@mui/styles');
var system = require('@mui/system');
var material = require('@mui/material');
+var styles$1 = require('@mui/material/styles');
+var CssBaseline = _interopDefault(require('@mui/material/CssBaseline'));
class MetaOptions {
constructor(id, name, shape, options) {
@@ -214,7 +216,10 @@ const vars = {
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)'
+ switchShadow: '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',
+ sidebarBg: '#ffffff',
+ sidebarShadow: `0 0 3.75rem rgba(0, 0, 0, 0.1),
+ 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)`
};
var Move = "";
@@ -300,6 +305,235 @@ const Sidebar = () => {
})))));
};
+const applicationTheme = params => {
+ const {
+ primaryBg,
+ fontFamily,
+ chipTextColor,
+ chipBgColor,
+ textWhite,
+ listItemActiveBg,
+ listSelectedTextColor,
+ listBoxShadow,
+ listBorderColor,
+ sidebarBg,
+ sidebarShadow
+ } = params;
+ return {
+ components: {
+ MuiCssBaseline: {
+ styleOverrides: `
+ html {
+ background: ${primaryBg};
+ font-family: ${fontFamily};
+ }
+ body {
+ background-color:${primaryBg};
+ font-family: ${fontFamily};
+ font-size: 1rem;
+ }
+ .sidebar {
+ z-index: 5;
+ width: 4rem;
+ background: ${sidebarBg};
+ box-shadow: ${sidebarShadow};
+ border-radius: 2rem;
+ position: fixed;
+ left: 1rem;
+ top: 50%;
+ transform: translateY(-50%);
+ }
+
+ .sidebar.right {
+ left: auto;
+ right: 1rem;
+ }
+
+ .sidebar .MuiList-root {
+ padding: 0.75rem
+ }
+
+ .canvas-widget {
+ height: 100%;
+ width: 100%;
+ background-color: #fff;
+ }
+
+ .node {
+ border: solid 0.0625rem;
+ border-radius: 50%;
+ width: 10rem;
+ height: 10rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ position: relative;
+ }
+
+ .node img {
+ margin-bottom: 0.25rem
+ }
+
+ .node p {
+ font-weight: 500;
+ font-size: 0.8125rem;
+ line-height: 1.25rem;
+ letter-spacing: -0.005rem;
+ margin: 0;
+ }
+
+ .node-button.MuiButton-root {
+ background-color: #161A1E;
+ border-radius: 1.125rem;
+ font-weight: 600;
+ font-size: 0.8125rem;
+ display: flex;
+ line-height: 1rem;
+ letter-spacing: -0.025625rem;
+ color: rgba(255, 255, 255, 0.8);
+ margin: 0 !important;
+ width: 9.625rem;
+ padding: 0;
+ height: 2.25rem;
+ position: absolute;
+ top: -2.625rem;
+ font-family: ${fontFamily};
+ text-transform: none;
+ left: 50%;
+ transform: translateX(-50%);
+ }
+
+ .node-button.MuiButton-root:hover {
+ background-color: #161A1E;
+ }
+
+ .node-button .icon {
+ width: 1rem;
+ border: solid 0.0625rem;
+ height: 1rem;
+ border-radius: 50%;
+ margin-right: 1.25rem;
+ position: relative;
+ }
+
+ .node-button .icon:after {
+ content: "";
+ height: 1.75rem;
+ width: 0.0625rem;
+ display: block;
+ position: absolute;
+ right: -0.625rem;
+ top: 50%;
+ transform: translateY(-50%);
+ background-color: rgba(255, 255, 255, 0.2);
+ }
+
+ .nodes {
+ width: 10rem;
+ height: 10rem;
+ border: 0.09375rem solid #18A0FB;
+ z-index: 99999;
+ position: absolute;
+ }
+
+ .node .pointer {
+ width: 0.625rem;
+ height: 0.625rem;
+ background: #FFFFFF;
+ border: 0.09375rem solid #18A0FB;
+ border-radius: 0.125rem;
+ position: absolute;
+ }
+ `
+ },
+ MuiList: {
+ styleOverrides: {
+ root: {
+ '&.customSwitch': {
+ padding: '0.125rem',
+ background: chipTextColor,
+ 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: textWhite,
+ boxShadow: listBoxShadow,
+ border: `0.03125rem solid ${listBorderColor}`,
+ '& .MuiTypography-root': {
+ color: listSelectedTextColor
+ }
+ }
+ },
+ '& .MuiChip-root': {
+ marginLeft: '0.25rem'
+ },
+ '& .MuiTypography-root': {
+ fontWeight: 500,
+ fontSize: '0.8125rem',
+ lineHeight: '1.25rem',
+ letterSpacing: '-0.005rem',
+ color: chipBgColor,
+ margin: 0
+ }
+ }
+ }
+ }
+ },
+ MuiListItemIcon: {
+ styleOverrides: {
+ root: {
+ minWidth: 'inherit'
+ }
+ }
+ },
+ MuiListItemButton: {
+ styleOverrides: {
+ root: {
+ padding: 0,
+ width: '2.5rem',
+ height: '2.5rem',
+ borderRadius: '50%',
+ justifyContent: 'center',
+ backgroundColor: chipTextColor,
+ '&:hover': {
+ backgroundColor: chipTextColor
+ },
+ '&:not(:last-child)': {
+ marginBottom: '0.75rem'
+ },
+ '&.Mui-selected': {
+ backgroundColor: listItemActiveBg,
+ '&:hover': {
+ backgroundColor: listItemActiveBg
+ }
+ },
+ '&.Mui-disabled': {
+ opacity: 0.8
+ }
+ }
+ }
+ }
+ }
+ };
+};
+
+var theme = (customVariables => applicationTheme({ ...vars,
+ ...customVariables
+}));
+
class Position {
constructor(x, y) {
this.x = x;
@@ -316,7 +550,7 @@ const useStyles$1 = /*#__PURE__*/styles.makeStyles(_ => ({
canvasContainer: {
height: '100%',
width: '100%',
- background: '#333333'
+ background: '#fffff'
}
}));
@@ -325,7 +559,7 @@ const MetaDiagram = ({
metaLinks,
componentsMap,
wrapperClassName,
- canvasClassName
+ metaTheme
}) => {
const classes = useStyles$1(); // set up the diagram engine
@@ -343,13 +577,14 @@ const MetaDiagram = ({
engine.setModel(model);
const containerClassName = wrapperClassName ? wrapperClassName : classes.container;
- const diagramClassName = canvasClassName ? canvasClassName : classes.canvasContainer;
- return React.createElement("div", {
+ return React.createElement(styles$1.ThemeProvider, {
+ theme: styles$1.createTheme(theme(metaTheme == null ? void 0 : metaTheme.customThemeVariables))
+ }, React.createElement(CssBaseline, null), React.createElement(material.Box, {
className: containerClassName
}, React.createElement(Sidebar, null), React.createElement(reactCanvasCore.CanvasWidget, {
- className: diagramClassName,
+ className: `canvas-widget ${metaTheme == null ? void 0 : metaTheme.canvasClassName}`,
engine: engine
- }));
+ })));
};
exports.ComponentsMap = ComponentsMap;
diff --git a/dist/meta-diagram.cjs.development.js.map b/dist/meta-diagram.cjs.development.js.map
index 6e2df89..b22f930 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/models/MetaOptions.ts","../src/models/MetaNode.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/constants.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/models/Position.ts","../src/index.tsx"],"sourcesContent":["import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","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","export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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","export class Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\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';\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#333333',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n canvasClassName,\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n const diagramClassName = canvasClassName\n ? canvasClassName\n : classes.canvasContainer;\n return (\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":["MetaOptions","constructor","id","name","shape","options","set","getId","get","getShape","MetaNode","position","children","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","ReactDiagramMetaTypes","MetaNodeModel","NodeModel","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","getNode","find","n","getLinkModel","metaLink","link","Object","fromEntries","source","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","Position","x","y","_","container","height","canvasContainer","MetaDiagram","metaNodes","metaLinks","wrapperClassName","canvasClassName","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","ml","filter","mlm","addAll","setModel","containerClassName","diagramClassName","CanvasWidget"],"mappings":";;;;;;;;;;;;;;;MAGaA;EAGXC,YACEC,IACAC,MACAC,OACAC;IAEA,KAAKA,OAAL,GAAeA,OAAf;IACA,KAAKA,OAAL,CAAaC,GAAb,CAAiB,IAAjB,EAAuBJ,EAAvB;IACA,KAAKG,OAAL,CAAaC,GAAb,CAAiB,MAAjB,EAAyBH,IAAzB;IACA,KAAKE,OAAL,CAAaC,GAAb,CAAiB,OAAjB,EAA0BF,KAA1B;;;EAGFG,KAAK;IACH,OAAO,KAAKF,OAAL,CAAaG,GAAb,CAAiB,IAAjB,CAAP;;;EAGFC,QAAQ;IACN,OAAO,KAAKJ,OAAL,CAAaG,GAAb,CAAi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pBQ,GADW,CACPE,EAAE,IAAI9F,YAAY,CAAC8F,EAAD,EAAKhI,KAAL,CADX,EAEXiI,MAFW,CAEJC,GAAG,IAAIA,GAAG,KAAKtF,SAFX,CAAd;;EAIAzB,KAAK,CAACgH,MAAN,CAAa,GAAGnI,KAAhB,EAAuB,GAAGC,KAA1B;;EAGAoB,MAAM,CAAC+G,QAAP,CAAgBjH,KAAhB;EAEA,MAAMkH,kBAAkB,GAAGd,gBAAgB,GACvCA,gBADuC,GAEvC7B,OAAO,CAACuB,SAFZ;EAGA,MAAMqB,gBAAgB,GAAGd,eAAe,GACpCA,eADoC,GAEpC9B,OAAO,CAACyB,eAFZ;EAGA,OACExG,mBAAA,MAAA;IAAKiF,SAAS,EAAEyC;GAAhB,EACE1H,mBAAA,CAAC8E,OAAD,MAAA,CADF,EAEE9E,mBAAA,CAAC4H,4BAAD;IAAc3C,SAAS,EAAE0C;IAAkBjH,MAAM,EAAEA;GAAnD,CAFF,CADF;AAMD,CAjDD;;;;;;;;;;"}
\ No newline at end of file
+{"version":3,"file":"meta-diagram.cjs.development.js","sources":["../src/models/MetaOptions.ts","../src/models/MetaNode.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/constants.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Position.ts","../src/index.tsx"],"sourcesContent":["import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","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","export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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 sidebarBg: '#ffffff',\n sidebarShadow: `0 0 3.75rem rgba(0, 0, 0, 0.1),\n 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)`,\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 sidebarBg,\n sidebarShadow,\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 .sidebar {\n z-index: 5;\n width: 4rem;\n background: ${sidebarBg};\n box-shadow: ${sidebarShadow};\n border-radius: 2rem;\n position: fixed;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .sidebar.right {\n left: auto;\n right: 1rem;\n }\n\n .sidebar .MuiList-root {\n padding: 0.75rem\n }\n\n .canvas-widget {\n height: 100%;\n width: 100%;\n background-color: #fff;\n }\n\n .node {\n border: solid 0.0625rem;\n border-radius: 50%;\n width: 10rem;\n height: 10rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n position: relative;\n }\n\n .node img {\n margin-bottom: 0.25rem\n }\n\n .node p {\n font-weight: 500;\n font-size: 0.8125rem;\n line-height: 1.25rem;\n letter-spacing: -0.005rem;\n margin: 0;\n }\n\n .node-button.MuiButton-root {\n background-color: #161A1E;\n border-radius: 1.125rem;\n font-weight: 600;\n font-size: 0.8125rem;\n display: flex;\n line-height: 1rem;\n letter-spacing: -0.025625rem;\n color: rgba(255, 255, 255, 0.8);\n margin: 0 !important;\n width: 9.625rem;\n padding: 0;\n height: 2.25rem;\n position: absolute;\n top: -2.625rem;\n font-family: ${fontFamily};\n text-transform: none;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .node-button.MuiButton-root:hover {\n background-color: #161A1E;\n }\n\n .node-button .icon {\n width: 1rem;\n border: solid 0.0625rem;\n height: 1rem;\n border-radius: 50%;\n margin-right: 1.25rem;\n position: relative;\n }\n\n .node-button .icon:after {\n content: \"\";\n height: 1.75rem;\n width: 0.0625rem;\n display: block;\n position: absolute;\n right: -0.625rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .nodes {\n width: 10rem;\n height: 10rem;\n border: 0.09375rem solid #18A0FB;\n z-index: 99999;\n position: absolute;\n }\n\n .node .pointer {\n width: 0.625rem;\n height: 0.625rem;\n background: #FFFFFF;\n border: 0.09375rem solid #18A0FB;\n border-radius: 0.125rem;\n position: absolute;\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 Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\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';\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\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":["MetaOptions","constructor","id","name","shape","options","set","getId","get","getShape","MetaNode","position","children","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","ReactDiagramMetaTypes","MetaNodeModel","NodeModel","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","getNode","find","n","getLinkModel","metaLink","link","Object","fromEntries","source","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","sidebarBg","sidebarShadow","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","Position","x","y","_","container","canvasContainer","MetaDiagram","metaNodes","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","ml","filter","mlm","addAll","setModel","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;;;;;;;;;MAGaA;EAGXC,YACEC,IACAC,MACAC,OACAC;IAEA,KAAKA,OAAL,GAAeA,OAAf;IACA,KAAKA,OAAL,CAAaC,GAAb,CAAiB,IAAjB,EAAuBJ,EAAvB;IACA,KAAKG,OAAL,CAAaC,GAAb,CAAiB,MAAjB,EAAyBH,IAAzB;IACA,KAAKE,OAAL,CAAaC,GAAb,CAAiB,OAAjB,EAA0BF,KAA1B;;;EAGFG,KAAK;IACH,OAAO,KAAKF,OAAL,CAAaG,GAAb,CAAiB,IAAjB,CAAP;;;EAGFC,QAAQ;IACN,OAAO,KAAKJ,OAAL,CAAaG,GAAb,CAAiB,OAAjB,CAAP;;;;;MCpBSE;EAIXT,YACEC,IACAC,MACAC,OACAO,UACAN;IAEA,KAAKO,QAAL,GAAgB,EAAhB;IACAP,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBK,QAAxB;IACA,KAAKN,OAAL,GAAe,IAAIL,WAAJ,CAAgBE,EAAhB,EAAoBC,IAApB,EAA0BC,KAA1B,EAAiCC,OAAjC,CAAf;;;;;MCbSQ;EAOXZ,YACEC,IACAC,MACAC,OACAU,UACAC,cACAC,UACAC,cACAZ;IAEA,KAAKS,QAAL,GAAgBA,QAAhB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,QAAL,GAAgBA,QAAhB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKZ,OAAL,GAAe,IAAIL,WAAJ,CAAgBE,EAAhB,EAAoBC,IAApB,EAA0BC,KAA1B,EAAiCC,OAAjC,CAAf;;;EAGFa,WAAW;IACT,OAAO,KAAKJ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S,GAAV,CACZC,EAAE,IAAI,IAAInJ,aAAJ,CAAkBkC,MAAM,CAACC,WAAP,CAAmBgH,EAAE,CAAC1K,OAAH,CAAWA,OAA9B,CAAlB,CADM,CAAd;EAGA,MAAMqB,KAAK,GAAG4I,SAAS,CACpBQ,GADW,CACPE,EAAE,IAAIrH,YAAY,CAACqH,EAAD,EAAKvJ,KAAL,CADX,EAEXwJ,MAFW,CAEJC,GAAG,IAAIA,GAAG,KAAK7G,SAFX,CAAd;;EAIAzB,KAAK,CAACuI,MAAN,CAAa,GAAG1J,KAAhB,EAAuB,GAAGC,KAA1B;;EAGAoB,MAAM,CAACsI,QAAP,CAAgBxI,KAAhB;EAEA,MAAMyI,kBAAkB,GAAGd,gBAAgB,GACvCA,gBADuC,GAEvClD,OAAO,CAAC6C,SAFZ;EAIA,OACE9H,mBAAA,CAACkJ,sBAAD;IAAeC,KAAK,EAAEC,oBAAW,CAACD,KAAK,CAACf,SAAD,oBAACA,SAAS,CAAEiB,oBAAZ,CAAN;GAAjC,EACErJ,mBAAA,CAACsJ,WAAD,MAAA,CADF,EAEEtJ,mBAAA,CAACkF,YAAD;IAAKC,SAAS,EAAE8D;GAAhB,EACEjJ,mBAAA,CAACgF,OAAD,MAAA,CADF,EAEEhF,mBAAA,CAACuJ,4BAAD;IACEpE,SAAS,mBAAmBiD,SAAjB,oBAAiBA,SAAS,CAAEoB;IACvC9I,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CArDD;;;;;;;;;;"}
\ 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 6d194b3..90d5858 100644
--- a/dist/meta-diagram.cjs.production.min.js
+++ b/dist/meta-diagram.cjs.production.min.js
@@ -1,2 +1,2 @@
-"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=require("react"),o=e(r),n=require("@projectstorm/react-diagrams"),i=e(n),s=require("@projectstorm/react-canvas-core"),a=require("@mui/styles"),l=require("@mui/system"),c=require("@mui/material");class d{constructor(e,t,r,o){this.options=o,this.options.set("id",e),this.options.set("name",t),this.options.set("shape",r)}getId(){return this.options.get("id")}getShape(){return this.options.get("shape")}}!function(e){e.META_NODE="meta-node-type",e.META_LINK="meta-link-type"}(t||(t={}));class m extends n.NodeModel{constructor(e={}){super({...e,type:t.META_NODE}),this.addPort(new n.DefaultPortModel({in:!0,name:"in"})),this.addPort(new n.DefaultPortModel({in:!1,name:"out"}))}}const C=()=>o.createElement("div",null,"Unknown Type");class g extends s.AbstractReactFactory{constructor(e){super(t.META_NODE),this.componentsMap=e}generateModel(){return new m}generateReactWidget(e){if(this.componentsMap.has(e.model.options.shape)){const t=this.componentsMap.get(e.model.options.shape);return o.createElement(t,{engine:this.engine,model:e.model})}return o.createElement(C,null)}}class p extends n.DefaultLinkModel{constructor(e={}){super({...e,type:t.META_LINK})}}class u extends n.DefaultLinkFactory{constructor(e){super(t.META_LINK),this.componentsMap=e}generateModel(){return new p}generateLinkSegment(e,t,r){var n;if(this.componentsMap.has(null==(n=e.getOptions())?void 0:n.shape)){const n=this.componentsMap.get(e.getOptions().shape);return o.createElement(n,{engine:this.engine,model:e,path:r,selected:t})}return o.createElement(C,null)}}function h(e,t){return t.find(t=>t.getOptions().id===e)}const{textWhite:f,dividerColor: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)"},v=a.makeStyles(()=>({root:{zIndex:"5",width:"4rem",background:f,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:w,width:"calc(100% - 1.5rem)",margin:"0 auto",border:"none",borderTop:"0.0625rem solid"},"& img":{display:"block",margin:"1rem 0"}}})),x=()=>{const e=v();return o.createElement(l.Box,{className:e.root+" left"},o.createElement(c.List,{disablePadding:!0,component:"nav"},o.createElement(c.ListItemButton,{selected:!0},o.createElement(c.ListItemIcon,null,o.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"icon"}))),o.createElement(c.ListItemButton,null,o.createElement(c.ListItemIcon,null,o.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"move"})))),o.createElement(l.Box,{className:e.node},o.createElement(c.Divider,null),o.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"node"}),o.createElement(c.Divider,null)),o.createElement(c.List,{disablePadding:!0,component:"nav"},o.createElement(c.ListItemButton,{disabled:!0},o.createElement(c.ListItemIcon,null,o.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"icon"}))),o.createElement(c.ListItemButton,null,o.createElement(c.ListItemIcon,null,o.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"fullscreen"})))))},M=a.makeStyles(e=>({container:{height:"100%",width:"100%"},canvasContainer:{height:"100%",width:"100%",background:"#333333"}}));exports.ComponentsMap=class{constructor(e,t){this.nodes=e,this.links=t}},exports.MetaLink=class{constructor(e,t,r,o,n,i,s,a){this.sourceId=o,this.sourcePortId=n,this.targetId=i,this.targetPortId=s,this.options=new d(e,t,r,a)}getSourceId(){return this.sourceId}getSourcePortId(){return this.sourcePortId}getTargetId(){return this.targetId}getTargetPortId(){return this.targetPortId}},exports.MetaLinkModel=p,exports.MetaNode=class{constructor(e,t,r,o,n){this.children=[],n.set("position",o),this.options=new d(e,t,r,n)}},exports.MetaNodeModel=m,exports.Position=class{constructor(e,t){this.x=e,this.y=t}},exports.default=({metaNodes:e,metaLinks:t,componentsMap:o,wrapperClassName:a,canvasClassName:l})=>{const c=M(),d=i();d.getNodeFactories().registerFactory(new g(o.nodes)),d.getLinkFactories().registerFactory(new u(o.links));const C=new n.DiagramModel,f=e.map(e=>new m(Object.fromEntries(e.options.options))),w=t.map(e=>function(e,t){const r=new p(Object.fromEntries(e.options.options)),o=h(e.getSourceId(),t),n=h(e.getTargetId(),t);if(o&&n)return r.setSourcePort(o.getPort(e.getSourcePortId())),r.setTargetPort(n.getPort(e.getTargetPortId())),r}(e,f)).filter(e=>void 0!==e);C.addAll(...f,...w),d.setModel(C);const v=l||c.canvasContainer;return r.createElement("div",{className:a||c.container},r.createElement(x,null),r.createElement(s.CanvasWidget,{className:v,engine:d}))};
+"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t,r=require("react"),n=e(r),o=require("@projectstorm/react-diagrams"),i=e(o),a=require("@projectstorm/react-canvas-core"),s=require("@mui/styles"),l=require("@mui/system"),d=require("@mui/material"),m=require("@mui/material/styles"),c=e(require("@mui/material/CssBaseline"));class g{constructor(e,t,r,n){this.options=n,this.options.set("id",e),this.options.set("name",t),this.options.set("shape",r)}getId(){return this.options.get("id")}getShape(){return this.options.get("shape")}}!function(e){e.META_NODE="meta-node-type",e.META_LINK="meta-link-type"}(t||(t={}));class u extends o.NodeModel{constructor(e={}){super({...e,type:t.META_NODE}),this.addPort(new o.DefaultPortModel({in:!0,name:"in"})),this.addPort(new o.DefaultPortModel({in:!1,name:"out"}))}}const h=()=>n.createElement("div",null,"Unknown Type");class C extends a.AbstractReactFactory{constructor(e){super(t.META_NODE),this.componentsMap=e}generateModel(){return new u}generateReactWidget(e){if(this.componentsMap.has(e.model.options.shape)){const t=this.componentsMap.get(e.model.options.shape);return n.createElement(t,{engine:this.engine,model:e.model})}return n.createElement(h,null)}}class p extends o.DefaultLinkModel{constructor(e={}){super({...e,type:t.META_LINK})}}class f extends o.DefaultLinkFactory{constructor(e){super(t.META_LINK),this.componentsMap=e}generateModel(){return new p}generateLinkSegment(e,t,r){var o;if(this.componentsMap.has(null==(o=e.getOptions())?void 0:o.shape)){const o=this.componentsMap.get(e.getOptions().shape);return n.createElement(o,{engine:this.engine,model:e,path:r,selected:t})}return n.createElement(h,null)}}function b(e,t){return t.find(t=>t.getOptions().id===e)}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)",sidebarBg:"#ffffff",sidebarShadow:"0 0 3.75rem rgba(0, 0, 0, 0.1),\n 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)"},{textWhite:x,dividerColor:v}=w,M=s.makeStyles(()=>({root:{zIndex:"5",width:"4rem",background:x,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:v,width:"calc(100% - 1.5rem)",margin:"0 auto",border:"none",borderTop:"0.0625rem solid"},"& img":{display:"block",margin:"1rem 0"}}})),y=()=>{const e=M();return n.createElement(l.Box,{className:e.root+" left"},n.createElement(d.List,{disablePadding:!0,component:"nav"},n.createElement(d.ListItemButton,{selected:!0},n.createElement(d.ListItemIcon,null,n.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"icon"}))),n.createElement(d.ListItemButton,null,n.createElement(d.ListItemIcon,null,n.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"move"})))),n.createElement(l.Box,{className:e.node},n.createElement(d.Divider,null),n.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"node"}),n.createElement(d.Divider,null)),n.createElement(d.List,{disablePadding:!0,component:"nav"},n.createElement(d.ListItemButton,{disabled:!0},n.createElement(d.ListItemIcon,null,n.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"icon"}))),n.createElement(d.ListItemButton,null,n.createElement(d.ListItemIcon,null,n.createElement("img",{src:"data:image/svg+xml;base64,"+new Buffer('').toString("base64"),alt:"fullscreen"})))))},B=s.makeStyles(e=>({container:{height:"100%",width:"100%"},canvasContainer:{height:"100%",width:"100%",background:"#fffff"}}));exports.ComponentsMap=class{constructor(e,t){this.nodes=e,this.links=t}},exports.MetaLink=class{constructor(e,t,r,n,o,i,a,s){this.sourceId=n,this.sourcePortId=o,this.targetId=i,this.targetPortId=a,this.options=new g(e,t,r,s)}getSourceId(){return this.sourceId}getSourcePortId(){return this.sourcePortId}getTargetId(){return this.targetId}getTargetPortId(){return this.targetPortId}},exports.MetaLinkModel=p,exports.MetaNode=class{constructor(e,t,r,n,o){this.children=[],o.set("position",n),this.options=new g(e,t,r,o)}},exports.MetaNodeModel=u,exports.Position=class{constructor(e,t){this.x=e,this.y=t}},exports.default=({metaNodes:e,metaLinks:t,componentsMap:n,wrapperClassName:s,metaTheme:l})=>{const g=B(),h=i();h.getNodeFactories().registerFactory(new C(n.nodes)),h.getLinkFactories().registerFactory(new f(n.links));const x=new o.DiagramModel,v=e.map(e=>new u(Object.fromEntries(e.options.options))),M=t.map(e=>function(e,t){const r=new p(Object.fromEntries(e.options.options)),n=b(e.getSourceId(),t),o=b(e.getTargetId(),t);if(n&&o)return r.setSourcePort(n.getPort(e.getSourcePortId())),r.setTargetPort(o.getPort(e.getTargetPortId())),r}(e,v)).filter(e=>void 0!==e);x.addAll(...v,...M),h.setModel(x);const E=s||g.container;return r.createElement(m.ThemeProvider,{theme:m.createTheme((L=null==l?void 0:l.customThemeVariables,(e=>{const{primaryBg:t,fontFamily:r,chipTextColor:n,chipBgColor:o,textWhite:i,listItemActiveBg:a,listSelectedTextColor:s,listBoxShadow:l,listBorderColor:d,sidebarBg:m,sidebarShadow:c}=e;return{components:{MuiCssBaseline:{styleOverrides:`\n html {\n background: ${t};\n font-family: ${r};\n }\n body {\n background-color:${t};\n font-family: ${r};\n font-size: 1rem;\n }\n .sidebar {\n z-index: 5;\n width: 4rem;\n background: ${m};\n box-shadow: ${c};\n border-radius: 2rem;\n position: fixed;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .sidebar.right {\n left: auto;\n right: 1rem;\n }\n\n .sidebar .MuiList-root {\n padding: 0.75rem\n }\n\n .canvas-widget {\n height: 100%;\n width: 100%;\n background-color: #fff;\n }\n\n .node {\n border: solid 0.0625rem;\n border-radius: 50%;\n width: 10rem;\n height: 10rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n position: relative;\n }\n\n .node img {\n margin-bottom: 0.25rem\n }\n\n .node p {\n font-weight: 500;\n font-size: 0.8125rem;\n line-height: 1.25rem;\n letter-spacing: -0.005rem;\n margin: 0;\n }\n\n .node-button.MuiButton-root {\n background-color: #161A1E;\n border-radius: 1.125rem;\n font-weight: 600;\n font-size: 0.8125rem;\n display: flex;\n line-height: 1rem;\n letter-spacing: -0.025625rem;\n color: rgba(255, 255, 255, 0.8);\n margin: 0 !important;\n width: 9.625rem;\n padding: 0;\n height: 2.25rem;\n position: absolute;\n top: -2.625rem;\n font-family: ${r};\n text-transform: none;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .node-button.MuiButton-root:hover {\n background-color: #161A1E;\n }\n\n .node-button .icon {\n width: 1rem;\n border: solid 0.0625rem;\n height: 1rem;\n border-radius: 50%;\n margin-right: 1.25rem;\n position: relative;\n }\n\n .node-button .icon:after {\n content: "";\n height: 1.75rem;\n width: 0.0625rem;\n display: block;\n position: absolute;\n right: -0.625rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .nodes {\n width: 10rem;\n height: 10rem;\n border: 0.09375rem solid #18A0FB;\n z-index: 99999;\n position: absolute;\n }\n\n .node .pointer {\n width: 0.625rem;\n height: 0.625rem;\n background: #FFFFFF;\n border: 0.09375rem solid #18A0FB;\n border-radius: 0.125rem;\n position: absolute;\n }\n `},MuiList:{styleOverrides:{root:{"&.customSwitch":{padding:"0.125rem",background:n,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:s}}},"& .MuiChip-root":{marginLeft:"0.25rem"},"& .MuiTypography-root":{fontWeight:500,fontSize:"0.8125rem",lineHeight:"1.25rem",letterSpacing:"-0.005rem",color:o,margin:0}}}}},MuiListItemIcon:{styleOverrides:{root:{minWidth:"inherit"}}},MuiListItemButton:{styleOverrides:{root:{padding:0,width:"2.5rem",height:"2.5rem",borderRadius:"50%",justifyContent:"center",backgroundColor:n,"&:hover":{backgroundColor:n},"&:not(:last-child)":{marginBottom:"0.75rem"},"&.Mui-selected":{backgroundColor:a,"&:hover":{backgroundColor:a}},"&.Mui-disabled":{opacity:.8}}}}}}})({...w,...L})))},r.createElement(c,null),r.createElement(d.Box,{className:E},r.createElement(y,null),r.createElement(a.CanvasWidget,{className:"canvas-widget "+(null==l?void 0:l.canvasClassName),engine:h})));var L};
//# 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 19addab..aa47725 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/MetaOptions.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/components/Sidebar.tsx","../src/components/assets/styles/variables.ts","../src/index.tsx","../src/models/ComponentsMap.ts","../src/models/MetaLink.ts","../src/models/MetaNode.ts","../src/models/Position.ts","../src/helpers/linksHelper.ts"],"sourcesContent":["export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\n}\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","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 * 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';\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#333333',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n canvasClassName,\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n const diagramClassName = canvasClassName\n ? canvasClassName\n : classes.canvasContainer;\n return (\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 { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","export class Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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"],"names":["ReactDiagramMetaTypes","MetaOptions","constructor","id","name","shape","options","this","set","getId","get","getShape","MetaNodeModel","NodeModel","super","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","_model$getOptions","getNode","nodes","find","n","textWhite","dividerColor","fontFamily","primaryBg","chipTextColor","chipBgColor","chipPrimaryTextColor","chipPrimaryBgColor","breadcrumbLinkColor","breadcrumbTextColor","buttonPrimaryBgColor","buttonPrimaryBgHoverColor","buttonPrimaryDisabledBgColor","listItemActiveBg","listSelectedTextColor","listBoxShadow","listBorderColor","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","_","container","height","canvasContainer","nodesMap","linksMap","links","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","children","x","y","metaNodes","metaLinks","wrapperClassName","canvasClassName","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","Object","fromEntries","ml","metaLink","link","source","target","setSourcePort","getPort","setTargetPort","getLinkModel","filter","mlm","undefined","addAll","setModel","diagramClassName","CanvasWidget"],"mappings":"8IAAYA,6MCGCC,EAGXC,YACEC,EACAC,EACAC,EACAC,GAEAC,KAAKD,QAAUA,EACfC,KAAKD,QAAQE,IAAI,KAAML,GACvBI,KAAKD,QAAQE,IAAI,OAAQJ,GACzBG,KAAKD,QAAQE,IAAI,QAASH,GAG5BI,QACE,OAAOF,KAAKD,QAAQI,IAAI,MAG1BC,WACE,OAAOJ,KAAKD,QAAQI,IAAI,WDvB5B,SAAYV,GACVA,6BACAA,6BAFF,CAAYA,IAAAA,aEGCY,UAAsBC,YACjCX,YAAYI,EAAU,IACpBQ,MAAM,IACDR,EACHS,KAAMf,EAAsBgB,YAK9BT,KAAKU,QACH,IAAIC,mBAAiB,CACnBC,IAAI,EACJf,KAAM,QAGVG,KAAKU,QACH,IAAIC,mBAAiB,CACnBC,IAAI,EACJf,KAAM,gBCnBDgB,EAAoB,IACxBC,iDCGIC,UAAwBC,uBAGnCrB,YAAYsB,GACVV,MAAMd,EAAsBgB,WAC5BT,KAAKiB,cAAgBA,EAGvBC,gBACE,OAAO,IAAIb,EAGbc,oBAAoBC,GAClB,GAAIpB,KAAKiB,cAAcI,IAAID,EAAME,MAAMvB,QAAQD,OAAQ,CACrD,MAAMyB,EAAqBvB,KAAKiB,cAAcd,IAC5CiB,EAAME,MAAMvB,QAAQD,OAGtB,OAAOgB,gBAACS,GAAmBC,OAAQxB,KAAKwB,OAAQF,MAAOF,EAAME,QAG/D,OAAOR,gBAACD,eCxBCY,UAAsBC,mBACjC/B,YAAYI,EAAU,IACpBQ,MAAM,IACDR,EACHS,KAAMf,EAAsBkC,mBCDrBC,UAAwBC,qBAGnClC,YAAYsB,GACVV,MAAMd,EAAsBkC,WAC5B3B,KAAKiB,cAAgBA,EAGvBC,gBACE,OAAO,IAAIO,EAGbK,oBACER,EACAS,EACAC,SAGA,GAAIhC,KAAKiB,cAAcI,aAAIC,EAA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EAAIA,EACTtH,KAAKuH,EAAIA,oBJ2BO,EAClBC,UAAAA,EACAC,UAAAA,EACAxG,cAAAA,EACAyG,iBAAAA,EACAC,gBAAAA,MAEA,MAAMnC,EAAUzB,IAGVvC,EAASoG,IAEfpG,EACGqG,mBAEAC,gBAAgB,IAAI/G,EAAgBE,EAAcmB,QAErDZ,EACGuG,mBAEAD,gBAAgB,IAAIlG,EAAgBX,EAAc2F,QAIrD,MAAMtF,EAAQ,IAAI0G,eACZ5F,EAAQoF,EAAUS,IACtBC,GAAM,IAAI7H,EAAc8H,OAAOC,YAAYF,EAAGnI,QAAQA,WAElD6G,EAAQa,EACXQ,IAAII,YKxDPC,EACAlG,GAEA,MAAMmG,EAAO,IAAI9G,EAAc0G,OAAOC,YAAYE,EAASvI,QAAQA,UAC7DyI,EAASrG,EAAQmG,EAASrB,cAAe7E,GACzCqG,EAAStG,EAAQmG,EAASnB,cAAe/E,GAC/C,GAAIoG,GAAUC,EAGZ,OAFAF,EAAKG,cAAcF,EAAOG,QAAQL,EAASpB,oBAC3CqB,EAAKK,cAAcH,EAAOE,QAAQL,EAASlB,oBACpCmB,EL+CIM,CAAaR,EAAIjG,IAC3B0G,OAAOC,QAAeC,IAARD,GAEjBzH,EAAM2H,UAAU7G,KAAUwE,GAG1BpF,EAAO0H,SAAS5H,GAEhB,MAGM6H,EAAmBxB,GAErBnC,EAAQiB,gBACZ,OACE3F,uBAAK4E,UAPoBgC,GAEvBlC,EAAQe,WAMRzF,gBAACyE,QACDzE,gBAACsI,gBAAa1D,UAAWyD,EAAkB3H,OAAQA"}
\ No newline at end of file
+{"version":3,"file":"meta-diagram.cjs.production.min.js","sources":["../src/constants.ts","../src/models/MetaOptions.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/index.tsx","../src/models/ComponentsMap.ts","../src/models/MetaLink.ts","../src/models/MetaNode.ts","../src/models/Position.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","import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\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 sidebarBg: '#ffffff',\n sidebarShadow: `0 0 3.75rem rgba(0, 0, 0, 0.1),\n 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)`,\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 * 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';\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\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 { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","export class Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\n }\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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 sidebarBg,\n sidebarShadow,\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 .sidebar {\n z-index: 5;\n width: 4rem;\n background: ${sidebarBg};\n box-shadow: ${sidebarShadow};\n border-radius: 2rem;\n position: fixed;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .sidebar.right {\n left: auto;\n right: 1rem;\n }\n\n .sidebar .MuiList-root {\n padding: 0.75rem\n }\n\n .canvas-widget {\n height: 100%;\n width: 100%;\n background-color: #fff;\n }\n\n .node {\n border: solid 0.0625rem;\n border-radius: 50%;\n width: 10rem;\n height: 10rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n position: relative;\n }\n\n .node img {\n margin-bottom: 0.25rem\n }\n\n .node p {\n font-weight: 500;\n font-size: 0.8125rem;\n line-height: 1.25rem;\n letter-spacing: -0.005rem;\n margin: 0;\n }\n\n .node-button.MuiButton-root {\n background-color: #161A1E;\n border-radius: 1.125rem;\n font-weight: 600;\n font-size: 0.8125rem;\n display: flex;\n line-height: 1rem;\n letter-spacing: -0.025625rem;\n color: rgba(255, 255, 255, 0.8);\n margin: 0 !important;\n width: 9.625rem;\n padding: 0;\n height: 2.25rem;\n position: absolute;\n top: -2.625rem;\n font-family: ${fontFamily};\n text-transform: none;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .node-button.MuiButton-root:hover {\n background-color: #161A1E;\n }\n\n .node-button .icon {\n width: 1rem;\n border: solid 0.0625rem;\n height: 1rem;\n border-radius: 50%;\n margin-right: 1.25rem;\n position: relative;\n }\n\n .node-button .icon:after {\n content: \"\";\n height: 1.75rem;\n width: 0.0625rem;\n display: block;\n position: absolute;\n right: -0.625rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .nodes {\n width: 10rem;\n height: 10rem;\n border: 0.09375rem solid #18A0FB;\n z-index: 99999;\n position: absolute;\n }\n\n .node .pointer {\n width: 0.625rem;\n height: 0.625rem;\n background: #FFFFFF;\n border: 0.09375rem solid #18A0FB;\n border-radius: 0.125rem;\n position: absolute;\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","MetaOptions","constructor","id","name","shape","options","this","set","getId","get","getShape","MetaNodeModel","NodeModel","super","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","_model$getOptions","getNode","nodes","find","n","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","sidebarBg","sidebarShadow","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","_","container","height","canvasContainer","nodesMap","linksMap","links","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","children","x","y","metaNodes","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","Object","fromEntries","ml","metaLink","link","source","target","setSourcePort","getPort","setTargetPort","getLinkModel","filter","mlm","undefined","addAll","setModel","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,yRCGCC,EAGXC,YACEC,EACAC,EACAC,EACAC,GAEAC,KAAKD,QAAUA,EACfC,KAAKD,QAAQE,IAAI,KAAML,GACvBI,KAAKD,QAAQE,IAAI,OAAQJ,GACzBG,KAAKD,QAAQE,IAAI,QAASH,GAG5BI,QACE,OAAOF,KAAKD,QAAQI,IAAI,MAG1BC,WACE,OAAOJ,KAAKD,QAAQI,IAAI,WDvB5B,SAAYV,GACVA,6BACAA,6BAFF,CAAYA,IAAAA,aEGCY,UAAsBC,YACjCX,YAAYI,EAAU,IACpBQ,MAAM,IACDR,EACHS,KAAMf,EAAsBgB,YAK9BT,KAAKU,QACH,IAAIC,mBAAiB,CACnBC,IAAI,EACJf,KAAM,QAGVG,KAAKU,QACH,IAAIC,mBAAiB,CACnBC,IAAI,EACJf,KAAM,gBCnBDgB,EAAoB,IACxBC,iDCGIC,UAAwBC,uBAGnCrB,YAAYsB,GACVV,MAAMd,EAAs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,aAAc,MACd2F,eAAgB,SAChBiB,gBAAiB1I,EACjB2I,UAAW,CACTD,gBAAiB1I,GAEnB0H,qBAAsB,CACpBC,aAAc,WAEhBG,iBAAkB,CAChBY,gBAAiBjI,EACjBkI,UAAW,CACTD,gBAAiBjI,IAGrBmH,iBAAkB,CAChBC,QAAS,UAUrBe,CAAiB,IACZhJ,KACAmH,ONtJD5I,gBAAC0K,QACD1K,gBAAC8E,OAAIC,UAAWyD,GACdxI,gBAAC4E,QACD5E,gBAAC2K,gBACC5F,kCAA4BiC,SAAAA,EAAW4D,iBACvClK,OAAQA,UM8IFkI"}
\ No newline at end of file
diff --git a/dist/meta-diagram.esm.js b/dist/meta-diagram.esm.js
index dc3c2d2..6959ae2 100644
--- a/dist/meta-diagram.esm.js
+++ b/dist/meta-diagram.esm.js
@@ -3,7 +3,9 @@ import createEngine, { NodeModel, DefaultPortModel, DefaultLinkModel, DefaultLin
import { AbstractReactFactory, CanvasWidget } from '@projectstorm/react-canvas-core';
import { makeStyles } from '@mui/styles';
import { Box } from '@mui/system';
-import { List, ListItemButton, ListItemIcon, Divider } from '@mui/material';
+import { List, ListItemButton, ListItemIcon, Divider, Box as Box$1 } from '@mui/material';
+import { ThemeProvider, createTheme } from '@mui/material/styles';
+import CssBaseline from '@mui/material/CssBaseline';
class MetaOptions {
constructor(id, name, shape, options) {
@@ -206,7 +208,10 @@ const vars = {
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)'
+ switchShadow: '0 0.1875rem 0.5rem rgba(0, 0, 0, 0.15), 0 0.1875rem 0.0625rem rgba(0, 0, 0, 0.06)',
+ sidebarBg: '#ffffff',
+ sidebarShadow: `0 0 3.75rem rgba(0, 0, 0, 0.1),
+ 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)`
};
var Move = "";
@@ -292,6 +297,235 @@ const Sidebar = () => {
})))));
};
+const applicationTheme = params => {
+ const {
+ primaryBg,
+ fontFamily,
+ chipTextColor,
+ chipBgColor,
+ textWhite,
+ listItemActiveBg,
+ listSelectedTextColor,
+ listBoxShadow,
+ listBorderColor,
+ sidebarBg,
+ sidebarShadow
+ } = params;
+ return {
+ components: {
+ MuiCssBaseline: {
+ styleOverrides: `
+ html {
+ background: ${primaryBg};
+ font-family: ${fontFamily};
+ }
+ body {
+ background-color:${primaryBg};
+ font-family: ${fontFamily};
+ font-size: 1rem;
+ }
+ .sidebar {
+ z-index: 5;
+ width: 4rem;
+ background: ${sidebarBg};
+ box-shadow: ${sidebarShadow};
+ border-radius: 2rem;
+ position: fixed;
+ left: 1rem;
+ top: 50%;
+ transform: translateY(-50%);
+ }
+
+ .sidebar.right {
+ left: auto;
+ right: 1rem;
+ }
+
+ .sidebar .MuiList-root {
+ padding: 0.75rem
+ }
+
+ .canvas-widget {
+ height: 100%;
+ width: 100%;
+ background-color: #fff;
+ }
+
+ .node {
+ border: solid 0.0625rem;
+ border-radius: 50%;
+ width: 10rem;
+ height: 10rem;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ position: relative;
+ }
+
+ .node img {
+ margin-bottom: 0.25rem
+ }
+
+ .node p {
+ font-weight: 500;
+ font-size: 0.8125rem;
+ line-height: 1.25rem;
+ letter-spacing: -0.005rem;
+ margin: 0;
+ }
+
+ .node-button.MuiButton-root {
+ background-color: #161A1E;
+ border-radius: 1.125rem;
+ font-weight: 600;
+ font-size: 0.8125rem;
+ display: flex;
+ line-height: 1rem;
+ letter-spacing: -0.025625rem;
+ color: rgba(255, 255, 255, 0.8);
+ margin: 0 !important;
+ width: 9.625rem;
+ padding: 0;
+ height: 2.25rem;
+ position: absolute;
+ top: -2.625rem;
+ font-family: ${fontFamily};
+ text-transform: none;
+ left: 50%;
+ transform: translateX(-50%);
+ }
+
+ .node-button.MuiButton-root:hover {
+ background-color: #161A1E;
+ }
+
+ .node-button .icon {
+ width: 1rem;
+ border: solid 0.0625rem;
+ height: 1rem;
+ border-radius: 50%;
+ margin-right: 1.25rem;
+ position: relative;
+ }
+
+ .node-button .icon:after {
+ content: "";
+ height: 1.75rem;
+ width: 0.0625rem;
+ display: block;
+ position: absolute;
+ right: -0.625rem;
+ top: 50%;
+ transform: translateY(-50%);
+ background-color: rgba(255, 255, 255, 0.2);
+ }
+
+ .nodes {
+ width: 10rem;
+ height: 10rem;
+ border: 0.09375rem solid #18A0FB;
+ z-index: 99999;
+ position: absolute;
+ }
+
+ .node .pointer {
+ width: 0.625rem;
+ height: 0.625rem;
+ background: #FFFFFF;
+ border: 0.09375rem solid #18A0FB;
+ border-radius: 0.125rem;
+ position: absolute;
+ }
+ `
+ },
+ MuiList: {
+ styleOverrides: {
+ root: {
+ '&.customSwitch': {
+ padding: '0.125rem',
+ background: chipTextColor,
+ 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: textWhite,
+ boxShadow: listBoxShadow,
+ border: `0.03125rem solid ${listBorderColor}`,
+ '& .MuiTypography-root': {
+ color: listSelectedTextColor
+ }
+ }
+ },
+ '& .MuiChip-root': {
+ marginLeft: '0.25rem'
+ },
+ '& .MuiTypography-root': {
+ fontWeight: 500,
+ fontSize: '0.8125rem',
+ lineHeight: '1.25rem',
+ letterSpacing: '-0.005rem',
+ color: chipBgColor,
+ margin: 0
+ }
+ }
+ }
+ }
+ },
+ MuiListItemIcon: {
+ styleOverrides: {
+ root: {
+ minWidth: 'inherit'
+ }
+ }
+ },
+ MuiListItemButton: {
+ styleOverrides: {
+ root: {
+ padding: 0,
+ width: '2.5rem',
+ height: '2.5rem',
+ borderRadius: '50%',
+ justifyContent: 'center',
+ backgroundColor: chipTextColor,
+ '&:hover': {
+ backgroundColor: chipTextColor
+ },
+ '&:not(:last-child)': {
+ marginBottom: '0.75rem'
+ },
+ '&.Mui-selected': {
+ backgroundColor: listItemActiveBg,
+ '&:hover': {
+ backgroundColor: listItemActiveBg
+ }
+ },
+ '&.Mui-disabled': {
+ opacity: 0.8
+ }
+ }
+ }
+ }
+ }
+ };
+};
+
+var theme = (customVariables => applicationTheme({ ...vars,
+ ...customVariables
+}));
+
class Position {
constructor(x, y) {
this.x = x;
@@ -308,7 +542,7 @@ const useStyles$1 = /*#__PURE__*/makeStyles(_ => ({
canvasContainer: {
height: '100%',
width: '100%',
- background: '#333333'
+ background: '#fffff'
}
}));
@@ -317,7 +551,7 @@ const MetaDiagram = ({
metaLinks,
componentsMap,
wrapperClassName,
- canvasClassName
+ metaTheme
}) => {
const classes = useStyles$1(); // set up the diagram engine
@@ -335,13 +569,14 @@ const MetaDiagram = ({
engine.setModel(model);
const containerClassName = wrapperClassName ? wrapperClassName : classes.container;
- const diagramClassName = canvasClassName ? canvasClassName : classes.canvasContainer;
- return createElement("div", {
+ return createElement(ThemeProvider, {
+ theme: createTheme(theme(metaTheme == null ? void 0 : metaTheme.customThemeVariables))
+ }, createElement(CssBaseline, null), createElement(Box$1, {
className: containerClassName
}, createElement(Sidebar, null), createElement(CanvasWidget, {
- className: diagramClassName,
+ className: `canvas-widget ${metaTheme == null ? void 0 : metaTheme.canvasClassName}`,
engine: engine
- }));
+ })));
};
export default MetaDiagram;
diff --git a/dist/meta-diagram.esm.js.map b/dist/meta-diagram.esm.js.map
index 948e9fd..a7d9841 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/models/MetaOptions.ts","../src/models/MetaNode.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/constants.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/models/Position.ts","../src/index.tsx"],"sourcesContent":["import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","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","export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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","export class Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\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';\n\nconst useStyles = makeStyles(_ => ({\n container: {\n height: '100%',\n width: '100%',\n },\n canvasContainer: {\n height: '100%',\n width: '100%',\n background: '#333333',\n },\n}));\n\ninterface MetaDiagramProps {\n metaNodes: MetaNode[];\n metaLinks: MetaLink[];\n componentsMap: ComponentsMap;\n wrapperClassName?: string;\n canvasClassName?: string;\n}\n\nconst MetaDiagram = ({\n metaNodes,\n metaLinks,\n componentsMap,\n wrapperClassName,\n canvasClassName,\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\n\n const containerClassName = wrapperClassName\n ? wrapperClassName\n : classes.container;\n const diagramClassName = canvasClassName\n ? canvasClassName\n : classes.canvasContainer;\n return (\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":["MetaOptions","constructor","id","name","shape","options","set","getId","get","getShape","MetaNode","position","children","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","ReactDiagramMetaTypes","MetaNodeModel","NodeModel","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","getNode","find","n","getLinkModel","metaLink","link","Object","fromEntries","source","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","Position","x","y","_","container","height","canvasContainer","MetaDiagram","metaNodes","metaLinks","wrapperClassName","canvasClassName","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","ml","filter","mlm","addAll","setModel","containerClassName","diagramClassName","CanvasWidget"],"mappings":";;;;;;;MAGaA;EAGXC,YACEC,IACAC,MACAC,OACAC;IAEA,KAAKA,OAAL,GAAeA,OAAf;IACA,KAAKA,OAAL,CAAaC,GAAb,CAAiB,IAAjB,EAAuBJ,EAAvB;IACA,KAAKG,OAAL,CAAaC,GAAb,CAAiB,MAAjB,EAAyBH,IAAzB;IACA,KAAKE,OAAL,CAAaC,GAAb,CAAiB,OAAjB,EAA0BF,KAA1B;;;EAGFG,KAAK;IACH,OAAO,KAAKF,OAAL,CAAaG,GAAb,CAAiB,IAAjB,CAAP;;;EAGFC,QAAQ;IACN,OAAO,KAAKJ,OAAL,CAAaG,GAAb,CAAiB,OAAjB,CAAP;;;;;MCpBSE;EAIXT,YACEC,IACAC,MACAC,OACAO,UACAN;IAEA,KAAKO,QAAL,GAAgB,EAAhB;IACAP,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBK,QAAxB;IACA,KAAKN,OAAL,GAAe,IAAIL,WAAJ,CAAgBE,EAAhB,EAAoBC,IAApB,EAA0BC,KAA1B,EAAiCC,OAAjC,CAAf;;;;;MCbSQ;EAOXZ,YACEC,IACAC,MACAC,OACAU,UACAC,cACAC,UACAC,cACAZ;IAEA,KAAKS,QAAL,GAAgBA,QAAhB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,QAAL,GAAgBA,QAAhB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKZ,OAAL,GAAe,IAAIL,WAAJ,CAAgBE,EAAhB,EAAoBC,IAApB,EAA0BC,KAA1B,EAAiCC,OAAjC,CAAf;;;EAGFa,WAAW;IACT,OAAO,KAAKJ,QAAZ;;;EAGFK,eAAe;IACb,OAAO,KAAKJ,YAAZ;;;EAGFK,WAAW;IACT,OAAO,KAAKJ,QAAZ;;;EAGFK,eAA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AS,EAAzB;;EAGA,MAAMjD,MAAM,GAAGoG,YAAY,EAA3B;EAEApG,MAAM,CACHqG,gBADH;GAGGC,eAHH,CAGmB,IAAI/G,eAAJ,CAAoBE,aAAa,CAACd,KAAlC,CAHnB;EAKAqB,MAAM,CACHuG,gBADH;GAGGD,eAHH,CAGmB,IAAIlG,eAAJ,CAAoBX,aAAa,CAACb,KAAlC,CAHnB;;EAOA,MAAMkB,KAAK,GAAG,IAAI0G,YAAJ,EAAd;EACA,MAAM7H,KAAK,GAAGqH,SAAS,CAACS,GAAV,CACZC,EAAE,IAAI,IAAI5H,aAAJ,CAAkBkC,MAAM,CAACC,WAAP,CAAmByF,EAAE,CAACnJ,OAAH,CAAWA,OAA9B,CAAlB,CADM,CAAd;EAGA,MAAMqB,KAAK,GAAGqH,SAAS,CACpBQ,GADW,CACPE,EAAE,IAAI9F,YAAY,CAAC8F,EAAD,EAAKhI,KAAL,CADX,EAEXiI,MAFW,CAEJC,GAAG,IAAIA,GAAG,KAAKtF,SAFX,CAAd;;EAIAzB,KAAK,CAACgH,MAAN,CAAa,GAAGnI,KAAhB,EAAuB,GAAGC,KAA1B;;EAGAoB,MAAM,CAAC+G,QAAP,CAAgBjH,KAAhB;EAEA,MAAMkH,kBAAkB,GAAGd,gBAAgB,GACvCA,gBADuC,GAEvC7B,OAAO,CAACuB,SAFZ;EAGA,MAAMqB,gBAAgB,GAAGd,eAAe,GACpCA,eADoC,GAEpC9B,OAAO,CAACyB,eAFZ;EAGA,OACExG,aAAA,MAAA;IAAKiF,SAAS,EAAEyC;GAAhB,EACE1H,aAAA,CAAC8E,OAAD,MAAA,CADF,EAEE9E,aAAA,CAAC4H,YAAD;IAAc3C,SAAS,EAAE0C;IAAkBjH,MAAM,EAAEA;GAAnD,CAFF,CADF;AAMD,CAjDD;;;;;"}
\ No newline at end of file
+{"version":3,"file":"meta-diagram.esm.js","sources":["../src/models/MetaOptions.ts","../src/models/MetaNode.ts","../src/models/MetaLink.ts","../src/models/ComponentsMap.ts","../src/constants.ts","../src/react-diagrams/MetaNodeModel.ts","../src/components/UnknownTypeWidget.tsx","../src/react-diagrams/MetaNodeFactory.tsx","../src/react-diagrams/MetaLinkModel.ts","../src/react-diagrams/MetaLinkFactory.tsx","../src/helpers/nodesHelper.ts","../src/helpers/linksHelper.ts","../src/components/assets/styles/variables.ts","../src/components/Sidebar.tsx","../src/theme.ts","../src/models/Position.ts","../src/index.tsx"],"sourcesContent":["import { IShape } from './IShape';\nimport { IId } from './IId';\n\nexport class MetaOptions implements IShape, IId {\n options: Map;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n options: Map\n ) {\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 getId(): string {\n return this.options.get('id');\n }\n\n getShape(): string {\n return this.options.get('shape');\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { Position } from './Position';\n\nexport class MetaNode {\n children: MetaNode[];\n options: MetaOptions;\n\n constructor(\n id: string,\n name: string,\n shape: string,\n position: Position,\n options: Map\n ) {\n this.children = [];\n options.set('position', position);\n this.options = new MetaOptions(id, name, shape, options);\n }\n}\n","import { MetaOptions } from './MetaOptions';\nimport { ILink } from './ILink';\n\nexport class MetaLink implements ILink {\n sourceId: string;\n sourcePortId: string;\n targetId: string;\n targetPortId: string;\n options: MetaOptions;\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 = new MetaOptions(id, name, shape, options);\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","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","export enum ReactDiagramMetaTypes {\n META_NODE = 'meta-node-type',\n META_LINK = 'meta-link-type',\n}\n","import { DefaultPortModel, NodeModel } from '@projectstorm/react-diagrams';\nimport { ReactDiagramMetaTypes } from '../constants';\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","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 // @ts-ignore\n return ;\n }\n // TODO: Generate default node instead\n return ;\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 { 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 { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\n\nexport function getNode(\n id: string,\n nodes: MetaNodeModel[]\n): MetaNodeModel | undefined {\n return nodes.find(n => n.getOptions().id === id);\n}\n","import { MetaLink } from '../models/MetaLink';\nimport { MetaLinkModel } from '../react-diagrams/MetaLinkModel';\nimport { MetaNodeModel } from '../react-diagrams/MetaNodeModel';\nimport { getNode } from './nodesHelper';\n\nexport function getLinkModel(\n metaLink: MetaLink,\n nodes: MetaNodeModel[]\n): MetaLinkModel | undefined {\n const link = new MetaLinkModel(Object.fromEntries(metaLink.options.options));\n const source = getNode(metaLink.getSourceId(), nodes);\n const target = getNode(metaLink.getTargetId(), nodes);\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 sidebarBg: '#ffffff',\n sidebarShadow: `0 0 3.75rem rgba(0, 0, 0, 0.1),\n 0 0.5rem 2.5rem -0.625rem rgba(0, 0, 0, 0.1)`,\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 sidebarBg,\n sidebarShadow,\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 .sidebar {\n z-index: 5;\n width: 4rem;\n background: ${sidebarBg};\n box-shadow: ${sidebarShadow};\n border-radius: 2rem;\n position: fixed;\n left: 1rem;\n top: 50%;\n transform: translateY(-50%);\n }\n\n .sidebar.right {\n left: auto;\n right: 1rem;\n }\n\n .sidebar .MuiList-root {\n padding: 0.75rem\n }\n\n .canvas-widget {\n height: 100%;\n width: 100%;\n background-color: #fff;\n }\n\n .node {\n border: solid 0.0625rem;\n border-radius: 50%;\n width: 10rem;\n height: 10rem;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n position: relative;\n }\n\n .node img {\n margin-bottom: 0.25rem\n }\n\n .node p {\n font-weight: 500;\n font-size: 0.8125rem;\n line-height: 1.25rem;\n letter-spacing: -0.005rem;\n margin: 0;\n }\n\n .node-button.MuiButton-root {\n background-color: #161A1E;\n border-radius: 1.125rem;\n font-weight: 600;\n font-size: 0.8125rem;\n display: flex;\n line-height: 1rem;\n letter-spacing: -0.025625rem;\n color: rgba(255, 255, 255, 0.8);\n margin: 0 !important;\n width: 9.625rem;\n padding: 0;\n height: 2.25rem;\n position: absolute;\n top: -2.625rem;\n font-family: ${fontFamily};\n text-transform: none;\n left: 50%;\n transform: translateX(-50%);\n }\n\n .node-button.MuiButton-root:hover {\n background-color: #161A1E;\n }\n\n .node-button .icon {\n width: 1rem;\n border: solid 0.0625rem;\n height: 1rem;\n border-radius: 50%;\n margin-right: 1.25rem;\n position: relative;\n }\n\n .node-button .icon:after {\n content: \"\";\n height: 1.75rem;\n width: 0.0625rem;\n display: block;\n position: absolute;\n right: -0.625rem;\n top: 50%;\n transform: translateY(-50%);\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .nodes {\n width: 10rem;\n height: 10rem;\n border: 0.09375rem solid #18A0FB;\n z-index: 99999;\n position: absolute;\n }\n\n .node .pointer {\n width: 0.625rem;\n height: 0.625rem;\n background: #FFFFFF;\n border: 0.09375rem solid #18A0FB;\n border-radius: 0.125rem;\n position: absolute;\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 Position {\n x: number;\n y: number;\n\n constructor(x: number, y: number) {\n this.x = x;\n this.y = y;\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';\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 // set up the diagram model\n\n const model = new DiagramModel();\n const nodes = metaNodes.map(\n mn => new MetaNodeModel(Object.fromEntries(mn.options.options))\n );\n const links = metaLinks\n .map(ml => getLinkModel(ml, nodes))\n .filter(mlm => mlm !== undefined);\n // @ts-ignore\n model.addAll(...nodes, ...links);\n\n // load model into engine\n engine.setModel(model);\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":["MetaOptions","constructor","id","name","shape","options","set","getId","get","getShape","MetaNode","position","children","MetaLink","sourceId","sourcePortId","targetId","targetPortId","getSourceId","getSourcePortId","getTargetId","getTargetPortId","ComponentsMap","nodesMap","linksMap","nodes","links","ReactDiagramMetaTypes","MetaNodeModel","NodeModel","type","META_NODE","addPort","DefaultPortModel","in","UnknownTypeWidget","React","MetaNodeFactory","AbstractReactFactory","componentsMap","generateModel","generateReactWidget","event","has","model","ReactComponentType","engine","MetaLinkModel","DefaultLinkModel","META_LINK","MetaLinkFactory","DefaultLinkFactory","generateLinkSegment","selected","path","getOptions","getNode","find","n","getLinkModel","metaLink","link","Object","fromEntries","source","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","sidebarBg","sidebarShadow","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","Position","x","y","_","container","canvasContainer","MetaDiagram","metaNodes","metaLinks","wrapperClassName","metaTheme","createEngine","getNodeFactories","registerFactory","getLinkFactories","DiagramModel","map","mn","ml","filter","mlm","addAll","setModel","containerClassName","ThemeProvider","theme","createTheme","customThemeVariables","CssBaseline","CanvasWidget","canvasClassName"],"mappings":";;;;;;;;;MAGaA;EAGXC,YACEC,IACAC,MACAC,OACAC;IAEA,KAAKA,OAAL,GAAeA,OAAf;IACA,KAAKA,OAAL,CAAaC,GAAb,CAAiB,IAAjB,EAAuBJ,EAAvB;IACA,KAAKG,OAAL,CAAaC,GAAb,CAAiB,MAAjB,EAAyBH,IAAzB;IACA,KAAKE,OAAL,CAAaC,GAAb,CAAiB,OAAjB,EAA0BF,KAA1B;;;EAGFG,KAAK;IACH,OAAO,KAAKF,OAAL,CAAaG,GAAb,CAAiB,IAAjB,CAAP;;;EAGFC,QAAQ;IACN,OAAO,KAAKJ,OAAL,CAAaG,GAAb,CAAiB,OAAjB,CAAP;;;;;MCpBSE;EAIXT,YACEC,IACAC,MACAC,OACAO,UACAN;IAEA,KAAKO,QAAL,GAAgB,EAAhB;IACAP,OAAO,CAACC,GAA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AEEhF,aAAA,CAACuJ,YAAD;IACEpE,SAAS,mBAAmBiD,SAAjB,oBAAiBA,SAAS,CAAEoB;IACvC9I,MAAM,EAAEA;GAFV,CAFF,CAFF,CADF;AAYD,CArDD;;;;;"}
\ No newline at end of file
diff --git a/dist/react-diagrams/MetaLinkFactory.d.ts b/dist/react-diagrams/MetaLinkFactory.d.ts
index 76070e6..1dbaa29 100644
--- a/dist/react-diagrams/MetaLinkFactory.d.ts
+++ b/dist/react-diagrams/MetaLinkFactory.d.ts
@@ -1,4 +1,3 @@
-///
import { MetaLinkModel } from './MetaLinkModel';
import { DefaultLinkFactory } from '@projectstorm/react-diagrams';
export declare class MetaLinkFactory extends DefaultLinkFactory {
diff --git a/dist/theme.d.ts b/dist/theme.d.ts
new file mode 100644
index 0000000..4cbe1e1
--- /dev/null
+++ b/dist/theme.d.ts
@@ -0,0 +1,90 @@
+declare type ThemeVars = {
+ [key: string]: any;
+};
+declare const _default: (customVariables: ThemeVars) => {
+ components: {
+ MuiCssBaseline: {
+ styleOverrides: string;
+ };
+ MuiList: {
+ styleOverrides: {
+ root: {
+ '&.customSwitch': {
+ padding: string;
+ background: any;
+ borderRadius: string;
+ display: string;
+ '& .MuiListItemButton-root': {
+ padding: string;
+ borderRadius: string;
+ width: string;
+ display: string;
+ alignItems: string;
+ justifyContent: string;
+ '&:not(:last-child)': {
+ marginBottom: string;
+ };
+ '&.Mui-disabled': {
+ opacity: number;
+ };
+ '&.Mui-selected': {
+ background: any;
+ boxShadow: any;
+ border: string;
+ '& .MuiTypography-root': {
+ color: any;
+ };
+ };
+ };
+ '& .MuiChip-root': {
+ marginLeft: string;
+ };
+ '& .MuiTypography-root': {
+ fontWeight: number;
+ fontSize: string;
+ lineHeight: string;
+ letterSpacing: string;
+ color: any;
+ margin: number;
+ };
+ };
+ };
+ };
+ };
+ MuiListItemIcon: {
+ styleOverrides: {
+ root: {
+ minWidth: string;
+ };
+ };
+ };
+ MuiListItemButton: {
+ styleOverrides: {
+ root: {
+ padding: number;
+ width: string;
+ height: string;
+ borderRadius: string;
+ justifyContent: string;
+ backgroundColor: any;
+ '&:hover': {
+ backgroundColor: any;
+ };
+ '&:not(:last-child)': {
+ marginBottom: string;
+ };
+ '&.Mui-selected': {
+ backgroundColor: any;
+ '&:hover': {
+ backgroundColor: any;
+ };
+ };
+ '&.Mui-disabled': {
+ opacity: number;
+ };
+ };
+ };
+ };
+ };
+};
+export default _default;