@teambit/graph 0.0.639 → 0.0.640
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/{__preview-1643772133658.js → __preview-1643858579620.js} +1 -1
- package/dist/ui/dependencies-graph/dependencies-graph.js +2 -2
- package/dist/ui/dependencies-graph/dependencies-graph.js.map +1 -1
- package/package-tar/teambit-graph-0.0.640.tgz +0 -0
- package/package.json +8 -8
- package/ui/dependencies-graph/dependencies-graph.tsx +22 -19
- package/package-tar/teambit-graph-0.0.639.tgz +0 -0
@@ -1 +1 @@
|
|
1
|
-
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.
|
1
|
+
export const overview = [require('/home/circleci/Library/Caches/Bit/capsules/8891be5ad3d35bfc38b9cd90c0e05b598a5a55af/teambit.component_graph@0.0.640/dist/graph.docs.md')]
|
@@ -169,7 +169,7 @@ function DependenciesGraph(_ref) {
|
|
169
169
|
}, [graph]);
|
170
170
|
return /*#__PURE__*/_react().default.createElement(_graphContext().ComponentGraphContext.Provider, {
|
171
171
|
value: context
|
172
|
-
}, /*#__PURE__*/_react().default.createElement(_reactFlowRenderer().default, (0, _extends2().default)({
|
172
|
+
}, /*#__PURE__*/_react().default.createElement(_reactFlowRenderer().ReactFlowProvider, null, /*#__PURE__*/_react().default.createElement(_reactFlowRenderer().default, (0, _extends2().default)({
|
173
173
|
draggable: false,
|
174
174
|
nodesDraggable: true,
|
175
175
|
selectNodesOnDrag: false,
|
@@ -187,7 +187,7 @@ function DependenciesGraph(_ref) {
|
|
187
187
|
}), /*#__PURE__*/_react().default.createElement(_reactFlowRenderer().MiniMap, {
|
188
188
|
nodeColor: _minimap().calcMinimapColors,
|
189
189
|
className: _dependenciesGraphModule().default.minimap
|
190
|
-
}), children));
|
190
|
+
}), children)));
|
191
191
|
}
|
192
192
|
|
193
193
|
//# sourceMappingURL=dependencies-graph.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["dependencies-graph.tsx"],"names":["ComponentNodeContainer","props","sourcePosition","Position","Top","targetPosition","Bottom","data","id","node","type","NodeTypes","ComponentNode","DependenciesGraph","graph","rootNode","componentWidgets","className","onLoad","children","rest","graphRef","elements","context","handleLoad","instance","current","fitView","undefined","styles","controls","calcMinimapColors","minimap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;
|
1
|
+
{"version":3,"sources":["dependencies-graph.tsx"],"names":["ComponentNodeContainer","props","sourcePosition","Position","Top","targetPosition","Bottom","data","id","node","type","NodeTypes","ComponentNode","DependenciesGraph","graph","rootNode","componentWidgets","className","onLoad","children","rest","graphRef","elements","context","handleLoad","instance","current","fitView","undefined","styles","controls","calcMinimapColors","minimap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAeA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;;;AAEA,SAASA,sBAAT,CAAgCC,KAAhC,EAAkD;AAChD,QAAM;AAAEC,IAAAA,cAAc,GAAGC,8BAASC,GAA5B;AAAiCC,IAAAA,cAAc,GAAGF,8BAASG,MAA3D;AAAmEC,IAAAA,IAAnE;AAAyEC,IAAAA;AAAzE,MAAgFP,KAA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AA1C,EAAsD,EAAtD;AAEA,0BAAU,MAAM;AAAA;;AACd,yBAAAP,QAAQ,CAACK,OAAT,wEAAkBC,OAAlB;AACD,GAFD,EAEG,CAACb,KAAD,CAFH;AAIA,sBACE,+BAAC,qCAAD,CAAuB,QAAvB;AAAgC,IAAA,KAAK,EAAES;AAAvC,kBACE,+BAAC,sCAAD,qBACE,+BAAC,4BAAD;AACE,IAAA,SAAS,EAAE,KADb;AAEE,IAAA,cAAc,EAAE,IAFlB;AAGE,IAAA,iBAAiB,EAAE,KAHrB;AAIE,IAAA,gBAAgB,EAAE,KAJpB;AAKE,IAAA,iBAAiB,EAAE,KALrB;AAME,IAAA,kBAAkB,EAAE,KANtB;AAOE,IAAA,OAAO,EAAE;AAPX,KAQMH,IARN;AASE,IAAA,SAAS,EAAE,2BAAWS,mCAAOf,KAAlB,EAAyBG,SAAzB,CATb;AAUE,IAAA,QAAQ,EAAEK,QAVZ;AAWE,IAAA,SAAS,EAAEX,SAXb;AAYE,IAAA,MAAM,EAAEa;AAZV,mBAcE,+BAAC,+BAAD,OAdF,eAeE,+BAAC,6BAAD;AAAU,IAAA,SAAS,EAAEK,mCAAOC;AAA5B,IAfF,eAgBE,+BAAC,4BAAD;AAAS,IAAA,SAAS,EAAEC,4BAApB;AAAuC,IAAA,SAAS,EAAEF,mCAAOG;AAAzD,IAhBF,EAiBGb,QAjBH,CADF,CADF,CADF;AAyBD","sourcesContent":["import React, { useMemo, useCallback, useRef, useEffect } from 'react';\nimport classnames from 'classnames';\nimport ReactFlow, {\n ReactFlowProvider,\n Controls,\n Background,\n MiniMap,\n OnLoadParams,\n NodeTypesType,\n Handle,\n Position,\n NodeProps,\n ReactFlowProps,\n} from 'react-flow-renderer';\nimport { ComponentID } from '@teambit/component';\n\nimport { ComponentWidgetSlot } from '../../graph.ui.runtime';\nimport { ComponentNode } from '../component-node';\nimport { GraphModel } from '../query';\nimport { calcElements } from './calc-elements';\nimport { calcMinimapColors } from './minimap';\nimport { ComponentGraphContext } from './graph-context';\n\nimport styles from './dependencies-graph.module.scss';\n\nfunction ComponentNodeContainer(props: NodeProps) {\n const { sourcePosition = Position.Top, targetPosition = Position.Bottom, data, id } = props;\n\n return (\n <div key={id}>\n <Handle type=\"target\" position={targetPosition} isConnectable={false} />\n <Handle type=\"source\" position={sourcePosition} isConnectable={false} />\n <ComponentNode node={data.node} type={data.type} />\n </div>\n );\n}\n\nconst NodeTypes: NodeTypesType = { ComponentNode: ComponentNodeContainer };\n\nexport type DependenciesGraphProps = {\n rootNode: ComponentID;\n graph: GraphModel;\n componentWidgets: ComponentWidgetSlot;\n onLoad?: (instance: OnLoadParams) => void;\n} & Omit<ReactFlowProps, 'elements'>;\n\nexport function DependenciesGraph({\n graph,\n rootNode,\n componentWidgets,\n className,\n onLoad,\n children,\n ...rest\n}: DependenciesGraphProps) {\n const graphRef = useRef<OnLoadParams>();\n const elements = calcElements(graph, { rootNode });\n const context = useMemo(() => ({ componentWidgets }), [componentWidgets]);\n\n const handleLoad = useCallback(\n (instance: OnLoadParams) => {\n graphRef.current = instance;\n instance.fitView();\n onLoad?.(instance);\n },\n [onLoad]\n );\n\n // clear ref on unmount\n useEffect(() => () => (graphRef.current = undefined), []);\n\n useEffect(() => {\n graphRef.current?.fitView();\n }, [graph]);\n\n return (\n <ComponentGraphContext.Provider value={context}>\n <ReactFlowProvider>\n <ReactFlow\n draggable={false}\n nodesDraggable={true}\n selectNodesOnDrag={false}\n nodesConnectable={false}\n zoomOnDoubleClick={false}\n elementsSelectable={false}\n maxZoom={1}\n {...rest}\n className={classnames(styles.graph, className)}\n elements={elements}\n nodeTypes={NodeTypes}\n onLoad={handleLoad}\n >\n <Background />\n <Controls className={styles.controls} />\n <MiniMap nodeColor={calcMinimapColors} className={styles.minimap} />\n {children}\n </ReactFlow>\n </ReactFlowProvider>\n </ComponentGraphContext.Provider>\n );\n}\n"]}
|
Binary file
|
package/package.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teambit/graph",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.640",
|
4
4
|
"homepage": "https://bit.dev/teambit/component/graph",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"componentId": {
|
7
7
|
"scope": "teambit.component",
|
8
8
|
"name": "graph",
|
9
|
-
"version": "0.0.
|
9
|
+
"version": "0.0.640"
|
10
10
|
},
|
11
11
|
"dependencies": {
|
12
12
|
"@teambit/harmony": "0.2.11",
|
@@ -23,10 +23,10 @@
|
|
23
23
|
"@teambit/base-ui.text.muted-text": "1.0.1",
|
24
24
|
"@teambit/evangelist.input.checkbox.label": "1.0.3",
|
25
25
|
"@teambit/documenter.ui.heading": "4.1.1",
|
26
|
-
"@teambit/component": "0.0.
|
27
|
-
"@teambit/graphql": "0.0.
|
28
|
-
"@teambit/cli": "0.0.
|
29
|
-
"@teambit/ui": "0.0.
|
26
|
+
"@teambit/component": "0.0.640",
|
27
|
+
"@teambit/graphql": "0.0.640",
|
28
|
+
"@teambit/cli": "0.0.437",
|
29
|
+
"@teambit/ui": "0.0.640",
|
30
30
|
"@teambit/legacy-bit-id": "0.0.397",
|
31
31
|
"@teambit/component.ui.deprecation-icon": "0.0.492",
|
32
32
|
"@teambit/design.ui.styles.ellipsis": "0.0.347",
|
@@ -49,7 +49,7 @@
|
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
51
51
|
"@apollo/client": "^3.0.0",
|
52
|
-
"@teambit/legacy": "1.0.
|
52
|
+
"@teambit/legacy": "1.0.213",
|
53
53
|
"react-dom": "^16.8.0 || ^17.0.0",
|
54
54
|
"react": "^16.8.0 || ^17.0.0"
|
55
55
|
},
|
@@ -77,7 +77,7 @@
|
|
77
77
|
"react": "-"
|
78
78
|
},
|
79
79
|
"peerDependencies": {
|
80
|
-
"@teambit/legacy": "1.0.
|
80
|
+
"@teambit/legacy": "1.0.213",
|
81
81
|
"react-dom": "^16.8.0 || ^17.0.0",
|
82
82
|
"react": "^16.8.0 || ^17.0.0"
|
83
83
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React, { useMemo, useCallback, useRef, useEffect } from 'react';
|
2
2
|
import classnames from 'classnames';
|
3
3
|
import ReactFlow, {
|
4
|
+
ReactFlowProvider,
|
4
5
|
Controls,
|
5
6
|
Background,
|
6
7
|
MiniMap,
|
@@ -74,25 +75,27 @@ export function DependenciesGraph({
|
|
74
75
|
|
75
76
|
return (
|
76
77
|
<ComponentGraphContext.Provider value={context}>
|
77
|
-
<
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
78
|
+
<ReactFlowProvider>
|
79
|
+
<ReactFlow
|
80
|
+
draggable={false}
|
81
|
+
nodesDraggable={true}
|
82
|
+
selectNodesOnDrag={false}
|
83
|
+
nodesConnectable={false}
|
84
|
+
zoomOnDoubleClick={false}
|
85
|
+
elementsSelectable={false}
|
86
|
+
maxZoom={1}
|
87
|
+
{...rest}
|
88
|
+
className={classnames(styles.graph, className)}
|
89
|
+
elements={elements}
|
90
|
+
nodeTypes={NodeTypes}
|
91
|
+
onLoad={handleLoad}
|
92
|
+
>
|
93
|
+
<Background />
|
94
|
+
<Controls className={styles.controls} />
|
95
|
+
<MiniMap nodeColor={calcMinimapColors} className={styles.minimap} />
|
96
|
+
{children}
|
97
|
+
</ReactFlow>
|
98
|
+
</ReactFlowProvider>
|
96
99
|
</ComponentGraphContext.Provider>
|
97
100
|
);
|
98
101
|
}
|
Binary file
|