@module-federation/devtools 0.0.0-chore-bump-node-22-20260710161714

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 (164) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/dist/es/App.css +13 -0
  4. package/dist/es/App.js +498 -0
  5. package/dist/es/App.module.js +5 -0
  6. package/dist/es/App_module.css +307 -0
  7. package/dist/es/component/DependencyGraph/index.js +204 -0
  8. package/dist/es/component/DependencyGraph/index.module.js +5 -0
  9. package/dist/es/component/DependencyGraph/index_module.css +100 -0
  10. package/dist/es/component/DependencyGraphItem/index.js +95 -0
  11. package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
  12. package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
  13. package/dist/es/component/Form/index.js +363 -0
  14. package/dist/es/component/Form/index.module.js +5 -0
  15. package/dist/es/component/Form/index_module.css +198 -0
  16. package/dist/es/component/LanguageSwitch.js +50 -0
  17. package/dist/es/component/Layout/index.js +470 -0
  18. package/dist/es/component/Layout/index.module.js +5 -0
  19. package/dist/es/component/Layout/index_module.css +68 -0
  20. package/dist/es/component/LoadingTrace/index.js +944 -0
  21. package/dist/es/component/LoadingTrace/index.module.js +5 -0
  22. package/dist/es/component/LoadingTrace/index_module.css +876 -0
  23. package/dist/es/component/ModuleInfo/index.js +313 -0
  24. package/dist/es/component/ModuleInfo/index.module.js +5 -0
  25. package/dist/es/component/ModuleInfo/index_module.css +184 -0
  26. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +35 -0
  27. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.module.js +5 -0
  28. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  29. package/dist/es/component/SharedDepsExplorer/index.js +636 -0
  30. package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
  31. package/dist/es/component/SharedDepsExplorer/index_module.css +467 -0
  32. package/dist/es/component/SharedDepsExplorer/share-utils.js +222 -0
  33. package/dist/es/component/ThemeToggle.js +19 -0
  34. package/dist/es/component/ThemeToggle.module.js +5 -0
  35. package/dist/es/component/ThemeToggle_module.css +12 -0
  36. package/dist/es/hooks/useDevtoolsTheme.js +77 -0
  37. package/dist/es/i18n/index.js +688 -0
  38. package/dist/es/init.js +8 -0
  39. package/dist/es/template/constant.js +51 -0
  40. package/dist/es/template/index.js +1 -0
  41. package/dist/es/utils/chrome/fast-refresh.js +342 -0
  42. package/dist/es/utils/chrome/index.js +284 -0
  43. package/dist/es/utils/chrome/messages.js +12 -0
  44. package/dist/es/utils/chrome/observability-plugin.js +93 -0
  45. package/dist/es/utils/chrome/observability-shared.js +99 -0
  46. package/dist/es/utils/chrome/observability.js +208 -0
  47. package/dist/es/utils/chrome/override-remote.js +2 -0
  48. package/dist/es/utils/chrome/post-message-init.js +5 -0
  49. package/dist/es/utils/chrome/post-message-listener.js +39 -0
  50. package/dist/es/utils/chrome/post-message-start.js +10 -0
  51. package/dist/es/utils/chrome/post-message.js +71 -0
  52. package/dist/es/utils/chrome/safe-post-message.js +124 -0
  53. package/dist/es/utils/chrome/snapshot-plugin.js +2 -0
  54. package/dist/es/utils/chrome/storage.js +50 -0
  55. package/dist/es/utils/data/index.js +59 -0
  56. package/dist/es/utils/index.js +4 -0
  57. package/dist/es/utils/sdk/graph.js +190 -0
  58. package/dist/es/utils/sdk/index.js +70 -0
  59. package/dist/es/utils/types/common.js +0 -0
  60. package/dist/es/utils/types/index.js +1 -0
  61. package/dist/es/vendor/basic-proxy-core.js +155 -0
  62. package/dist/es/worker/index.js +187 -0
  63. package/dist/lib/App.css +13 -0
  64. package/dist/lib/App.js +519 -0
  65. package/dist/lib/App.module.js +24 -0
  66. package/dist/lib/App_module.css +307 -0
  67. package/dist/lib/component/DependencyGraph/index.js +225 -0
  68. package/dist/lib/component/DependencyGraph/index.module.js +24 -0
  69. package/dist/lib/component/DependencyGraph/index_module.css +100 -0
  70. package/dist/lib/component/DependencyGraphItem/index.js +124 -0
  71. package/dist/lib/component/DependencyGraphItem/index.module.js +24 -0
  72. package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
  73. package/dist/lib/component/Form/index.js +372 -0
  74. package/dist/lib/component/Form/index.module.js +24 -0
  75. package/dist/lib/component/Form/index_module.css +198 -0
  76. package/dist/lib/component/LanguageSwitch.js +79 -0
  77. package/dist/lib/component/Layout/index.js +471 -0
  78. package/dist/lib/component/Layout/index.module.js +24 -0
  79. package/dist/lib/component/Layout/index_module.css +68 -0
  80. package/dist/lib/component/LoadingTrace/index.js +953 -0
  81. package/dist/lib/component/LoadingTrace/index.module.js +24 -0
  82. package/dist/lib/component/LoadingTrace/index_module.css +876 -0
  83. package/dist/lib/component/ModuleInfo/index.js +342 -0
  84. package/dist/lib/component/ModuleInfo/index.module.js +24 -0
  85. package/dist/lib/component/ModuleInfo/index_module.css +184 -0
  86. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +64 -0
  87. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +24 -0
  88. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  89. package/dist/lib/component/SharedDepsExplorer/index.js +638 -0
  90. package/dist/lib/component/SharedDepsExplorer/index.module.js +24 -0
  91. package/dist/lib/component/SharedDepsExplorer/index_module.css +467 -0
  92. package/dist/lib/component/SharedDepsExplorer/share-utils.js +252 -0
  93. package/dist/lib/component/ThemeToggle.js +48 -0
  94. package/dist/lib/component/ThemeToggle.module.js +24 -0
  95. package/dist/lib/component/ThemeToggle_module.css +12 -0
  96. package/dist/lib/hooks/useDevtoolsTheme.js +100 -0
  97. package/dist/lib/i18n/index.js +721 -0
  98. package/dist/lib/init.js +8 -0
  99. package/dist/lib/template/constant.js +84 -0
  100. package/dist/lib/template/index.js +21 -0
  101. package/dist/lib/utils/chrome/fast-refresh.js +329 -0
  102. package/dist/lib/utils/chrome/index.js +321 -0
  103. package/dist/lib/utils/chrome/messages.js +39 -0
  104. package/dist/lib/utils/chrome/observability-plugin.js +85 -0
  105. package/dist/lib/utils/chrome/observability-shared.js +125 -0
  106. package/dist/lib/utils/chrome/observability.js +233 -0
  107. package/dist/lib/utils/chrome/override-remote.js +17 -0
  108. package/dist/lib/utils/chrome/post-message-init.js +5 -0
  109. package/dist/lib/utils/chrome/post-message-listener.js +36 -0
  110. package/dist/lib/utils/chrome/post-message-start.js +10 -0
  111. package/dist/lib/utils/chrome/post-message.js +91 -0
  112. package/dist/lib/utils/chrome/safe-post-message.js +147 -0
  113. package/dist/lib/utils/chrome/snapshot-plugin.js +17 -0
  114. package/dist/lib/utils/chrome/storage.js +71 -0
  115. package/dist/lib/utils/data/index.js +83 -0
  116. package/dist/lib/utils/index.js +27 -0
  117. package/dist/lib/utils/sdk/graph.js +213 -0
  118. package/dist/lib/utils/sdk/index.js +104 -0
  119. package/dist/lib/utils/types/common.js +15 -0
  120. package/dist/lib/utils/types/index.js +21 -0
  121. package/dist/lib/vendor/basic-proxy-core.js +147 -0
  122. package/dist/lib/worker/index.js +175 -0
  123. package/dist/types/src/App.d.ts +7 -0
  124. package/dist/types/src/component/DependencyGraph/index.d.ts +6 -0
  125. package/dist/types/src/component/DependencyGraphItem/index.d.ts +9 -0
  126. package/dist/types/src/component/Form/index.d.ts +21 -0
  127. package/dist/types/src/component/LanguageSwitch.d.ts +2 -0
  128. package/dist/types/src/component/Layout/index.d.ts +15 -0
  129. package/dist/types/src/component/LoadingTrace/index.d.ts +6 -0
  130. package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
  131. package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
  132. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
  133. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +45 -0
  134. package/dist/types/src/component/ThemeToggle.d.ts +8 -0
  135. package/dist/types/src/hooks/useDevtoolsTheme.d.ts +2 -0
  136. package/dist/types/src/i18n/index.d.ts +5 -0
  137. package/dist/types/src/index.d.ts +1 -0
  138. package/dist/types/src/init.d.ts +12 -0
  139. package/dist/types/src/template/constant.d.ts +21 -0
  140. package/dist/types/src/template/index.d.ts +1 -0
  141. package/dist/types/src/utils/chrome/fast-refresh.d.ts +1 -0
  142. package/dist/types/src/utils/chrome/index.d.ts +19 -0
  143. package/dist/types/src/utils/chrome/messages.d.ts +5 -0
  144. package/dist/types/src/utils/chrome/observability-plugin.d.ts +1 -0
  145. package/dist/types/src/utils/chrome/observability-shared.d.ts +41 -0
  146. package/dist/types/src/utils/chrome/observability.d.ts +110 -0
  147. package/dist/types/src/utils/chrome/override-remote.d.ts +1 -0
  148. package/dist/types/src/utils/chrome/post-message-init.d.ts +1 -0
  149. package/dist/types/src/utils/chrome/post-message-listener.d.ts +1 -0
  150. package/dist/types/src/utils/chrome/post-message-start.d.ts +1 -0
  151. package/dist/types/src/utils/chrome/post-message.d.ts +1 -0
  152. package/dist/types/src/utils/chrome/safe-post-message.d.ts +1 -0
  153. package/dist/types/src/utils/chrome/snapshot-plugin.d.ts +1 -0
  154. package/dist/types/src/utils/chrome/storage.d.ts +5 -0
  155. package/dist/types/src/utils/data/index.d.ts +10 -0
  156. package/dist/types/src/utils/index.d.ts +4 -0
  157. package/dist/types/src/utils/sdk/graph.d.ts +46 -0
  158. package/dist/types/src/utils/sdk/index.d.ts +11 -0
  159. package/dist/types/src/utils/types/common.d.ts +22 -0
  160. package/dist/types/src/utils/types/index.d.ts +1 -0
  161. package/dist/types/src/worker/index.d.ts +1 -0
  162. package/dist/types/stories/index.stories.d.ts +9 -0
  163. package/install-deps.bash +23 -0
  164. package/package.json +108 -0
