@module-federation/devtools 0.22.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/App.css +12 -0
- package/dist/es/App.js +330 -22
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +291 -5
- package/dist/es/component/DependencyGraph/index.js +205 -0
- package/dist/es/component/DependencyGraph/index.module.js +5 -0
- package/dist/es/component/DependencyGraph/index_module.css +97 -0
- package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
- package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
- package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/es/component/Form/index.js +191 -109
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +179 -25
- package/dist/es/component/Layout/index.js +300 -49
- package/dist/es/component/Layout/index.module.js +1 -1
- package/dist/es/component/Layout/index_module.css +52 -32
- package/dist/es/component/ModuleInfo/index.js +289 -0
- package/dist/es/component/ModuleInfo/index.module.js +5 -0
- package/dist/es/component/ModuleInfo/index_module.css +183 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +33 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.module.js +5 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
- package/dist/es/component/SharedDepsExplorer/index.js +506 -0
- package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
- package/dist/es/component/SharedDepsExplorer/index_module.css +457 -0
- package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
- package/dist/es/template/constant.js +3 -19
- package/dist/es/utils/chrome/index.js +91 -38
- package/dist/es/utils/chrome/messages.js +6 -0
- package/dist/es/utils/chrome/override-remote.js +42 -0
- package/dist/es/utils/chrome/post-message-listener.js +2 -1
- package/dist/es/utils/chrome/post-message-start.js +10 -2
- package/dist/es/utils/chrome/storage.js +6 -1
- package/dist/es/utils/sdk/graph.js +25 -4
- package/dist/es/utils/sdk/index.js +9 -0
- package/dist/es/worker/index.js +168 -1
- package/dist/lib/App.css +12 -0
- package/dist/lib/App.js +321 -18
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +291 -5
- package/dist/lib/component/DependencyGraph/index.js +227 -0
- package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraph/index_module.css +97 -0
- package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
- package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/lib/component/Form/index.js +188 -107
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +179 -25
- package/dist/lib/component/Layout/index.js +294 -47
- package/dist/lib/component/Layout/index.module.js +1 -1
- package/dist/lib/component/Layout/index_module.css +52 -32
- package/dist/lib/component/ModuleInfo/index.js +319 -0
- package/dist/lib/component/ModuleInfo/index.module.js +25 -0
- package/dist/lib/component/ModuleInfo/index_module.css +183 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +63 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +25 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
- package/dist/lib/component/SharedDepsExplorer/index.js +513 -0
- package/dist/lib/component/SharedDepsExplorer/index.module.js +25 -0
- package/dist/lib/component/SharedDepsExplorer/index_module.css +457 -0
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
- package/dist/lib/template/constant.js +4 -17
- package/dist/lib/utils/chrome/index.js +94 -38
- package/dist/lib/utils/chrome/messages.js +31 -0
- package/dist/lib/utils/chrome/override-remote.js +65 -0
- package/dist/lib/utils/chrome/post-message-listener.js +2 -1
- package/dist/lib/utils/chrome/post-message-start.js +10 -2
- package/dist/lib/utils/chrome/storage.js +5 -0
- package/dist/lib/utils/sdk/graph.js +25 -4
- package/dist/lib/utils/sdk/index.js +10 -0
- package/dist/lib/worker/index.js +156 -1
- package/dist/types/src/App.d.ts +2 -1
- package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
- package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
- package/dist/types/src/component/Form/index.d.ts +2 -0
- package/dist/types/src/component/Layout/index.d.ts +0 -1
- package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
- package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
- package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
- package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
- package/dist/types/src/init.d.ts +0 -1
- package/dist/types/src/template/constant.d.ts +2 -5
- package/dist/types/src/utils/chrome/index.d.ts +5 -3
- package/dist/types/src/utils/chrome/messages.d.ts +2 -0
- package/dist/types/src/utils/chrome/override-remote.d.ts +1 -0
- package/dist/types/src/utils/chrome/storage.d.ts +5 -4
- package/dist/types/src/utils/sdk/graph.d.ts +2 -1
- package/dist/types/src/utils/sdk/index.d.ts +1 -0
- package/dist/types/src/utils/types/common.d.ts +4 -0
- package/dist/types/src/worker/index.d.ts +1 -0
- package/package.json +11 -9
- package/dist/es/component/Graph/index.js +0 -127
- package/dist/es/component/Graph/index.module.js +0 -5
- package/dist/es/component/Graph/index_module.css +0 -12
- package/dist/es/component/GraphItem/index.module.js +0 -5
- package/dist/es/component/GraphItem/index_module.css +0 -61
- package/dist/lib/component/Graph/index.js +0 -149
- package/dist/lib/component/Graph/index_module.css +0 -12
- package/dist/lib/component/GraphItem/index_module.css +0 -61
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { useCallback, useEffect, useState } from "react";
|
|
22
|
+
import ReactFlow, {
|
|
23
|
+
addEdge,
|
|
24
|
+
ConnectionLineType,
|
|
25
|
+
useNodesState,
|
|
26
|
+
useEdgesState,
|
|
27
|
+
Controls
|
|
28
|
+
} from "reactflow";
|
|
29
|
+
import dagre from "dagre";
|
|
30
|
+
import { Select } from "@arco-design/web-react";
|
|
31
|
+
import { DependencyGraph } from "../../utils/sdk/graph";
|
|
32
|
+
import GraphItem from "../DependencyGraphItem";
|
|
33
|
+
import { separateType } from "../../utils";
|
|
34
|
+
import styles from "./index.module";
|
|
35
|
+
import "reactflow/dist/style.css";
|
|
36
|
+
const nodeWidth = 360;
|
|
37
|
+
const nodeHeight = 420;
|
|
38
|
+
const nodeTypes = { graphItem: GraphItem };
|
|
39
|
+
const { Option } = Select;
|
|
40
|
+
const Graph = (props) => {
|
|
41
|
+
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
42
|
+
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
43
|
+
const { snapshot } = props;
|
|
44
|
+
const federation = window.__FEDERATION__ || {
|
|
45
|
+
moduleInfo: {},
|
|
46
|
+
originModuleInfo: {}
|
|
47
|
+
};
|
|
48
|
+
const { moduleInfo } = federation;
|
|
49
|
+
const { consumers } = separateType(moduleInfo);
|
|
50
|
+
const [selectedConsumer, setSelectedConsumer] = useState("All");
|
|
51
|
+
const [maxDepth, setMaxDepth] = useState(Infinity);
|
|
52
|
+
const [availableDepth, setAvailableDepth] = useState(1);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
|
|
55
|
+
let maxD = 0;
|
|
56
|
+
for (const consumer of targetConsumers) {
|
|
57
|
+
const moduleGraph = new DependencyGraph(snapshot, consumer);
|
|
58
|
+
moduleGraph.createGraph();
|
|
59
|
+
const depth = moduleGraph.calculateDepth();
|
|
60
|
+
if (depth > maxD) {
|
|
61
|
+
maxD = depth;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
setAvailableDepth(maxD || 1);
|
|
65
|
+
}, [snapshot, selectedConsumer, consumers]);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const dagreGraph = new dagre.graphlib.Graph();
|
|
68
|
+
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
69
|
+
const getLayoutedElements = (nodes2, edges2, direction = "TB") => {
|
|
70
|
+
dagreGraph.setGraph({ rankdir: direction });
|
|
71
|
+
nodes2.forEach((node) => {
|
|
72
|
+
dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
|
|
73
|
+
});
|
|
74
|
+
edges2.forEach((edge) => {
|
|
75
|
+
dagreGraph.setEdge(edge.source, edge.target);
|
|
76
|
+
});
|
|
77
|
+
dagre.layout(dagreGraph);
|
|
78
|
+
nodes2.forEach((node) => {
|
|
79
|
+
const nodeWithPosition = dagreGraph.node(node.id);
|
|
80
|
+
node.position = {
|
|
81
|
+
x: nodeWithPosition.x - nodeWidth / 2,
|
|
82
|
+
y: nodeWithPosition.y - nodeHeight / 2
|
|
83
|
+
};
|
|
84
|
+
});
|
|
85
|
+
return { nodes: nodes2, edges: edges2 };
|
|
86
|
+
};
|
|
87
|
+
let nodeSet = [];
|
|
88
|
+
let edgeSet = [];
|
|
89
|
+
const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
|
|
90
|
+
for (const consumer of targetConsumers) {
|
|
91
|
+
const moduleGraph = new DependencyGraph(snapshot, consumer);
|
|
92
|
+
moduleGraph.createGraph();
|
|
93
|
+
moduleGraph.run(
|
|
94
|
+
moduleGraph.graph,
|
|
95
|
+
consumer,
|
|
96
|
+
"graphItem",
|
|
97
|
+
consumer,
|
|
98
|
+
0,
|
|
99
|
+
maxDepth
|
|
100
|
+
);
|
|
101
|
+
nodeSet = [...nodeSet, ...moduleGraph.node];
|
|
102
|
+
edgeSet = [...edgeSet, ...moduleGraph.edge];
|
|
103
|
+
}
|
|
104
|
+
if (!nodeSet.length) {
|
|
105
|
+
nodeSet.push({
|
|
106
|
+
id: "1",
|
|
107
|
+
type: "graphItem",
|
|
108
|
+
position: {
|
|
109
|
+
x: 0,
|
|
110
|
+
y: 0
|
|
111
|
+
},
|
|
112
|
+
data: {
|
|
113
|
+
color: "lightgreen"
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
|
|
118
|
+
nodeSet,
|
|
119
|
+
edgeSet
|
|
120
|
+
);
|
|
121
|
+
setNodes(layoutedNodes);
|
|
122
|
+
setEdges(layoutedEdges);
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
const element = document.getElementsByClassName(
|
|
125
|
+
"react-flow__controls-fitview"
|
|
126
|
+
)[0];
|
|
127
|
+
element == null ? void 0 : element.click();
|
|
128
|
+
}, 50);
|
|
129
|
+
}, [snapshot, selectedConsumer, maxDepth]);
|
|
130
|
+
const onConnect = useCallback(
|
|
131
|
+
(params) => setEdges(
|
|
132
|
+
(eds) => addEdge(
|
|
133
|
+
__spreadProps(__spreadValues({}, params), { type: ConnectionLineType.SmoothStep, animated: true }),
|
|
134
|
+
eds
|
|
135
|
+
)
|
|
136
|
+
),
|
|
137
|
+
[]
|
|
138
|
+
);
|
|
139
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.depWrapper, children: [
|
|
140
|
+
/* @__PURE__ */ jsxs("div", { className: styles.header, children: [
|
|
141
|
+
/* @__PURE__ */ jsxs("div", { className: styles.titleBlock, children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", { className: styles.title, children: "Dependency Graph" }),
|
|
143
|
+
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: "Visualise how consumers resolve remotes with the current overrides." })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsxs("div", { className: styles.filterBlock, children: [
|
|
146
|
+
/* @__PURE__ */ jsxs(
|
|
147
|
+
Select,
|
|
148
|
+
{
|
|
149
|
+
showSearch: true,
|
|
150
|
+
placeholder: "Select Consumer",
|
|
151
|
+
style: { width: 200 },
|
|
152
|
+
value: selectedConsumer,
|
|
153
|
+
onChange: setSelectedConsumer,
|
|
154
|
+
children: [
|
|
155
|
+
/* @__PURE__ */ jsx(Option, { value: "All", children: "All Consumers" }),
|
|
156
|
+
Object.keys(consumers).map((key) => /* @__PURE__ */ jsx(Option, { value: key, children: key }, key))
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
/* @__PURE__ */ jsxs(
|
|
161
|
+
Select,
|
|
162
|
+
{
|
|
163
|
+
showSearch: true,
|
|
164
|
+
placeholder: "Select Depth",
|
|
165
|
+
style: { width: 120 },
|
|
166
|
+
value: maxDepth === Infinity ? "All" : maxDepth,
|
|
167
|
+
onChange: (val) => setMaxDepth(val === "All" ? Infinity : val),
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsx(Option, { value: "All", children: "All Depth" }),
|
|
170
|
+
Array.from({ length: availableDepth }, (_, i) => i + 1).map(
|
|
171
|
+
(depth) => /* @__PURE__ */ jsxs(Option, { value: depth, children: [
|
|
172
|
+
"Depth: ",
|
|
173
|
+
depth
|
|
174
|
+
] }, depth)
|
|
175
|
+
)
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
] }),
|
|
180
|
+
/* @__PURE__ */ jsxs("div", { className: styles.meta, children: [
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: styles.metaBadge, children: nodes.length }),
|
|
182
|
+
/* @__PURE__ */ jsx("span", { className: styles.metaLabel, children: nodes.length === 1 ? "node rendered" : "nodes rendered" })
|
|
183
|
+
] })
|
|
184
|
+
] }),
|
|
185
|
+
/* @__PURE__ */ jsx("div", { className: styles.canvas, children: /* @__PURE__ */ jsx(
|
|
186
|
+
ReactFlow,
|
|
187
|
+
{
|
|
188
|
+
className: styles.graph,
|
|
189
|
+
nodes,
|
|
190
|
+
edges,
|
|
191
|
+
onNodesChange,
|
|
192
|
+
onEdgesChange,
|
|
193
|
+
onConnect,
|
|
194
|
+
nodeTypes,
|
|
195
|
+
proOptions: { hideAttribution: true },
|
|
196
|
+
fitView: true,
|
|
197
|
+
children: /* @__PURE__ */ jsx(Controls, { className: styles.controls })
|
|
198
|
+
}
|
|
199
|
+
) })
|
|
200
|
+
] });
|
|
201
|
+
};
|
|
202
|
+
var DependencyGraph_default = Graph;
|
|
203
|
+
export {
|
|
204
|
+
DependencyGraph_default as default
|
|
205
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./index_module.css";
|
|
2
|
+
var index_module_default = { "depWrapper": "depWrapper_5e584", "header": "header_5e584", "titleBlock": "titleBlock_5e584", "title": "title_5e584", "subtitle": "subtitle_5e584", "meta": "meta_5e584", "metaBadge": "metaBadge_5e584", "metaLabel": "metaLabel_5e584", "filterBlock": "filterBlock_5e584", "canvas": "canvas_5e584", "graph": "graph_5e584", "controls": "controls_5e584" };
|
|
3
|
+
export {
|
|
4
|
+
index_module_default as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.depWrapper_5e584 {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 16px;
|
|
5
|
+
min-height: 340px;
|
|
6
|
+
color: #1f2937;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.header_5e584 {
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: space-between;
|
|
12
|
+
align-items: flex-start;
|
|
13
|
+
gap: 18px;
|
|
14
|
+
padding: 0 6px 6px;
|
|
15
|
+
border-bottom: 1px solid rgba(96, 165, 250, 0.3);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.titleBlock_5e584 {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
gap: 6px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.title_5e584 {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
color: #1f2937;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.subtitle_5e584 {
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
color: #4b5563;
|
|
33
|
+
max-width: 260px;
|
|
34
|
+
line-height: 1.5;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.meta_5e584 {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 10px;
|
|
41
|
+
background: rgba(228, 228, 231, 0.5);
|
|
42
|
+
padding: 4px 12px;
|
|
43
|
+
border-radius: 999px;
|
|
44
|
+
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.metaBadge_5e584 {
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
font-weight: 600;
|
|
50
|
+
color: #1f2937;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.metaLabel_5e584 {
|
|
54
|
+
font-size: 12px;
|
|
55
|
+
color: #4b5563;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.filterBlock_5e584 {
|
|
59
|
+
display: flex;
|
|
60
|
+
align-items: center;
|
|
61
|
+
gap: 12px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.canvas_5e584 {
|
|
65
|
+
flex: 1 1;
|
|
66
|
+
padding: 12px;
|
|
67
|
+
border-radius: 16px;
|
|
68
|
+
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
69
|
+
background: rgba(228, 228, 231, 0.5);
|
|
70
|
+
backdrop-filter: blur(4px);
|
|
71
|
+
}
|
|
72
|
+
.canvas_5e584 .react-flow__handle {
|
|
73
|
+
width: 10px;
|
|
74
|
+
height: 10px;
|
|
75
|
+
border-radius: 50%;
|
|
76
|
+
border: 2px solid rgba(96, 165, 250, 0.3);
|
|
77
|
+
background: rgba(243, 244, 246, 0.9);
|
|
78
|
+
}
|
|
79
|
+
.canvas_5e584 .react-flow__controls-button:hover {
|
|
80
|
+
background: rgba(243, 244, 246, 0.9);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.graph_5e584 {
|
|
84
|
+
width: 100%;
|
|
85
|
+
height: 58vh !important;
|
|
86
|
+
min-height: 280px;
|
|
87
|
+
border-radius: 12px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.controls_5e584 .react-flow__controls-button {
|
|
91
|
+
background: rgba(243, 244, 246, 0.3);
|
|
92
|
+
border-color: rgba(96, 165, 250, 0.3);
|
|
93
|
+
color: #1f2937;
|
|
94
|
+
}
|
|
95
|
+
.controls_5e584 .react-flow__controls-button:hover {
|
|
96
|
+
background: rgb(255, 255, 255);
|
|
97
|
+
}
|
|
@@ -23,12 +23,17 @@ const GraphItem = (props) => {
|
|
|
23
23
|
let shareds2;
|
|
24
24
|
if (isEntryType) {
|
|
25
25
|
fetch(version).then((response) => response.json()).then((json) => {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const exposeList = Array.isArray(json == null ? void 0 : json.exposes) ? json.exposes : [];
|
|
27
|
+
const sharedList = Array.isArray(json == null ? void 0 : json.shared) ? json.shared : [];
|
|
28
|
+
exposes2 = exposeList.map((expose) => expose.path) || [];
|
|
29
|
+
shareds2 = sharedList.map(
|
|
28
30
|
(share) => `${share.name}:${share.version}`
|
|
29
31
|
) || [];
|
|
30
32
|
setExposes(exposes2);
|
|
31
33
|
setShareds(shareds2);
|
|
34
|
+
}).catch(() => {
|
|
35
|
+
setExposes([]);
|
|
36
|
+
setShareds([]);
|
|
32
37
|
});
|
|
33
38
|
} else {
|
|
34
39
|
exposes2 = ((_a = remote == null ? void 0 : remote.modules) == null ? void 0 : _a.map(
|
|
@@ -40,8 +45,12 @@ const GraphItem = (props) => {
|
|
|
40
45
|
setExposes(exposes2);
|
|
41
46
|
setShareds(shareds2);
|
|
42
47
|
}
|
|
43
|
-
}, []);
|
|
44
|
-
|
|
48
|
+
}, [isEntryType, remote, version]);
|
|
49
|
+
const accentColor = color || "rgba(99, 102, 241, 0.45)";
|
|
50
|
+
const style = {
|
|
51
|
+
["--mf-accent"]: accentColor
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ jsxs("div", { style, className: styles.Wrapper, children: [
|
|
45
54
|
/* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top }),
|
|
46
55
|
/* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
47
56
|
/* @__PURE__ */ jsx("div", { className: styles.group, children: /* @__PURE__ */ jsx("div", { className: styles.name, children: name }) }),
|
|
@@ -67,7 +76,7 @@ const GraphItem = (props) => {
|
|
|
67
76
|
/* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, id: "source" })
|
|
68
77
|
] });
|
|
69
78
|
};
|
|
70
|
-
var
|
|
79
|
+
var DependencyGraphItem_default = GraphItem;
|
|
71
80
|
export {
|
|
72
|
-
|
|
81
|
+
DependencyGraphItem_default as default
|
|
73
82
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "./index_module.css";
|
|
2
|
+
var index_module_default = { "Wrapper": "Wrapper_d8079", "container": "container_d8079", "group": "group_d8079", "name": "name_d8079", "info": "info_d8079", "expose-container": "expose-container_d8079", "type": "type_d8079", "item": "item_d8079", "message": "message_d8079" };
|
|
3
|
+
export {
|
|
4
|
+
index_module_default as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
.Wrapper_d8079 {
|
|
2
|
+
display: flex;
|
|
3
|
+
width: 320px;
|
|
4
|
+
border-radius: 18px;
|
|
5
|
+
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
box-shadow: 0 18px 32px rgba(8, 11, 25, 0.35);
|
|
8
|
+
background: linear-gradient(140deg, var(--mf-accent, rgba(243, 244, 246, 0.9)) 0%, rgba(229, 231, 235, 0.7) 45%, rgba(255, 255, 255, 0.95) 100%), rgba(255, 255, 255, 0.9);
|
|
9
|
+
color: #1f2937;
|
|
10
|
+
backdrop-filter: blur(4px);
|
|
11
|
+
}
|
|
12
|
+
.Wrapper_d8079 .react-flow__handle {
|
|
13
|
+
width: 10px;
|
|
14
|
+
height: 10px;
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
border: 2px solid rgba(96, 165, 250, 0.3);
|
|
17
|
+
background: rgba(243, 244, 246, 0.9);
|
|
18
|
+
box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
|
|
19
|
+
}
|
|
20
|
+
.Wrapper_d8079 .container_d8079 {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
width: 100%;
|
|
24
|
+
padding-bottom: 8px;
|
|
25
|
+
}
|
|
26
|
+
.Wrapper_d8079 .group_d8079 {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
padding: 12px;
|
|
31
|
+
background: var(--mf-accent, rgba(243, 244, 246, 0.9));
|
|
32
|
+
}
|
|
33
|
+
.Wrapper_d8079 .name_d8079 {
|
|
34
|
+
font-size: 15px;
|
|
35
|
+
font-weight: 600;
|
|
36
|
+
letter-spacing: 0.02em;
|
|
37
|
+
color: white;
|
|
38
|
+
}
|
|
39
|
+
.Wrapper_d8079 .info_d8079 {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
gap: 10px;
|
|
43
|
+
margin: 0 12px;
|
|
44
|
+
padding: 12px;
|
|
45
|
+
border-radius: 14px;
|
|
46
|
+
background: rgba(243, 244, 246, 0.4);
|
|
47
|
+
border: 1px solid rgba(96, 165, 250, 0.3);
|
|
48
|
+
font-size: 11px;
|
|
49
|
+
}
|
|
50
|
+
.Wrapper_d8079 .expose-container_d8079 {
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: 6px;
|
|
54
|
+
}
|
|
55
|
+
.Wrapper_d8079 .expose-container_d8079 div {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
gap: 6px;
|
|
59
|
+
}
|
|
60
|
+
.Wrapper_d8079 .type_d8079 {
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
text-transform: uppercase;
|
|
64
|
+
letter-spacing: 0.04em;
|
|
65
|
+
color: #4b5563;
|
|
66
|
+
}
|
|
67
|
+
.Wrapper_d8079 .item_d8079 {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
padding: 4px 8px;
|
|
71
|
+
border-radius: 999px;
|
|
72
|
+
background: rgba(243, 244, 246, 0.6);
|
|
73
|
+
color: #1f2937;
|
|
74
|
+
font-size: 10px;
|
|
75
|
+
font-weight: 500;
|
|
76
|
+
margin-right: 6px;
|
|
77
|
+
max-width: 100%;
|
|
78
|
+
white-space: nowrap;
|
|
79
|
+
text-overflow: ellipsis;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
box-shadow: 0 4px 10px rgba(8, 11, 25, 0.45);
|
|
82
|
+
}
|
|
83
|
+
.Wrapper_d8079 .message_d8079 {
|
|
84
|
+
display: flex;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 6px;
|
|
87
|
+
font-size: 11px;
|
|
88
|
+
color: #4b5563;
|
|
89
|
+
}
|
|
90
|
+
.Wrapper_d8079 .message_d8079 .item_d8079 {
|
|
91
|
+
margin-right: 0;
|
|
92
|
+
padding: 4px 10px;
|
|
93
|
+
background: rgba(243, 244, 246, 0.6);
|
|
94
|
+
color: #1f2937;
|
|
95
|
+
}
|