@module-federation/devtools 2.6.0 → 2.8.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.
Files changed (132) hide show
  1. package/dist/es/App.js +3 -2
  2. package/dist/es/component/DependencyGraphItem/index.js +18 -7
  3. package/dist/es/utils/chrome/index.js +37 -17
  4. package/dist/es/utils/chrome/post-message-listener.js +5 -2
  5. package/dist/es/utils/sdk/graph.js +25 -11
  6. package/dist/lib/App.js +2 -3
  7. package/dist/lib/App.module.js +0 -1
  8. package/dist/lib/component/DependencyGraph/index.js +0 -1
  9. package/dist/lib/component/DependencyGraph/index.module.js +0 -1
  10. package/dist/lib/component/DependencyGraphItem/index.js +18 -8
  11. package/dist/lib/component/DependencyGraphItem/index.module.js +0 -1
  12. package/dist/lib/component/Form/index.js +0 -1
  13. package/dist/lib/component/Form/index.module.js +0 -1
  14. package/dist/lib/component/LanguageSwitch.js +0 -1
  15. package/dist/lib/component/Layout/index.js +0 -1
  16. package/dist/lib/component/Layout/index.module.js +0 -1
  17. package/dist/lib/component/LoadingTrace/index.js +0 -1
  18. package/dist/lib/component/LoadingTrace/index.module.js +0 -1
  19. package/dist/lib/component/ModuleInfo/index.js +0 -1
  20. package/dist/lib/component/ModuleInfo/index.module.js +0 -1
  21. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +0 -1
  22. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.module.js +0 -1
  23. package/dist/lib/component/SharedDepsExplorer/index.js +0 -1
  24. package/dist/lib/component/SharedDepsExplorer/index.module.js +0 -1
  25. package/dist/lib/component/SharedDepsExplorer/share-utils.js +0 -1
  26. package/dist/lib/component/ThemeToggle.js +0 -1
  27. package/dist/lib/component/ThemeToggle.module.js +0 -1
  28. package/dist/lib/hooks/useDevtoolsTheme.js +0 -1
  29. package/dist/lib/i18n/index.js +0 -1
  30. package/dist/lib/init.js +0 -1
  31. package/dist/lib/template/constant.js +0 -1
  32. package/dist/lib/template/index.js +0 -1
  33. package/dist/lib/utils/chrome/fast-refresh.js +0 -1
  34. package/dist/lib/utils/chrome/index.js +38 -18
  35. package/dist/lib/utils/chrome/messages.js +0 -1
  36. package/dist/lib/utils/chrome/observability-plugin.js +0 -1
  37. package/dist/lib/utils/chrome/observability-shared.js +0 -1
  38. package/dist/lib/utils/chrome/observability.js +0 -1
  39. package/dist/lib/utils/chrome/override-remote.js +0 -1
  40. package/dist/lib/utils/chrome/post-message-init.js +0 -1
  41. package/dist/lib/utils/chrome/post-message-listener.js +5 -3
  42. package/dist/lib/utils/chrome/post-message-start.js +0 -1
  43. package/dist/lib/utils/chrome/post-message.js +0 -1
  44. package/dist/lib/utils/chrome/safe-post-message.js +0 -1
  45. package/dist/lib/utils/chrome/snapshot-plugin.js +0 -1
  46. package/dist/lib/utils/chrome/storage.js +0 -1
  47. package/dist/lib/utils/data/index.js +0 -1
  48. package/dist/lib/utils/index.js +0 -1
  49. package/dist/lib/utils/sdk/graph.js +25 -12
  50. package/dist/lib/utils/sdk/index.js +0 -1
  51. package/dist/lib/utils/types/common.js +0 -1
  52. package/dist/lib/utils/types/index.js +0 -1
  53. package/dist/lib/worker/index.js +0 -1
  54. package/dist/types/App.css +13 -0
  55. package/dist/types/App.js +519 -0
  56. package/dist/types/App.module.js +24 -0
  57. package/dist/types/App_module.css +307 -0
  58. package/dist/types/component/DependencyGraph/index.js +225 -0
  59. package/dist/types/component/DependencyGraph/index.module.js +24 -0
  60. package/dist/types/component/DependencyGraph/index_module.css +100 -0
  61. package/dist/types/component/DependencyGraphItem/index.js +124 -0
  62. package/dist/types/component/DependencyGraphItem/index.module.js +24 -0
  63. package/dist/types/component/DependencyGraphItem/index_module.css +95 -0
  64. package/dist/types/component/Form/index.js +372 -0
  65. package/dist/types/component/Form/index.module.js +24 -0
  66. package/dist/types/component/Form/index_module.css +198 -0
  67. package/dist/types/component/LanguageSwitch.js +79 -0
  68. package/dist/types/component/Layout/index.js +471 -0
  69. package/dist/types/component/Layout/index.module.js +24 -0
  70. package/dist/types/component/Layout/index_module.css +68 -0
  71. package/dist/types/component/LoadingTrace/index.js +953 -0
  72. package/dist/types/component/LoadingTrace/index.module.js +24 -0
  73. package/dist/types/component/LoadingTrace/index_module.css +876 -0
  74. package/dist/types/component/ModuleInfo/index.js +342 -0
  75. package/dist/types/component/ModuleInfo/index.module.js +24 -0
  76. package/dist/types/component/ModuleInfo/index_module.css +184 -0
  77. package/dist/types/component/SharedDepsExplorer/FocusResultDisplay.js +64 -0
  78. package/dist/types/component/SharedDepsExplorer/FocusResultDisplay.module.js +24 -0
  79. package/dist/types/component/SharedDepsExplorer/FocusResultDisplay_module.css +45 -0
  80. package/dist/types/component/SharedDepsExplorer/index.js +638 -0
  81. package/dist/types/component/SharedDepsExplorer/index.module.js +24 -0
  82. package/dist/types/component/SharedDepsExplorer/index_module.css +467 -0
  83. package/dist/types/component/SharedDepsExplorer/share-utils.js +252 -0
  84. package/dist/types/component/ThemeToggle.js +48 -0
  85. package/dist/types/component/ThemeToggle.module.js +24 -0
  86. package/dist/types/component/ThemeToggle_module.css +12 -0
  87. package/dist/types/hooks/useDevtoolsTheme.js +100 -0
  88. package/dist/types/i18n/index.js +721 -0
  89. package/dist/types/init.js +8 -0
  90. package/dist/types/src/App.d.ts +1 -1
  91. package/dist/types/src/component/DependencyGraph/index.d.ts +1 -1
  92. package/dist/types/src/component/DependencyGraphItem/index.d.ts +1 -1
  93. package/dist/types/src/component/Form/index.d.ts +1 -1
  94. package/dist/types/src/component/LanguageSwitch.d.ts +1 -1
  95. package/dist/types/src/component/Layout/index.d.ts +1 -1
  96. package/dist/types/src/component/LoadingTrace/index.d.ts +1 -1
  97. package/dist/types/src/component/ModuleInfo/index.d.ts +1 -1
  98. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +1 -1
  99. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +1 -1
  100. package/dist/types/src/i18n/index.d.ts +1 -1
  101. package/dist/types/src/template/constant.d.ts +1 -1
  102. package/dist/types/src/utils/chrome/index.d.ts +2 -1
  103. package/dist/types/src/utils/chrome/observability.d.ts +1 -1
  104. package/dist/types/src/utils/data/index.d.ts +1 -1
  105. package/dist/types/src/utils/sdk/graph.d.ts +1 -1
  106. package/dist/types/src/utils/sdk/index.d.ts +2 -2
  107. package/dist/types/stories/index.stories.d.ts +2 -1
  108. package/dist/types/template/constant.js +84 -0
  109. package/dist/types/template/index.js +21 -0
  110. package/dist/types/utils/chrome/fast-refresh.js +329 -0
  111. package/dist/types/utils/chrome/index.js +321 -0
  112. package/dist/types/utils/chrome/messages.js +39 -0
  113. package/dist/types/utils/chrome/observability-plugin.js +85 -0
  114. package/dist/types/utils/chrome/observability-shared.js +125 -0
  115. package/dist/types/utils/chrome/observability.js +233 -0
  116. package/dist/types/utils/chrome/override-remote.js +17 -0
  117. package/dist/types/utils/chrome/post-message-init.js +5 -0
  118. package/dist/types/utils/chrome/post-message-listener.js +36 -0
  119. package/dist/types/utils/chrome/post-message-start.js +10 -0
  120. package/dist/types/utils/chrome/post-message.js +91 -0
  121. package/dist/types/utils/chrome/safe-post-message.js +147 -0
  122. package/dist/types/utils/chrome/snapshot-plugin.js +17 -0
  123. package/dist/types/utils/chrome/storage.js +71 -0
  124. package/dist/types/utils/data/index.js +83 -0
  125. package/dist/types/utils/index.js +27 -0
  126. package/dist/types/utils/sdk/graph.js +213 -0
  127. package/dist/types/utils/sdk/index.js +104 -0
  128. package/dist/types/utils/types/common.js +15 -0
  129. package/dist/types/utils/types/index.js +21 -0
  130. package/dist/types/vendor/basic-proxy-core.js +147 -0
  131. package/dist/types/worker/index.js +175 -0
  132. package/package.json +8 -9
