@teambit/graph 1.0.282 → 1.0.283
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/__bit_junit.xml +1 -1
- package/artifacts/preview/teambit_component_graph-preview.js +1 -1
- package/artifacts/schema.json +9 -9
- package/dist/component-graph/component-graph.js +1 -1
- package/dist/component-graph/component-graph.js.map +1 -1
- package/dist/component-id-graph.js +2 -2
- package/dist/component-id-graph.js.map +1 -1
- package/dist/duplicate-dependency.js +1 -1
- package/dist/graph-cmd.js +2 -2
- package/dist/graph-cmd.js.map +1 -1
- package/dist/graph.compare.section.js +2 -2
- package/dist/graph.compare.section.js.map +1 -1
- package/dist/graph.composition.js +1 -1
- package/dist/graph.composition.js.map +1 -1
- package/dist/graph.graphql.js.map +1 -1
- package/dist/graph.main.runtime.js +1 -1
- package/dist/graph.main.runtime.js.map +1 -1
- package/dist/graph.ui.runtime.js +1 -1
- package/dist/graph.ui.runtime.js.map +1 -1
- package/dist/model/dependency/dependency.js +1 -1
- package/dist/{preview-1716520879631.js → preview-1716607230882.js} +2 -2
- package/dist/ui/component-node/component-node.js +4 -4
- package/dist/ui/component-node/component-node.js.map +1 -1
- package/dist/ui/component-node/index.js +1 -1
- package/dist/ui/component-node/index.js.map +1 -1
- package/dist/ui/component-node/variants.js +1 -1
- package/dist/ui/component-node/variants.js.map +1 -1
- package/dist/ui/dependencies-compare/compare-node-model.js +1 -1
- package/dist/ui/dependencies-compare/compare-node-model.js.map +1 -1
- package/dist/ui/dependencies-compare/dependencies-compare.js +1 -1
- package/dist/ui/dependencies-compare/dependencies-compare.js.map +1 -1
- package/dist/ui/dependencies-compare/dependency-compare-node.js +4 -4
- package/dist/ui/dependencies-compare/dependency-compare-node.js.map +1 -1
- package/dist/ui/dependencies-compare/diff-graph.js +1 -1
- package/dist/ui/dependencies-compare/diff-graph.js.map +1 -1
- package/dist/ui/dependencies-graph/calc-elements.js.map +1 -1
- package/dist/ui/dependencies-graph/calc-layout.js +1 -1
- package/dist/ui/dependencies-graph/calc-layout.js.map +1 -1
- package/dist/ui/dependencies-graph/dep-edge/dep-edge.js +1 -1
- package/dist/ui/dependencies-graph/dep-edge/dep-edge.js.map +1 -1
- package/dist/ui/dependencies-graph/dependencies-graph.js +4 -4
- package/dist/ui/dependencies-graph/dependencies-graph.js.map +1 -1
- package/dist/ui/dependencies-graph/index.js +1 -1
- package/dist/ui/dependencies-graph/index.js.map +1 -1
- package/dist/ui/graph-page/graph-filters.js +3 -3
- package/dist/ui/graph-page/graph-filters.js.map +1 -1
- package/dist/ui/graph-page/graph-page.js +1 -1
- package/dist/ui/graph-page/graph-page.js.map +1 -1
- package/dist/ui/graph-page/index.js +1 -1
- package/dist/ui/graph-page/index.js.map +1 -1
- package/dist/ui/graph.section.js +2 -2
- package/dist/ui/graph.section.js.map +1 -1
- package/dist/ui/query/edge-model.js +1 -1
- package/dist/ui/query/get-graph.query.js.map +1 -1
- package/dist/ui/query/node-model.js +1 -1
- package/dist/ui/query/node-model.js.map +1 -1
- package/package.json +8 -8
@@ -90,12 +90,12 @@ function _variantsModule() {
|
|
90
90
|
}
|
91
91
|
const _excluded = ["node", "type"],
|
92
92
|
_excluded2 = ["componentId", "className"]; // keep order: styles, then variants
|
93
|
-
function _interopRequireDefault(
|
93
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
94
94
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
95
95
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
96
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
97
|
-
function _objectWithoutProperties(
|
98
|
-
function _objectWithoutPropertiesLoose(
|
96
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
97
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
98
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
99
99
|
function ComponentNode(_ref) {
|
100
100
|
let {
|
101
101
|
node,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_baseUiText","_componentUi","_envsUi","_designUiStyles","_baseUiSurfaces","_baseUiRouting","_componentModules","_dependenciesGraph","_componentNodeModule","_variantsModule","_excluded","_excluded2","
|
1
|
+
{"version":3,"names":["_react","data","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_baseUiText","_componentUi","_envsUi","_designUiStyles","_baseUiSurfaces","_baseUiRouting","_componentModules","_dependenciesGraph","_componentNodeModule","_variantsModule","_excluded","_excluded2","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","ComponentNode","_ref","node","type","rest","graphContext","useContext","ComponentGraphContext","component","id","createElement","Card","className","classnames","styles","compNode","variants","elevation","firstRow","EnvIcon","envIcon","Breadcrumbs","componentId","mutedText","nameLine","NavLink","link","external","href","ComponentUrl","toUrl","includeVersion","name","ellipsis","version","buffs","DeprecationIcon","componentWidgets","toArray","map","widgetId","Widget","key","_ref2","scope","namespace","showSep","breadcrumbs"],"sources":["component-node.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport classnames from 'classnames';\nimport { mutedText } from '@teambit/base-ui.text.muted-text';\nimport { ComponentID } from '@teambit/component';\nimport { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';\nimport { EnvIcon } from '@teambit/envs.ui.env-icon';\nimport { ellipsis } from '@teambit/design.ui.styles.ellipsis';\nimport { Card, CardProps } from '@teambit/base-ui.surfaces.card';\nimport { NavLink } from '@teambit/base-ui.routing.nav-link';\nimport { ComponentUrl } from '@teambit/component.modules.component-url';\nimport { NodeModel } from '../query/node-model';\nimport { ComponentGraphContext } from '../dependencies-graph/';\n\n// keep order: styles, then variants\nimport styles from './component-node.module.scss';\nimport variants from './variants.module.scss';\n\nexport interface IComponentNode extends CardProps {\n node: NodeModel;\n type: string;\n}\n\nexport function ComponentNode({ node, type = 'defaultNode', ...rest }: IComponentNode) {\n const graphContext = useContext(ComponentGraphContext);\n const { component } = node;\n const { id } = component;\n\n return (\n <Card className={classnames(styles.compNode, variants[type])} elevation=\"none\" {...rest}>\n <div className={styles.firstRow}>\n <EnvIcon component={component} className={styles.envIcon} />\n <Breadcrumbs componentId={id} className={mutedText} />\n </div>\n <div className={styles.nameLine}>\n <NavLink className={styles.link} external={true} href={ComponentUrl.toUrl(id, { includeVersion: false })}>\n <span className={classnames(styles.name, ellipsis)}>{id.name}</span>\n </NavLink>\n {id.version && <span className={classnames(styles.version, ellipsis)}>{id.version}</span>}\n\n <div className={styles.buffs}>\n <DeprecationIcon component={component} />\n {graphContext &&\n graphContext.componentWidgets\n .toArray()\n .map(([widgetId, Widget]) => <Widget key={widgetId} component={component} />)}\n </div>\n </div>\n </Card>\n );\n}\n\ntype BreadcrumbsProps = { componentId: ComponentID } & React.HTMLAttributes<HTMLDivElement>;\n\nfunction Breadcrumbs({ componentId, className, ...rest }: BreadcrumbsProps) {\n const { scope, namespace } = componentId;\n const showSep = !!scope && !!namespace;\n\n return (\n <div {...rest} className={classnames(styles.breadcrumbs, ellipsis, className)}>\n {scope}\n {showSep && '/'}\n {namespace}\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAI,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,YAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,WAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,gBAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,eAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAS,gBAAA;EAAA,MAAAT,IAAA,GAAAE,OAAA;EAA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CH,YAAY,IACXA,YAAY,CAACgC,gBAAgB,CAC1BC,OAAO,CAAC,CAAC,CACTC,GAAG,CAAC,CAAC,CAACC,QAAQ,EAAEC,MAAM,CAAC,kBAAK3F,MAAA,GAAAoB,OAAA,CAAAwC,aAAA,CAAC+B,MAAM;IAACC,GAAG,EAAEF,QAAS;IAAChC,SAAS,EAAEA;EAAU,CAAE,CAAC,CAC7E,CACF,CACD,CAAC;AAEX;AAIA,SAASa,WAAWA,CAAAsB,KAAA,EAAwD;EAAA,IAAvD;MAAErB,WAAW;MAAEV;IAAqC,CAAC,GAAA+B,KAAA;IAAxBvC,IAAI,GAAAV,wBAAA,CAAAiD,KAAA,EAAA5E,UAAA;EACpD,MAAM;IAAE6E,KAAK;IAAEC;EAAU,CAAC,GAAGvB,WAAW;EACxC,MAAMwB,OAAO,GAAG,CAAC,CAACF,KAAK,IAAI,CAAC,CAACC,SAAS;EAEtC,oBACE/F,MAAA,GAAAoB,OAAA,CAAAwC,aAAA,QAAAtB,QAAA,KAASgB,IAAI;IAAEQ,SAAS,EAAE,IAAAC,qBAAU,EAACC,8BAAM,CAACiC,WAAW,EAAEd,0BAAQ,EAAErB,SAAS;EAAE,IAC3EgC,KAAK,EACLE,OAAO,IAAI,GAAG,EACdD,SACE,CAAC;AAEV","ignoreList":[]}
|
@@ -67,7 +67,7 @@ function _variants() {
|
|
67
67
|
};
|
68
68
|
return data;
|
69
69
|
}
|
70
|
-
function _interopRequireDefault(
|
70
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
71
71
|
const {
|
72
72
|
compNode,
|
73
73
|
firstRow,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_componentNodeModule","data","_interopRequireDefault","require","_componentNode","_variants","
|
1
|
+
{"version":3,"names":["_componentNodeModule","data","_interopRequireDefault","require","_componentNode","_variants","e","__esModule","default","compNode","firstRow","envIcon","breadcrumbs","nameLine","name","version","buffs","link","componentStyles","styles","exports"],"sources":["index.ts"],"sourcesContent":["import componentStyles from './component-node.module.scss';\n\nexport { ComponentNode } from './component-node';\n\nexport { defaultNodeColor, rootNodeColor, externalNodeColor, root, defaultNode, external } from './variants';\n\nconst { compNode, firstRow, envIcon, breadcrumbs, nameLine, name, version, buffs, link } = componentStyles;\nexport const styles = { compNode, firstRow, envIcon, breadcrumbs, nameLine, name, version, buffs, link };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAAA,qBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,oBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,eAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,cAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAI,UAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,SAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6G,SAAAC,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7G,MAAM;EAAEG,QAAQ;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,WAAW;EAAEC,QAAQ;EAAEC,IAAI;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAK,CAAC,GAAGC,8BAAe;AACnG,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EAAEV,QAAQ;EAAEC,QAAQ;EAAEC,OAAO;EAAEC,WAAW;EAAEC,QAAQ;EAAEC,IAAI;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAK,CAAC","ignoreList":[]}
|
@@ -11,7 +11,7 @@ function _variantsModule() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _interopRequireDefault(
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
15
15
|
const {
|
16
16
|
root,
|
17
17
|
defaultNode,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_variantsModule","data","_interopRequireDefault","require","
|
1
|
+
{"version":3,"names":["_variantsModule","data","_interopRequireDefault","require","e","__esModule","default","root","defaultNode","external","rootNodeColor","defaultNodeColor","externalNodeColor","variants","exports"],"sources":["variants.ts"],"sourcesContent":["import variants from './variants.module.scss';\n\nconst { root, defaultNode, external, rootNodeColor, defaultNodeColor, externalNodeColor } = variants;\n\nexport { root, defaultNode, external, rootNodeColor, defaultNodeColor, externalNodeColor };\n"],"mappings":";;;;;;AAAA,SAAAA,gBAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,eAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA8C,SAAAC,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9C,MAAM;EAAEG,IAAI;EAAEC,WAAW;EAAEC,QAAQ;EAAEC,aAAa;EAAEC,gBAAgB;EAAEC;AAAkB,CAAC,GAAGC,yBAAQ;AAACC,OAAA,CAAAF,iBAAA,GAAAA,iBAAA;AAAAE,OAAA,CAAAH,gBAAA,GAAAA,gBAAA;AAAAG,OAAA,CAAAJ,aAAA,GAAAA,aAAA;AAAAI,OAAA,CAAAL,QAAA,GAAAA,QAAA;AAAAK,OAAA,CAAAN,WAAA,GAAAA,WAAA;AAAAM,OAAA,CAAAP,IAAA,GAAAA,IAAA","ignoreList":[]}
|
@@ -11,7 +11,7 @@ function _query() {
|
|
11
11
|
};
|
12
12
|
return data;
|
13
13
|
}
|
14
|
-
function _defineProperty(
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
15
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
16
16
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
17
17
|
class CompareNodeModel extends _query().NodeModel {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_query","data","require","_defineProperty","
|
1
|
+
{"version":3,"names":["_query","data","require","_defineProperty","e","r","t","_toPropertyKey","Object","defineProperty","value","enumerable","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","CompareNodeModel","NodeModel","constructor","args","exports"],"sources":["compare-node-model.ts"],"sourcesContent":["import { ComponentModel } from '@teambit/component';\nimport { NodeModel } from '../query';\n\nexport type CompareStatus = 'modified' | 'new' | 'deleted' | undefined;\n\nexport class CompareNodeModel extends NodeModel {\n id: string;\n component: ComponentModel;\n compareVersion: string;\n status: CompareStatus;\n}\n"],"mappings":";;;;;;AACA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAqC,SAAAE,gBAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,YAAAD,CAAA,GAAAE,cAAA,CAAAF,CAAA,MAAAD,CAAA,GAAAI,MAAA,CAAAC,cAAA,CAAAL,CAAA,EAAAC,CAAA,IAAAK,KAAA,EAAAJ,CAAA,EAAAK,UAAA,MAAAC,YAAA,MAAAC,QAAA,UAAAT,CAAA,CAAAC,CAAA,IAAAC,CAAA,EAAAF,CAAA;AAAA,SAAAG,eAAAD,CAAA,QAAAQ,CAAA,GAAAC,YAAA,CAAAT,CAAA,uCAAAQ,CAAA,GAAAA,CAAA,GAAAA,CAAA;AAAA,SAAAC,aAAAT,CAAA,EAAAD,CAAA,2BAAAC,CAAA,KAAAA,CAAA,SAAAA,CAAA,MAAAF,CAAA,GAAAE,CAAA,CAAAU,MAAA,CAAAC,WAAA,kBAAAb,CAAA,QAAAU,CAAA,GAAAV,CAAA,CAAAc,IAAA,CAAAZ,CAAA,EAAAD,CAAA,uCAAAS,CAAA,SAAAA,CAAA,YAAAK,SAAA,yEAAAd,CAAA,GAAAe,MAAA,GAAAC,MAAA,EAAAf,CAAA;AAI9B,MAAMgB,gBAAgB,SAASC,kBAAS,CAAC;EAAAC,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAtB,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;AAKhD;AAACuB,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
@@ -83,7 +83,7 @@ function _diffGraph() {
|
|
83
83
|
}
|
84
84
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
85
85
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
86
|
-
function _interopRequireDefault(
|
86
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
87
87
|
function ComponentNodeContainer(props) {
|
88
88
|
const {
|
89
89
|
sourcePosition = _reactflow().Position.Top,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_classnames","data","_interopRequireDefault","require","_designUi","_componentUiComponentCompare","_react","_interopRequireWildcard","_reactflow","_query","_graphPage","_dependenciesGraph","_dependenciesCompareModule","_dependencyCompareNode","_diffGraph","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj","ComponentNodeContainer","props","sourcePosition","Position","Top","targetPosition","Bottom","id","ReactFlowHandle","Handle","createElement","key","type","position","isConnectable","DependencyCompareNode","node","DependenciesCompare","nodeTypes","React","useMemo","ComponentNode","graphRef","useRef","componentCompare","useComponentCompare","baseId","base","model","compareId","compare","filter","setFilter","useState","isFiltered","loading","baseLoading","graph","baseGraph","useGraphQuery","toString","compareLoading","compareGraph","diffGraph","undefined","elements","calcElements","rootNode","useEffect","current","setTimeout","nodes","length","fitView","padding","handleLoad","useCallback","instance","maxZoom","onCheckFilter","_isFiltered","Fragment","className","classNames","styles","page","graphPageStyles","loader","RoundLoader","ReactFlowProvider","draggable","nodesDraggable","selectNodesOnDrag","nodesConnectable","zoomOnDoubleClick","elementsSelectable","minZoom","dependenciesGraphStyles","defaultNodes","defaultEdges","edges","onInit","proOptions","hideAttribution","Background","Controls","controls","MiniMap","nodeColor","calcMinimapColors","minimap","GraphFilters","filters","disable","onChangeFilter"],"sources":["dependencies-compare.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { RoundLoader } from '@teambit/design.ui.round-loader';\nimport { useComponentCompare } from '@teambit/component.ui.component-compare.context';\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport ReactFlow, {\n Background,\n Controls,\n Handle,\n MiniMap,\n NodeProps,\n NodeTypes,\n Position,\n ReactFlowProvider,\n ReactFlowInstance,\n} from 'reactflow';\nimport { useGraphQuery } from '../query';\nimport { GraphFilter } from '../../model/graph-filters';\nimport { GraphFilters, styles as graphPageStyles } from '../graph-page';\nimport { calcMinimapColors, calcElements, styles as dependenciesGraphStyles } from '../dependencies-graph';\nimport styles from './dependencies-compare.module.scss';\nimport { DependencyCompareNode } from './dependency-compare-node';\nimport { diffGraph } from './diff-graph';\n\nfunction ComponentNodeContainer(props: NodeProps) {\n const { sourcePosition = Position.Top, targetPosition = Position.Bottom, data, id } = props;\n const ReactFlowHandle = Handle;\n return (\n <div key={id}>\n <ReactFlowHandle type=\"target\" position={targetPosition} isConnectable={false} />\n <ReactFlowHandle type=\"source\" position={sourcePosition} isConnectable={false} />\n <DependencyCompareNode node={data.node} type={data.type} />\n </div>\n );\n}\n\nexport function DependenciesCompare() {\n const nodeTypes: NodeTypes = React.useMemo(() => ({ ComponentNode: ComponentNodeContainer }), []);\n const graphRef = useRef<ReactFlowInstance>();\n const componentCompare = useComponentCompare();\n\n const baseId = componentCompare?.base?.model.id;\n const compareId = componentCompare?.compare?.model.id;\n\n const [filter, setFilter] = useState<GraphFilter>('runtimeOnly');\n const isFiltered = filter === 'runtimeOnly';\n const { loading: baseLoading, graph: baseGraph } = useGraphQuery(baseId && [baseId.toString()], filter);\n const { loading: compareLoading, graph: compareGraph } = useGraphQuery(compareId && [compareId.toString()], filter);\n const loading = baseLoading || compareLoading;\n const graph = diffGraph(baseGraph, compareGraph, baseId) ?? undefined;\n const elements = calcElements(graph, { rootNode: baseId });\n\n useEffect(() => () => (graphRef.current = undefined), []);\n\n useEffect(() => {\n setTimeout(() => {\n if (graph && graph.nodes.length <= 3)\n return graphRef.current?.fitView({\n padding: 2,\n });\n return graphRef.current?.fitView();\n }, 0);\n }, [graph]);\n\n const handleLoad = useCallback(\n (instance: ReactFlowInstance) => {\n graphRef.current = instance;\n if ((graph?.nodes.length ?? 0) <= 3) {\n graphRef.current?.fitView({\n padding: 2,\n maxZoom: 1,\n });\n } else {\n instance.fitView({\n maxZoom: 1,\n });\n }\n },\n [graph?.nodes.length]\n );\n\n useEffect(() => {\n setTimeout(() => {\n if ((graph?.nodes.length ?? 0) <= 3)\n return graphRef.current?.fitView({\n padding: 2,\n });\n return graphRef.current?.fitView();\n }, 0);\n }, [compareId?.toString(), baseId?.toString()]);\n\n const onCheckFilter = (_isFiltered: boolean) => {\n setFilter(_isFiltered ? 'runtimeOnly' : undefined);\n };\n\n if (!loading && !graph) {\n return <></>;\n }\n\n return (\n <div className={classNames([styles.page, graphPageStyles.graph])}>\n {loading && (\n <div className={styles.loader}>\n <RoundLoader />\n </div>\n )}\n {!loading && (\n <ReactFlowProvider>\n <ReactFlow\n draggable={false}\n nodesDraggable={true}\n selectNodesOnDrag={false}\n nodesConnectable={false}\n zoomOnDoubleClick={false}\n elementsSelectable={false}\n maxZoom={100}\n minZoom={0}\n className={dependenciesGraphStyles.graph}\n defaultNodes={elements.nodes}\n defaultEdges={elements.edges}\n nodeTypes={nodeTypes}\n onInit={handleLoad}\n proOptions={{\n hideAttribution: true,\n }}\n >\n <Background />\n <Controls className={dependenciesGraphStyles.controls} />\n <MiniMap nodeColor={calcMinimapColors} className={dependenciesGraphStyles.minimap} />\n <GraphFilters\n className={graphPageStyles.filters}\n disable={loading}\n isFiltered={isFiltered}\n onChangeFilter={onCheckFilter}\n />\n </ReactFlow>\n </ReactFlowProvider>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,6BAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,4BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAJ,OAAA;EA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A,CAACtC,UAAA,GAAAa,OAAS;IACRqF,SAAS,EAAE,KAAM;IACjBC,cAAc,EAAE,IAAK;IACrBC,iBAAiB,EAAE,KAAM;IACzBC,gBAAgB,EAAE,KAAM;IACxBC,iBAAiB,EAAE,KAAM;IACzBC,kBAAkB,EAAE,KAAM;IAC1BjB,OAAO,EAAE,GAAI;IACbkB,OAAO,EAAE,CAAE;IACXd,SAAS,EAAEe,2BAAuB,CAACxC,KAAM;IACzCyC,YAAY,EAAEjC,QAAQ,CAACM,KAAM;IAC7B4B,YAAY,EAAElC,QAAQ,CAACmC,KAAM;IAC7B9D,SAAS,EAAEA,SAAU;IACrB+D,MAAM,EAAE1B,UAAW;IACnB2B,UAAU,EAAE;MACVC,eAAe,EAAE;IACnB;EAAE,gBAEFjH,MAAA,GAAAe,OAAA,CAAAyB,aAAA,CAACtC,UAAA,GAAAgH,UAAU,MAAE,CAAC,eACdlH,MAAA,GAAAe,OAAA,CAAAyB,aAAA,CAACtC,UAAA,GAAAiH,QAAQ;IAACvB,SAAS,EAAEe,2BAAuB,CAACS;EAAS,CAAE,CAAC,eACzDpH,MAAA,GAAAe,OAAA,CAAAyB,aAAA,CAACtC,UAAA,GAAAmH,OAAO;IAACC,SAAS,EAAEC,sCAAkB;IAAC3B,SAAS,EAAEe,2BAAuB,CAACa;EAAQ,CAAE,CAAC,eACrFxH,MAAA,GAAAe,OAAA,CAAAyB,aAAA,CAACpC,UAAA,GAAAqH,YAAY;IACX7B,SAAS,EAAEI,mBAAe,CAAC0B,OAAQ;IACnCC,OAAO,EAAE1D,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvB4D,cAAc,EAAEnC;EAAc,CAC/B,CACQ,CACM,CAElB,CAAC;AAEV","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_classnames","data","_interopRequireDefault","require","_designUi","_componentUiComponentCompare","_react","_interopRequireWildcard","_reactflow","_query","_graphPage","_dependenciesGraph","_dependenciesCompareModule","_dependencyCompareNode","_diffGraph","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ComponentNodeContainer","props","sourcePosition","Position","Top","targetPosition","Bottom","id","ReactFlowHandle","Handle","createElement","key","type","position","isConnectable","DependencyCompareNode","node","DependenciesCompare","nodeTypes","React","useMemo","ComponentNode","graphRef","useRef","componentCompare","useComponentCompare","baseId","base","model","compareId","compare","filter","setFilter","useState","isFiltered","loading","baseLoading","graph","baseGraph","useGraphQuery","toString","compareLoading","compareGraph","diffGraph","undefined","elements","calcElements","rootNode","useEffect","current","setTimeout","nodes","length","fitView","padding","handleLoad","useCallback","instance","maxZoom","onCheckFilter","_isFiltered","Fragment","className","classNames","styles","page","graphPageStyles","loader","RoundLoader","ReactFlowProvider","draggable","nodesDraggable","selectNodesOnDrag","nodesConnectable","zoomOnDoubleClick","elementsSelectable","minZoom","dependenciesGraphStyles","defaultNodes","defaultEdges","edges","onInit","proOptions","hideAttribution","Background","Controls","controls","MiniMap","nodeColor","calcMinimapColors","minimap","GraphFilters","filters","disable","onChangeFilter"],"sources":["dependencies-compare.tsx"],"sourcesContent":["import classNames from 'classnames';\nimport { RoundLoader } from '@teambit/design.ui.round-loader';\nimport { useComponentCompare } from '@teambit/component.ui.component-compare.context';\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport ReactFlow, {\n Background,\n Controls,\n Handle,\n MiniMap,\n NodeProps,\n NodeTypes,\n Position,\n ReactFlowProvider,\n ReactFlowInstance,\n} from 'reactflow';\nimport { useGraphQuery } from '../query';\nimport { GraphFilter } from '../../model/graph-filters';\nimport { GraphFilters, styles as graphPageStyles } from '../graph-page';\nimport { calcMinimapColors, calcElements, styles as dependenciesGraphStyles } from '../dependencies-graph';\nimport styles from './dependencies-compare.module.scss';\nimport { DependencyCompareNode } from './dependency-compare-node';\nimport { diffGraph } from './diff-graph';\n\nfunction ComponentNodeContainer(props: NodeProps) {\n const { sourcePosition = Position.Top, targetPosition = Position.Bottom, data, id } = props;\n const ReactFlowHandle = Handle;\n return (\n <div key={id}>\n <ReactFlowHandle type=\"target\" position={targetPosition} isConnectable={false} />\n <ReactFlowHandle type=\"source\" position={sourcePosition} isConnectable={false} />\n <DependencyCompareNode node={data.node} type={data.type} />\n </div>\n );\n}\n\nexport function DependenciesCompare() {\n const nodeTypes: NodeTypes = React.useMemo(() => ({ ComponentNode: ComponentNodeContainer }), []);\n const graphRef = useRef<ReactFlowInstance>();\n const componentCompare = useComponentCompare();\n\n const baseId = componentCompare?.base?.model.id;\n const compareId = componentCompare?.compare?.model.id;\n\n const [filter, setFilter] = useState<GraphFilter>('runtimeOnly');\n const isFiltered = filter === 'runtimeOnly';\n const { loading: baseLoading, graph: baseGraph } = useGraphQuery(baseId && [baseId.toString()], filter);\n const { loading: compareLoading, graph: compareGraph } = useGraphQuery(compareId && [compareId.toString()], filter);\n const loading = baseLoading || compareLoading;\n const graph = diffGraph(baseGraph, compareGraph, baseId) ?? undefined;\n const elements = calcElements(graph, { rootNode: baseId });\n\n useEffect(() => () => (graphRef.current = undefined), []);\n\n useEffect(() => {\n setTimeout(() => {\n if (graph && graph.nodes.length <= 3)\n return graphRef.current?.fitView({\n padding: 2,\n });\n return graphRef.current?.fitView();\n }, 0);\n }, [graph]);\n\n const handleLoad = useCallback(\n (instance: ReactFlowInstance) => {\n graphRef.current = instance;\n if ((graph?.nodes.length ?? 0) <= 3) {\n graphRef.current?.fitView({\n padding: 2,\n maxZoom: 1,\n });\n } else {\n instance.fitView({\n maxZoom: 1,\n });\n }\n },\n [graph?.nodes.length]\n );\n\n useEffect(() => {\n setTimeout(() => {\n if ((graph?.nodes.length ?? 0) <= 3)\n return graphRef.current?.fitView({\n padding: 2,\n });\n return graphRef.current?.fitView();\n }, 0);\n }, [compareId?.toString(), baseId?.toString()]);\n\n const onCheckFilter = (_isFiltered: boolean) => {\n setFilter(_isFiltered ? 'runtimeOnly' : undefined);\n };\n\n if (!loading && !graph) {\n return <></>;\n }\n\n return (\n <div className={classNames([styles.page, graphPageStyles.graph])}>\n {loading && (\n <div className={styles.loader}>\n <RoundLoader />\n </div>\n )}\n {!loading && (\n <ReactFlowProvider>\n <ReactFlow\n draggable={false}\n nodesDraggable={true}\n selectNodesOnDrag={false}\n nodesConnectable={false}\n zoomOnDoubleClick={false}\n elementsSelectable={false}\n maxZoom={100}\n minZoom={0}\n className={dependenciesGraphStyles.graph}\n defaultNodes={elements.nodes}\n defaultEdges={elements.edges}\n nodeTypes={nodeTypes}\n onInit={handleLoad}\n proOptions={{\n hideAttribution: true,\n }}\n >\n <Background />\n <Controls className={dependenciesGraphStyles.controls} />\n <MiniMap nodeColor={calcMinimapColors} className={dependenciesGraphStyles.minimap} />\n <GraphFilters\n className={graphPageStyles.filters}\n disable={loading}\n isFiltered={isFiltered}\n onChangeFilter={onCheckFilter}\n />\n </ReactFlow>\n </ReactFlowProvider>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,UAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,SAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,6BAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,4BAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,OAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAJ,OAAA;EAAAG,MAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,WAAA;EAAA,MAAAP,IAAA,GAAAM,uBAAA,CAAAJ,OAAA;EAAAK,UAAA,YAAAA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IACzBC,kBAAkB,EAAE,KAAM;IAC1BjB,OAAO,EAAE,GAAI;IACbkB,OAAO,EAAE,CAAE;IACXd,SAAS,EAAEe,2BAAuB,CAACxC,KAAM;IACzCyC,YAAY,EAAEjC,QAAQ,CAACM,KAAM;IAC7B4B,YAAY,EAAElC,QAAQ,CAACmC,KAAM;IAC7B9D,SAAS,EAAEA,SAAU;IACrB+D,MAAM,EAAE1B,UAAW;IACnB2B,UAAU,EAAE;MACVC,eAAe,EAAE;IACnB;EAAE,gBAEFhH,MAAA,GAAAe,OAAA,CAAAwB,aAAA,CAACrC,UAAA,GAAA+G,UAAU,MAAE,CAAC,eACdjH,MAAA,GAAAe,OAAA,CAAAwB,aAAA,CAACrC,UAAA,GAAAgH,QAAQ;IAACvB,SAAS,EAAEe,2BAAuB,CAACS;EAAS,CAAE,CAAC,eACzDnH,MAAA,GAAAe,OAAA,CAAAwB,aAAA,CAACrC,UAAA,GAAAkH,OAAO;IAACC,SAAS,EAAEC,sCAAkB;IAAC3B,SAAS,EAAEe,2BAAuB,CAACa;EAAQ,CAAE,CAAC,eACrFvH,MAAA,GAAAe,OAAA,CAAAwB,aAAA,CAACnC,UAAA,GAAAoH,YAAY;IACX7B,SAAS,EAAEI,mBAAe,CAAC0B,OAAQ;IACnCC,OAAO,EAAE1D,OAAQ;IACjBD,UAAU,EAAEA,UAAW;IACvB4D,cAAc,EAAEnC;EAAc,CAC/B,CACQ,CACM,CAElB,CAAC;AAEV","ignoreList":[]}
|
@@ -119,10 +119,10 @@ function _dependencyCompareVariantsModule() {
|
|
119
119
|
const _excluded = ["componentId", "className"];
|
120
120
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
121
121
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
122
|
-
function _interopRequireDefault(
|
123
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
124
|
-
function _objectWithoutProperties(
|
125
|
-
function _objectWithoutPropertiesLoose(
|
122
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
123
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
124
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
125
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
126
126
|
function getVariant(nodeType) {
|
127
127
|
switch (nodeType) {
|
128
128
|
case 'defaultNode':
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_baseUiRouting","data","require","_baseUiSurfaces","_baseUiText","_component","_componentModules","_componentUiComponentCompare","_componentUi","_designUiStyles","_envsUi","_classnames","_interopRequireDefault","_react","_interopRequireWildcard","_semver","_variants","_componentNode","_dependencyCompareNodeModule","_dependencyCompareVariantsModule","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","obj","_extends","assign","bind","target","arguments","length","source","key","prototype","apply","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","indexOf","propertyIsEnumerable","getVariant","nodeType","defaultNode","variants","external","DependencyCompareNode","props","node","type","id","baseIdStr","component","baseComponent","compareVersion","status","version","baseVersion","baseId","ComponentID","fromString","versionDiff","useMemo","valid","compare","createElement","Card","className","classnames","componentNodeStyles","compNode","elevation","firstRow","EnvIcon","envIcon","Breadcrumbs","componentId","mutedText","nameLine","NavLink","styles","link","href","ComponentUrl","toUrl","includeVersion","name","ellipsis","arrowIcon","versionUp","src","versionDown","buffs","DeprecationIcon","undefined","CompareStatusResolver","_ref","rest","scope","namespace","showSep","breadcrumbs"],"sources":["dependency-compare-node.tsx"],"sourcesContent":["import { NavLink } from '@teambit/base-ui.routing.nav-link';\nimport { Card } from '@teambit/base-ui.surfaces.card';\nimport { mutedText } from '@teambit/base-ui.text.muted-text';\nimport { ComponentID } from '@teambit/component';\nimport { ComponentUrl } from '@teambit/component.modules.component-url';\nimport { CompareStatusResolver } from '@teambit/component.ui.component-compare.status-resolver';\nimport { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';\nimport { ellipsis } from '@teambit/design.ui.styles.ellipsis';\nimport { EnvIcon } from '@teambit/envs.ui.env-icon';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { compare, valid } from 'semver';\nimport { defaultNode, external } from '../../ui/component-node/variants';\nimport { styles as componentNodeStyles } from '../../ui/component-node';\nimport { CompareNodeModel } from './compare-node-model';\nimport styles from './dependency-compare-node.module.scss';\nimport variants from './dependency-compare-variants.module.scss';\n\nfunction getVariant(nodeType?: string) {\n switch (nodeType) {\n case 'defaultNode':\n return defaultNode;\n case 'root':\n return variants[nodeType];\n case 'external':\n return external;\n default:\n return null;\n }\n}\n\nexport type DependencyCompareNodeProps = {\n node: CompareNodeModel;\n type?: string;\n};\n\nexport function DependencyCompareNode(props: DependencyCompareNodeProps) {\n const { node, type = 'defaultNode' } = props;\n const { id: baseIdStr, component: baseComponent, compareVersion, status } = node;\n const { version: baseVersion } = baseComponent;\n const baseId = ComponentID.fromString(baseIdStr);\n const versionDiff = useMemo(\n () => valid(baseVersion) && valid(compareVersion) && compare(baseVersion, compareVersion),\n [baseVersion, compareVersion]\n );\n\n return (\n <Card className={classnames(componentNodeStyles.compNode, getVariant(type))} elevation=\"none\">\n <div className={componentNodeStyles.firstRow}>\n <EnvIcon component={baseComponent} className={componentNodeStyles.envIcon} />\n <Breadcrumbs componentId={baseId} className={mutedText} />\n </div>\n <div className={componentNodeStyles.nameLine}>\n <NavLink className={styles.link} external={true} href={ComponentUrl.toUrl(baseId, { includeVersion: false })}>\n <span className={classnames(componentNodeStyles.name, ellipsis)}>{baseId.name}</span>\n </NavLink>\n {baseId.version && <span className={classnames(componentNodeStyles.version, ellipsis)}>{baseId.version}</span>}\n {versionDiff !== 0 && (\n <img\n className={classnames([styles.arrowIcon, styles.versionUp])}\n src=\"https://static.bit.dev/bit-icons/version-bump.svg\"\n />\n )}\n {compareVersion && versionDiff !== 0 && (\n <span\n className={classnames(\n styles.version,\n componentNodeStyles.version,\n ellipsis,\n versionDiff === -1 && styles.versionUp,\n versionDiff === 1 && styles.versionDown\n )}\n >\n {compareVersion}\n </span>\n )}\n\n <div className={styles.buffs}>\n <DeprecationIcon component={baseComponent} />\n {status !== undefined && <CompareStatusResolver status={status} />}\n </div>\n </div>\n </Card>\n );\n}\n\ntype BreadcrumbsProps = { componentId: ComponentID } & React.HTMLAttributes<HTMLDivElement>;\n\nfunction Breadcrumbs({ componentId, className, ...rest }: BreadcrumbsProps) {\n const { scope, namespace } = componentId;\n const showSep = !!scope && !!namespace;\n\n return (\n <div {...rest} className={classnames(styles.breadcrumbs, ellipsis, className)}>\n {scope}\n {showSep && '/'}\n {namespace}\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAA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AC5E,4BAAA,GAAA0G,qBAAqB;IAACxC,MAAM,EAAEA;EAAO,CAAE,CAC9D,CACF,CACD,CAAC;AAEX;AAIA,SAASoB,WAAWA,CAAAqB,IAAA,EAAwD;EAAA,IAAvD;MAAEpB,WAAW;MAAET;IAAqC,CAAC,GAAA6B,IAAA;IAAxBC,IAAI,GAAA/D,wBAAA,CAAA8D,IAAA,EAAA9F,SAAA;EACpD,MAAM;IAAEgG,KAAK;IAAEC;EAAU,CAAC,GAAGvB,WAAW;EACxC,MAAMwB,OAAO,GAAG,CAAC,CAACF,KAAK,IAAI,CAAC,CAACC,SAAS;EAEtC,oBACExG,MAAA,GAAAc,OAAA,CAAAwD,aAAA,QAAAzC,QAAA,KAASyE,IAAI;IAAE9B,SAAS,EAAE,IAAAC,qBAAU,EAACY,sCAAM,CAACqB,WAAW,EAAEd,0BAAQ,EAAEpB,SAAS;EAAE,IAC3E+B,KAAK,EACLE,OAAO,IAAI,GAAG,EACdD,SACE,CAAC;AAEV","ignoreList":[]}
|
1
|
+
{"version":3,"names":["_baseUiRouting","data","require","_baseUiSurfaces","_baseUiText","_component","_componentModules","_componentUiComponentCompare","_componentUi","_designUiStyles","_envsUi","_classnames","_interopRequireDefault","_react","_interopRequireWildcard","_semver","_variants","_componentNode","_dependencyCompareNodeModule","_dependencyCompareVariantsModule","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","o","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","getVariant","nodeType","defaultNode","variants","external","DependencyCompareNode","props","node","type","id","baseIdStr","component","baseComponent","compareVersion","status","version","baseVersion","baseId","ComponentID","fromString","versionDiff","useMemo","valid","compare","createElement","Card","className","classnames","componentNodeStyles","compNode","elevation","firstRow","EnvIcon","envIcon","Breadcrumbs","componentId","mutedText","nameLine","NavLink","styles","link","href","ComponentUrl","toUrl","includeVersion","name","ellipsis","arrowIcon","versionUp","src","versionDown","buffs","DeprecationIcon","undefined","CompareStatusResolver","_ref","rest","scope","namespace","showSep","breadcrumbs"],"sources":["dependency-compare-node.tsx"],"sourcesContent":["import { NavLink } from '@teambit/base-ui.routing.nav-link';\nimport { Card } from '@teambit/base-ui.surfaces.card';\nimport { mutedText } from '@teambit/base-ui.text.muted-text';\nimport { ComponentID } from '@teambit/component';\nimport { ComponentUrl } from '@teambit/component.modules.component-url';\nimport { CompareStatusResolver } from '@teambit/component.ui.component-compare.status-resolver';\nimport { DeprecationIcon } from '@teambit/component.ui.deprecation-icon';\nimport { ellipsis } from '@teambit/design.ui.styles.ellipsis';\nimport { EnvIcon } from '@teambit/envs.ui.env-icon';\nimport classnames from 'classnames';\nimport React, { useMemo } from 'react';\nimport { compare, valid } from 'semver';\nimport { defaultNode, external } from '../../ui/component-node/variants';\nimport { styles as componentNodeStyles } from '../../ui/component-node';\nimport { CompareNodeModel } from './compare-node-model';\nimport styles from './dependency-compare-node.module.scss';\nimport variants from './dependency-compare-variants.module.scss';\n\nfunction getVariant(nodeType?: string) {\n switch (nodeType) {\n case 'defaultNode':\n return defaultNode;\n case 'root':\n return variants[nodeType];\n case 'external':\n return external;\n default:\n return null;\n }\n}\n\nexport type DependencyCompareNodeProps = {\n node: CompareNodeModel;\n type?: string;\n};\n\nexport function DependencyCompareNode(props: DependencyCompareNodeProps) {\n const { node, type = 'defaultNode' } = props;\n const { id: baseIdStr, component: baseComponent, compareVersion, status } = node;\n const { version: baseVersion } = baseComponent;\n const baseId = ComponentID.fromString(baseIdStr);\n const versionDiff = useMemo(\n () => valid(baseVersion) && valid(compareVersion) && compare(baseVersion, compareVersion),\n [baseVersion, compareVersion]\n );\n\n return (\n <Card className={classnames(componentNodeStyles.compNode, getVariant(type))} elevation=\"none\">\n <div className={componentNodeStyles.firstRow}>\n <EnvIcon component={baseComponent} className={componentNodeStyles.envIcon} />\n <Breadcrumbs componentId={baseId} className={mutedText} />\n </div>\n <div className={componentNodeStyles.nameLine}>\n <NavLink className={styles.link} external={true} href={ComponentUrl.toUrl(baseId, { includeVersion: false })}>\n <span className={classnames(componentNodeStyles.name, ellipsis)}>{baseId.name}</span>\n </NavLink>\n {baseId.version && <span className={classnames(componentNodeStyles.version, ellipsis)}>{baseId.version}</span>}\n {versionDiff !== 0 && (\n <img\n className={classnames([styles.arrowIcon, styles.versionUp])}\n src=\"https://static.bit.dev/bit-icons/version-bump.svg\"\n />\n )}\n {compareVersion && versionDiff !== 0 && (\n <span\n className={classnames(\n styles.version,\n componentNodeStyles.version,\n ellipsis,\n versionDiff === -1 && styles.versionUp,\n versionDiff === 1 && styles.versionDown\n )}\n >\n {compareVersion}\n </span>\n )}\n\n <div className={styles.buffs}>\n <DeprecationIcon component={baseComponent} />\n {status !== undefined && <CompareStatusResolver status={status} />}\n </div>\n </div>\n </Card>\n );\n}\n\ntype BreadcrumbsProps = { componentId: ComponentID } & React.HTMLAttributes<HTMLDivElement>;\n\nfunction Breadcrumbs({ componentId, className, ...rest }: BreadcrumbsProps) {\n const { scope, namespace } = componentId;\n const showSep = !!scope && !!namespace;\n\n return (\n <div {...rest} className={classnames(styles.breadcrumbs, ellipsis, className)}>\n {scope}\n {showSep && '/'}\n {namespace}\n </div>\n );\n}\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,gBAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,eAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SA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E,IAAI;IAAE9B,SAAS,EAAE,IAAAC,qBAAU,EAACY,sCAAM,CAACqB,WAAW,EAAEd,0BAAQ,EAAEpB,SAAS;EAAE,IAC3E+B,KAAK,EACLE,OAAO,IAAI,GAAG,EACdD,SACE,CAAC;AAEV","ignoreList":[]}
|
@@ -13,7 +13,7 @@ function _compareGraphModel() {
|
|
13
13
|
}
|
14
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
15
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
16
|
-
function _defineProperty(
|
16
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
18
18
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
19
19
|
const toShortId = node => node.component.id.toStringWithoutVersion();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_compareGraphModel","data","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","
|
1
|
+
{"version":3,"names":["_compareGraphModel","data","require","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","defineProperty","_toPropertyKey","value","configurable","writable","i","_toPrimitive","Symbol","toPrimitive","call","TypeError","String","Number","toShortId","node","component","id","toStringWithoutVersion","toShortIdFromNodeId","nodeId","split","delim","getEdgeId","_e","sourceId","targetId","diffGraph","baseGraph","compareGraph","baseId","baseNodes","nodes","compareNodes","baseNodesMap","Map","map","n","compareNodesMap","allNodes","baseNode","compareNode","get","compareVersion","version","status","isEqual","undefined","newNodes","has","allNodesMap","baseEdgesMap","edges","baseEdge","edgesOnlyInCompare","compareEdge","toString","allEdges","CompareGraphModel"],"sources":["diff-graph.ts"],"sourcesContent":["import { ComponentID } from '@teambit/component';\nimport { EdgeModel, GraphModel, NodeModel } from '../query';\nimport { CompareGraphModel } from './compare-graph-model';\nimport { CompareNodeModel } from './compare-node-model';\n\nconst toShortId = (node: NodeModel) => node.component.id.toStringWithoutVersion();\n\n// this is to get a key with versions ignored so that we'll have a unique set of component nodes\nconst toShortIdFromNodeId = (nodeId: string) => nodeId.split('@')[0];\n\nconst delim = '::';\n\nconst getEdgeId = (_e: EdgeModel) => {\n return `${toShortIdFromNodeId(_e.sourceId)}${delim}${toShortIdFromNodeId(_e.targetId)}`;\n};\n\nexport function diffGraph(\n baseGraph?: GraphModel<NodeModel, EdgeModel>,\n compareGraph?: GraphModel<NodeModel, EdgeModel>,\n baseId?: ComponentID\n) {\n if (!baseGraph || !compareGraph || !baseId) return null;\n\n const baseNodes = baseGraph.nodes;\n const compareNodes = compareGraph.nodes;\n\n const baseNodesMap = new Map<string, NodeModel>(baseNodes.map((n) => [toShortId(n), n]));\n const compareNodesMap = new Map<string, NodeModel>(compareNodes.map((n) => [toShortId(n), n]));\n\n const allNodes: Array<CompareNodeModel> = [];\n for (const baseNode of baseNodes) {\n const compareNode = compareNodesMap.get(toShortId(baseNode));\n if (compareNode) {\n allNodes.push({\n ...baseNode,\n compareVersion: compareNode.component.version,\n status: compareNode.component.id.isEqual(baseNode.component.id) ? undefined : 'modified',\n });\n } else {\n allNodes.push({\n ...baseNode,\n compareVersion: baseNode.component.version,\n status: 'deleted',\n });\n }\n }\n\n const newNodes = compareNodes.filter((n) => !baseNodesMap.has(toShortId(n)));\n\n for (const node of newNodes) {\n allNodes.push({\n ...node,\n compareVersion: '',\n status: 'new',\n });\n }\n const allNodesMap = new Map<string, CompareNodeModel>(allNodes.map((n) => [toShortId(n), n]));\n\n const baseEdgesMap = new Map<string, EdgeModel>(baseGraph.edges.map((baseEdge) => [getEdgeId(baseEdge), baseEdge]));\n const edgesOnlyInCompare = compareGraph.edges\n .filter((compareEdge) => !baseEdgesMap.has(getEdgeId(compareEdge)))\n .map((compareEdge) => ({\n ...compareEdge,\n sourceId: allNodesMap.get(toShortIdFromNodeId(compareEdge.sourceId))?.id.toString() || baseId.toString(),\n targetId: allNodesMap.get(toShortIdFromNodeId(compareEdge.targetId))?.id.toString() || baseId.toString(),\n }));\n const allEdges = [...baseGraph.edges, ...edgesOnlyInCompare];\n return new CompareGraphModel(allNodes, allEdges);\n}\n"],"mappings":";;;;;;AAEA,SAAAA,mBAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,kBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA0D,SAAAE,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAA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C;EACnH,MAAMC,kBAAkB,GAAGzB,YAAY,CAACuB,KAAK,CAC1C/D,MAAM,CAAEkE,WAAW,IAAK,CAACJ,YAAY,CAACF,GAAG,CAAC1B,SAAS,CAACgC,WAAW,CAAC,CAAC,CAAC,CAClEnB,GAAG,CAAEmB,WAAW,IAAA7D,aAAA,CAAAA,aAAA,KACZ6D,WAAW;IACd9B,QAAQ,EAAEyB,WAAW,CAACR,GAAG,CAACvB,mBAAmB,CAACoC,WAAW,CAAC9B,QAAQ,CAAC,CAAC,EAAER,EAAE,CAACuC,QAAQ,CAAC,CAAC,IAAI1B,MAAM,CAAC0B,QAAQ,CAAC,CAAC;IACxG9B,QAAQ,EAAEwB,WAAW,CAACR,GAAG,CAACvB,mBAAmB,CAACoC,WAAW,CAAC7B,QAAQ,CAAC,CAAC,EAAET,EAAE,CAACuC,QAAQ,CAAC,CAAC,IAAI1B,MAAM,CAAC0B,QAAQ,CAAC;EAAC,EACxG,CAAC;EACL,MAAMC,QAAQ,GAAG,CAAC,GAAG7B,SAAS,CAACwB,KAAK,EAAE,GAAGE,kBAAkB,CAAC;EAC5D,OAAO,KAAII,sCAAiB,EAACnB,QAAQ,EAAEkB,QAAQ,CAAC;AAClD","ignoreList":[]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_react","data","require","_reactflow","_calcLayout","_depEdge","calcElements","graph","rootNode","useMemo","nodes","edges","positions","calcLayout","Array","from","values","map","x","id","type","node","component","isEqual","ignoreVersion","undefined","position","get","y","e","sourceId","targetId","source","target","label","depTypeToLabel","dependencyLifecycleType","labelBgPadding","className","depTypeToClass","arrowHeadType","MarkerType","Arrow","markerEnd"],"sources":["calc-elements.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { MarkerType, Edge, Node } from 'reactflow';\nimport { ComponentID } from '@teambit/component';\nimport { calcLayout } from './calc-layout';\nimport { EdgeModel, GraphModel, NodeModel } from '../query';\n\nimport { depTypeToClass, depTypeToLabel } from './dep-edge';\n\ntype ElementsOptions = {\n rootNode?: ComponentID;\n};\n\n/**\n * generate Nodes and Edges for the ReactFlowRenderer graph renderer\n */\nexport function calcElements(\n graph: GraphModel<NodeModel, EdgeModel> | undefined,\n { rootNode }: ElementsOptions\n): { nodes: Node[]; edges: Edge[] } {\n return useMemo(() => {\n if (!graph) return { nodes: [], edges: [] };\n\n const positions = calcLayout(graph);\n\n const nodes: Node[] = Array.from(graph.nodes.values()).map((x) => {\n return {\n id: x.id,\n type: 'ComponentNode',\n data: {\n node: x,\n type: rootNode && x.component.id.isEqual(rootNode, { ignoreVersion: true }) ? 'root' : undefined,\n },\n position: positions.get(x.id) || { x: 0, y: 0 },\n };\n });\n\n const edges: Edge[] = graph.edges.map((e) => ({\n id: `_${e.sourceId}__${e.targetId}`,\n source: e.sourceId,\n target: e.targetId,\n label: depTypeToLabel(e.dependencyLifecycleType),\n labelBgPadding: [4, 4],\n type: 'smoothstep',\n className: depTypeToClass(e.dependencyLifecycleType),\n arrowHeadType: MarkerType.Arrow,\n markerEnd: {\n type: MarkerType.Arrow,\n },\n }));\n\n return { nodes, edges };\n }, [graph]);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMA;AACA;AACA;AACO,SAASK,YAAYA,CAC1BC,KAAmD,EACnD;EAAEC;AAA0B,CAAC,EACK;EAClC,OAAO,IAAAC,gBAAO,EAAC,MAAM;IACnB,IAAI,CAACF,KAAK,EAAE,OAAO;MAAEG,KAAK,EAAE,EAAE;MAAEC,KAAK,EAAE;IAAG,CAAC;IAE3C,MAAMC,SAAS,GAAG,IAAAC,wBAAU,EAACN,KAAK,CAAC;IAEnC,MAAMG,KAAa,GAAGI,KAAK,CAACC,IAAI,CAACR,KAAK,CAACG,KAAK,CAACM,MAAM,CAAC,CAAC,CAAC,CAACC,GAAG,CAAEC,CAAC,IAAK;MAChE,OAAO;QACLC,EAAE,EAAED,CAAC,CAACC,EAAE;QACRC,IAAI,EAAE,eAAe;QACrBnB,IAAI,EAAE;UACJoB,IAAI,EAAEH,CAAC;UACPE,IAAI,EAAEZ,QAAQ,IAAIU,CAAC,CAACI,SAAS,CAACH,EAAE,CAACI,OAAO,CAACf,QAAQ,EAAE;YAAEgB,aAAa,EAAE;UAAK,CAAC,CAAC,GAAG,MAAM,GAAGC;QACzF,CAAC;QACDC,QAAQ,EAAEd,SAAS,CAACe,GAAG,CAACT,CAAC,CAACC,EAAE,CAAC,IAAI;UAAED,CAAC,EAAE,CAAC;UAAEU,CAAC,EAAE;QAAE;MAChD,CAAC;IACH,CAAC,CAAC;IAEF,MAAMjB,KAAa,GAAGJ,KAAK,CAACI,KAAK,CAACM,GAAG,CAAEY,CAAC,KAAM;MAC5CV,EAAE,
|
1
|
+
{"version":3,"names":["_react","data","require","_reactflow","_calcLayout","_depEdge","calcElements","graph","rootNode","useMemo","nodes","edges","positions","calcLayout","Array","from","values","map","x","id","type","node","component","isEqual","ignoreVersion","undefined","position","get","y","e","sourceId","targetId","source","target","label","depTypeToLabel","dependencyLifecycleType","labelBgPadding","className","depTypeToClass","arrowHeadType","MarkerType","Arrow","markerEnd"],"sources":["calc-elements.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport { MarkerType, Edge, Node } from 'reactflow';\nimport { ComponentID } from '@teambit/component';\nimport { calcLayout } from './calc-layout';\nimport { EdgeModel, GraphModel, NodeModel } from '../query';\n\nimport { depTypeToClass, depTypeToLabel } from './dep-edge';\n\ntype ElementsOptions = {\n rootNode?: ComponentID;\n};\n\n/**\n * generate Nodes and Edges for the ReactFlowRenderer graph renderer\n */\nexport function calcElements(\n graph: GraphModel<NodeModel, EdgeModel> | undefined,\n { rootNode }: ElementsOptions\n): { nodes: Node[]; edges: Edge[] } {\n return useMemo(() => {\n if (!graph) return { nodes: [], edges: [] };\n\n const positions = calcLayout(graph);\n\n const nodes: Node[] = Array.from(graph.nodes.values()).map((x) => {\n return {\n id: x.id,\n type: 'ComponentNode',\n data: {\n node: x,\n type: rootNode && x.component.id.isEqual(rootNode, { ignoreVersion: true }) ? 'root' : undefined,\n },\n position: positions.get(x.id) || { x: 0, y: 0 },\n };\n });\n\n const edges: Edge[] = graph.edges.map((e) => ({\n id: `_${e.sourceId}__${e.targetId}`,\n source: e.sourceId,\n target: e.targetId,\n label: depTypeToLabel(e.dependencyLifecycleType),\n labelBgPadding: [4, 4],\n type: 'smoothstep',\n className: depTypeToClass(e.dependencyLifecycleType),\n arrowHeadType: MarkerType.Arrow,\n markerEnd: {\n type: MarkerType.Arrow,\n },\n }));\n\n return { nodes, edges };\n }, [graph]);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAG,YAAA;EAAA,MAAAH,IAAA,GAAAC,OAAA;EAAAE,WAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AA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IAAAC,yBAAc,EAACN,CAAC,CAACO,uBAAuB,CAAC;MAChDC,cAAc,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACtBjB,IAAI,EAAE,YAAY;MAClBkB,SAAS,EAAE,IAAAC,yBAAc,EAACV,CAAC,CAACO,uBAAuB,CAAC;MACpDI,aAAa,EAAEC,uBAAU,CAACC,KAAK;MAC/BC,SAAS,EAAE;QACTvB,IAAI,EAAEqB,uBAAU,CAACC;MACnB;IACF,CAAC,CAAC,CAAC;IAEH,OAAO;MAAEhC,KAAK;MAAEC;IAAM,CAAC;EACzB,CAAC,EAAE,CAACJ,KAAK,CAAC,CAAC;AACb","ignoreList":[]}
|
@@ -15,7 +15,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
15
15
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
18
|
-
function _defineProperty(
|
18
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
20
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
21
21
|
const NODE_WIDTH = 260;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_dagre","data","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","
|
1
|
+
{"version":3,"names":["_dagre","data","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","NODE_WIDTH","NODE_HEIGHT","TOP_TO_BOTTOM","calcLayout","graph","g","graphlib","Graph","setGraph","rankdir","nodesep","ranksep","edgesep","ranker","acyclicer","setDefaultEdgeLabel","nodes","setNode","id","width","height","edges","setEdge","sourceId","targetId","dagre","layout","positionsArr","map","nodeId","node","pos","x","y","Map"],"sources":["calc-layout.tsx"],"sourcesContent":["import dagre, { graphlib } from '@dagrejs/dagre';\nimport { EdgeModel, GraphModel, NodeModel } from '../query';\n\nconst NODE_WIDTH = 260;\nconst NODE_HEIGHT = 90;\n\nconst TOP_TO_BOTTOM = 'TB';\n\n/**\n * calculate the specific location of each node in the graph\n */\nexport function calcLayout(graph: GraphModel<NodeModel, EdgeModel>) {\n const g = new graphlib.Graph();\n g.setGraph({\n rankdir: TOP_TO_BOTTOM,\n nodesep: 25,\n ranksep: 100,\n edgesep: 100,\n ranker: 'longest-path',\n acyclicer: 'greedy',\n });\n g.setDefaultEdgeLabel(() => ({}));\n\n // make a new instance of { width, height } per node, or dagre will get confused and place all nodes in the same spot\n graph.nodes.forEach((n) => g.setNode(n.id, { ...n, width: NODE_WIDTH, height: NODE_HEIGHT }));\n graph.edges.forEach((e) => g.setEdge(e.sourceId, e.targetId));\n\n // position items in graph\n dagre.layout(g);\n\n const positionsArr: [string, { x: number; y: number }][] = g.nodes().map((nodeId) => {\n const node = g.node(nodeId);\n\n const pos = {\n x: node.x - node.width / 2,\n y: node.y - node.height / 2,\n };\n\n return [nodeId, pos];\n });\n\n return new Map(positionsArr);\n}\n"],"mappings":";;;;;;AAAA,SAAAA,OAAA;EAAA,MAAAC,IAAA,GAAAC,uBAAA,CAAAC,OAAA;EAAAH,MAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAiD,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,w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OAAO,CAACS,MAAM,EAAEE,GAAG,CAAC;EACtB,CAAC,CAAC;EAEF,OAAO,IAAIG,GAAG,CAACP,YAAY,CAAC;AAC9B","ignoreList":[]}
|
@@ -19,7 +19,7 @@ function _edgeModule() {
|
|
19
19
|
};
|
20
20
|
return data;
|
21
21
|
}
|
22
|
-
function _interopRequireDefault(
|
22
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
23
23
|
function depTypeToClass(depType) {
|
24
24
|
switch (depType) {
|
25
25
|
case 'DEV':
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_edgeType","data","require","_edgeModule","_interopRequireDefault","
|
1
|
+
{"version":3,"names":["_edgeType","data","require","_edgeModule","_interopRequireDefault","e","__esModule","default","depTypeToClass","depType","edgeStyles","dev","peer","runtime","undefined","depTypeToLabel","type","EdgeType","toLowerCase"],"sources":["dep-edge.tsx"],"sourcesContent":["import { EdgeType } from '../../../edge-type';\nimport edgeStyles from './edge.module.scss';\n\nexport function depTypeToClass(depType: string) {\n switch (depType) {\n case 'DEV':\n return edgeStyles.dev;\n case 'PEER':\n return edgeStyles.peer;\n case 'RUNTIME':\n return edgeStyles.runtime;\n default:\n return undefined;\n }\n}\n\nexport function depTypeToLabel(type: EdgeType) {\n switch (type) {\n case EdgeType.peer:\n return 'Peer Dependency';\n case EdgeType.dev:\n return 'Development Dependency';\n case EdgeType.runtime:\n return 'Dependency';\n default:\n return (type as string).toLowerCase();\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,YAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,WAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA4C,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAErC,SAASG,cAAcA,CAACC,OAAe,EAAE;EAC9C,QAAQA,OAAO;IACb,KAAK,KAAK;MACR,OAAOC,qBAAU,CAACC,GAAG;IACvB,KAAK,MAAM;MACT,OAAOD,qBAAU,CAACE,IAAI;IACxB,KAAK,SAAS;MACZ,OAAOF,qBAAU,CAACG,OAAO;IAC3B;MACE,OAAOC,SAAS;EACpB;AACF;AAEO,SAASC,cAAcA,CAACC,IAAc,EAAE;EAC7C,QAAQA,IAAI;IACV,KAAKC,oBAAQ,CAACL,IAAI;MAChB,OAAO,iBAAiB;IAC1B,KAAKK,oBAAQ,CAACN,GAAG;MACf,OAAO,wBAAwB;IACjC,KAAKM,oBAAQ,CAACJ,OAAO;MACnB,OAAO,YAAY;IACrB;MACE,OAAQG,IAAI,CAAYE,WAAW,CAAC,CAAC;EACzC;AACF","ignoreList":[]}
|
@@ -62,12 +62,12 @@ function _dependenciesGraphModule() {
|
|
62
62
|
return data;
|
63
63
|
}
|
64
64
|
const _excluded = ["graph", "rootNode", "componentWidgets", "className", "onLoad", "children"];
|
65
|
-
function _interopRequireDefault(
|
65
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
66
66
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
67
67
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
68
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
69
|
-
function _objectWithoutProperties(
|
70
|
-
function _objectWithoutPropertiesLoose(
|
68
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
69
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
70
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
71
71
|
function ComponentNodeContainer(props) {
|
72
72
|
const {
|
73
73
|
sourcePosition = _reactflow().Position.Top,
|