@module-federation/devtools 0.22.1 → 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 +6 -5
- package/dist/es/App.js +191 -59
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +38 -36
- package/dist/es/component/DependencyGraph/index.js +10 -11
- package/dist/es/component/DependencyGraph/index_module.css +20 -17
- package/dist/es/component/DependencyGraphItem/index.js +5 -3
- package/dist/es/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/es/component/Form/index.js +24 -31
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +22 -25
- package/dist/es/component/LanguageSwitch.js +50 -0
- package/dist/es/component/Layout/index.js +6 -10
- package/dist/es/component/Layout/index_module.css +7 -7
- package/dist/es/component/ModuleInfo/index.js +65 -41
- package/dist/es/component/ModuleInfo/index_module.css +12 -11
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +5 -3
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/es/component/SharedDepsExplorer/index.js +64 -75
- package/dist/es/component/SharedDepsExplorer/index_module.css +12 -2
- 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/lib/App.css +6 -5
- package/dist/lib/App.js +189 -59
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +38 -36
- package/dist/lib/component/DependencyGraph/index.js +10 -11
- package/dist/lib/component/DependencyGraph/index_module.css +20 -17
- package/dist/lib/component/DependencyGraphItem/index.js +5 -3
- package/dist/lib/component/DependencyGraphItem/index_module.css +7 -7
- package/dist/lib/component/Form/index.js +24 -31
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +22 -25
- package/dist/lib/component/LanguageSwitch.js +80 -0
- package/dist/lib/component/Layout/index.js +6 -10
- package/dist/lib/component/Layout/index_module.css +7 -7
- package/dist/lib/component/ModuleInfo/index.js +65 -41
- package/dist/lib/component/ModuleInfo/index_module.css +12 -11
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +5 -3
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay_module.css +5 -5
- package/dist/lib/component/SharedDepsExplorer/index.js +64 -75
- package/dist/lib/component/SharedDepsExplorer/index_module.css +12 -2
- 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/types/src/component/LanguageSwitch.d.ts +2 -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/package.json +10 -8
package/dist/es/App.css
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
.loaded-status-tag {
|
|
2
|
-
color: white !important;
|
|
3
|
-
background-color: black !important;
|
|
2
|
+
color: var(--color-bg-1, white) !important;
|
|
3
|
+
background-color: var(--color-neutral-10, black) !important;
|
|
4
4
|
}
|
|
5
5
|
.reused-status-tag {
|
|
6
6
|
background-color: greenyellow !important;
|
|
7
|
+
color: black !important;
|
|
7
8
|
}
|
|
8
9
|
.common-tag {
|
|
9
|
-
color:
|
|
10
|
-
background-color: #
|
|
11
|
-
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
10
|
+
color: var(--color-text-2, #71717a) !important;
|
|
11
|
+
background-color: var(--color-bg-1, #ffffff) !important;
|
|
12
|
+
border-color: var(--color-border-2, rgba(228, 228, 231, 0.5)) !important;
|
|
12
13
|
}
|
package/dist/es/App.js
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
var __async = (__this, __arguments, generator) => {
|
|
2
18
|
return new Promise((resolve, reject) => {
|
|
3
19
|
var fulfilled = (value) => {
|
|
@@ -23,11 +39,15 @@ import { useState, useEffect, useMemo, useCallback, useRef } from "react";
|
|
|
23
39
|
import "@arco-design/web-react/es/_util/react-19-adapter";
|
|
24
40
|
import "./App.css";
|
|
25
41
|
import { Empty, Tag, Button, Tooltip } from "@arco-design/web-react";
|
|
42
|
+
import { I18nextProvider, useTranslation } from "react-i18next";
|
|
26
43
|
import "./init";
|
|
44
|
+
import { IconRefresh } from "@arco-design/web-react/icon";
|
|
27
45
|
import ProxyLayout from "./component/Layout";
|
|
28
46
|
import Dependency from "./component/DependencyGraph";
|
|
29
47
|
import ModuleInfo from "./component/ModuleInfo";
|
|
30
48
|
import SharedDepsExplorer from "./component/SharedDepsExplorer";
|
|
49
|
+
import LanguageSwitch from "./component/LanguageSwitch";
|
|
50
|
+
import ThemeToggle from "./component/ThemeToggle";
|
|
31
51
|
import {
|
|
32
52
|
getGlobalModuleInfo,
|
|
33
53
|
refreshModuleInfo,
|
|
@@ -35,8 +55,11 @@ import {
|
|
|
35
55
|
syncActiveTab
|
|
36
56
|
} from "./utils";
|
|
37
57
|
import { MESSAGE_ACTIVE_TAB_CHANGED } from "./utils/chrome/messages";
|
|
58
|
+
import { useDevtoolsTheme } from "./hooks/useDevtoolsTheme";
|
|
59
|
+
import i18n from "./i18n";
|
|
38
60
|
import "@arco-design/web-react/dist/css/arco.css";
|
|
39
61
|
import styles from "./App.module";
|
|
62
|
+
import btnStyles from "./component/ThemeToggle.module";
|
|
40
63
|
const cloneModuleInfo = (info) => {
|
|
41
64
|
try {
|
|
42
65
|
return JSON.parse(JSON.stringify(info || {}));
|
|
@@ -92,13 +115,14 @@ const buildShareSnapshot = (share) => {
|
|
|
92
115
|
return scopes;
|
|
93
116
|
};
|
|
94
117
|
const NAV_ITEMS = [
|
|
95
|
-
{ key: "moduleInfo",
|
|
96
|
-
{ key: "proxy",
|
|
97
|
-
{ key: "dependency",
|
|
98
|
-
{ key: "share",
|
|
99
|
-
{ key: "performance",
|
|
118
|
+
{ key: "moduleInfo", i18nKey: "app.nav.moduleInfo" },
|
|
119
|
+
{ key: "proxy", i18nKey: "app.nav.proxy" },
|
|
120
|
+
{ key: "dependency", i18nKey: "app.nav.dependency" },
|
|
121
|
+
{ key: "share", i18nKey: "app.nav.share" },
|
|
122
|
+
{ key: "performance", i18nKey: "app.nav.performance" }
|
|
100
123
|
];
|
|
101
|
-
const
|
|
124
|
+
const THEME_STORAGE_KEY = "mf-devtools-theme";
|
|
125
|
+
const InnerApp = (props) => {
|
|
102
126
|
const {
|
|
103
127
|
versionList,
|
|
104
128
|
setVersionList,
|
|
@@ -108,6 +132,10 @@ const App = (props) => {
|
|
|
108
132
|
customValueValidate,
|
|
109
133
|
headerSlot
|
|
110
134
|
} = props;
|
|
135
|
+
const autoTheme = useDevtoolsTheme();
|
|
136
|
+
const [userTheme, setUserTheme] = useState(null);
|
|
137
|
+
const effectiveTheme = userTheme != null ? userTheme : autoTheme;
|
|
138
|
+
const { t } = useTranslation();
|
|
111
139
|
const [moduleInfo, setModuleInfo] = useState(
|
|
112
140
|
() => {
|
|
113
141
|
var _a;
|
|
@@ -147,6 +175,64 @@ const App = (props) => {
|
|
|
147
175
|
[consumers]
|
|
148
176
|
);
|
|
149
177
|
const hasModule = moduleCount > 0 || process.env.NODE_ENV === "development";
|
|
178
|
+
useEffect(() => {
|
|
179
|
+
var _a;
|
|
180
|
+
if (typeof window === "undefined") {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
let cancelled = false;
|
|
184
|
+
const applyTheme = (value) => {
|
|
185
|
+
if (cancelled) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
if (value === "light" || value === "dark") {
|
|
189
|
+
setUserTheme(value);
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
try {
|
|
193
|
+
const stored = window.localStorage.getItem(THEME_STORAGE_KEY);
|
|
194
|
+
if (stored === "light" || stored === "dark") {
|
|
195
|
+
applyTheme(stored);
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.warn("[MF Devtools] read theme from localStorage failed", error);
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
const chromeObj = window.chrome;
|
|
203
|
+
const storage = (_a = chromeObj == null ? void 0 : chromeObj.storage) == null ? void 0 : _a.sync;
|
|
204
|
+
if (storage && typeof storage.get === "function") {
|
|
205
|
+
storage.get([THEME_STORAGE_KEY], (result) => {
|
|
206
|
+
applyTheme(result == null ? void 0 : result[THEME_STORAGE_KEY]);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
} catch (error) {
|
|
210
|
+
console.warn(
|
|
211
|
+
"[MF Devtools] read theme from chrome.storage.sync failed",
|
|
212
|
+
error
|
|
213
|
+
);
|
|
214
|
+
}
|
|
215
|
+
return () => {
|
|
216
|
+
cancelled = true;
|
|
217
|
+
};
|
|
218
|
+
}, []);
|
|
219
|
+
useEffect(() => {
|
|
220
|
+
if (typeof document === "undefined") {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const { body } = document;
|
|
224
|
+
if (!body) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (effectiveTheme === "dark") {
|
|
228
|
+
body.setAttribute("arco-theme", "dark");
|
|
229
|
+
} else {
|
|
230
|
+
body.removeAttribute("arco-theme");
|
|
231
|
+
}
|
|
232
|
+
return () => {
|
|
233
|
+
body.removeAttribute("arco-theme");
|
|
234
|
+
};
|
|
235
|
+
}, [effectiveTheme]);
|
|
150
236
|
useEffect(() => {
|
|
151
237
|
if (!moduleKeys.length) {
|
|
152
238
|
setSelectedModuleId(null);
|
|
@@ -211,6 +297,34 @@ const App = (props) => {
|
|
|
211
297
|
setRefreshing(false);
|
|
212
298
|
}
|
|
213
299
|
});
|
|
300
|
+
const handleThemeToggle = () => {
|
|
301
|
+
var _a;
|
|
302
|
+
const current = effectiveTheme;
|
|
303
|
+
const next = current === "dark" ? "light" : "dark";
|
|
304
|
+
setUserTheme(next);
|
|
305
|
+
if (typeof window !== "undefined") {
|
|
306
|
+
try {
|
|
307
|
+
window.localStorage.setItem(THEME_STORAGE_KEY, next);
|
|
308
|
+
} catch (error) {
|
|
309
|
+
console.warn(
|
|
310
|
+
"[MF Devtools] persist theme to localStorage failed",
|
|
311
|
+
error
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
try {
|
|
315
|
+
const chromeObj = window.chrome;
|
|
316
|
+
const storage = (_a = chromeObj == null ? void 0 : chromeObj.storage) == null ? void 0 : _a.sync;
|
|
317
|
+
if (storage && typeof storage.set === "function") {
|
|
318
|
+
storage.set({ [THEME_STORAGE_KEY]: next });
|
|
319
|
+
}
|
|
320
|
+
} catch (error) {
|
|
321
|
+
console.warn(
|
|
322
|
+
"[MF Devtools] persist theme to chrome.storage.sync failed",
|
|
323
|
+
error
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
214
328
|
const resetModuleInfo = useCallback(() => {
|
|
215
329
|
var _a;
|
|
216
330
|
const origin = ((_a = window.__FEDERATION__) == null ? void 0 : _a.originModuleInfo) || {};
|
|
@@ -270,7 +384,7 @@ const App = (props) => {
|
|
|
270
384
|
return hasModule ? /* @__PURE__ */ jsx(Dependency, { snapshot: moduleInfo }) : /* @__PURE__ */ jsx("div", { className: styles.emptyState, children: /* @__PURE__ */ jsx(
|
|
271
385
|
Empty,
|
|
272
386
|
{
|
|
273
|
-
description: "
|
|
387
|
+
description: t("common.empty.noModuleInfo"),
|
|
274
388
|
className: styles.empty
|
|
275
389
|
}
|
|
276
390
|
) });
|
|
@@ -284,65 +398,83 @@ const App = (props) => {
|
|
|
284
398
|
}
|
|
285
399
|
);
|
|
286
400
|
case "performance":
|
|
287
|
-
return /* @__PURE__ */ jsx("div", { className: styles.placeholder, children: "
|
|
401
|
+
return /* @__PURE__ */ jsx("div", { className: styles.placeholder, children: t("app.performance.placeholder") });
|
|
288
402
|
default:
|
|
289
403
|
return null;
|
|
290
404
|
}
|
|
291
405
|
};
|
|
292
|
-
return /* @__PURE__ */ jsxs(
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
{
|
|
296
|
-
|
|
297
|
-
className:
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
/* @__PURE__ */ jsx("span", { className: styles.statLabel, children: "Remotes" })
|
|
406
|
+
return /* @__PURE__ */ jsxs(
|
|
407
|
+
"div",
|
|
408
|
+
{
|
|
409
|
+
className: `${styles.shell} ${styles.overrideArco} ${effectiveTheme === "dark" ? "arco-theme-dark" : ""}`,
|
|
410
|
+
children: [
|
|
411
|
+
/* @__PURE__ */ jsx("aside", { className: styles.sidebar, children: NAV_ITEMS.map((item) => /* @__PURE__ */ jsx(
|
|
412
|
+
"button",
|
|
413
|
+
{
|
|
414
|
+
type: "button",
|
|
415
|
+
className: `${styles.tabItem} ${activePanel === item.key ? styles.activeTab : ""}`,
|
|
416
|
+
onClick: () => setActivePanel(item.key),
|
|
417
|
+
children: t(item.i18nKey)
|
|
418
|
+
},
|
|
419
|
+
item.key
|
|
420
|
+
)) }),
|
|
421
|
+
/* @__PURE__ */ jsxs("section", { className: styles.panel, children: [
|
|
422
|
+
/* @__PURE__ */ jsxs("header", { className: styles.header, children: [
|
|
423
|
+
/* @__PURE__ */ jsxs("div", { className: styles.headerTop, children: [
|
|
424
|
+
/* @__PURE__ */ jsxs("div", { className: styles.branding, children: [
|
|
425
|
+
/* @__PURE__ */ jsx("span", { className: styles.logo, children: t("app.header.title") }),
|
|
426
|
+
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: t("app.header.subtitle") })
|
|
427
|
+
] }),
|
|
428
|
+
/* @__PURE__ */ jsxs("div", { className: styles.headerActions, children: [
|
|
429
|
+
/* @__PURE__ */ jsx(LanguageSwitch, {}),
|
|
430
|
+
/* @__PURE__ */ jsx(
|
|
431
|
+
ThemeToggle,
|
|
432
|
+
{
|
|
433
|
+
theme: effectiveTheme,
|
|
434
|
+
onToggle: handleThemeToggle
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ jsx(Tooltip, { content: t("app.header.refresh.tooltip"), children: /* @__PURE__ */ jsx(
|
|
438
|
+
Button,
|
|
439
|
+
{
|
|
440
|
+
size: "default",
|
|
441
|
+
icon: /* @__PURE__ */ jsx(IconRefresh, {}),
|
|
442
|
+
loading: refreshing,
|
|
443
|
+
onClick: handleRefresh,
|
|
444
|
+
className: btnStyles.themeToggle
|
|
445
|
+
}
|
|
446
|
+
) })
|
|
447
|
+
] })
|
|
335
448
|
] }),
|
|
336
|
-
/* @__PURE__ */ jsxs("div", { className: styles.
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
-
|
|
449
|
+
/* @__PURE__ */ jsxs("div", { className: styles.meta, children: [
|
|
450
|
+
/* @__PURE__ */ jsxs("div", { className: styles.scope, children: [
|
|
451
|
+
/* @__PURE__ */ jsx("span", { className: styles.scopeLabel, children: t("app.header.scope.label") }),
|
|
452
|
+
/* @__PURE__ */ jsx(Tag, { className: "common-tag", children: (inspectedTab == null ? void 0 : inspectedTab.title) || t("app.header.scope.waiting") })
|
|
453
|
+
] }),
|
|
454
|
+
/* @__PURE__ */ jsxs("div", { className: styles.stats, children: [
|
|
455
|
+
/* @__PURE__ */ jsxs("div", { className: styles.statBlock, children: [
|
|
456
|
+
/* @__PURE__ */ jsx("span", { className: styles.statValue, children: moduleCount }),
|
|
457
|
+
/* @__PURE__ */ jsx("span", { className: styles.statLabel, children: t("app.header.stats.modules") })
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ jsxs("div", { className: styles.statBlock, children: [
|
|
460
|
+
/* @__PURE__ */ jsx("span", { className: styles.statValue, children: producer.length }),
|
|
461
|
+
/* @__PURE__ */ jsx("span", { className: styles.statLabel, children: t("app.header.stats.remotes") })
|
|
462
|
+
] }),
|
|
463
|
+
/* @__PURE__ */ jsxs("div", { className: styles.statBlock, children: [
|
|
464
|
+
/* @__PURE__ */ jsx("span", { className: styles.statValue, children: consumerCount }),
|
|
465
|
+
/* @__PURE__ */ jsx("span", { className: styles.statLabel, children: t("app.header.stats.consumers") })
|
|
466
|
+
] })
|
|
467
|
+
] })
|
|
339
468
|
] })
|
|
340
|
-
] })
|
|
469
|
+
] }),
|
|
470
|
+
/* @__PURE__ */ jsx("div", { className: styles.body, children: /* @__PURE__ */ jsx("div", { className: styles.content, children: renderContent() }) })
|
|
341
471
|
] })
|
|
342
|
-
]
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
472
|
+
]
|
|
473
|
+
}
|
|
474
|
+
);
|
|
475
|
+
};
|
|
476
|
+
const App = (props) => {
|
|
477
|
+
return /* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(InnerApp, __spreadValues({}, props)) });
|
|
346
478
|
};
|
|
347
479
|
var App_default = App;
|
|
348
480
|
export {
|
package/dist/es/App.module.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./App_module.css";
|
|
2
|
-
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", "
|
|
2
|
+
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" };
|
|
3
3
|
export {
|
|
4
4
|
App_module_default as default
|
|
5
5
|
};
|
package/dist/es/App_module.css
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
flex: 1 1;
|
|
11
11
|
}
|
|
12
12
|
.arco-empty {
|
|
13
|
-
color: #4b5563;
|
|
13
|
+
color: var(--color-text-2, #4b5563);
|
|
14
14
|
}
|
|
15
15
|
.arco-select, .arco-input {
|
|
16
16
|
background: transparent;
|
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
border: 1px solid rgba(34, 197, 94, 0.35);
|
|
21
21
|
color: #4b5563;
|
|
22
22
|
}
|
|
23
|
+
body {
|
|
24
|
+
--form-control-alpha: 0.9;
|
|
25
|
+
}
|
|
26
|
+
body[arco-theme=dark] {
|
|
27
|
+
--form-control-alpha: 0.1;
|
|
28
|
+
}
|
|
23
29
|
|
|
24
30
|
.shell_ae2ee {
|
|
25
31
|
width: 100%;
|
|
@@ -41,8 +47,8 @@
|
|
|
41
47
|
gap: 12px;
|
|
42
48
|
padding: clamp(18px, 2.5vw, 24px) clamp(14px, 2vw, 18px);
|
|
43
49
|
border-radius: 22px;
|
|
44
|
-
border: 1px solid rgba(148, 163, 184, 0.18);
|
|
45
|
-
background: rgba(255, 255, 255, 0.95);
|
|
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));
|
|
46
52
|
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.05) inset;
|
|
47
53
|
box-sizing: border-box;
|
|
48
54
|
}
|
|
@@ -54,8 +60,8 @@
|
|
|
54
60
|
border: 1px solid transparent;
|
|
55
61
|
border-radius: 12px;
|
|
56
62
|
padding: 10px 12px;
|
|
57
|
-
background: rgba(249, 250, 251, 0.8);
|
|
58
|
-
color: rgba(55, 65, 81, 0.9);
|
|
63
|
+
background: var(--color-bg-2, rgba(249, 250, 251, 0.8));
|
|
64
|
+
color: var(--color-text-2, rgba(55, 65, 81, 0.9));
|
|
59
65
|
font-size: 13px;
|
|
60
66
|
letter-spacing: 0.04em;
|
|
61
67
|
text-transform: uppercase;
|
|
@@ -66,13 +72,13 @@
|
|
|
66
72
|
|
|
67
73
|
.tabItem_ae2ee:hover {
|
|
68
74
|
border-color: rgba(37, 49, 48, 0.45);
|
|
69
|
-
color: #1e293b;
|
|
75
|
+
color: var(--color-text-1, #1e293b);
|
|
70
76
|
}
|
|
71
77
|
|
|
72
78
|
.activeTab_ae2ee {
|
|
73
79
|
border-color: rgba(99, 102, 241, 0.65);
|
|
74
80
|
background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
|
|
75
|
-
color: #1e293b;
|
|
81
|
+
color: var(--color-text-1, #1e293b);
|
|
76
82
|
box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
|
|
77
83
|
}
|
|
78
84
|
|
|
@@ -82,8 +88,8 @@
|
|
|
82
88
|
width: 100%;
|
|
83
89
|
max-width: 1120px;
|
|
84
90
|
min-height: calc(100vh - 56px);
|
|
85
|
-
background: rgba(255, 255, 255, 0.98);
|
|
86
|
-
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
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));
|
|
87
93
|
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.06), 0 2px 0 rgba(0, 0, 0, 0.04) inset;
|
|
88
94
|
border-radius: 22px;
|
|
89
95
|
padding: clamp(20px, 3vw, 32px);
|
|
@@ -91,7 +97,7 @@
|
|
|
91
97
|
flex-direction: column;
|
|
92
98
|
gap: 28px;
|
|
93
99
|
box-sizing: border-box;
|
|
94
|
-
color: #1f2937;
|
|
100
|
+
color: var(--color-text-1, #1f2937);
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
.header_ae2ee {
|
|
@@ -113,25 +119,17 @@
|
|
|
113
119
|
gap: 4px;
|
|
114
120
|
}
|
|
115
121
|
|
|
116
|
-
.refresh_ae2ee .arco-btn-primary {
|
|
117
|
-
background: linear-gradient(135deg, rgba(34, 197, 94, 0.8), rgba(22, 163, 74, 0.7));
|
|
118
|
-
border-color: rgba(34, 197, 94, 0.65);
|
|
119
|
-
}
|
|
120
|
-
.refresh_ae2ee .arco-btn-primary:hover {
|
|
121
|
-
background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.85));
|
|
122
|
-
}
|
|
123
|
-
|
|
124
122
|
.logo_ae2ee {
|
|
125
123
|
font-size: 20px;
|
|
126
124
|
font-weight: 600;
|
|
127
125
|
letter-spacing: 0.02em;
|
|
128
|
-
color: #1e293b;
|
|
126
|
+
color: var(--color-text-1, #1e293b);
|
|
129
127
|
}
|
|
130
128
|
|
|
131
129
|
.subtitle_ae2ee {
|
|
132
130
|
font-size: 12px;
|
|
133
131
|
font-weight: 500;
|
|
134
|
-
color: rgba(75, 85, 99, 0.8);
|
|
132
|
+
color: var(--color-text-2, rgba(75, 85, 99, 0.8));
|
|
135
133
|
text-transform: uppercase;
|
|
136
134
|
letter-spacing: 0.12em;
|
|
137
135
|
}
|
|
@@ -153,7 +151,7 @@
|
|
|
153
151
|
|
|
154
152
|
.scopeLabel_ae2ee {
|
|
155
153
|
font-size: 12px;
|
|
156
|
-
color: rgba(75, 85, 99, 0.85);
|
|
154
|
+
color: var(--color-text-2, rgba(75, 85, 99, 0.85));
|
|
157
155
|
text-transform: uppercase;
|
|
158
156
|
letter-spacing: 0.08em;
|
|
159
157
|
}
|
|
@@ -172,7 +170,7 @@
|
|
|
172
170
|
min-width: 80px;
|
|
173
171
|
padding: 12px 14px;
|
|
174
172
|
border-radius: 14px;
|
|
175
|
-
background: linear-gradient(140deg, rgba(243, 244, 246, 0
|
|
173
|
+
background: linear-gradient(140deg, rgba(243, 244, 246, 0) 0%, rgba(229, 231, 235, 0.1) 100%);
|
|
176
174
|
border: 1px solid rgba(203, 213, 225, 0.4);
|
|
177
175
|
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
|
|
178
176
|
}
|
|
@@ -180,13 +178,13 @@
|
|
|
180
178
|
.statValue_ae2ee {
|
|
181
179
|
font-size: 22px;
|
|
182
180
|
font-weight: 600;
|
|
183
|
-
color: #1e293b;
|
|
181
|
+
color: var(--color-text-1, #1e293b);
|
|
184
182
|
line-height: 1.1;
|
|
185
183
|
}
|
|
186
184
|
|
|
187
185
|
.statLabel_ae2ee {
|
|
188
186
|
font-size: 11px;
|
|
189
|
-
color: rgba(75, 85, 99, 0.88);
|
|
187
|
+
color: var(--color-text-2, rgba(75, 85, 99, 0.88));
|
|
190
188
|
letter-spacing: 0.04em;
|
|
191
189
|
text-transform: uppercase;
|
|
192
190
|
}
|
|
@@ -251,7 +249,7 @@
|
|
|
251
249
|
justify-content: center;
|
|
252
250
|
border-radius: 18px;
|
|
253
251
|
border: 1px dashed rgba(203, 213, 225, 0.4);
|
|
254
|
-
background: rgba(255, 255, 255, 0.8);
|
|
252
|
+
background: var(--color-bg-2, rgba(255, 255, 255, 0.8));
|
|
255
253
|
padding: 32px;
|
|
256
254
|
}
|
|
257
255
|
|
|
@@ -266,8 +264,8 @@
|
|
|
266
264
|
justify-content: center;
|
|
267
265
|
border-radius: 18px;
|
|
268
266
|
border: 1px dashed rgba(203, 213, 225, 0.4);
|
|
269
|
-
background: rgba(255, 255, 255, 0.8);
|
|
270
|
-
color: rgba(75, 85, 99, 0.75);
|
|
267
|
+
background: var(--color-bg-2, rgba(255, 255, 255, 0.8));
|
|
268
|
+
color: var(--color-text-2, rgba(75, 85, 99, 0.75));
|
|
271
269
|
font-size: 14px;
|
|
272
270
|
letter-spacing: 0.08em;
|
|
273
271
|
text-transform: uppercase;
|
|
@@ -275,18 +273,18 @@
|
|
|
275
273
|
|
|
276
274
|
.overrideArco_ae2ee .arco-input-inner-wrapper,
|
|
277
275
|
.overrideArco_ae2ee .arco-select-view {
|
|
278
|
-
background-color: #fff !important;
|
|
279
|
-
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
276
|
+
background-color: var(--color-bg-1, #fff) !important;
|
|
277
|
+
border-color: var(--color-border-2, rgba(228, 228, 231, 0.5)) !important;
|
|
280
278
|
}
|
|
281
279
|
.overrideArco_ae2ee .arco-input-inner-wrapper:hover,
|
|
282
280
|
.overrideArco_ae2ee .arco-select-view:hover {
|
|
283
|
-
background-color: #fff !important;
|
|
284
|
-
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
281
|
+
background-color: var(--color-bg-1, #fff) !important;
|
|
282
|
+
border-color: var(--color-border-2, rgba(228, 228, 231, 0.5)) !important;
|
|
285
283
|
}
|
|
286
284
|
.overrideArco_ae2ee .arco-input-inner-wrapper:focus-within,
|
|
287
285
|
.overrideArco_ae2ee .arco-select-view-focus {
|
|
288
|
-
background-color: #fff !important;
|
|
289
|
-
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
286
|
+
background-color: var(--color-bg-1, #fff) !important;
|
|
287
|
+
border-color: var(--color-border-2, rgba(228, 228, 231, 0.5)) !important;
|
|
290
288
|
}
|
|
291
289
|
.overrideArco_ae2ee .arco-collapse-item .arco-collapse-item-icon-hover {
|
|
292
290
|
top: 25% !important;
|
|
@@ -296,10 +294,14 @@
|
|
|
296
294
|
}
|
|
297
295
|
|
|
298
296
|
.arco-table-th {
|
|
299
|
-
background-color: rgb(250 250 250/var(--tw-bg-opacity)) !important;
|
|
300
|
-
border-bottom-color: rgb(228 228 231/var(--tw-border-opacity)) !important;
|
|
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;
|
|
301
299
|
}
|
|
302
300
|
|
|
303
301
|
.arco-table-td {
|
|
304
|
-
border-bottom-color: rgba(228, 228, 231, 0.5) !important;
|
|
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%);
|
|
305
307
|
}
|
|
@@ -28,6 +28,7 @@ import ReactFlow, {
|
|
|
28
28
|
} from "reactflow";
|
|
29
29
|
import dagre from "dagre";
|
|
30
30
|
import { Select } from "@arco-design/web-react";
|
|
31
|
+
import { useTranslation } from "react-i18next";
|
|
31
32
|
import { DependencyGraph } from "../../utils/sdk/graph";
|
|
32
33
|
import GraphItem from "../DependencyGraphItem";
|
|
33
34
|
import { separateType } from "../../utils";
|
|
@@ -38,6 +39,7 @@ const nodeHeight = 420;
|
|
|
38
39
|
const nodeTypes = { graphItem: GraphItem };
|
|
39
40
|
const { Option } = Select;
|
|
40
41
|
const Graph = (props) => {
|
|
42
|
+
const { t } = useTranslation();
|
|
41
43
|
const [nodes, setNodes, onNodesChange] = useNodesState([]);
|
|
42
44
|
const [edges, setEdges, onEdgesChange] = useEdgesState([]);
|
|
43
45
|
const { snapshot } = props;
|
|
@@ -139,20 +141,20 @@ const Graph = (props) => {
|
|
|
139
141
|
return /* @__PURE__ */ jsxs("div", { className: styles.depWrapper, children: [
|
|
140
142
|
/* @__PURE__ */ jsxs("div", { className: styles.header, children: [
|
|
141
143
|
/* @__PURE__ */ jsxs("div", { className: styles.titleBlock, children: [
|
|
142
|
-
/* @__PURE__ */ jsx("span", { className: styles.title, children: "
|
|
143
|
-
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: "
|
|
144
|
+
/* @__PURE__ */ jsx("span", { className: styles.title, children: t("dependencyGraph.title") }),
|
|
145
|
+
/* @__PURE__ */ jsx("span", { className: styles.subtitle, children: t("dependencyGraph.subtitle") })
|
|
144
146
|
] }),
|
|
145
147
|
/* @__PURE__ */ jsxs("div", { className: styles.filterBlock, children: [
|
|
146
148
|
/* @__PURE__ */ jsxs(
|
|
147
149
|
Select,
|
|
148
150
|
{
|
|
149
151
|
showSearch: true,
|
|
150
|
-
placeholder: "
|
|
152
|
+
placeholder: t("dependencyGraph.filters.consumerPlaceholder"),
|
|
151
153
|
style: { width: 200 },
|
|
152
154
|
value: selectedConsumer,
|
|
153
155
|
onChange: setSelectedConsumer,
|
|
154
156
|
children: [
|
|
155
|
-
/* @__PURE__ */ jsx(Option, { value: "All", children: "
|
|
157
|
+
/* @__PURE__ */ jsx(Option, { value: "All", children: t("dependencyGraph.filters.consumerAll") }),
|
|
156
158
|
Object.keys(consumers).map((key) => /* @__PURE__ */ jsx(Option, { value: key, children: key }, key))
|
|
157
159
|
]
|
|
158
160
|
}
|
|
@@ -161,17 +163,14 @@ const Graph = (props) => {
|
|
|
161
163
|
Select,
|
|
162
164
|
{
|
|
163
165
|
showSearch: true,
|
|
164
|
-
placeholder: "
|
|
166
|
+
placeholder: t("dependencyGraph.filters.depthPlaceholder"),
|
|
165
167
|
style: { width: 120 },
|
|
166
168
|
value: maxDepth === Infinity ? "All" : maxDepth,
|
|
167
169
|
onChange: (val) => setMaxDepth(val === "All" ? Infinity : val),
|
|
168
170
|
children: [
|
|
169
|
-
/* @__PURE__ */ jsx(Option, { value: "All", children: "
|
|
171
|
+
/* @__PURE__ */ jsx(Option, { value: "All", children: t("dependencyGraph.filters.depthAll") }),
|
|
170
172
|
Array.from({ length: availableDepth }, (_, i) => i + 1).map(
|
|
171
|
-
(depth) => /* @__PURE__ */
|
|
172
|
-
"Depth: ",
|
|
173
|
-
depth
|
|
174
|
-
] }, depth)
|
|
173
|
+
(depth) => /* @__PURE__ */ jsx(Option, { value: depth, children: t("dependencyGraph.filters.depthOption", { depth }) }, depth)
|
|
175
174
|
)
|
|
176
175
|
]
|
|
177
176
|
}
|
|
@@ -179,7 +178,7 @@ const Graph = (props) => {
|
|
|
179
178
|
] }),
|
|
180
179
|
/* @__PURE__ */ jsxs("div", { className: styles.meta, children: [
|
|
181
180
|
/* @__PURE__ */ jsx("span", { className: styles.metaBadge, children: nodes.length }),
|
|
182
|
-
/* @__PURE__ */ jsx("span", { className: styles.metaLabel, children: nodes.length === 1 ? "
|
|
181
|
+
/* @__PURE__ */ jsx("span", { className: styles.metaLabel, children: nodes.length === 1 ? t("dependencyGraph.meta.singleNode") : t("dependencyGraph.meta.multiNodes") })
|
|
183
182
|
] })
|
|
184
183
|
] }),
|
|
185
184
|
/* @__PURE__ */ jsx("div", { className: styles.canvas, children: /* @__PURE__ */ jsx(
|