@@ -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,204 @@
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 { useTranslation } from "react-i18next";
32
+ import { DependencyGraph } from "../../utils/sdk/graph";
33
+ import GraphItem from "../DependencyGraphItem";
34
+ import { separateType } from "../../utils";
35
+ import styles from "./index.module";
36
+ import "reactflow/dist/style.css";
37
+ const nodeWidth = 360;
38
+ const nodeHeight = 420;
39
+ const nodeTypes = { graphItem: GraphItem };
40
+ const { Option } = Select;
41
+ const Graph = (props) => {
42
+ const { t } = useTranslation();
43
+ const [nodes, setNodes, onNodesChange] = useNodesState([]);
44
+ const [edges, setEdges, onEdgesChange] = useEdgesState([]);
45
+ const { snapshot } = props;
46
+ const federation = window.__FEDERATION__ || {
47
+ moduleInfo: {},
48
+ originModuleInfo: {}
49
+ };
50
+ const { moduleInfo } = federation;
51
+ const { consumers } = separateType(moduleInfo);
52
+ const [selectedConsumer, setSelectedConsumer] = useState("All");
53
+ const [maxDepth, setMaxDepth] = useState(Infinity);
54
+ const [availableDepth, setAvailableDepth] = useState(1);
55
+ useEffect(() => {
56
+ const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
57
+ let maxD = 0;
58
+ for (const consumer of targetConsumers) {
59
+ const moduleGraph = new DependencyGraph(snapshot, consumer);
60
+ moduleGraph.createGraph();
61
+ const depth = moduleGraph.calculateDepth();
62
+ if (depth > maxD) {
63
+ maxD = depth;
64
+ }
65
+ }
66
+ setAvailableDepth(maxD || 1);
67
+ }, [snapshot, selectedConsumer, consumers]);
68
+ useEffect(() => {
69
+ const dagreGraph = new dagre.graphlib.Graph();
70
+ dagreGraph.setDefaultEdgeLabel(() => ({}));
71
+ const getLayoutedElements = (nodes2, edges2, direction = "TB") => {
72
+ dagreGraph.setGraph({ rankdir: direction });
73
+ nodes2.forEach((node) => {
74
+ dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
75
+ });
76
+ edges2.forEach((edge) => {
77
+ dagreGraph.setEdge(edge.source, edge.target);
78
+ });
79
+ dagre.layout(dagreGraph);
80
+ nodes2.forEach((node) => {
81
+ const nodeWithPosition = dagreGraph.node(node.id);
82
+ node.position = {
83
+ x: nodeWithPosition.x - nodeWidth / 2,
84
+ y: nodeWithPosition.y - nodeHeight / 2
85
+ };
86
+ });
87
+ return { nodes: nodes2, edges: edges2 };
88
+ };
89
+ let nodeSet = [];
90
+ let edgeSet = [];
91
+ const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
92
+ for (const consumer of targetConsumers) {
93
+ const moduleGraph = new DependencyGraph(snapshot, consumer);
94
+ moduleGraph.createGraph();
95
+ moduleGraph.run(
96
+ moduleGraph.graph,
97
+ consumer,
98
+ "graphItem",
99
+ consumer,
100
+ 0,
101
+ maxDepth
102
+ );
103
+ nodeSet = [...nodeSet, ...moduleGraph.node];
104
+ edgeSet = [...edgeSet, ...moduleGraph.edge];
105
+ }
106
+ if (!nodeSet.length) {
107
+ nodeSet.push({
108
+ id: "1",
109
+ type: "graphItem",
110
+ position: {
111
+ x: 0,
112
+ y: 0
113
+ },
114
+ data: {
115
+ color: "lightgreen"
116
+ }
117
+ });
118
+ }
119
+ const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
120
+ nodeSet,
121
+ edgeSet
122
+ );
123
+ setNodes(layoutedNodes);
124
+ setEdges(layoutedEdges);
125
+ setTimeout(() => {
126
+ const element = document.getElementsByClassName(
127
+ "react-flow__controls-fitview"
128
+ )[0];
129
+ element == null ? void 0 : element.click();
130
+ }, 50);
131
+ }, [snapshot, selectedConsumer, maxDepth]);
132
+ const onConnect = useCallback(
133
+ (params) => setEdges(
134
+ (eds) => addEdge(
135
+ __spreadProps(__spreadValues({}, params), { type: ConnectionLineType.SmoothStep, animated: true }),
136
+ eds
137
+ )
138
+ ),
139
+ []
140
+ );
141
+ return /* @__PURE__ */ jsxs("div", { className: styles.depWrapper, children: [
142
+ /* @__PURE__ */ jsxs("div", { className: styles.header, children: [
143
+ /* @__PURE__ */ jsxs("div", { className: styles.titleBlock, children: [
144
+ /* @__PURE__ */ jsx("span", { className: styles.title, children: t("dependencyGraph.title") }),
145
+ /* @__PURE__ */ jsx("span", { className: styles.subtitle, children: t("dependencyGraph.subtitle") })
146
+ ] }),
147
+ /* @__PURE__ */ jsxs("div", { className: styles.filterBlock, children: [
148
+ /* @__PURE__ */ jsxs(
149
+ Select,
150
+ {
151
+ showSearch: true,
152
+ placeholder: t("dependencyGraph.filters.consumerPlaceholder"),
153
+ style: { width: 200 },
154
+ value: selectedConsumer,
155
+ onChange: setSelectedConsumer,
156
+ children: [
157
+ /* @__PURE__ */ jsx(Option, { value: "All", children: t("dependencyGraph.filters.consumerAll") }),
158
+ Object.keys(consumers).map((key) => /* @__PURE__ */ jsx(Option, { value: key, children: key }, key))
159
+ ]
160
+ }
161
+ ),
162
+ /* @__PURE__ */ jsxs(
163
+ Select,
164
+ {
165
+ showSearch: true,
166
+ placeholder: t("dependencyGraph.filters.depthPlaceholder"),
167
+ style: { width: 120 },
168
+ value: maxDepth === Infinity ? "All" : maxDepth,
169
+ onChange: (val) => setMaxDepth(val === "All" ? Infinity : Number(val)),
170
+ children: [
171
+ /* @__PURE__ */ jsx(Option, { value: "All", children: t("dependencyGraph.filters.depthAll") }),
172
+ Array.from({ length: availableDepth }, (_, i) => i + 1).map(
173
+ (depth) => /* @__PURE__ */ jsx(Option, { value: depth, children: t("dependencyGraph.filters.depthOption", { depth }) }, depth)
174
+ )
175
+ ]
176
+ }
177
+ )
178
+ ] }),
179
+ /* @__PURE__ */ jsxs("div", { className: styles.meta, children: [
180
+ /* @__PURE__ */ jsx("span", { className: styles.metaBadge, children: nodes.length }),
181
+ /* @__PURE__ */ jsx("span", { className: styles.metaLabel, children: nodes.length === 1 ? t("dependencyGraph.meta.singleNode") : t("dependencyGraph.meta.multiNodes") })
182
+ ] })
183
+ ] }),
184
+ /* @__PURE__ */ jsx("div", { className: styles.canvas, children: /* @__PURE__ */ jsx(
185
+ ReactFlow,
186
+ {
187
+ className: styles.graph,
188
+ nodes,
189
+ edges,
190
+ onNodesChange,
191
+ onEdgesChange,
192
+ onConnect,
193
+ nodeTypes,
194
+ proOptions: { hideAttribution: true },
195
+ fitView: true,
196
+ children: /* @__PURE__ */ jsx(Controls, { className: styles.controls })
197
+ }
198
+ ) })
199
+ ] });
200
+ };
201
+ var DependencyGraph_default = Graph;
202
+ export {
203
+ DependencyGraph_default as default
204
+ };
@@ -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,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
+ }
@@ -0,0 +1,95 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { Handle, Position } from "reactflow";
4
+ import { useTranslation } from "react-i18next";
5
+ import styles from "./index.module";
6
+ import "reactflow/dist/style.css";
7
+ const parseInfo = (info) => {
8
+ const array = info.split(":");
9
+ const [fallbackName, fallbackVersion = ""] = array;
10
+ const idx = array.findIndex((item, index) => {
11
+ return index > 0 && (item.startsWith("http") || item.startsWith("//"));
12
+ });
13
+ if (idx > 0) {
14
+ return {
15
+ name: array.slice(0, idx).join(":"),
16
+ version: array.slice(idx).join(":")
17
+ };
18
+ }
19
+ return {
20
+ name: fallbackName,
21
+ version: fallbackVersion
22
+ };
23
+ };
24
+ const GraphItem = (props) => {
25
+ const [shareds, setShareds] = useState([]);
26
+ const [exposes, setExposes] = useState([]);
27
+ const { t } = useTranslation();
28
+ let name;
29
+ let version;
30
+ const { info = "", color, remote } = props.data;
31
+ ({ name, version } = parseInfo(info));
32
+ const isEntryType = (version == null ? void 0 : version.startsWith("http")) || (version == null ? void 0 : version.startsWith("//"));
33
+ useEffect(() => {
34
+ var _a, _b;
35
+ let exposes2;
36
+ let shareds2;
37
+ if (isEntryType) {
38
+ fetch(version).then((response) => response.json()).then((json) => {
39
+ const exposeList = Array.isArray(json == null ? void 0 : json.exposes) ? json.exposes : [];
40
+ const sharedList = Array.isArray(json == null ? void 0 : json.shared) ? json.shared : [];
41
+ exposes2 = exposeList.map((expose) => expose.path) || [];
42
+ shareds2 = sharedList.map(
43
+ (share) => `${share.name}:${share.version}`
44
+ ) || [];
45
+ setExposes(exposes2);
46
+ setShareds(shareds2);
47
+ }).catch(() => {
48
+ setExposes([]);
49
+ setShareds([]);
50
+ });
51
+ } else {
52
+ exposes2 = ((_a = remote == null ? void 0 : remote.modules) == null ? void 0 : _a.map(
53
+ (item) => item.modulePath
54
+ )) || [];
55
+ shareds2 = ((_b = remote == null ? void 0 : remote.shared) == null ? void 0 : _b.map(
56
+ (item) => `${item.sharedName}:${item.version}`
57
+ )) || [];
58
+ setExposes(exposes2);
59
+ setShareds(shareds2);
60
+ }
61
+ }, [isEntryType, remote, version]);
62
+ const accentColor = color || "rgba(99, 102, 241, 0.45)";
63
+ const style = {
64
+ ["--mf-accent"]: accentColor
65
+ };
66
+ return /* @__PURE__ */ jsxs("div", { style, className: styles.Wrapper, children: [
67
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top }),
68
+ /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
69
+ /* @__PURE__ */ jsx("div", { className: styles.group, children: /* @__PURE__ */ jsx("div", { className: styles.name, children: name }) }),
70
+ version && /* @__PURE__ */ jsxs("div", { className: styles.info, children: [
71
+ exposes.length > 0 ? /* @__PURE__ */ jsxs("div", { className: styles["expose-container"], children: [
72
+ /* @__PURE__ */ jsx("span", { className: styles.type, children: t("graphItem.expose") }),
73
+ /* @__PURE__ */ jsx("div", { children: exposes.map((expose, index) => {
74
+ return /* @__PURE__ */ jsx("span", { className: styles.item, children: expose }, index);
75
+ }) })
76
+ ] }) : null,
77
+ shareds.length > 0 ? /* @__PURE__ */ jsxs("div", { className: styles["expose-container"], children: [
78
+ /* @__PURE__ */ jsx("span", { className: styles.type, children: t("graphItem.shared") }),
79
+ /* @__PURE__ */ jsx("div", { children: shareds.map((shared, index) => {
80
+ return /* @__PURE__ */ jsx("span", { className: styles.item, children: shared }, index);
81
+ }) })
82
+ ] }) : null,
83
+ /* @__PURE__ */ jsxs("div", { className: styles.message, children: [
84
+ /* @__PURE__ */ jsx("span", { className: styles.type, children: isEntryType ? t("graphItem.entry") : t("graphItem.version") }),
85
+ /* @__PURE__ */ jsx("span", { className: styles.item, children: version })
86
+ ] })
87
+ ] })
88
+ ] }),
89
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, id: "source" })
90
+ ] });
91
+ };
92
+ var DependencyGraphItem_default = GraphItem;
93
+ export {
94
+ DependencyGraphItem_default as default
95
+ };