@@ -0,0 +1,638 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __export = (target, all) => {
37
+ for (var name in all)
38
+ __defProp(target, name, { get: all[name], enumerable: true });
39
+ };
40
+ var __copyProps = (to, from, except, desc) => {
41
+ if (from && typeof from === "object" || typeof from === "function") {
42
+ for (let key of __getOwnPropNames(from))
43
+ if (!__hasOwnProp.call(to, key) && key !== except)
44
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
45
+ }
46
+ return to;
47
+ };
48
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
49
+ // If the importer is in node compatibility mode or this is not an ESM
50
+ // file that has been converted to a CommonJS file using a Babel-
51
+ // compatible transform (i.e. "__esModule" has not been set), then set
52
+ // "default" to the CommonJS "module.exports" for node compatibility.
53
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
54
+ mod
55
+ ));
56
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
+ var __async = (__this, __arguments, generator) => {
58
+ return new Promise((resolve, reject) => {
59
+ var fulfilled = (value) => {
60
+ try {
61
+ step(generator.next(value));
62
+ } catch (e) {
63
+ reject(e);
64
+ }
65
+ };
66
+ var rejected = (value) => {
67
+ try {
68
+ step(generator.throw(value));
69
+ } catch (e) {
70
+ reject(e);
71
+ }
72
+ };
73
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
74
+ step((generator = generator.apply(__this, __arguments)).next());
75
+ });
76
+ };
77
+ var SharedDepsExplorer_exports = {};
78
+ __export(SharedDepsExplorer_exports, {
79
+ default: () => SharedDepsExplorer_default
80
+ });
81
+ module.exports = __toCommonJS(SharedDepsExplorer_exports);
82
+ var import_jsx_runtime = require("react/jsx-runtime");
83
+ var import_react = require("react");
84
+ var import_lucide_react = require("lucide-react");
85
+ var import_web_react = require("@arco-design/web-react");
86
+ var import_react_i18next = require("react-i18next");
87
+ var import_share_utils = require("./share-utils");
88
+ var import_FocusResultDisplay = __toESM(require("./FocusResultDisplay"));
89
+ var import_index = __toESM(require("./index.module"));
90
+ const ALL_VALUE = "__all__";
91
+ function HoverTag(_a) {
92
+ var _b = _a, { tooltip, children } = _b, tagProps = __objRest(_b, ["tooltip", "children"]);
93
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Popover, { trigger: "hover", position: "top", content: tooltip != null ? tooltip : children, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, __spreadProps(__spreadValues({}, tagProps), { children })) });
94
+ }
95
+ function SharedDepsExplorer({
96
+ shareData: shareDataProp
97
+ }) {
98
+ const { t } = (0, import_react_i18next.useTranslation)();
99
+ const [normalized, setNormalized] = (0, import_react.useState)([]);
100
+ const [loadingState, setLoadingState] = (0, import_react.useState)("idle");
101
+ const [errorMessage, setErrorMessage] = (0, import_react.useState)(null);
102
+ const loadedStatusLabelLocal = (status) => {
103
+ if (status === "loaded") {
104
+ return t("sharedDeps.status.loaded");
105
+ }
106
+ if (status === "loading") {
107
+ return t("sharedDeps.status.loading");
108
+ }
109
+ if (status === "t-loaded") {
110
+ return t("sharedDeps.status.tLoaded");
111
+ }
112
+ if (status === "t-loading") {
113
+ return t("sharedDeps.status.tLoading");
114
+ }
115
+ return t("sharedDeps.status.notLoaded");
116
+ };
117
+ const [selectedProvider, setSelectedProvider] = (0, import_react.useState)("");
118
+ const [selectedPackage, setSelectedPackage] = (0, import_react.useState)("");
119
+ const [selectedVersion, setSelectedVersion] = (0, import_react.useState)("");
120
+ const [selectedMode, setSelectedMode] = (0, import_react.useState)("");
121
+ const [searchText, setSearchText] = (0, import_react.useState)("");
122
+ const [chartScope, setChartScope] = (0, import_react.useState)("default");
123
+ const [focusPackage, setFocusPackage] = (0, import_react.useState)("react");
124
+ const [focusVersion, setFocusVersion] = (0, import_react.useState)("");
125
+ (0, import_react.useEffect)(() => {
126
+ let cancelled = false;
127
+ function bootstrap() {
128
+ return __async(this, null, function* () {
129
+ if (shareDataProp && Object.keys(shareDataProp).length > 0) {
130
+ const versions = (0, import_share_utils.normalizeShareData)(shareDataProp);
131
+ if (!cancelled) {
132
+ setNormalized(versions);
133
+ setLoadingState("idle");
134
+ setErrorMessage(null);
135
+ }
136
+ return;
137
+ }
138
+ if (!cancelled) {
139
+ setLoadingState("idle");
140
+ setErrorMessage(null);
141
+ }
142
+ });
143
+ }
144
+ bootstrap();
145
+ return () => {
146
+ cancelled = true;
147
+ };
148
+ }, [shareDataProp]);
149
+ const stats = (0, import_react.useMemo)(() => (0, import_share_utils.computeShareStats)(normalized), [normalized]);
150
+ const filterOptions = (0, import_react.useMemo)(
151
+ () => (0, import_share_utils.getFilterOptions)(normalized),
152
+ [normalized]
153
+ );
154
+ (0, import_react.useEffect)(() => {
155
+ const { scopes } = filterOptions;
156
+ if (!scopes.length) {
157
+ return;
158
+ }
159
+ if (!scopes.includes(chartScope)) {
160
+ if (scopes.includes("default")) {
161
+ setChartScope("default");
162
+ } else {
163
+ setChartScope(scopes[0]);
164
+ }
165
+ }
166
+ }, [filterOptions.scopes, chartScope]);
167
+ const filteredVersions = (0, import_react.useMemo)(() => {
168
+ const keyword = searchText.trim().toLowerCase();
169
+ return normalized.filter((v) => {
170
+ if (selectedProvider && v.from !== selectedProvider) {
171
+ return false;
172
+ }
173
+ if (selectedPackage && v.packageName !== selectedPackage) {
174
+ return false;
175
+ }
176
+ if (selectedVersion && v.version !== selectedVersion) {
177
+ return false;
178
+ }
179
+ if (selectedMode && v.treeShakingMode !== selectedMode) {
180
+ return false;
181
+ }
182
+ if (keyword && !v.packageName.toLowerCase().includes(keyword)) {
183
+ return false;
184
+ }
185
+ return true;
186
+ });
187
+ }, [
188
+ normalized,
189
+ selectedProvider,
190
+ selectedPackage,
191
+ selectedVersion,
192
+ selectedMode,
193
+ searchText
194
+ ]);
195
+ const tree = (0, import_react.useMemo)(
196
+ () => (0, import_share_utils.groupByProviderScopePackage)(filteredVersions),
197
+ [filteredVersions]
198
+ );
199
+ const versionsForSelectedPackage = (0, import_react.useMemo)(() => {
200
+ if (!selectedPackage) {
201
+ return [];
202
+ }
203
+ const set = /* @__PURE__ */ new Set();
204
+ normalized.forEach((v) => {
205
+ if (v.packageName === selectedPackage) {
206
+ set.add(v.version);
207
+ }
208
+ });
209
+ return Array.from(set).sort();
210
+ }, [normalized, selectedPackage]);
211
+ const modesForSelectedPackage = (0, import_react.useMemo)(() => {
212
+ if (!selectedPackage) {
213
+ return [];
214
+ }
215
+ const set = /* @__PURE__ */ new Set();
216
+ normalized.forEach((v) => {
217
+ if (v.packageName === selectedPackage && v.treeShakingMode) {
218
+ set.add(v.treeShakingMode);
219
+ }
220
+ });
221
+ return Array.from(set).sort();
222
+ }, [normalized, selectedPackage]);
223
+ const focusVersionsForPackage = (0, import_react.useMemo)(() => {
224
+ if (!focusPackage) {
225
+ return [];
226
+ }
227
+ const set = /* @__PURE__ */ new Set();
228
+ normalized.forEach((v) => {
229
+ if (v.packageName === focusPackage) {
230
+ set.add(v.version);
231
+ }
232
+ });
233
+ return Array.from(set).sort();
234
+ }, [normalized, focusPackage]);
235
+ const focusResult = (0, import_react.useMemo)(() => {
236
+ if (!focusPackage) {
237
+ return null;
238
+ }
239
+ return (0, import_share_utils.findPackageProvider)(
240
+ normalized,
241
+ focusPackage,
242
+ focusVersion || void 0
243
+ );
244
+ }, [normalized, focusPackage, focusVersion]);
245
+ const hasData = normalized.length > 0;
246
+ const columns = [
247
+ {
248
+ title: t("sharedDeps.table.columns.packageVersion"),
249
+ width: "28%",
250
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cellCol, children: [
251
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.packageName, children: item.packageName }),
252
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.version, children: [
253
+ "v",
254
+ item.version
255
+ ] })
256
+ ] })
257
+ },
258
+ {
259
+ title: t("sharedDeps.table.columns.providerScope"),
260
+ width: "20%",
261
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cellColGap, children: [
262
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.truncate, title: item.from, children: t("sharedDeps.table.providerPrefix", { name: item.from }) }),
263
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.scopeText, children: t("sharedDeps.table.scopePrefix", { scope: item.scope }) })
264
+ ] })
265
+ },
266
+ {
267
+ title: t("sharedDeps.table.columns.status"),
268
+ width: "22%",
269
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cellColGap, children: [
270
+ ["loaded", "loading", "t-loaded", "t-loading"].includes(
271
+ item.loadedStatus
272
+ ) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
273
+ HoverTag,
274
+ {
275
+ size: "small",
276
+ className: `${import_index.default.tagContainer} loaded-status-tag`,
277
+ tooltip: loadedStatusLabelLocal(item.loadedStatus),
278
+ children: loadedStatusLabelLocal(item.loadedStatus)
279
+ }
280
+ ) : null,
281
+ item.treeShakingMode ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
282
+ HoverTag,
283
+ {
284
+ size: "small",
285
+ className: import_index.default.tagContainer,
286
+ tooltip: item.treeShakingMode,
287
+ children: item.treeShakingMode
288
+ }
289
+ ) : null,
290
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.configTags, children: [
291
+ item.shareConfig.singleton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
292
+ HoverTag,
293
+ {
294
+ size: "small",
295
+ className: import_index.default.scale90,
296
+ tooltip: "singleton",
297
+ children: "singleton"
298
+ }
299
+ ),
300
+ item.shareConfig.eager && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoverTag, { size: "small", className: import_index.default.scale90, tooltip: "eager", children: "eager" }),
301
+ item.shareConfig.strictVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
302
+ HoverTag,
303
+ {
304
+ size: "small",
305
+ className: import_index.default.scale90,
306
+ tooltip: "strictVersion",
307
+ children: "strictVersion"
308
+ }
309
+ ),
310
+ item.shareConfig.requiredVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
311
+ HoverTag,
312
+ {
313
+ size: "small",
314
+ className: import_index.default.scale90,
315
+ tooltip: `requiredVersion: ${item.shareConfig.requiredVersion}`,
316
+ children: [
317
+ "requiredVersion: ",
318
+ item.shareConfig.requiredVersion
319
+ ]
320
+ }
321
+ )
322
+ ] })
323
+ ] })
324
+ },
325
+ {
326
+ title: t("sharedDeps.table.columns.consumers"),
327
+ width: "18%",
328
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
329
+ import_web_react.Popover,
330
+ {
331
+ trigger: "click",
332
+ position: "right",
333
+ content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.popoverContent, children: [
334
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.popoverTitle, children: t("sharedDeps.consumersPopover.title") }),
335
+ item.useIn.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: import_index.default.scopeText, children: t("sharedDeps.consumersPopover.empty") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: import_index.default.consumerList, children: item.useIn.map((c) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: import_index.default.consumerItem, children: [
336
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.dot }),
337
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.packageName, children: c })
338
+ ] }, c)) })
339
+ ] }),
340
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Button, { size: "mini", type: "secondary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.btnContent, children: [
341
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Network, { className: import_index.default.mr1, size: 12 }),
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sharedDeps.consumersPopover.button", {
343
+ count: item.useIn.length || 0
344
+ }) })
345
+ ] }) })
346
+ }
347
+ )
348
+ },
349
+ {
350
+ title: t("sharedDeps.table.columns.strategy"),
351
+ width: "12%",
352
+ render: (_, item) => {
353
+ var _a;
354
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HoverTag, { size: "small", color: "gray", children: (_a = item.strategy) != null ? _a : t("sharedDeps.table.strategyFallback") });
355
+ }
356
+ }
357
+ ];
358
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.container, children: [
359
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: import_index.default.heroSection, children: [
360
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: import_index.default.heroSubtitle, children: t("sharedDeps.hero.subtitle") }),
361
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: import_index.default.heroTitle, children: t("sharedDeps.hero.title") })
362
+ ] }),
363
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statsGrid, children: [
364
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: import_index.default.cardWithPadding, children: [
365
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.cardHeader, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statSpace, children: [
366
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.statLabel, children: t("sharedDeps.stats.providers.title") }),
367
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statValue, children: [
368
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Server, { className: import_index.default.icon }),
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalProviders })
370
+ ] })
371
+ ] }) }),
372
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: import_index.default.statDescription, children: t("sharedDeps.stats.providers.description") })
373
+ ] }),
374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: import_index.default.cardWithPadding, children: [
375
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.cardHeader, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statSpace, children: [
376
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.statLabel, children: t("sharedDeps.stats.scopes.title") }),
377
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statValue, children: [
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: import_index.default.icon }),
379
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalScopes }),
380
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.statSubtext, children: t("sharedDeps.stats.scopes.badge") })
381
+ ] })
382
+ ] }) }),
383
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cardFooter, children: [
384
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${import_index.default.truncate} ${import_index.default.mr2}`, children: t("sharedDeps.stats.scopes.description") }),
385
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: import_index.default.badgeGroup, children: [
386
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Box, { className: import_index.default.iconSmall }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
388
+ stats.totalPackages,
389
+ t("sharedDeps.stats.scopes.packagesBadge", {
390
+ count: stats.totalPackages
391
+ })
392
+ ] })
393
+ ] })
394
+ ] })
395
+ ] }),
396
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: import_index.default.cardWithPadding, children: [
397
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.cardHeader, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statSpace, children: [
398
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.statLabel, children: t("sharedDeps.stats.versions.title") }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.statValue, children: [
400
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Package2, { className: import_index.default.icon }),
401
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalVersions })
402
+ ] })
403
+ ] }) }),
404
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.statusTags, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.tagRow, children: [
405
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
406
+ HoverTag,
407
+ {
408
+ className: `${import_index.default.tagContent} loaded-status-tag`,
409
+ tooltip: `Loaded: ${stats.loadedCount}`,
410
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.tagContent, children: [
411
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Network, { className: `${import_index.default.iconSmall} ${import_index.default.mr1}` }),
412
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sharedDeps.stats.versions.loadedLabel") }),
413
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.tagValue, children: stats.loadedCount })
414
+ ] })
415
+ }
416
+ ),
417
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
418
+ HoverTag,
419
+ {
420
+ className: `${import_index.default.tagContent} reused-status-tag`,
421
+ tooltip: `Reused: ${stats.reusedCount}`,
422
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.tagContent, children: [
423
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Repeat, { className: `${import_index.default.iconSmall} ${import_index.default.mr1}` }),
424
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sharedDeps.stats.versions.reusedLabel") }) }),
425
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.tagValue, children: stats.reusedCount })
426
+ ] })
427
+ }
428
+ )
429
+ ] }) })
430
+ ] })
431
+ ] }) }),
432
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: import_index.default.rightPanels, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.panelStack, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
433
+ import_web_react.Card,
434
+ {
435
+ className: import_index.default.card,
436
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cardTitle, children: [
437
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Box, { className: import_index.default.iconMedium }),
438
+ t("sharedDeps.focusPanel.title", { package: focusPackage })
439
+ ] }),
440
+ children: [
441
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.controlsGrid, children: [
442
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.inputGroup, children: [
443
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.focusPanel.packageLabel") }),
444
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
445
+ import_web_react.Select,
446
+ {
447
+ showSearch: true,
448
+ value: focusPackage,
449
+ onChange: (value) => {
450
+ setFocusPackage(value);
451
+ setFocusVersion("");
452
+ },
453
+ placeholder: t("sharedDeps.focusPanel.packagePlaceholder"),
454
+ className: import_index.default.fullWidth,
455
+ children: filterOptions.packages.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: name, children: name }, name))
456
+ }
457
+ )
458
+ ] }),
459
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.inputGroup, children: [
460
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.focusPanel.versionLabel") }),
461
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
462
+ import_web_react.Select,
463
+ {
464
+ showSearch: true,
465
+ value: focusVersion || ALL_VALUE,
466
+ onChange: (value) => setFocusVersion(value === ALL_VALUE ? "" : value),
467
+ placeholder: t("sharedDeps.focusPanel.versionPlaceholder"),
468
+ className: import_index.default.fullWidth,
469
+ children: [
470
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: ALL_VALUE, children: t("sharedDeps.focusPanel.versionAllOption") }),
471
+ focusVersionsForPackage.map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: v, children: v }, v))
472
+ ]
473
+ }
474
+ )
475
+ ] })
476
+ ] }),
477
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.resultBox, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
478
+ import_FocusResultDisplay.default,
479
+ {
480
+ focusResult,
481
+ hasData,
482
+ loadedStatusLabel: loadedStatusLabelLocal
483
+ }
484
+ ) })
485
+ ]
486
+ }
487
+ ) }) }),
488
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
489
+ import_web_react.Card,
490
+ {
491
+ className: import_index.default.card,
492
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.cardTitle, children: [
493
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { className: import_index.default.iconMedium }),
494
+ t("sharedDeps.filters.cardTitle")
495
+ ] }),
496
+ children: [
497
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.filterGrid, children: [
498
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${import_index.default.inputGroup} ${import_index.default.padding2}`, children: [
499
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.filters.providerLabel") }),
500
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
501
+ import_web_react.Select,
502
+ {
503
+ value: selectedProvider || void 0,
504
+ onChange: (value) => setSelectedProvider(value === ALL_VALUE ? "" : value),
505
+ placeholder: t("sharedDeps.filters.providerPlaceholder"),
506
+ className: import_index.default.fullWidth,
507
+ allowClear: true,
508
+ children: filterOptions.providers.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: p, children: p }, p))
509
+ }
510
+ )
511
+ ] }),
512
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${import_index.default.inputGroup} ${import_index.default.padding2}`, children: [
513
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.filters.packageLabel") }),
514
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
515
+ import_web_react.Select,
516
+ {
517
+ value: selectedPackage || void 0,
518
+ onChange: (value) => setSelectedPackage(value === ALL_VALUE ? "" : value),
519
+ placeholder: t("sharedDeps.filters.packagePlaceholder"),
520
+ className: import_index.default.fullWidth,
521
+ allowClear: true,
522
+ children: filterOptions.packages.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: name, children: name }, name))
523
+ }
524
+ )
525
+ ] }),
526
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${import_index.default.inputGroup} ${import_index.default.padding2}`, children: [
527
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.filters.versionLabel") }),
528
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
529
+ import_web_react.Select,
530
+ {
531
+ value: selectedVersion || void 0,
532
+ onChange: (value) => setSelectedVersion(value === ALL_VALUE ? "" : value),
533
+ placeholder: t("sharedDeps.filters.versionPlaceholder"),
534
+ className: import_index.default.fullWidth,
535
+ disabled: !selectedPackage,
536
+ allowClear: true,
537
+ children: versionsForSelectedPackage.map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: v, children: v }, v))
538
+ }
539
+ )
540
+ ] }),
541
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `${import_index.default.inputGroup} ${import_index.default.padding2}`, children: [
542
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
543
+ "div",
544
+ {
545
+ className: import_index.default.inputLabel,
546
+ style: { display: "flex", alignItems: "center", gap: 4 },
547
+ children: [
548
+ "Mode",
549
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tooltip, { content: "Shared Tree Shaking Mode, options: server-calc | runtime-infer", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
550
+ import_lucide_react.Info,
551
+ {
552
+ size: 14,
553
+ style: { cursor: "help", color: "#86909c" }
554
+ }
555
+ ) })
556
+ ]
557
+ }
558
+ ),
559
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
560
+ import_web_react.Select,
561
+ {
562
+ value: selectedMode || void 0,
563
+ onChange: (value) => setSelectedMode(value === ALL_VALUE ? "" : value),
564
+ placeholder: "All Modes",
565
+ className: import_index.default.fullWidth,
566
+ disabled: !selectedPackage || modesForSelectedPackage.length === 0,
567
+ allowClear: true,
568
+ children: modesForSelectedPackage.map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: v, children: v }, v))
569
+ }
570
+ )
571
+ ] })
572
+ ] }),
573
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.searchGrid, children: [
574
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.inputGroup, children: [
575
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.inputLabel, children: t("sharedDeps.filters.keywordLabel") }),
576
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
577
+ import_web_react.Input,
578
+ {
579
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { className: import_index.default.iconMedium }),
580
+ className: import_index.default.searchInput,
581
+ placeholder: t("sharedDeps.filters.keywordPlaceholder"),
582
+ value: searchText,
583
+ onChange: (val) => setSearchText(val)
584
+ }
585
+ )
586
+ ] }),
587
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.matchCount, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
588
+ t("sharedDeps.filters.matchCountLabel"),
589
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: import_index.default.matchValue, children: filteredVersions.length })
590
+ ] }) })
591
+ ] }),
592
+ !hasData && loadingState === "loading" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.loadingText, children: t("sharedDeps.messages.loading") }),
593
+ loadingState === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.errorText, children: errorMessage ? t("sharedDeps.messages.error", { message: errorMessage }) : t("sharedDeps.messages.errorUnknown") }),
594
+ hasData && Object.keys(tree).length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.noMatchText, children: t("sharedDeps.messages.noMatch") }),
595
+ hasData && Object.keys(tree).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.treeContainer, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.collapseWrapper, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Collapse, { children: Object.entries(tree).map(([provider, scopes]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
596
+ import_web_react.Collapse.Item,
597
+ {
598
+ name: provider,
599
+ header: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.providerHeader, children: [
600
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.providerTitle, children: [
601
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Server, { className: import_index.default.iconMedium }),
602
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: provider })
603
+ ] }),
604
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.providerMeta, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sharedDeps.filters.scopeCount", {
605
+ count: Object.keys(scopes).length
606
+ }) }) })
607
+ ] }),
608
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.scopeList, children: Object.entries(scopes).map(([scopeName, packages]) => {
609
+ const list = Object.values(packages).flat();
610
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.scopeItem, children: [
611
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: import_index.default.scopeHeader, children: [
612
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: import_index.default.iconSmall }),
613
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: t("sharedDeps.filters.scopePrefix", {
614
+ name: scopeName
615
+ }) })
616
+ ] }),
617
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: import_index.default.tableContainer, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
618
+ import_web_react.Table,
619
+ {
620
+ columns,
621
+ data: list,
622
+ pagination: false,
623
+ rowKey: "id",
624
+ border: false,
625
+ size: "small"
626
+ }
627
+ ) })
628
+ ] }, scopeName);
629
+ }) })
630
+ },
631
+ provider
632
+ )) }) }) })
633
+ ]
634
+ }
635
+ ) })
636
+ ] });
637
+ }
638
+ var SharedDepsExplorer_default = SharedDepsExplorer;