@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/lib/App.js
CHANGED
|
@@ -3,8 +3,22 @@ var __create = Object.create;
|
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
8
22
|
var __export = (target, all) => {
|
|
9
23
|
for (var name in all)
|
|
10
24
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -56,15 +70,22 @@ var import_react = require("react");
|
|
|
56
70
|
var import_react_19_adapter = require("@arco-design/web-react/es/_util/react-19-adapter");
|
|
57
71
|
var import_App = require("./App.css");
|
|
58
72
|
var import_web_react = require("@arco-design/web-react");
|
|
73
|
+
var import_react_i18next = require("react-i18next");
|
|
59
74
|
var import_init = require("./init");
|
|
75
|
+
var import_icon = require("@arco-design/web-react/icon");
|
|
60
76
|
var import_Layout = __toESM(require("./component/Layout"));
|
|
61
77
|
var import_DependencyGraph = __toESM(require("./component/DependencyGraph"));
|
|
62
78
|
var import_ModuleInfo = __toESM(require("./component/ModuleInfo"));
|
|
63
79
|
var import_SharedDepsExplorer = __toESM(require("./component/SharedDepsExplorer"));
|
|
80
|
+
var import_LanguageSwitch = __toESM(require("./component/LanguageSwitch"));
|
|
81
|
+
var import_ThemeToggle = __toESM(require("./component/ThemeToggle"));
|
|
64
82
|
var import_utils = require("./utils");
|
|
65
83
|
var import_messages = require("./utils/chrome/messages");
|
|
84
|
+
var import_useDevtoolsTheme = require("./hooks/useDevtoolsTheme");
|
|
85
|
+
var import_i18n = __toESM(require("./i18n"));
|
|
66
86
|
var import_arco = require("@arco-design/web-react/dist/css/arco.css");
|
|
67
87
|
var import_App2 = __toESM(require("./App.module"));
|
|
88
|
+
var import_ThemeToggle2 = __toESM(require("./component/ThemeToggle.module"));
|
|
68
89
|
const cloneModuleInfo = (info) => {
|
|
69
90
|
try {
|
|
70
91
|
return JSON.parse(JSON.stringify(info || {}));
|
|
@@ -120,13 +141,14 @@ const buildShareSnapshot = (share) => {
|
|
|
120
141
|
return scopes;
|
|
121
142
|
};
|
|
122
143
|
const NAV_ITEMS = [
|
|
123
|
-
{ key: "moduleInfo",
|
|
124
|
-
{ key: "proxy",
|
|
125
|
-
{ key: "dependency",
|
|
126
|
-
{ key: "share",
|
|
127
|
-
{ key: "performance",
|
|
144
|
+
{ key: "moduleInfo", i18nKey: "app.nav.moduleInfo" },
|
|
145
|
+
{ key: "proxy", i18nKey: "app.nav.proxy" },
|
|
146
|
+
{ key: "dependency", i18nKey: "app.nav.dependency" },
|
|
147
|
+
{ key: "share", i18nKey: "app.nav.share" },
|
|
148
|
+
{ key: "performance", i18nKey: "app.nav.performance" }
|
|
128
149
|
];
|
|
129
|
-
const
|
|
150
|
+
const THEME_STORAGE_KEY = "mf-devtools-theme";
|
|
151
|
+
const InnerApp = (props) => {
|
|
130
152
|
const {
|
|
131
153
|
versionList,
|
|
132
154
|
setVersionList,
|
|
@@ -136,6 +158,10 @@ const App = (props) => {
|
|
|
136
158
|
customValueValidate,
|
|
137
159
|
headerSlot
|
|
138
160
|
} = props;
|
|
161
|
+
const autoTheme = (0, import_useDevtoolsTheme.useDevtoolsTheme)();
|
|
162
|
+
const [userTheme, setUserTheme] = (0, import_react.useState)(null);
|
|
163
|
+
const effectiveTheme = userTheme != null ? userTheme : autoTheme;
|
|
164
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
139
165
|
const [moduleInfo, setModuleInfo] = (0, import_react.useState)(
|
|
140
166
|
() => {
|
|
141
167
|
var _a;
|
|
@@ -175,6 +201,64 @@ const App = (props) => {
|
|
|
175
201
|
[consumers]
|
|
176
202
|
);
|
|
177
203
|
const hasModule = moduleCount > 0 || process.env.NODE_ENV === "development";
|
|
204
|
+
(0, import_react.useEffect)(() => {
|
|
205
|
+
var _a;
|
|
206
|
+
if (typeof window === "undefined") {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
let cancelled = false;
|
|
210
|
+
const applyTheme = (value) => {
|
|
211
|
+
if (cancelled) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
if (value === "light" || value === "dark") {
|
|
215
|
+
setUserTheme(value);
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
try {
|
|
219
|
+
const stored = window.localStorage.getItem(THEME_STORAGE_KEY);
|
|
220
|
+
if (stored === "light" || stored === "dark") {
|
|
221
|
+
applyTheme(stored);
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
} catch (error) {
|
|
225
|
+
console.warn("[MF Devtools] read theme from localStorage failed", error);
|
|
226
|
+
}
|
|
227
|
+
try {
|
|
228
|
+
const chromeObj = window.chrome;
|
|
229
|
+
const storage = (_a = chromeObj == null ? void 0 : chromeObj.storage) == null ? void 0 : _a.sync;
|
|
230
|
+
if (storage && typeof storage.get === "function") {
|
|
231
|
+
storage.get([THEME_STORAGE_KEY], (result) => {
|
|
232
|
+
applyTheme(result == null ? void 0 : result[THEME_STORAGE_KEY]);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
} catch (error) {
|
|
236
|
+
console.warn(
|
|
237
|
+
"[MF Devtools] read theme from chrome.storage.sync failed",
|
|
238
|
+
error
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
return () => {
|
|
242
|
+
cancelled = true;
|
|
243
|
+
};
|
|
244
|
+
}, []);
|
|
245
|
+
(0, import_react.useEffect)(() => {
|
|
246
|
+
if (typeof document === "undefined") {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
const { body } = document;
|
|
250
|
+
if (!body) {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (effectiveTheme === "dark") {
|
|
254
|
+
body.setAttribute("arco-theme", "dark");
|
|
255
|
+
} else {
|
|
256
|
+
body.removeAttribute("arco-theme");
|
|
257
|
+
}
|
|
258
|
+
return () => {
|
|
259
|
+
body.removeAttribute("arco-theme");
|
|
260
|
+
};
|
|
261
|
+
}, [effectiveTheme]);
|
|
178
262
|
(0, import_react.useEffect)(() => {
|
|
179
263
|
if (!moduleKeys.length) {
|
|
180
264
|
setSelectedModuleId(null);
|
|
@@ -239,6 +323,34 @@ const App = (props) => {
|
|
|
239
323
|
setRefreshing(false);
|
|
240
324
|
}
|
|
241
325
|
});
|
|
326
|
+
const handleThemeToggle = () => {
|
|
327
|
+
var _a;
|
|
328
|
+
const current = effectiveTheme;
|
|
329
|
+
const next = current === "dark" ? "light" : "dark";
|
|
330
|
+
setUserTheme(next);
|
|
331
|
+
if (typeof window !== "undefined") {
|
|
332
|
+
try {
|
|
333
|
+
window.localStorage.setItem(THEME_STORAGE_KEY, next);
|
|
334
|
+
} catch (error) {
|
|
335
|
+
console.warn(
|
|
336
|
+
"[MF Devtools] persist theme to localStorage failed",
|
|
337
|
+
error
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
try {
|
|
341
|
+
const chromeObj = window.chrome;
|
|
342
|
+
const storage = (_a = chromeObj == null ? void 0 : chromeObj.storage) == null ? void 0 : _a.sync;
|
|
343
|
+
if (storage && typeof storage.set === "function") {
|
|
344
|
+
storage.set({ [THEME_STORAGE_KEY]: next });
|
|
345
|
+
}
|
|
346
|
+
} catch (error) {
|
|
347
|
+
console.warn(
|
|
348
|
+
"[MF Devtools] persist theme to chrome.storage.sync failed",
|
|
349
|
+
error
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
};
|
|
242
354
|
const resetModuleInfo = (0, import_react.useCallback)(() => {
|
|
243
355
|
var _a;
|
|
244
356
|
const origin = ((_a = window.__FEDERATION__) == null ? void 0 : _a.originModuleInfo) || {};
|
|
@@ -298,7 +410,7 @@ const App = (props) => {
|
|
|
298
410
|
return hasModule ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DependencyGraph.default, { snapshot: moduleInfo }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.emptyState, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
299
411
|
import_web_react.Empty,
|
|
300
412
|
{
|
|
301
|
-
description: "
|
|
413
|
+
description: t("common.empty.noModuleInfo"),
|
|
302
414
|
className: import_App2.default.empty
|
|
303
415
|
}
|
|
304
416
|
) });
|
|
@@ -312,64 +424,82 @@ const App = (props) => {
|
|
|
312
424
|
}
|
|
313
425
|
);
|
|
314
426
|
case "performance":
|
|
315
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.placeholder, children: "
|
|
427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.placeholder, children: t("app.performance.placeholder") });
|
|
316
428
|
default:
|
|
317
429
|
return null;
|
|
318
430
|
}
|
|
319
431
|
};
|
|
320
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
{
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: "Remotes" })
|
|
432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
433
|
+
"div",
|
|
434
|
+
{
|
|
435
|
+
className: `${import_App2.default.shell} ${import_App2.default.overrideArco} ${effectiveTheme === "dark" ? "arco-theme-dark" : ""}`,
|
|
436
|
+
children: [
|
|
437
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("aside", { className: import_App2.default.sidebar, children: NAV_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
438
|
+
"button",
|
|
439
|
+
{
|
|
440
|
+
type: "button",
|
|
441
|
+
className: `${import_App2.default.tabItem} ${activePanel === item.key ? import_App2.default.activeTab : ""}`,
|
|
442
|
+
onClick: () => setActivePanel(item.key),
|
|
443
|
+
children: t(item.i18nKey)
|
|
444
|
+
},
|
|
445
|
+
item.key
|
|
446
|
+
)) }),
|
|
447
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: import_App2.default.panel, children: [
|
|
448
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: import_App2.default.header, children: [
|
|
449
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.headerTop, children: [
|
|
450
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.branding, children: [
|
|
451
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.logo, children: t("app.header.title") }),
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.subtitle, children: t("app.header.subtitle") })
|
|
453
|
+
] }),
|
|
454
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.headerActions, children: [
|
|
455
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_LanguageSwitch.default, {}),
|
|
456
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
457
|
+
import_ThemeToggle.default,
|
|
458
|
+
{
|
|
459
|
+
theme: effectiveTheme,
|
|
460
|
+
onToggle: handleThemeToggle
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: t("app.header.refresh.tooltip"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
464
|
+
import_web_react.Button,
|
|
465
|
+
{
|
|
466
|
+
size: "default",
|
|
467
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icon.IconRefresh, {}),
|
|
468
|
+
loading: refreshing,
|
|
469
|
+
onClick: handleRefresh,
|
|
470
|
+
className: import_ThemeToggle2.default.themeToggle
|
|
471
|
+
}
|
|
472
|
+
) })
|
|
473
|
+
] })
|
|
363
474
|
] }),
|
|
364
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.
|
|
365
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
366
|
-
|
|
475
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.meta, children: [
|
|
476
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.scope, children: [
|
|
477
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.scopeLabel, children: t("app.header.scope.label") }),
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { className: "common-tag", children: (inspectedTab == null ? void 0 : inspectedTab.title) || t("app.header.scope.waiting") })
|
|
479
|
+
] }),
|
|
480
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.stats, children: [
|
|
481
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
482
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: moduleCount }),
|
|
483
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: t("app.header.stats.modules") })
|
|
484
|
+
] }),
|
|
485
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
486
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: producer.length }),
|
|
487
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: t("app.header.stats.remotes") })
|
|
488
|
+
] }),
|
|
489
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
490
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: consumerCount }),
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: t("app.header.stats.consumers") })
|
|
492
|
+
] })
|
|
493
|
+
] })
|
|
367
494
|
] })
|
|
368
|
-
] })
|
|
495
|
+
] }),
|
|
496
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.body, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.content, children: renderContent() }) })
|
|
369
497
|
] })
|
|
370
|
-
]
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
);
|
|
501
|
+
};
|
|
502
|
+
const App = (props) => {
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_i18next.I18nextProvider, { i18n: import_i18n.default, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InnerApp, __spreadValues({}, props)) });
|
|
374
504
|
};
|
|
375
505
|
var App_default = App;
|
package/dist/lib/App.module.js
CHANGED
|
@@ -22,4 +22,4 @@ __export(App_module_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(App_module_exports);
|
|
24
24
|
var import_App_module = require("./App_module.css");
|
|
25
|
-
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", "
|
|
25
|
+
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" };
|
package/dist/lib/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
|
}
|
|
@@ -53,6 +53,7 @@ var import_react = require("react");
|
|
|
53
53
|
var import_reactflow = __toESM(require("reactflow"));
|
|
54
54
|
var import_dagre = __toESM(require("dagre"));
|
|
55
55
|
var import_web_react = require("@arco-design/web-react");
|
|
56
|
+
var import_react_i18next = require("react-i18next");
|
|
56
57
|
var import_graph = require("../../utils/sdk/graph");
|
|
57
58
|
var import_DependencyGraphItem = __toESM(require("../DependencyGraphItem"));
|
|
58
59
|
var import_utils = require("../../utils");
|
|
@@ -63,6 +64,7 @@ const nodeHeight = 420;
|
|
|
63
64
|
const nodeTypes = { graphItem: import_DependencyGraphItem.default };
|
|
64
65
|
const { Option } = import_web_react.Select;
|
|
65
66
|
const Graph = (props) => {
|
|
67
|
+
const { t } = (0, import_react_i18next.useTranslation)();
|
|
66
68
|
const [nodes, setNodes, onNodesChange] = (0, import_reactflow.useNodesState)([]);
|
|
67
69
|
const [edges, setEdges, onEdgesChange] = (0, import_reactflow.useEdgesState)([]);
|
|
68
70
|
const { snapshot } = props;
|
|
@@ -164,20 +166,20 @@ const Graph = (props) => {
|
|
|
164
166
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.depWrapper, children: [
|
|
165
167
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.header, children: [
|
|
166
168
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.titleBlock, children: [
|
|
167
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.title, children: "
|
|
168
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.subtitle, 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") })
|
|
169
171
|
] }),
|
|
170
172
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.filterBlock, children: [
|
|
171
173
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
172
174
|
import_web_react.Select,
|
|
173
175
|
{
|
|
174
176
|
showSearch: true,
|
|
175
|
-
placeholder: "
|
|
177
|
+
placeholder: t("dependencyGraph.filters.consumerPlaceholder"),
|
|
176
178
|
style: { width: 200 },
|
|
177
179
|
value: selectedConsumer,
|
|
178
180
|
onChange: setSelectedConsumer,
|
|
179
181
|
children: [
|
|
180
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: "
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: t("dependencyGraph.filters.consumerAll") }),
|
|
181
183
|
Object.keys(consumers).map((key) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: key, children: key }, key))
|
|
182
184
|
]
|
|
183
185
|
}
|
|
@@ -186,17 +188,14 @@ const Graph = (props) => {
|
|
|
186
188
|
import_web_react.Select,
|
|
187
189
|
{
|
|
188
190
|
showSearch: true,
|
|
189
|
-
placeholder: "
|
|
191
|
+
placeholder: t("dependencyGraph.filters.depthPlaceholder"),
|
|
190
192
|
style: { width: 120 },
|
|
191
193
|
value: maxDepth === Infinity ? "All" : maxDepth,
|
|
192
194
|
onChange: (val) => setMaxDepth(val === "All" ? Infinity : val),
|
|
193
195
|
children: [
|
|
194
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: "
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: "All", children: t("dependencyGraph.filters.depthAll") }),
|
|
195
197
|
Array.from({ length: availableDepth }, (_, i) => i + 1).map(
|
|
196
|
-
(depth) => /* @__PURE__ */ (0, import_jsx_runtime.
|
|
197
|
-
"Depth: ",
|
|
198
|
-
depth
|
|
199
|
-
] }, depth)
|
|
198
|
+
(depth) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Option, { value: depth, children: t("dependencyGraph.filters.depthOption", { depth }) }, depth)
|
|
200
199
|
)
|
|
201
200
|
]
|
|
202
201
|
}
|
|
@@ -204,7 +203,7 @@ const Graph = (props) => {
|
|
|
204
203
|
] }),
|
|
205
204
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.meta, children: [
|
|
206
205
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaBadge, children: nodes.length }),
|
|
207
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.metaLabel, children: nodes.length === 1 ? "
|
|
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") })
|
|
208
207
|
] })
|
|
209
208
|
] }),
|
|
210
209
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.canvas, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|