@module-federation/devtools 0.21.6 → 0.22.1
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 +12 -0
- package/dist/es/App.js +330 -22
- package/dist/es/App.module.js +1 -1
- package/dist/es/App_module.css +291 -5
- package/dist/es/component/DependencyGraph/index.js +205 -0
- package/dist/es/component/DependencyGraph/index.module.js +5 -0
- package/dist/es/component/DependencyGraph/index_module.css +97 -0
- package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
- 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 +191 -109
- package/dist/es/component/Form/index.module.js +1 -1
- package/dist/es/component/Form/index_module.css +179 -25
- package/dist/es/component/Layout/index.js +300 -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 +289 -0
- package/dist/es/component/ModuleInfo/index.module.js +5 -0
- package/dist/es/component/ModuleInfo/index_module.css +183 -0
- package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +33 -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 +506 -0
- package/dist/es/component/SharedDepsExplorer/index.module.js +5 -0
- package/dist/es/component/SharedDepsExplorer/index_module.css +457 -0
- package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -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 +12 -0
- package/dist/lib/App.js +321 -18
- package/dist/lib/App.module.js +1 -1
- package/dist/lib/App_module.css +291 -5
- package/dist/lib/component/DependencyGraph/index.js +227 -0
- package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
- package/dist/lib/component/DependencyGraph/index_module.css +97 -0
- package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
- 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 +188 -107
- package/dist/lib/component/Form/index.module.js +1 -1
- package/dist/lib/component/Form/index_module.css +179 -25
- package/dist/lib/component/Layout/index.js +294 -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 +319 -0
- package/dist/lib/component/ModuleInfo/index.module.js +25 -0
- package/dist/lib/component/ModuleInfo/index_module.css +183 -0
- package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +63 -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 +513 -0
- package/dist/lib/component/SharedDepsExplorer/index.module.js +25 -0
- package/dist/lib/component/SharedDepsExplorer/index_module.css +457 -0
- package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -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/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/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 +16 -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.js
CHANGED
|
@@ -26,6 +26,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var __async = (__this, __arguments, generator) => {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
var fulfilled = (value) => {
|
|
32
|
+
try {
|
|
33
|
+
step(generator.next(value));
|
|
34
|
+
} catch (e) {
|
|
35
|
+
reject(e);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var rejected = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.throw(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
46
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
47
|
+
});
|
|
48
|
+
};
|
|
29
49
|
var App_exports = {};
|
|
30
50
|
__export(App_exports, {
|
|
31
51
|
default: () => App_default
|
|
@@ -33,15 +53,80 @@ __export(App_exports, {
|
|
|
33
53
|
module.exports = __toCommonJS(App_exports);
|
|
34
54
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
55
|
var import_react = require("react");
|
|
56
|
+
var import_react_19_adapter = require("@arco-design/web-react/es/_util/react-19-adapter");
|
|
57
|
+
var import_App = require("./App.css");
|
|
36
58
|
var import_web_react = require("@arco-design/web-react");
|
|
37
59
|
var import_init = require("./init");
|
|
38
60
|
var import_Layout = __toESM(require("./component/Layout"));
|
|
61
|
+
var import_DependencyGraph = __toESM(require("./component/DependencyGraph"));
|
|
62
|
+
var import_ModuleInfo = __toESM(require("./component/ModuleInfo"));
|
|
63
|
+
var import_SharedDepsExplorer = __toESM(require("./component/SharedDepsExplorer"));
|
|
39
64
|
var import_utils = require("./utils");
|
|
65
|
+
var import_messages = require("./utils/chrome/messages");
|
|
40
66
|
var import_arco = require("@arco-design/web-react/dist/css/arco.css");
|
|
41
|
-
var
|
|
42
|
-
const
|
|
67
|
+
var import_App2 = __toESM(require("./App.module"));
|
|
68
|
+
const cloneModuleInfo = (info) => {
|
|
69
|
+
try {
|
|
70
|
+
return JSON.parse(JSON.stringify(info || {}));
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.warn("[MF Devtools] cloneModuleInfo failed", error);
|
|
73
|
+
return info || {};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
const normalizeShareValue = (target, seen = /* @__PURE__ */ new WeakSet()) => {
|
|
77
|
+
if (typeof target === "function") {
|
|
78
|
+
const name = target.name ? `: ${target.name}` : "";
|
|
79
|
+
return `[Function${name}]`;
|
|
80
|
+
}
|
|
81
|
+
if (!target || typeof target !== "object") {
|
|
82
|
+
return target;
|
|
83
|
+
}
|
|
84
|
+
if (seen.has(target)) {
|
|
85
|
+
return "[Circular]";
|
|
86
|
+
}
|
|
87
|
+
seen.add(target);
|
|
88
|
+
if (target instanceof Map) {
|
|
89
|
+
const mapped = {};
|
|
90
|
+
target.forEach((value, key) => {
|
|
91
|
+
mapped[String(key)] = normalizeShareValue(value, seen);
|
|
92
|
+
});
|
|
93
|
+
return mapped;
|
|
94
|
+
}
|
|
95
|
+
if (target instanceof Set) {
|
|
96
|
+
const setItems = [];
|
|
97
|
+
target.forEach((value) => {
|
|
98
|
+
setItems.push(normalizeShareValue(value, seen));
|
|
99
|
+
});
|
|
100
|
+
return setItems;
|
|
101
|
+
}
|
|
102
|
+
if (Array.isArray(target)) {
|
|
103
|
+
return target.map((item) => normalizeShareValue(item, seen));
|
|
104
|
+
}
|
|
105
|
+
return Object.keys(target).reduce((memo, key) => {
|
|
106
|
+
memo[key] = normalizeShareValue(target[key], seen);
|
|
107
|
+
return memo;
|
|
108
|
+
}, {});
|
|
109
|
+
};
|
|
110
|
+
const buildShareSnapshot = (share) => {
|
|
111
|
+
const normalize = (value) => {
|
|
112
|
+
try {
|
|
113
|
+
return normalizeShareValue(value);
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.warn("[MF Devtools] normalize share snapshot failed", error);
|
|
116
|
+
return normalizeShareValue(value);
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
const scopes = normalize(share || {});
|
|
120
|
+
return scopes;
|
|
121
|
+
};
|
|
122
|
+
const NAV_ITEMS = [
|
|
123
|
+
{ key: "moduleInfo", label: "Module info" },
|
|
124
|
+
{ key: "proxy", label: "Proxy" },
|
|
125
|
+
{ key: "dependency", label: "Dependency graph" },
|
|
126
|
+
{ key: "share", label: "Shared" },
|
|
127
|
+
{ key: "performance", label: "Performance" }
|
|
128
|
+
];
|
|
43
129
|
const App = (props) => {
|
|
44
|
-
var _a;
|
|
45
130
|
const {
|
|
46
131
|
versionList,
|
|
47
132
|
setVersionList,
|
|
@@ -51,22 +136,240 @@ const App = (props) => {
|
|
|
51
136
|
customValueValidate,
|
|
52
137
|
headerSlot
|
|
53
138
|
} = props;
|
|
54
|
-
const [
|
|
55
|
-
|
|
56
|
-
|
|
139
|
+
const [moduleInfo, setModuleInfo] = (0, import_react.useState)(
|
|
140
|
+
() => {
|
|
141
|
+
var _a;
|
|
142
|
+
return cloneModuleInfo(((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) || {});
|
|
143
|
+
}
|
|
144
|
+
);
|
|
145
|
+
const [shareInfo, setShareInfo] = (0, import_react.useState)(
|
|
146
|
+
() => {
|
|
147
|
+
var _a;
|
|
148
|
+
return buildShareSnapshot((_a = window.__FEDERATION__) == null ? void 0 : _a.__SHARE__);
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
const [inspectedTab, setInspectedTab] = (0, import_react.useState)(
|
|
152
|
+
window.targetTab
|
|
153
|
+
);
|
|
154
|
+
const [activePanel, setActivePanel] = (0, import_react.useState)("proxy");
|
|
155
|
+
const [selectedModuleId, setSelectedModuleId] = (0, import_react.useState)(null);
|
|
156
|
+
const [refreshing, setRefreshing] = (0, import_react.useState)(false);
|
|
157
|
+
const panelSyncReadyRef = (0, import_react.useRef)(false);
|
|
158
|
+
const applyModuleUpdate = (0, import_react.useCallback)((info) => {
|
|
159
|
+
var _a;
|
|
160
|
+
setModuleInfo(cloneModuleInfo(info));
|
|
161
|
+
const shareSnapshot = buildShareSnapshot(
|
|
162
|
+
(_a = window.__FEDERATION__) == null ? void 0 : _a.__SHARE__
|
|
163
|
+
);
|
|
164
|
+
setShareInfo(shareSnapshot);
|
|
165
|
+
panelSyncReadyRef.current = true;
|
|
57
166
|
}, []);
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
167
|
+
const { producer, consumers } = (0, import_react.useMemo)(
|
|
168
|
+
() => (0, import_utils.separateType)(moduleInfo),
|
|
169
|
+
[moduleInfo]
|
|
170
|
+
);
|
|
171
|
+
const moduleKeys = (0, import_react.useMemo)(() => Object.keys(moduleInfo || {}), [moduleInfo]);
|
|
172
|
+
const moduleCount = moduleKeys.length;
|
|
173
|
+
const consumerCount = (0, import_react.useMemo)(
|
|
174
|
+
() => Object.keys(consumers || {}).length,
|
|
175
|
+
[consumers]
|
|
176
|
+
);
|
|
177
|
+
const hasModule = moduleCount > 0 || process.env.NODE_ENV === "development";
|
|
178
|
+
(0, import_react.useEffect)(() => {
|
|
179
|
+
if (!moduleKeys.length) {
|
|
180
|
+
setSelectedModuleId(null);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (!selectedModuleId || !moduleKeys.includes(selectedModuleId)) {
|
|
184
|
+
setSelectedModuleId(moduleKeys[0]);
|
|
185
|
+
}
|
|
186
|
+
}, [moduleKeys, selectedModuleId]);
|
|
187
|
+
(0, import_react.useEffect)(() => {
|
|
188
|
+
const bootstrap = () => __async(void 0, null, function* () {
|
|
189
|
+
const tab = yield (0, import_utils.syncActiveTab)();
|
|
190
|
+
setInspectedTab(tab || void 0);
|
|
191
|
+
const detach = yield (0, import_utils.getGlobalModuleInfo)(
|
|
192
|
+
(info) => applyModuleUpdate(info)
|
|
193
|
+
);
|
|
194
|
+
panelSyncReadyRef.current = true;
|
|
195
|
+
return detach;
|
|
196
|
+
});
|
|
197
|
+
const cleanupPromise = bootstrap();
|
|
198
|
+
return () => {
|
|
199
|
+
cleanupPromise.then((cleanup) => cleanup == null ? void 0 : cleanup());
|
|
200
|
+
};
|
|
201
|
+
}, [applyModuleUpdate]);
|
|
202
|
+
(0, import_react.useEffect)(() => {
|
|
203
|
+
const updateActiveTab = (tabId) => __async(void 0, null, function* () {
|
|
204
|
+
var _a, _b;
|
|
205
|
+
const tab = yield (0, import_utils.syncActiveTab)(tabId);
|
|
206
|
+
setInspectedTab(tab || void 0);
|
|
207
|
+
if ((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) {
|
|
208
|
+
applyModuleUpdate(cloneModuleInfo((_b = window.__FEDERATION__) == null ? void 0 : _b.moduleInfo));
|
|
209
|
+
}
|
|
210
|
+
yield (0, import_utils.refreshModuleInfo)();
|
|
211
|
+
});
|
|
212
|
+
const onMessage = (message, _sender, _sendResponse) => {
|
|
213
|
+
if ((message == null ? void 0 : message.type) === import_messages.MESSAGE_ACTIVE_TAB_CHANGED) {
|
|
214
|
+
updateActiveTab(message.tabId);
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
chrome.runtime.onMessage.addListener(onMessage);
|
|
218
|
+
const onActivated = (activeInfo) => {
|
|
219
|
+
updateActiveTab(activeInfo.tabId);
|
|
220
|
+
};
|
|
221
|
+
chrome.tabs.onActivated.addListener(onActivated);
|
|
222
|
+
return () => {
|
|
223
|
+
chrome.runtime.onMessage.removeListener(onMessage);
|
|
224
|
+
chrome.tabs.onActivated.removeListener(onActivated);
|
|
225
|
+
};
|
|
226
|
+
}, [applyModuleUpdate]);
|
|
227
|
+
const handleRefresh = () => __async(void 0, null, function* () {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
if (refreshing) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
setRefreshing(true);
|
|
233
|
+
try {
|
|
234
|
+
yield (0, import_utils.refreshModuleInfo)();
|
|
235
|
+
if ((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) {
|
|
236
|
+
applyModuleUpdate(cloneModuleInfo((_b = window.__FEDERATION__) == null ? void 0 : _b.moduleInfo));
|
|
237
|
+
}
|
|
238
|
+
} finally {
|
|
239
|
+
setRefreshing(false);
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
const resetModuleInfo = (0, import_react.useCallback)(() => {
|
|
243
|
+
var _a;
|
|
244
|
+
const origin = ((_a = window.__FEDERATION__) == null ? void 0 : _a.originModuleInfo) || {};
|
|
245
|
+
applyModuleUpdate(cloneModuleInfo(origin));
|
|
246
|
+
}, [applyModuleUpdate]);
|
|
247
|
+
(0, import_react.useEffect)(() => {
|
|
248
|
+
const shouldAutoSync = activePanel === "proxy" || activePanel === "dependency" || activePanel === "share";
|
|
249
|
+
if (!shouldAutoSync || !panelSyncReadyRef.current) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
let cancelled = false;
|
|
253
|
+
const syncPanelData = () => __async(void 0, null, function* () {
|
|
254
|
+
var _a, _b;
|
|
255
|
+
yield (0, import_utils.refreshModuleInfo)();
|
|
256
|
+
if (cancelled) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if ((_a = window.__FEDERATION__) == null ? void 0 : _a.moduleInfo) {
|
|
260
|
+
applyModuleUpdate(cloneModuleInfo((_b = window.__FEDERATION__) == null ? void 0 : _b.moduleInfo));
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
void syncPanelData();
|
|
264
|
+
return () => {
|
|
265
|
+
cancelled = true;
|
|
266
|
+
};
|
|
267
|
+
}, [activePanel, applyModuleUpdate]);
|
|
268
|
+
const renderContent = () => {
|
|
269
|
+
var _a;
|
|
270
|
+
switch (activePanel) {
|
|
271
|
+
case "moduleInfo":
|
|
272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
273
|
+
import_ModuleInfo.default,
|
|
274
|
+
{
|
|
275
|
+
moduleInfo,
|
|
276
|
+
selectedModuleId,
|
|
277
|
+
onSelectModule: (id) => setSelectedModuleId(id)
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
case "proxy":
|
|
281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
282
|
+
import_Layout.default,
|
|
283
|
+
{
|
|
284
|
+
moduleInfo,
|
|
285
|
+
versionList,
|
|
286
|
+
setVersionList,
|
|
287
|
+
getVersion,
|
|
288
|
+
handleSnapshot,
|
|
289
|
+
handleProxyAddress,
|
|
290
|
+
customValueValidate,
|
|
291
|
+
headerSlot,
|
|
292
|
+
onModuleInfoChange: applyModuleUpdate,
|
|
293
|
+
onModuleInfoReset: resetModuleInfo,
|
|
294
|
+
tabId: inspectedTab == null ? void 0 : inspectedTab.id
|
|
295
|
+
}
|
|
296
|
+
);
|
|
297
|
+
case "dependency":
|
|
298
|
+
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
|
+
import_web_react.Empty,
|
|
300
|
+
{
|
|
301
|
+
description: "No ModuleInfo Detected",
|
|
302
|
+
className: import_App2.default.empty
|
|
303
|
+
}
|
|
304
|
+
) });
|
|
305
|
+
case "share":
|
|
306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
307
|
+
import_SharedDepsExplorer.default,
|
|
308
|
+
{
|
|
309
|
+
shareData: JSON.parse(
|
|
310
|
+
JSON.stringify((_a = window.__FEDERATION__) == null ? void 0 : _a.__SHARE__)
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
);
|
|
314
|
+
case "performance":
|
|
315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_App2.default.placeholder, children: "WIP..." });
|
|
316
|
+
default:
|
|
317
|
+
return null;
|
|
69
318
|
}
|
|
70
|
-
|
|
319
|
+
};
|
|
320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${import_App2.default.shell} ${import_App2.default.overrideArco}`, children: [
|
|
321
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("aside", { className: import_App2.default.sidebar, children: NAV_ITEMS.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
322
|
+
"button",
|
|
323
|
+
{
|
|
324
|
+
type: "button",
|
|
325
|
+
className: `${import_App2.default.tabItem} ${activePanel === item.key ? import_App2.default.activeTab : ""}`,
|
|
326
|
+
onClick: () => setActivePanel(item.key),
|
|
327
|
+
children: item.label
|
|
328
|
+
},
|
|
329
|
+
item.key
|
|
330
|
+
)) }),
|
|
331
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: import_App2.default.panel, children: [
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", { className: import_App2.default.header, children: [
|
|
333
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.headerTop, children: [
|
|
334
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.branding, children: [
|
|
335
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.logo, children: "Module Federation" }),
|
|
336
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.subtitle, children: "DevTools Companion" })
|
|
337
|
+
] }),
|
|
338
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: "重新同步当前页面的 Federation 信息", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
339
|
+
import_web_react.Button,
|
|
340
|
+
{
|
|
341
|
+
size: "mini",
|
|
342
|
+
type: "primary",
|
|
343
|
+
loading: refreshing,
|
|
344
|
+
onClick: handleRefresh,
|
|
345
|
+
className: import_App2.default.refresh,
|
|
346
|
+
children: "Refresh"
|
|
347
|
+
}
|
|
348
|
+
) })
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.meta, children: [
|
|
351
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.scope, children: [
|
|
352
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.scopeLabel, children: "Focus Tab" }),
|
|
353
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { className: "common-tag", children: (inspectedTab == null ? void 0 : inspectedTab.title) || "Waiting for target" })
|
|
354
|
+
] }),
|
|
355
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.stats, children: [
|
|
356
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
357
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: moduleCount }),
|
|
358
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: "Modules" })
|
|
359
|
+
] }),
|
|
360
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
361
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: producer.length }),
|
|
362
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: "Remotes" })
|
|
363
|
+
] }),
|
|
364
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_App2.default.statBlock, children: [
|
|
365
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statValue, children: consumerCount }),
|
|
366
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_App2.default.statLabel, children: "Consumers" })
|
|
367
|
+
] })
|
|
368
|
+
] })
|
|
369
|
+
] })
|
|
370
|
+
] }),
|
|
371
|
+
/* @__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() }) })
|
|
372
|
+
] })
|
|
373
|
+
] });
|
|
71
374
|
};
|
|
72
375
|
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 = { "
|
|
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", "refresh": "refresh_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
|
@@ -3,17 +3,303 @@
|
|
|
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: #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
|
+
}
|
|
12
23
|
|
|
13
|
-
.
|
|
24
|
+
.shell_ae2ee {
|
|
14
25
|
width: 100%;
|
|
15
|
-
height: 100vh;
|
|
26
|
+
min-height: 100vh;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: stretch;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
gap: clamp(18px, 3vw, 36px);
|
|
31
|
+
padding: 28px clamp(16px, 4vw, 48px);
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
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%);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.sidebar_ae2ee {
|
|
37
|
+
width: clamp(160px, 18vw, 220px);
|
|
38
|
+
min-width: 150px;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
gap: 12px;
|
|
42
|
+
padding: clamp(18px, 2.5vw, 24px) clamp(14px, 2vw, 18px);
|
|
43
|
+
border-radius: 22px;
|
|
44
|
+
border: 1px solid rgba(148, 163, 184, 0.18);
|
|
45
|
+
background: rgba(255, 255, 255, 0.95);
|
|
46
|
+
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.05) inset;
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.tabItem_ae2ee {
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: flex-start;
|
|
54
|
+
border: 1px solid transparent;
|
|
55
|
+
border-radius: 12px;
|
|
56
|
+
padding: 10px 12px;
|
|
57
|
+
background: rgba(249, 250, 251, 0.8);
|
|
58
|
+
color: rgba(55, 65, 81, 0.9);
|
|
59
|
+
font-size: 13px;
|
|
60
|
+
letter-spacing: 0.04em;
|
|
61
|
+
text-transform: uppercase;
|
|
62
|
+
cursor: pointer;
|
|
63
|
+
transition: all 0.15s ease;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.tabItem_ae2ee:hover {
|
|
68
|
+
border-color: rgba(37, 49, 48, 0.45);
|
|
69
|
+
color: #1e293b;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.activeTab_ae2ee {
|
|
73
|
+
border-color: rgba(99, 102, 241, 0.65);
|
|
74
|
+
background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
|
|
75
|
+
color: #1e293b;
|
|
76
|
+
box-shadow: 0 12px 28px rgba(30, 64, 175, 0.25);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.panel_ae2ee {
|
|
80
|
+
flex: 1 1;
|
|
81
|
+
min-width: 0;
|
|
82
|
+
width: 100%;
|
|
83
|
+
max-width: 1120px;
|
|
84
|
+
min-height: calc(100vh - 56px);
|
|
85
|
+
background: rgba(255, 255, 255, 0.98);
|
|
86
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
87
|
+
box-shadow: 0 24px 64px rgba(0, 0, 0, 0.06), 0 2px 0 rgba(0, 0, 0, 0.04) inset;
|
|
88
|
+
border-radius: 22px;
|
|
89
|
+
padding: clamp(20px, 3vw, 32px);
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 28px;
|
|
93
|
+
box-sizing: border-box;
|
|
94
|
+
color: #1f2937;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.header_ae2ee {
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
gap: 18px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.headerTop_ae2ee {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: space-between;
|
|
107
|
+
gap: 14px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.branding_ae2ee {
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 4px;
|
|
114
|
+
}
|
|
115
|
+
|
|
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
|
+
.logo_ae2ee {
|
|
125
|
+
font-size: 20px;
|
|
126
|
+
font-weight: 600;
|
|
127
|
+
letter-spacing: 0.02em;
|
|
128
|
+
color: #1e293b;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.subtitle_ae2ee {
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
color: rgba(75, 85, 99, 0.8);
|
|
135
|
+
text-transform: uppercase;
|
|
136
|
+
letter-spacing: 0.12em;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.meta_ae2ee {
|
|
140
|
+
display: flex;
|
|
141
|
+
align-items: stretch;
|
|
142
|
+
justify-content: space-between;
|
|
143
|
+
gap: 18px;
|
|
144
|
+
flex-wrap: wrap;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.scope_ae2ee {
|
|
148
|
+
display: flex;
|
|
149
|
+
flex-direction: column;
|
|
150
|
+
gap: 8px;
|
|
151
|
+
flex: 1 1 160px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.scopeLabel_ae2ee {
|
|
155
|
+
font-size: 12px;
|
|
156
|
+
color: rgba(75, 85, 99, 0.85);
|
|
157
|
+
text-transform: uppercase;
|
|
158
|
+
letter-spacing: 0.08em;
|
|
16
159
|
}
|
|
17
|
-
|
|
18
|
-
|
|
160
|
+
|
|
161
|
+
.stats_ae2ee {
|
|
162
|
+
display: flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
gap: 14px;
|
|
165
|
+
flex-wrap: wrap;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.statBlock_ae2ee {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: 2px;
|
|
172
|
+
min-width: 80px;
|
|
173
|
+
padding: 12px 14px;
|
|
174
|
+
border-radius: 14px;
|
|
175
|
+
background: linear-gradient(140deg, rgba(243, 244, 246, 0.8) 0%, rgba(229, 231, 235, 0.6) 100%);
|
|
176
|
+
border: 1px solid rgba(203, 213, 225, 0.4);
|
|
177
|
+
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.statValue_ae2ee {
|
|
181
|
+
font-size: 22px;
|
|
182
|
+
font-weight: 600;
|
|
183
|
+
color: #1e293b;
|
|
184
|
+
line-height: 1.1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.statLabel_ae2ee {
|
|
188
|
+
font-size: 11px;
|
|
189
|
+
color: rgba(75, 85, 99, 0.88);
|
|
190
|
+
letter-spacing: 0.04em;
|
|
191
|
+
text-transform: uppercase;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.body_ae2ee {
|
|
195
|
+
flex: 1 1;
|
|
196
|
+
display: flex;
|
|
197
|
+
flex-direction: column;
|
|
198
|
+
min-height: 0;
|
|
199
|
+
overflow: hidden;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.content_ae2ee {
|
|
203
|
+
flex: 1 1;
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: column;
|
|
206
|
+
min-height: 0;
|
|
207
|
+
overflow: auto;
|
|
208
|
+
gap: 16px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
@media (max-width: 980px) {
|
|
212
|
+
.shell_ae2ee {
|
|
213
|
+
flex-direction: column;
|
|
214
|
+
align-items: stretch;
|
|
215
|
+
}
|
|
216
|
+
.sidebar_ae2ee {
|
|
217
|
+
width: 100%;
|
|
218
|
+
flex-direction: row;
|
|
219
|
+
align-items: center;
|
|
220
|
+
justify-content: flex-start;
|
|
221
|
+
overflow-x: auto;
|
|
222
|
+
padding: 16px 12px;
|
|
223
|
+
gap: 10px;
|
|
224
|
+
}
|
|
225
|
+
.tabItem_ae2ee {
|
|
226
|
+
flex: 1 0 auto;
|
|
227
|
+
justify-content: center;
|
|
228
|
+
padding: 10px 14px;
|
|
229
|
+
}
|
|
230
|
+
.panel_ae2ee {
|
|
231
|
+
max-width: none;
|
|
232
|
+
min-height: auto;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
@media (max-width: 640px) {
|
|
236
|
+
.panel_ae2ee {
|
|
237
|
+
padding: 20px;
|
|
238
|
+
}
|
|
239
|
+
.meta_ae2ee {
|
|
240
|
+
gap: 12px;
|
|
241
|
+
}
|
|
242
|
+
.stats_ae2ee {
|
|
243
|
+
width: 100%;
|
|
244
|
+
justify-content: space-between;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
.emptyState_ae2ee {
|
|
248
|
+
flex: 1 1;
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
justify-content: center;
|
|
252
|
+
border-radius: 18px;
|
|
253
|
+
border: 1px dashed rgba(203, 213, 225, 0.4);
|
|
254
|
+
background: rgba(255, 255, 255, 0.8);
|
|
255
|
+
padding: 32px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.empty_ae2ee .arco-empty-image > svg path {
|
|
259
|
+
fill: rgba(75, 85, 99, 0.5);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.placeholder_ae2ee {
|
|
263
|
+
flex: 1 1;
|
|
264
|
+
display: flex;
|
|
265
|
+
align-items: center;
|
|
266
|
+
justify-content: center;
|
|
267
|
+
border-radius: 18px;
|
|
268
|
+
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);
|
|
271
|
+
font-size: 14px;
|
|
272
|
+
letter-spacing: 0.08em;
|
|
273
|
+
text-transform: uppercase;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.overrideArco_ae2ee .arco-input-inner-wrapper,
|
|
277
|
+
.overrideArco_ae2ee .arco-select-view {
|
|
278
|
+
background-color: #fff !important;
|
|
279
|
+
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
280
|
+
}
|
|
281
|
+
.overrideArco_ae2ee .arco-input-inner-wrapper:hover,
|
|
282
|
+
.overrideArco_ae2ee .arco-select-view:hover {
|
|
283
|
+
background-color: #fff !important;
|
|
284
|
+
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
285
|
+
}
|
|
286
|
+
.overrideArco_ae2ee .arco-input-inner-wrapper:focus-within,
|
|
287
|
+
.overrideArco_ae2ee .arco-select-view-focus {
|
|
288
|
+
background-color: #fff !important;
|
|
289
|
+
border-color: rgba(228, 228, 231, 0.5) !important;
|
|
290
|
+
}
|
|
291
|
+
.overrideArco_ae2ee .arco-collapse-item .arco-collapse-item-icon-hover {
|
|
292
|
+
top: 25% !important;
|
|
293
|
+
}
|
|
294
|
+
.overrideArco_ae2ee .arco-tabs-content {
|
|
295
|
+
padding-top: 0px !important;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.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;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.arco-table-td {
|
|
304
|
+
border-bottom-color: rgba(228, 228, 231, 0.5) !important;
|
|
19
305
|
}
|