@module-federation/devtools 0.0.0-next-20250925034616 → 0.0.0-perf-devtools-20260106124142

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.
Files changed (92) hide show
  1. package/dist/es/App.js +328 -22
  2. package/dist/es/App.module.js +1 -1
  3. package/dist/es/App_module.css +291 -5
  4. package/dist/es/component/DependencyGraph/index.js +205 -0
  5. package/dist/es/component/DependencyGraph/index.module.js +5 -0
  6. package/dist/es/component/DependencyGraph/index_module.css +97 -0
  7. package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
  8. package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
  9. package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
  10. package/dist/es/component/Form/index.js +191 -109
  11. package/dist/es/component/Form/index.module.js +1 -1
  12. package/dist/es/component/Form/index_module.css +179 -25
  13. package/dist/es/component/Layout/index.js +288 -51
  14. package/dist/es/component/Layout/index.module.js +1 -1
  15. package/dist/es/component/Layout/index_module.css +52 -32
  16. package/dist/es/component/ModuleInfo/index.js +289 -0
  17. package/dist/es/component/ModuleInfo/index.module.js +5 -0
  18. package/dist/es/component/ModuleInfo/index_module.css +183 -0
  19. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +39 -0
  20. package/dist/es/component/SharedDepsExplorer/index.js +505 -0
  21. package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
  22. package/dist/es/index.css +15 -0
  23. package/dist/es/template/constant.js +5 -19
  24. package/dist/es/utils/chrome/fast-refresh.js +80 -7
  25. package/dist/es/utils/chrome/index.js +91 -38
  26. package/dist/es/utils/chrome/messages.js +6 -0
  27. package/dist/es/utils/chrome/post-message-listener.js +2 -1
  28. package/dist/es/utils/chrome/post-message-start.js +10 -2
  29. package/dist/es/utils/chrome/storage.js +6 -1
  30. package/dist/es/utils/sdk/graph.js +25 -4
  31. package/dist/es/utils/sdk/index.js +9 -0
  32. package/dist/es/worker/index.js +168 -1
  33. package/dist/lib/App.js +318 -17
  34. package/dist/lib/App.module.js +1 -1
  35. package/dist/lib/App_module.css +291 -5
  36. package/dist/lib/component/DependencyGraph/index.js +227 -0
  37. package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
  38. package/dist/lib/component/DependencyGraph/index_module.css +97 -0
  39. package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
  40. package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
  41. package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
  42. package/dist/lib/component/Form/index.js +188 -107
  43. package/dist/lib/component/Form/index.module.js +1 -1
  44. package/dist/lib/component/Form/index_module.css +179 -25
  45. package/dist/lib/component/Layout/index.js +280 -48
  46. package/dist/lib/component/Layout/index.module.js +1 -1
  47. package/dist/lib/component/Layout/index_module.css +52 -32
  48. package/dist/lib/component/ModuleInfo/index.js +319 -0
  49. package/dist/lib/component/ModuleInfo/index.module.js +25 -0
  50. package/dist/lib/component/ModuleInfo/index_module.css +183 -0
  51. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +59 -0
  52. package/dist/lib/component/SharedDepsExplorer/index.js +512 -0
  53. package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
  54. package/dist/lib/index.css +15 -0
  55. package/dist/lib/template/constant.js +7 -17
  56. package/dist/lib/utils/chrome/fast-refresh.js +77 -8
  57. package/dist/lib/utils/chrome/index.js +94 -38
  58. package/dist/lib/utils/chrome/messages.js +31 -0
  59. package/dist/lib/utils/chrome/post-message-listener.js +2 -1
  60. package/dist/lib/utils/chrome/post-message-start.js +10 -2
  61. package/dist/lib/utils/chrome/storage.js +5 -0
  62. package/dist/lib/utils/sdk/graph.js +25 -4
  63. package/dist/lib/utils/sdk/index.js +10 -0
  64. package/dist/lib/worker/index.js +156 -1
  65. package/dist/types/src/App.d.ts +0 -1
  66. package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
  67. package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
  68. package/dist/types/src/component/Form/index.d.ts +2 -0
  69. package/dist/types/src/component/Layout/index.d.ts +0 -1
  70. package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
  71. package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
  72. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
  73. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
  74. package/dist/types/src/index.d.ts +2 -1
  75. package/dist/types/src/init.d.ts +0 -1
  76. package/dist/types/src/template/constant.d.ts +3 -5
  77. package/dist/types/src/utils/chrome/index.d.ts +5 -3
  78. package/dist/types/src/utils/chrome/messages.d.ts +2 -0
  79. package/dist/types/src/utils/chrome/storage.d.ts +5 -4
  80. package/dist/types/src/utils/sdk/graph.d.ts +2 -1
  81. package/dist/types/src/utils/sdk/index.d.ts +1 -0
  82. package/dist/types/src/utils/types/common.d.ts +4 -0
  83. package/dist/types/src/worker/index.d.ts +1 -0
  84. package/package.json +18 -14
  85. package/dist/es/component/Graph/index.js +0 -127
  86. package/dist/es/component/Graph/index.module.js +0 -5
  87. package/dist/es/component/Graph/index_module.css +0 -12
  88. package/dist/es/component/GraphItem/index.module.js +0 -5
  89. package/dist/es/component/GraphItem/index_module.css +0 -61
  90. package/dist/lib/component/Graph/index.js +0 -149
  91. package/dist/lib/component/Graph/index_module.css +0 -12
  92. package/dist/lib/component/GraphItem/index_module.css +0 -61
