@module-federation/devtools 0.22.0 → 0.23.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.
- package/dist/es/App.css +13 -0
- package/dist/es/App.js +461 -21
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +293 -5
- package/dist/es/component/DependencyGraph/index.js +204 -0
- package/dist/es/component/DependencyGraph/index.module.js +5 -0
- package/dist/es/component/DependencyGraph/index_module.css +100 -0
- package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +20 -9
- package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
- package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/es/component/Form/index.js +192 -117
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +176 -25
- package/dist/es/component/LanguageSwitch.js +50 -0
- package/dist/es/component/Layout/index.js +296 -49
- package/dist/es/component/Layout/index.module.js +1 -1
- package/dist/es/component/Layout/index_module.css +52 -32
- package/dist/es/component/ModuleInfo/index.js +313 -0
- package/dist/es/component/ModuleInfo/index.module.js +5 -0
- package/dist/es/component/ModuleInfo/index_module.css +184 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +35 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.module.js +5 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
- package/dist/es/component/SharedDepsExplorer/index.js +495 -0
- package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
- package/dist/es/component/SharedDepsExplorer/index_module.css +467 -0
- package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
- package/dist/es/component/ThemeToggle.js +19 -0
- package/dist/es/component/ThemeToggle.module.js +5 -0
- package/dist/es/component/ThemeToggle_module.css +12 -0
- package/dist/es/hooks/useDevtoolsTheme.js +77 -0
- package/dist/es/i18n/index.js +506 -0
- package/dist/es/template/constant.js +3 -19
- package/dist/es/utils/chrome/index.js +91 -38
- package/dist/es/utils/chrome/messages.js +6 -0
- package/dist/es/utils/chrome/override-remote.js +42 -0
- package/dist/es/utils/chrome/post-message-listener.js +2 -1
- package/dist/es/utils/chrome/post-message-start.js +10 -2
- package/dist/es/utils/chrome/storage.js +6 -1
- package/dist/es/utils/sdk/graph.js +25 -4
- package/dist/es/utils/sdk/index.js +9 -0
- package/dist/es/worker/index.js +168 -1
- package/dist/lib/App.css +13 -0
- package/dist/lib/App.js +451 -18
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +293 -5
- package/dist/lib/component/DependencyGraph/index.js +226 -0
- package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraph/index_module.css +100 -0
- package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +23 -12
- package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
- package/dist/lib/component/Form/index.js +189 -115
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +176 -25
- package/dist/lib/component/LanguageSwitch.js +80 -0
- package/dist/lib/component/Layout/index.js +290 -47
- package/dist/lib/component/Layout/index.module.js +1 -1
- package/dist/lib/component/Layout/index_module.css +52 -32
- package/dist/lib/component/ModuleInfo/index.js +343 -0
- package/dist/lib/component/ModuleInfo/index.module.js +25 -0
- package/dist/lib/component/ModuleInfo/index_module.css +184 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +65 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +25 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
- package/dist/lib/component/SharedDepsExplorer/index.js +502 -0
- package/dist/lib/component/SharedDepsExplorer/index.module.js +25 -0
- package/dist/lib/component/SharedDepsExplorer/index_module.css +467 -0
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
- package/dist/lib/component/ThemeToggle.js +49 -0
- package/dist/lib/component/ThemeToggle.module.js +25 -0
- package/dist/lib/component/ThemeToggle_module.css +12 -0
- package/dist/lib/hooks/useDevtoolsTheme.js +101 -0
- package/dist/lib/i18n/index.js +540 -0
- package/dist/lib/template/constant.js +4 -17
- package/dist/lib/utils/chrome/index.js +94 -38
- package/dist/lib/utils/chrome/messages.js +31 -0
- package/dist/lib/utils/chrome/override-remote.js +65 -0
- package/dist/lib/utils/chrome/post-message-listener.js +2 -1
- package/dist/lib/utils/chrome/post-message-start.js +10 -2
- package/dist/lib/utils/chrome/storage.js +5 -0
- package/dist/lib/utils/sdk/graph.js +25 -4
- package/dist/lib/utils/sdk/index.js +10 -0
- package/dist/lib/worker/index.js +156 -1
- package/dist/types/src/App.d.ts +2 -1
- package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
- package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
- package/dist/types/src/component/Form/index.d.ts +2 -0
- package/dist/types/src/component/LanguageSwitch.d.ts +2 -0
- package/dist/types/src/component/Layout/index.d.ts +0 -1
- package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
- package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
- package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
- package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
- package/dist/types/src/component/ThemeToggle.d.ts +8 -0
- package/dist/types/src/hooks/useDevtoolsTheme.d.ts +2 -0
- package/dist/types/src/i18n/index.d.ts +5 -0
- package/dist/types/src/init.d.ts +0 -1
- package/dist/types/src/template/constant.d.ts +2 -5
- package/dist/types/src/utils/chrome/index.d.ts +5 -3
- package/dist/types/src/utils/chrome/messages.d.ts +2 -0
- package/dist/types/src/utils/chrome/override-remote.d.ts +1 -0
- package/dist/types/src/utils/chrome/storage.d.ts +5 -4
- package/dist/types/src/utils/sdk/graph.d.ts +2 -1
- package/dist/types/src/utils/sdk/index.d.ts +1 -0
- package/dist/types/src/utils/types/common.d.ts +4 -0
- package/dist/types/src/worker/index.d.ts +1 -0
- package/package.json +18 -14
- package/dist/es/component/Graph/index.js +0 -127
- package/dist/es/component/Graph/index.module.js +0 -5
- package/dist/es/component/Graph/index_module.css +0 -12
- package/dist/es/component/GraphItem/index.module.js +0 -5
- package/dist/es/component/GraphItem/index_module.css +0 -61
- package/dist/lib/component/Graph/index.js +0 -149
- package/dist/lib/component/Graph/index_module.css +0 -12
- package/dist/lib/component/GraphItem/index_module.css +0 -61
package/dist/lib/App_module.css
CHANGED
|
@@ -3,17 +3,305 @@
|
|
|
3
3
|
}
|
|
4
4
|
.arco-form-layout-horizontal {
|
|
5
5
|
flex: 1 1;
|
|
6
|
-
margin: 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: 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
|
+
}
|
|
12
29
|
|
|
13
|
-
.
|
|
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(99, 102, 241, 0.65);
|
|
80
|
+
background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
|
|
81
|
+
color: var(--color-text-1, #1e293b);
|
|
82
|
+
box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.panel_ae2ee {
|
|
86
|
+
flex: 1 1;
|
|
87
|
+
min-width: 0;
|
|
14
88
|
width: 100%;
|
|
15
|
-
|
|
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;
|
|
16
283
|
}
|
|
17
|
-
.
|
|
18
|
-
|
|
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%);
|
|
19
307
|
}
|
|
@@ -0,0 +1,226 @@
|
|
|
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_react_i18next = require("react-i18next");
|
|
57
|
+
var import_graph = require("../../utils/sdk/graph");
|
|
58
|
+
var import_DependencyGraphItem = __toESM(require("../DependencyGraphItem"));
|
|
59
|
+
var import_utils = require("../../utils");
|
|
60
|
+
var import_index = __toESM(require("./index.module"));
|
|
61
|
+
var import_style = require("reactflow/dist/style.css");
|
|
62
|
+
const nodeWidth = 360;
|
|
63
|
+
const nodeHeight = 420;
|
|
64
|
+
const nodeTypes = { graphItem: import_DependencyGraphItem.default };
|
|
65
|
+
const { Option } = import_web_react.Select;
|
|
66
|
+
const Graph = (props) => {
|
|
67
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
68
|
+
const [nodes, setNodes, onNodesChange] = (0, import_reactflow.useNodesState)([]);
|
|
69
|
+
const [edges, setEdges, onEdgesChange] = (0, import_reactflow.useEdgesState)([]);
|
|
70
|
+
const { snapshot } = props;
|
|
71
|
+
const federation = window.__FEDERATION__ || {
|
|
72
|
+
moduleInfo: {},
|
|
73
|
+
originModuleInfo: {}
|
|
74
|
+
};
|
|
75
|
+
const { moduleInfo } = federation;
|
|
76
|
+
const { consumers } = (0, import_utils.separateType)(moduleInfo);
|
|
77
|
+
const [selectedConsumer, setSelectedConsumer] = (0, import_react.useState)("All");
|
|
78
|
+
const [maxDepth, setMaxDepth] = (0, import_react.useState)(Infinity);
|
|
79
|
+
const [availableDepth, setAvailableDepth] = (0, import_react.useState)(1);
|
|
80
|
+
(0, import_react.useEffect)(() => {
|
|
81
|
+
const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
|
|
82
|
+
let maxD = 0;
|
|
83
|
+
for (const consumer of targetConsumers) {
|
|
84
|
+
const moduleGraph = new import_graph.DependencyGraph(snapshot, consumer);
|
|
85
|
+
moduleGraph.createGraph();
|
|
86
|
+
const depth = moduleGraph.calculateDepth();
|
|
87
|
+
if (depth > maxD) {
|
|
88
|
+
maxD = depth;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
setAvailableDepth(maxD || 1);
|
|
92
|
+
}, [snapshot, selectedConsumer, consumers]);
|
|
93
|
+
(0, import_react.useEffect)(() => {
|
|
94
|
+
const dagreGraph = new import_dagre.default.graphlib.Graph();
|
|
95
|
+
dagreGraph.setDefaultEdgeLabel(() => ({}));
|
|
96
|
+
const getLayoutedElements = (nodes2, edges2, direction = "TB") => {
|
|
97
|
+
dagreGraph.setGraph({ rankdir: direction });
|
|
98
|
+
nodes2.forEach((node) => {
|
|
99
|
+
dagreGraph.setNode(node.id, { width: nodeWidth, height: nodeHeight });
|
|
100
|
+
});
|
|
101
|
+
edges2.forEach((edge) => {
|
|
102
|
+
dagreGraph.setEdge(edge.source, edge.target);
|
|
103
|
+
});
|
|
104
|
+
import_dagre.default.layout(dagreGraph);
|
|
105
|
+
nodes2.forEach((node) => {
|
|
106
|
+
const nodeWithPosition = dagreGraph.node(node.id);
|
|
107
|
+
node.position = {
|
|
108
|
+
x: nodeWithPosition.x - nodeWidth / 2,
|
|
109
|
+
y: nodeWithPosition.y - nodeHeight / 2
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
return { nodes: nodes2, edges: edges2 };
|
|
113
|
+
};
|
|
114
|
+
let nodeSet = [];
|
|
115
|
+
let edgeSet = [];
|
|
116
|
+
const targetConsumers = selectedConsumer === "All" ? Object.keys(consumers) : [selectedConsumer].filter((c) => consumers[c]);
|
|
117
|
+
for (const consumer of targetConsumers) {
|
|
118
|
+
const moduleGraph = new import_graph.DependencyGraph(snapshot, consumer);
|
|
119
|
+
moduleGraph.createGraph();
|
|
120
|
+
moduleGraph.run(
|
|
121
|
+
moduleGraph.graph,
|
|
122
|
+
consumer,
|
|
123
|
+
"graphItem",
|
|
124
|
+
consumer,
|
|
125
|
+
0,
|
|
126
|
+
maxDepth
|
|
127
|
+
);
|
|
128
|
+
nodeSet = [...nodeSet, ...moduleGraph.node];
|
|
129
|
+
edgeSet = [...edgeSet, ...moduleGraph.edge];
|
|
130
|
+
}
|
|
131
|
+
if (!nodeSet.length) {
|
|
132
|
+
nodeSet.push({
|
|
133
|
+
id: "1",
|
|
134
|
+
type: "graphItem",
|
|
135
|
+
position: {
|
|
136
|
+
x: 0,
|
|
137
|
+
y: 0
|
|
138
|
+
},
|
|
139
|
+
data: {
|
|
140
|
+
color: "lightgreen"
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
const { nodes: layoutedNodes, edges: layoutedEdges } = getLayoutedElements(
|
|
145
|
+
nodeSet,
|
|
146
|
+
edgeSet
|
|
147
|
+
);
|
|
148
|
+
setNodes(layoutedNodes);
|
|
149
|
+
setEdges(layoutedEdges);
|
|
150
|
+
setTimeout(() => {
|
|
151
|
+
const element = document.getElementsByClassName(
|
|
152
|
+
"react-flow__controls-fitview"
|
|
153
|
+
)[0];
|
|
154
|
+
element == null ? void 0 : element.click();
|
|
155
|
+
}, 50);
|
|
156
|
+
}, [snapshot, selectedConsumer, maxDepth]);
|
|
157
|
+
const onConnect = (0, import_react.useCallback)(
|
|
158
|
+
(params) => setEdges(
|
|
159
|
+
(eds) => (0, import_reactflow.addEdge)(
|
|
160
|
+
__spreadProps(__spreadValues({}, params), { type: import_reactflow.ConnectionLineType.SmoothStep, animated: true }),
|
|
161
|
+
eds
|
|
162
|
+
)
|
|
163
|
+
),
|
|
164
|
+
[]
|
|
165
|
+
);
|
|
166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.depWrapper, children: [
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.header, children: [
|
|
168
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.titleBlock, children: [
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.title, children: t("dependencyGraph.title") }),
|
|
170
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.subtitle, children: t("dependencyGraph.subtitle") })
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.filterBlock, children: [
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
174
|
+
import_web_react.Select,
|
|
175
|
+
{
|
|
176
|
+
showSearch: true,
|
|
177
|
+
placeholder: t("dependencyGraph.filters.consumerPlaceholder"),
|
|
178
|
+
style: { width: 200 },
|
|
179
|
+
value: selectedConsumer,
|
|
180
|
+
onChange: setSelectedConsumer,
|
|
181
|
+
children: [
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: t("dependencyGraph.filters.consumerAll") }),
|
|
183
|
+
Object.keys(consumers).map((key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: key, children: key }, key))
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
188
|
+
import_web_react.Select,
|
|
189
|
+
{
|
|
190
|
+
showSearch: true,
|
|
191
|
+
placeholder: t("dependencyGraph.filters.depthPlaceholder"),
|
|
192
|
+
style: { width: 120 },
|
|
193
|
+
value: maxDepth === Infinity ? "All" : maxDepth,
|
|
194
|
+
onChange: (val) => setMaxDepth(val === "All" ? Infinity : val),
|
|
195
|
+
children: [
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: t("dependencyGraph.filters.depthAll") }),
|
|
197
|
+
Array.from({ length: availableDepth }, (_, i) => i + 1).map(
|
|
198
|
+
(depth) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: depth, children: t("dependencyGraph.filters.depthOption", { depth }) }, depth)
|
|
199
|
+
)
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
)
|
|
203
|
+
] }),
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.meta, children: [
|
|
205
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaBadge, children: nodes.length }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaLabel, children: nodes.length === 1 ? t("dependencyGraph.meta.singleNode") : t("dependencyGraph.meta.multiNodes") })
|
|
207
|
+
] })
|
|
208
|
+
] }),
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.canvas, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
import_reactflow.default,
|
|
211
|
+
{
|
|
212
|
+
className: import_index.default.graph,
|
|
213
|
+
nodes,
|
|
214
|
+
edges,
|
|
215
|
+
onNodesChange,
|
|
216
|
+
onEdgesChange,
|
|
217
|
+
onConnect,
|
|
218
|
+
nodeTypes,
|
|
219
|
+
proOptions: { hideAttribution: true },
|
|
220
|
+
fitView: true,
|
|
221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactflow.Controls, { className: import_index.default.controls })
|
|
222
|
+
}
|
|
223
|
+
) })
|
|
224
|
+
] });
|
|
225
|
+
};
|
|
226
|
+
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 = { "
|
|
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,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
|
+
}
|