@module-federation/devtools 2.6.0 → 2.8.0

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