@@ -3,17 +3,303 @@
3
3
  }
4
4
  .arco-form-layout-horizontal {
5
5
  flex: 1 1;
6
- margin: 0 1vw 0 0;
6
+ margin: 0;
7
7
  }
8
8
  .arco-form-item-wrapper {
9
9
  width: 100%;
10
10
  flex: 1 1;
11
11
  }
12
+ .arco-empty {
13
+ color: #4b5563;
14
+ }
15
+ .arco-select, .arco-input {
16
+ background: transparent;
17
+ }
18
+ .arco-tag-color-arcoblue {
19
+ background: rgba(34, 197, 94, 0.18);
20
+ border: 1px solid rgba(34, 197, 94, 0.35);
21
+ color: #4b5563;
22
+ }
12
23
 
13
- .layout_ae2ee {
24
+ .shell_ae2ee {
14
25
  width: 100%;
15
- height: 100vh;
26
+ min-height: 100vh;
27
+ display: flex;
28
+ align-items: stretch;
29
+ justify-content: center;
30
+ gap: clamp(18px, 3vw, 36px);
31
+ padding: 28px clamp(16px, 4vw, 48px);
32
+ box-sizing: border-box;
33
+ background: radial-gradient(circle at 10% 20%, rgba(229, 231, 235, 0.8) 0%, rgba(243, 244, 246, 0.9) 55%), linear-gradient(135deg, #ffffff 0%, #f9fafb 40%, #f3f4f6 100%);
34
+ }
35
+
36
+ .sidebar_ae2ee {
37
+ width: clamp(160px, 18vw, 220px);
38
+ min-width: 150px;
39
+ display: flex;
40
+ flex-direction: column;
41
+ gap: 12px;
42
+ padding: clamp(18px, 2.5vw, 24px) clamp(14px, 2vw, 18px);
43
+ border-radius: 22px;
44
+ border: 1px solid rgba(148, 163, 184, 0.18);
45
+ background: rgba(255, 255, 255, 0.95);
46
+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.05) inset;
47
+ box-sizing: border-box;
48
+ }
49
+
50
+ .tabItem_ae2ee {
51
+ display: flex;
52
+ align-items: center;
53
+ justify-content: flex-start;
54
+ border: 1px solid transparent;
55
+ border-radius: 12px;
56
+ padding: 10px 12px;
57
+ background: rgba(249, 250, 251, 0.8);
58
+ color: rgba(55, 65, 81, 0.9);
59
+ font-size: 13px;
60
+ letter-spacing: 0.04em;
61
+ text-transform: uppercase;
62
+ cursor: pointer;
63
+ transition: all 0.15s ease;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ .tabItem_ae2ee:hover {
68
+ border-color: rgba(37, 49, 48, 0.45);
69
+ color: #1e293b;
70
+ }
71
+
72
+ .activeTab_ae2ee {
73
+ border-color: rgba(99, 102, 241, 0.65);
74
+ background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
75
+ color: #1e293b;
76
+ box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
77
+ }
78
+
79
+ .panel_ae2ee {
80
+ flex: 1 1;
81
+ min-width: 0;
82
+ width: 100%;
83
+ max-width: 1120px;
84
+ min-height: calc(100vh - 56px);
85
+ background: rgba(255, 255, 255, 0.98);
86
+ border: 1px solid rgba(0, 0, 0, 0.08);
87
+ box-shadow: 0 24px 64px rgba(0, 0, 0, 0.06), 0 2px 0 rgba(0, 0, 0, 0.04) inset;
88
+ border-radius: 22px;
89
+ padding: clamp(20px, 3vw, 32px);
90
+ display: flex;
91
+ flex-direction: column;
92
+ gap: 28px;
93
+ box-sizing: border-box;
94
+ color: #1f2937;
95
+ }
96
+
97
+ .header_ae2ee {
98
+ display: flex;
99
+ flex-direction: column;
100
+ gap: 18px;
101
+ }
102
+
103
+ .headerTop_ae2ee {
104
+ display: flex;
105
+ align-items: center;
106
+ justify-content: space-between;
107
+ gap: 14px;
108
+ }
109
+
110
+ .branding_ae2ee {
111
+ display: flex;
112
+ flex-direction: column;
113
+ gap: 4px;
114
+ }
115
+
116
+ .refresh_ae2ee .arco-btn-primary {
117
+ background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.7));
118
+ border-color: rgba(34, 197, 94, 0.65);
119
+ }
120
+ .refresh_ae2ee .arco-btn-primary:hover {
121
+ background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.85));
122
+ }
123
+
124
+ .logo_ae2ee {
125
+ font-size: 20px;
126
+ font-weight: 600;
127
+ letter-spacing: 0.02em;
128
+ color: #1e293b;
129
+ }
130
+
131
+ .subtitle_ae2ee {
132
+ font-size: 12px;
133
+ font-weight: 500;
134
+ color: rgba(75, 85, 99, 0.8);
135
+ text-transform: uppercase;
136
+ letter-spacing: 0.12em;
137
+ }
138
+
139
+ .meta_ae2ee {
140
+ display: flex;
141
+ align-items: stretch;
142
+ justify-content: space-between;
143
+ gap: 18px;
144
+ flex-wrap: wrap;
145
+ }
146
+
147
+ .scope_ae2ee {
148
+ display: flex;
149
+ flex-direction: column;
150
+ gap: 8px;
151
+ flex: 1 1 160px;
152
+ }
153
+
154
+ .scopeLabel_ae2ee {
155
+ font-size: 12px;
156
+ color: rgba(75, 85, 99, 0.85);
157
+ text-transform: uppercase;
158
+ letter-spacing: 0.08em;
16
159
  }
17
- .layout_ae2ee .content_ae2ee {
18
- margin: 0 0.5vw 0 2vw;
160
+
161
+ .stats_ae2ee {
162
+ display: flex;
163
+ align-items: center;
164
+ gap: 14px;
165
+ flex-wrap: wrap;
166
+ }
167
+
168
+ .statBlock_ae2ee {
169
+ display: flex;
170
+ flex-direction: column;
171
+ gap: 2px;
172
+ min-width: 80px;
173
+ padding: 12px 14px;
174
+ border-radius: 14px;
175
+ background: linear-gradient(140deg, rgba(243, 244, 246, 0.8) 0%, rgba(229, 231, 235, 0.6) 100%);
176
+ border: 1px solid rgba(203, 213, 225, 0.4);
177
+ box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
178
+ }
179
+
180
+ .statValue_ae2ee {
181
+ font-size: 22px;
182
+ font-weight: 600;
183
+ color: #1e293b;
184
+ line-height: 1.1;
185
+ }
186
+
187
+ .statLabel_ae2ee {
188
+ font-size: 11px;
189
+ color: rgba(75, 85, 99, 0.88);
190
+ letter-spacing: 0.04em;
191
+ text-transform: uppercase;
192
+ }
193
+
194
+ .body_ae2ee {
195
+ flex: 1 1;
196
+ display: flex;
197
+ flex-direction: column;
198
+ min-height: 0;
199
+ overflow: hidden;
200
+ }
201
+
202
+ .content_ae2ee {
203
+ flex: 1 1;
204
+ display: flex;
205
+ flex-direction: column;
206
+ min-height: 0;
207
+ overflow: auto;
208
+ gap: 16px;
209
+ }
210
+
211
+ @media (max-width: 980px) {
212
+ .shell_ae2ee {
213
+ flex-direction: column;
214
+ align-items: stretch;
215
+ }
216
+ .sidebar_ae2ee {
217
+ width: 100%;
218
+ flex-direction: row;
219
+ align-items: center;
220
+ justify-content: flex-start;
221
+ overflow-x: auto;
222
+ padding: 16px 12px;
223
+ gap: 10px;
224
+ }
225
+ .tabItem_ae2ee {
226
+ flex: 1 0 auto;
227
+ justify-content: center;
228
+ padding: 10px 14px;
229
+ }
230
+ .panel_ae2ee {
231
+ max-width: none;
232
+ min-height: auto;
233
+ }
234
+ }
235
+ @media (max-width: 640px) {
236
+ .panel_ae2ee {
237
+ padding: 20px;
238
+ }
239
+ .meta_ae2ee {
240
+ gap: 12px;
241
+ }
242
+ .stats_ae2ee {
243
+ width: 100%;
244
+ justify-content: space-between;
245
+ }
246
+ }
247
+ .emptyState_ae2ee {
248
+ flex: 1 1;
249
+ display: flex;
250
+ align-items: center;
251
+ justify-content: center;
252
+ border-radius: 18px;
253
+ border: 1px dashed rgba(203, 213, 225, 0.4);
254
+ background: rgba(255, 255, 255, 0.8);
255
+ padding: 32px;
256
+ }
257
+
258
+ .empty_ae2ee .arco-empty-image > svg path {
259
+ fill: rgba(75, 85, 99, 0.5);
260
+ }
261
+
262
+ .placeholder_ae2ee {
263
+ flex: 1 1;
264
+ display: flex;
265
+ align-items: center;
266
+ justify-content: center;
267
+ border-radius: 18px;
268
+ border: 1px dashed rgba(203, 213, 225, 0.4);
269
+ background: rgba(255, 255, 255, 0.8);
270
+ color: rgba(75, 85, 99, 0.75);
271
+ font-size: 14px;
272
+ letter-spacing: 0.08em;
273
+ text-transform: uppercase;
274
+ }
275
+
276
+ .overrideArco_ae2ee .arco-input-inner-wrapper,
277
+ .overrideArco_ae2ee .arco-select-view {
278
+ background-color: #fff !important;
279
+ border-color: rgba(228, 228, 231, 0.5) !important;
280
+ }
281
+ .overrideArco_ae2ee .arco-input-inner-wrapper:hover,
282
+ .overrideArco_ae2ee .arco-select-view:hover {
283
+ background-color: #fff !important;
284
+ border-color: rgba(228, 228, 231, 0.5) !important;
285
+ }
286
+ .overrideArco_ae2ee .arco-input-inner-wrapper:focus-within,
287
+ .overrideArco_ae2ee .arco-select-view-focus {
288
+ background-color: #fff !important;
289
+ border-color: rgba(228, 228, 231, 0.5) !important;
290
+ }
291
+ .overrideArco_ae2ee .arco-collapse-item .arco-collapse-item-icon-hover {
292
+ top: 25% !important;
293
+ }
294
+ .overrideArco_ae2ee .arco-tabs-content {
295
+ padding-top: 0px !important;
296
+ }
297
+
298
+ .arco-table-th {
299
+ background-color: rgb(250 250 250/var(--tw-bg-opacity)) !important;
300
+ border-bottom-color: rgb(228 228 231/var(--tw-border-opacity)) !important;
301
+ }
302
+
303
+ .arco-table-td {
304
+ border-bottom-color: rgba(228, 228, 231, 0.5) !important;
19
305
  }
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __defProps = Object.defineProperties;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
+ var __spreadValues = (a, b) => {
14
+ for (var prop in b || (b = {}))
15
+ if (__hasOwnProp.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ if (__getOwnPropSymbols)
18
+ for (var prop of __getOwnPropSymbols(b)) {
19
+ if (__propIsEnum.call(b, prop))
20
+ __defNormalProp(a, prop, b[prop]);
21
+ }
22
+ return a;
23
+ };
24
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
+ var __export = (target, all) => {
26
+ for (var name in all)
27
+ __defProp(target, name, { get: all[name], enumerable: true });
28
+ };
29
+ var __copyProps = (to, from, except, desc) => {
30
+ if (from && typeof from === "object" || typeof from === "function") {
31
+ for (let key of __getOwnPropNames(from))
32
+ if (!__hasOwnProp.call(to, key) && key !== except)
33
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
34
+ }
35
+ return to;
36
+ };
37
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
38
+ // If the importer is in node compatibility mode or this is not an ESM
39
+ // file that has been converted to a CommonJS file using a Babel-
40
+ // compatible transform (i.e. "__esModule" has not been set), then set
41
+ // "default" to the CommonJS "module.exports" for node compatibility.
42
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
43
+ mod
44
+ ));
45
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
46
+ var DependencyGraph_exports = {};
47
+ __export(DependencyGraph_exports, {
48
+ default: () => DependencyGraph_default
49
+ });
50
+ module.exports = __toCommonJS(DependencyGraph_exports);
51
+ var import_jsx_runtime = require("react/jsx-runtime");
52
+ var import_react = require("react");
53
+ var import_reactflow = __toESM(require("reactflow"));
54
+ var import_dagre = __toESM(require("dagre"));
55
+ var import_web_react = require("@arco-design/web-react");
56
+ var import_graph = require("../../utils/sdk/graph");
57
+ var import_DependencyGraphItem = __toESM(require("../DependencyGraphItem"));
58
+ var import_utils = require("../../utils");
59
+ var import_index = __toESM(require("./index.module"));
60
+ var import_style = require("reactflow/dist/style.css");
61
+ const nodeWidth = 360;
62
+ const nodeHeight = 420;
63
+ const nodeTypes = { graphItem: import_DependencyGraphItem.default };
64
+ const { Option } = import_web_react.Select;
65
+ const Graph = (props) => {
66
+ const [nodes, setNodes, onNodesChange] = (0, import_reactflow.useNodesState)([]);
67
+ const [edges, setEdges, onEdgesChange] = (0, import_reactflow.useEdgesState)([]);
68
+ const { snapshot } = props;
69
+ const federation = window.__FEDERATION__ || {
70
+ moduleInfo: {},
71
+ originModuleInfo: {}
72
+ };
73
+ const { moduleInfo } = federation;
74
+ const { consumers } = (0, import_utils.separateType)(moduleInfo);
75
+ const [selectedConsumer, setSelectedConsumer] = (0, import_react.useState)("All");
76
+ const [maxDepth, setMaxDepth] = (0, import_react.useState)(Infinity);
77
+ const [availableDepth, setAvailableDepth] = (0, import_react.useState)(1);
78
+ (0, import_react.useEffect)(() => {
79
+ const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
80
+ let maxD = 0;
81
+ for (const consumer of targetConsumers) {
82
+ const moduleGraph = new import_graph.DependencyGraph(snapshot, consumer);
83
+ moduleGraph.createGraph();
84
+ const depth = moduleGraph.calculateDepth();
85
+ if (depth > maxD) {
86
+ maxD = depth;
87
+ }
88
+ }
89
+ setAvailableDepth(maxD || 1);
90
+ }, [snapshot, selectedConsumer, consumers]);
91
+ (0, import_react.useEffect)(() => {
92
+ const dagreGraph = new import_dagre.default.graphlib.Graph();
93
+ dagreGraph.setDefaultEdgeLabel(() => ({}));
94
+ const getLayoutedElements = (nodes2, edges2, direction = "TB") => {
95
+ dagreGraph.setGraph({ rankdir: direction });
96
+ nodes2.forEach((node) => {
97
+ dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
98
+ });
99
+ edges2.forEach((edge) => {
100
+ dagreGraph.setEdge(edge.source, edge.target);
101
+ });
102
+ import_dagre.default.layout(dagreGraph);
103
+ nodes2.forEach((node) => {
104
+ const nodeWithPosition = dagreGraph.node(node.id);
105
+ node.position = {
106
+ x: nodeWithPosition.x - nodeWidth / 2,
107
+ y: nodeWithPosition.y - nodeHeight / 2
108
+ };
109
+ });
110
+ return { nodes: nodes2, edges: edges2 };
111
+ };
112
+ let nodeSet = [];
113
+ let edgeSet = [];
114
+ const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
115
+ for (const consumer of targetConsumers) {
116
+ const moduleGraph = new import_graph.DependencyGraph(snapshot, consumer);
117
+ moduleGraph.createGraph();
118
+ moduleGraph.run(
119
+ moduleGraph.graph,
120
+ consumer,
121
+ "graphItem",
122
+ consumer,
123
+ 0,
124
+ maxDepth
125
+ );
126
+ nodeSet = [...nodeSet, ...moduleGraph.node];
127
+ edgeSet = [...edgeSet, ...moduleGraph.edge];
128
+ }
129
+ if (!nodeSet.length) {
130
+ nodeSet.push({
131
+ id: "1",
132
+ type: "graphItem",
133
+ position: {
134
+ x: 0,
135
+ y: 0
136
+ },
137
+ data: {
138
+ color: "lightgreen"
139
+ }
140
+ });
141
+ }
142
+ const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
143
+ nodeSet,
144
+ edgeSet
145
+ );
146
+ setNodes(layoutedNodes);
147
+ setEdges(layoutedEdges);
148
+ setTimeout(() => {
149
+ const element = document.getElementsByClassName(
150
+ "react-flow__controls-fitview"
151
+ )[0];
152
+ element == null ? void 0 : element.click();
153
+ }, 50);
154
+ }, [snapshot, selectedConsumer, maxDepth]);
155
+ const onConnect = (0, import_react.useCallback)(
156
+ (params) => setEdges(
157
+ (eds) => (0, import_reactflow.addEdge)(
158
+ __spreadProps(__spreadValues({}, params), { type: import_reactflow.ConnectionLineType.SmoothStep, animated: true }),
159
+ eds
160
+ )
161
+ ),
162
+ []
163
+ );
164
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.depWrapper, children: [
165
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.header, children: [
166
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.titleBlock, children: [
167
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.title, children: "Dependency Graph" }),
168
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.subtitle, children: "Visualise how consumers resolve remotes with the current overrides." })
169
+ ] }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.filterBlock, children: [
171
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
172
+ import_web_react.Select,
173
+ {
174
+ showSearch: true,
175
+ placeholder: "Select Consumer",
176
+ style: { width: 200 },
177
+ value: selectedConsumer,
178
+ onChange: setSelectedConsumer,
179
+ children: [
180
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: "All Consumers" }),
181
+ Object.keys(consumers).map((key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: key, children: key }, key))
182
+ ]
183
+ }
184
+ ),
185
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
186
+ import_web_react.Select,
187
+ {
188
+ showSearch: true,
189
+ placeholder: "Select Depth",
190
+ style: { width: 120 },
191
+ value: maxDepth === Infinity ? "All" : maxDepth,
192
+ onChange: (val) => setMaxDepth(val === "All" ? Infinity : val),
193
+ children: [
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: "All Depth" }),
195
+ Array.from({ length: availableDepth }, (_, i) => i + 1).map(
196
+ (depth) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Option, { value: depth, children: [
197
+ "Depth: ",
198
+ depth
199
+ ] }, depth)
200
+ )
201
+ ]
202
+ }
203
+ )
204
+ ] }),
205
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.meta, children: [
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaBadge, children: nodes.length }),
207
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaLabel, children: nodes.length === 1 ? "node rendered" : "nodes rendered" })
208
+ ] })
209
+ ] }),
210
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.canvas, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
211
+ import_reactflow.default,
212
+ {
213
+ className: import_index.default.graph,
214
+ nodes,
215
+ edges,
216
+ onNodesChange,
217
+ onEdgesChange,
218
+ onConnect,
219
+ nodeTypes,
220
+ proOptions: { hideAttribution: true },
221
+ fitView: true,
222
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactflow.Controls, { className: import_index.default.controls })
223
+ }
224
+ ) })
225
+ ] });
226
+ };
227
+ var DependencyGraph_default = Graph;
@@ -22,4 +22,4 @@ __export(index_module_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(index_module_exports);
24
24
  var import_index_module = require("./index_module.css");
25
- var index_module_default = { "Wrapper": "Wrapper_2fa4f", "container": "container_2fa4f", "group": "group_2fa4f", "name": "name_2fa4f", "info": "info_2fa4f", "expose-container": "expose-container_2fa4f", "type": "type_2fa4f", "item": "item_2fa4f", "message": "message_2fa4f" };
25
+ 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" };
@@ -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
+ }
@@ -26,11 +26,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var GraphItem_exports = {};
30
- __export(GraphItem_exports, {
31
- default: () => GraphItem_default
29
+ var DependencyGraphItem_exports = {};
30
+ __export(DependencyGraphItem_exports, {
31
+ default: () => DependencyGraphItem_default
32
32
  });
33
- module.exports = __toCommonJS(GraphItem_exports);
33
+ module.exports = __toCommonJS(DependencyGraphItem_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  var import_react = require("react");
36
36
  var import_reactflow = require("reactflow");
@@ -56,12 +56,17 @@ const GraphItem = (props) => {
56
56
  let shareds2;
57
57
  if (isEntryType) {
58
58
  fetch(version).then((response) => response.json()).then((json) => {
59
- exposes2 = json.exposes.map((expose) => expose.path) || [];
60
- shareds2 = json.shared.map(
59
+ const exposeList = Array.isArray(json == null ? void 0 : json.exposes) ? json.exposes : [];
60
+ const sharedList = Array.isArray(json == null ? void 0 : json.shared) ? json.shared : [];
61
+ exposes2 = exposeList.map((expose) => expose.path) || [];
62
+ shareds2 = sharedList.map(
61
63
  (share) => `${share.name}:${share.version}`
62
64
  ) || [];
63
65
  setExposes(exposes2);
64
66
  setShareds(shareds2);
67
+ }).catch(() => {
68
+ setExposes([]);
69
+ setShareds([]);
65
70
  });
66
71
  } else {
67
72
  exposes2 = ((_a = remote == null ? void 0 : remote.modules) == null ? void 0 : _a.map(
@@ -73,8 +78,12 @@ const GraphItem = (props) => {
73
78
  setExposes(exposes2);
74
79
  setShareds(shareds2);
75
80
  }
76
- }, []);
77
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style: { background: color }, className: import_index.default.Wrapper, children: [
81
+ }, [isEntryType, remote, version]);
82
+ const accentColor = color || "rgba(99, 102, 241, 0.45)";
83
+ const style = {
84
+ ["--mf-accent"]: accentColor
85
+ };
86
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { style, className: import_index.default.Wrapper, children: [
78
87
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactflow.Handle, { type: "target", position: import_reactflow.Position.Top }),
79
88
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.container, children: [
80
89
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.group, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.name, children: name }) }),
@@ -100,4 +109,4 @@ const GraphItem = (props) => {
100
109
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactflow.Handle, { type: "source", position: import_reactflow.Position.Bottom, id: "source" })
101
110
  ] });
102
111
  };
103
- var GraphItem_default = GraphItem;
112
+ var DependencyGraphItem_default = GraphItem;
@@ -22,4 +22,4 @@ __export(index_module_exports, {
22
22
  });
23
23
  module.exports = __toCommonJS(index_module_exports);
24
24
  var import_index_module = require("./index_module.css");
25
- var index_module_default = { "depWrapper": "depWrapper_613b1", "table": "table_613b1", "graph": "graph_613b1" };
25
+ 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" };