@module-federation/devtools 0.0.0-next-20250926024003 → 0.0.0-perf-devtools-20260106124142

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 (92) hide show
  1. package/dist/es/App.js +328 -22
  2. package/dist/es/App.module.js +1 -1
  3. package/dist/es/App_module.css +291 -5
  4. package/dist/es/component/DependencyGraph/index.js +205 -0
  5. package/dist/es/component/DependencyGraph/index.module.js +5 -0
  6. package/dist/es/component/DependencyGraph/index_module.css +97 -0
  7. package/dist/es/component/{GraphItem → DependencyGraphItem}/index.js +15 -6
  8. package/dist/es/component/DependencyGraphItem/index.module.js +5 -0
  9. package/dist/es/component/DependencyGraphItem/index_module.css +95 -0
  10. package/dist/es/component/Form/index.js +191 -109
  11. package/dist/es/component/Form/index.module.js +1 -1
  12. package/dist/es/component/Form/index_module.css +179 -25
  13. package/dist/es/component/Layout/index.js +288 -51
  14. package/dist/es/component/Layout/index.module.js +1 -1
  15. package/dist/es/component/Layout/index_module.css +52 -32
  16. package/dist/es/component/ModuleInfo/index.js +289 -0
  17. package/dist/es/component/ModuleInfo/index.module.js +5 -0
  18. package/dist/es/component/ModuleInfo/index_module.css +183 -0
  19. package/dist/es/component/SharedDepsExplorer/FocusResultDisplay.js +39 -0
  20. package/dist/es/component/SharedDepsExplorer/index.js +505 -0
  21. package/dist/es/component/SharedDepsExplorer/share-utils.js +206 -0
  22. package/dist/es/index.css +15 -0
  23. package/dist/es/template/constant.js +5 -19
  24. package/dist/es/utils/chrome/fast-refresh.js +80 -7
  25. package/dist/es/utils/chrome/index.js +91 -38
  26. package/dist/es/utils/chrome/messages.js +6 -0
  27. package/dist/es/utils/chrome/post-message-listener.js +2 -1
  28. package/dist/es/utils/chrome/post-message-start.js +10 -2
  29. package/dist/es/utils/chrome/storage.js +6 -1
  30. package/dist/es/utils/sdk/graph.js +25 -4
  31. package/dist/es/utils/sdk/index.js +9 -0
  32. package/dist/es/worker/index.js +168 -1
  33. package/dist/lib/App.js +318 -17
  34. package/dist/lib/App.module.js +1 -1
  35. package/dist/lib/App_module.css +291 -5
  36. package/dist/lib/component/DependencyGraph/index.js +227 -0
  37. package/dist/lib/component/{GraphItem → DependencyGraph}/index.module.js +1 -1
  38. package/dist/lib/component/DependencyGraph/index_module.css +97 -0
  39. package/dist/lib/component/{GraphItem → DependencyGraphItem}/index.js +18 -9
  40. package/dist/lib/component/{Graph → DependencyGraphItem}/index.module.js +1 -1
  41. package/dist/lib/component/DependencyGraphItem/index_module.css +95 -0
  42. package/dist/lib/component/Form/index.js +188 -107
  43. package/dist/lib/component/Form/index.module.js +1 -1
  44. package/dist/lib/component/Form/index_module.css +179 -25
  45. package/dist/lib/component/Layout/index.js +280 -48
  46. package/dist/lib/component/Layout/index.module.js +1 -1
  47. package/dist/lib/component/Layout/index_module.css +52 -32
  48. package/dist/lib/component/ModuleInfo/index.js +319 -0
  49. package/dist/lib/component/ModuleInfo/index.module.js +25 -0
  50. package/dist/lib/component/ModuleInfo/index_module.css +183 -0
  51. package/dist/lib/component/SharedDepsExplorer/FocusResultDisplay.js +59 -0
  52. package/dist/lib/component/SharedDepsExplorer/index.js +512 -0
  53. package/dist/lib/component/SharedDepsExplorer/share-utils.js +237 -0
  54. package/dist/lib/index.css +15 -0
  55. package/dist/lib/template/constant.js +7 -17
  56. package/dist/lib/utils/chrome/fast-refresh.js +77 -8
  57. package/dist/lib/utils/chrome/index.js +94 -38
  58. package/dist/lib/utils/chrome/messages.js +31 -0
  59. package/dist/lib/utils/chrome/post-message-listener.js +2 -1
  60. package/dist/lib/utils/chrome/post-message-start.js +10 -2
  61. package/dist/lib/utils/chrome/storage.js +5 -0
  62. package/dist/lib/utils/sdk/graph.js +25 -4
  63. package/dist/lib/utils/sdk/index.js +10 -0
  64. package/dist/lib/worker/index.js +156 -1
  65. package/dist/types/src/App.d.ts +0 -1
  66. package/dist/types/src/component/{Graph → DependencyGraph}/index.d.ts +0 -1
  67. package/dist/types/src/component/{GraphItem → DependencyGraphItem}/index.d.ts +0 -1
  68. package/dist/types/src/component/Form/index.d.ts +2 -0
  69. package/dist/types/src/component/Layout/index.d.ts +0 -1
  70. package/dist/types/src/component/ModuleInfo/index.d.ts +8 -0
  71. package/dist/types/src/component/SharedDepsExplorer/FocusResultDisplay.d.ts +15 -0
  72. package/dist/types/src/component/SharedDepsExplorer/index.d.ts +6 -0
  73. package/dist/types/src/component/SharedDepsExplorer/share-utils.d.ts +44 -0
  74. package/dist/types/src/index.d.ts +2 -1
  75. package/dist/types/src/init.d.ts +0 -1
  76. package/dist/types/src/template/constant.d.ts +3 -5
  77. package/dist/types/src/utils/chrome/index.d.ts +5 -3
  78. package/dist/types/src/utils/chrome/messages.d.ts +2 -0
  79. package/dist/types/src/utils/chrome/storage.d.ts +5 -4
  80. package/dist/types/src/utils/sdk/graph.d.ts +2 -1
  81. package/dist/types/src/utils/sdk/index.d.ts +1 -0
  82. package/dist/types/src/utils/types/common.d.ts +4 -0
  83. package/dist/types/src/worker/index.d.ts +1 -0
  84. package/package.json +18 -14
  85. package/dist/es/component/Graph/index.js +0 -127
  86. package/dist/es/component/Graph/index.module.js +0 -5
  87. package/dist/es/component/Graph/index_module.css +0 -12
  88. package/dist/es/component/GraphItem/index.module.js +0 -5
  89. package/dist/es/component/GraphItem/index_module.css +0 -61
  90. package/dist/lib/component/Graph/index.js +0 -149
  91. package/dist/lib/component/Graph/index_module.css +0 -12
  92. package/dist/lib/component/GraphItem/index_module.css +0 -61
@@ -0,0 +1,512 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
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
+ };
49
+ var SharedDepsExplorer_exports = {};
50
+ __export(SharedDepsExplorer_exports, {
51
+ default: () => SharedDepsExplorer_default
52
+ });
53
+ module.exports = __toCommonJS(SharedDepsExplorer_exports);
54
+ var import_jsx_runtime = require("react/jsx-runtime");
55
+ var import_react = require("react");
56
+ var import_lucide_react = require("lucide-react");
57
+ var import_web_react = require("@arco-design/web-react");
58
+ var import_share_utils = require("./share-utils");
59
+ var import_FocusResultDisplay = __toESM(require("./FocusResultDisplay"));
60
+ const ALL_VALUE = "__all__";
61
+ function loadedStatusLabel(status) {
62
+ if (status === "loaded") {
63
+ return "Loaded";
64
+ }
65
+ if (status === "loading") {
66
+ return "Loading";
67
+ }
68
+ return "Not Loaded";
69
+ }
70
+ function SharedDepsExplorer({
71
+ shareData: shareDataProp
72
+ }) {
73
+ const [normalized, setNormalized] = (0, import_react.useState)([]);
74
+ const [loadingState, setLoadingState] = (0, import_react.useState)("idle");
75
+ const [errorMessage, setErrorMessage] = (0, import_react.useState)(null);
76
+ const [selectedProvider, setSelectedProvider] = (0, import_react.useState)("");
77
+ const [selectedPackage, setSelectedPackage] = (0, import_react.useState)("");
78
+ const [selectedVersion, setSelectedVersion] = (0, import_react.useState)("");
79
+ const [searchText, setSearchText] = (0, import_react.useState)("");
80
+ const [chartScope, setChartScope] = (0, import_react.useState)("default");
81
+ const [focusPackage, setFocusPackage] = (0, import_react.useState)("react");
82
+ const [focusVersion, setFocusVersion] = (0, import_react.useState)("");
83
+ (0, import_react.useEffect)(() => {
84
+ let cancelled = false;
85
+ function bootstrap() {
86
+ return __async(this, null, function* () {
87
+ if (shareDataProp && Object.keys(shareDataProp).length > 0) {
88
+ const versions = (0, import_share_utils.normalizeShareData)(shareDataProp);
89
+ if (!cancelled) {
90
+ setNormalized(versions);
91
+ setLoadingState("idle");
92
+ setErrorMessage(null);
93
+ }
94
+ return;
95
+ }
96
+ if (!cancelled) {
97
+ setLoadingState("idle");
98
+ setErrorMessage(null);
99
+ }
100
+ });
101
+ }
102
+ bootstrap();
103
+ return () => {
104
+ cancelled = true;
105
+ };
106
+ }, [shareDataProp]);
107
+ const stats = (0, import_react.useMemo)(() => (0, import_share_utils.computeShareStats)(normalized), [normalized]);
108
+ const filterOptions = (0, import_react.useMemo)(
109
+ () => (0, import_share_utils.getFilterOptions)(normalized),
110
+ [normalized]
111
+ );
112
+ (0, import_react.useEffect)(() => {
113
+ const { scopes } = filterOptions;
114
+ if (!scopes.length) {
115
+ return;
116
+ }
117
+ if (!scopes.includes(chartScope)) {
118
+ if (scopes.includes("default")) {
119
+ setChartScope("default");
120
+ } else {
121
+ setChartScope(scopes[0]);
122
+ }
123
+ }
124
+ }, [filterOptions.scopes, chartScope]);
125
+ const filteredVersions = (0, import_react.useMemo)(() => {
126
+ const keyword = searchText.trim().toLowerCase();
127
+ return normalized.filter((v) => {
128
+ if (selectedProvider && v.from !== selectedProvider) {
129
+ return false;
130
+ }
131
+ if (selectedPackage && v.packageName !== selectedPackage) {
132
+ return false;
133
+ }
134
+ if (selectedVersion && v.version !== selectedVersion) {
135
+ return false;
136
+ }
137
+ if (keyword && !v.packageName.toLowerCase().includes(keyword)) {
138
+ return false;
139
+ }
140
+ return true;
141
+ });
142
+ }, [
143
+ normalized,
144
+ selectedProvider,
145
+ selectedPackage,
146
+ selectedVersion,
147
+ searchText
148
+ ]);
149
+ const tree = (0, import_react.useMemo)(
150
+ () => (0, import_share_utils.groupByProviderScopePackage)(filteredVersions),
151
+ [filteredVersions]
152
+ );
153
+ const versionsForSelectedPackage = (0, import_react.useMemo)(() => {
154
+ if (!selectedPackage) {
155
+ return [];
156
+ }
157
+ const set = /* @__PURE__ */ new Set();
158
+ normalized.forEach((v) => {
159
+ if (v.packageName === selectedPackage) {
160
+ set.add(v.version);
161
+ }
162
+ });
163
+ return Array.from(set).sort();
164
+ }, [normalized, selectedPackage]);
165
+ const focusVersionsForPackage = (0, import_react.useMemo)(() => {
166
+ if (!focusPackage) {
167
+ return [];
168
+ }
169
+ const set = /* @__PURE__ */ new Set();
170
+ normalized.forEach((v) => {
171
+ if (v.packageName === focusPackage) {
172
+ set.add(v.version);
173
+ }
174
+ });
175
+ return Array.from(set).sort();
176
+ }, [normalized, focusPackage]);
177
+ const focusResult = (0, import_react.useMemo)(() => {
178
+ if (!focusPackage) {
179
+ return null;
180
+ }
181
+ return (0, import_share_utils.findPackageProvider)(
182
+ normalized,
183
+ focusPackage,
184
+ focusVersion || void 0
185
+ );
186
+ }, [normalized, focusPackage, focusVersion]);
187
+ const hasData = normalized.length > 0;
188
+ const columns = [
189
+ {
190
+ title: "Package / Version",
191
+ width: "28%",
192
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col", children: [
193
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "break-all font-mono text-[11px] text-zinc-800", children: item.packageName }),
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-1 text-[11px] text-zinc-500", children: [
195
+ "v",
196
+ item.version
197
+ ] })
198
+ ] })
199
+ },
200
+ {
201
+ title: "Provider / Scope",
202
+ width: "20%",
203
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-1", children: [
204
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "truncate", title: item.from, children: [
205
+ "Provider: ",
206
+ item.from
207
+ ] }),
208
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-[11px] text-zinc-500", children: [
209
+ "scope: ",
210
+ item.scope
211
+ ] })
212
+ ] })
213
+ },
214
+ {
215
+ title: "Status",
216
+ width: "22%",
217
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-1", children: [
218
+ ["loaded", "loading"].includes(item.loadedStatus) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
219
+ import_web_react.Tag,
220
+ {
221
+ size: "small",
222
+ className: `w-16 flex items-center justify-center loaded-status-tag`,
223
+ children: loadedStatusLabel(item.loadedStatus)
224
+ }
225
+ ) : null,
226
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mt-1 flex flex-wrap gap-1 text-[10px] text-zinc-500", children: [
227
+ item.shareConfig.singleton && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { size: "small", className: "scale-90 origin-left", children: "singleton" }),
228
+ item.shareConfig.eager && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { size: "small", className: "scale-90 origin-left", children: "eager" }),
229
+ item.shareConfig.strictVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { size: "small", className: "scale-90 origin-left", children: "strictVersion" }),
230
+ item.shareConfig.requiredVersion && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Tag, { size: "small", className: "scale-90 origin-left", children: [
231
+ "req: ",
232
+ item.shareConfig.requiredVersion
233
+ ] })
234
+ ] })
235
+ ] })
236
+ },
237
+ {
238
+ title: "Consumers",
239
+ width: "18%",
240
+ render: (_, item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
241
+ import_web_react.Popover,
242
+ {
243
+ trigger: "click",
244
+ position: "right",
245
+ content: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-72", children: [
246
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-1 text-xs font-medium", children: "Consumer List" }),
247
+ item.useIn.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-[11px] text-zinc-500", children: "No applications are consuming this shared dependency version." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "space-y-1 text-[11px] text-zinc-700", children: item.useIn.map((c) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "flex items-center gap-1", children: [
248
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "h-1.5 w-1.5 rounded-full bg-emerald-500" }),
249
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "break-all", children: c })
250
+ ] }, c)) })
251
+ ] }),
252
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Button, { size: "mini", type: "secondary", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center", children: [
253
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Network, { className: "h-3 w-3 mr-1" }),
254
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
255
+ item.useIn.length || 0,
256
+ " Apps"
257
+ ] })
258
+ ] }) })
259
+ }
260
+ )
261
+ },
262
+ {
263
+ title: "Strategy",
264
+ width: "12%",
265
+ render: (_, item) => {
266
+ var _a;
267
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { size: "small", color: "gray", children: (_a = item.strategy) != null ? _a : "-" });
268
+ }
269
+ }
270
+ ];
271
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: `flex flex-col gap-4 px-3 py-4 md:px-4 md:py-6 max-w-5xl`, children: [
272
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: "space-y-2", children: [
273
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wide text-zinc-500", children: "Module Federation · Shared Dependencies" }),
274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: "text-3xl font-bold tracking-tight text-zinc-900", children: "Overview of Shared Dependencies Usage" })
275
+ ] }),
276
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3", children: [
277
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
278
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
279
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-zinc-500", children: "Number of Providers" }),
280
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
281
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Server, { className: "h-5 w-5 text-zinc-400" }),
282
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalProviders })
283
+ ] })
284
+ ] }) }),
285
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-zinc-500", children: "Number of applications/build versions exposing shared dependencies." })
286
+ ] }),
287
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
288
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
289
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-zinc-500", children: "Share Scope / Package" }),
290
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
291
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-5 w-5 text-zinc-400" }),
292
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalScopes }),
293
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-base text-zinc-400", children: "scope" })
294
+ ] })
295
+ ] }) }),
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center justify-between text-xs text-zinc-500 whitespace-nowrap", children: [
297
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "truncate mr-2", children: "Shared spaces under Scope dimension." }),
298
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 flex-shrink-0", children: [
299
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Box, { className: "h-3 w-3" }),
300
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
301
+ stats.totalPackages,
302
+ " packages"
303
+ ] })
304
+ ] })
305
+ ] })
306
+ ] }),
307
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_web_react.Card, { className: "rounded-xl shadow-sm border-zinc-200 p-4", children: [
308
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-row items-center justify-between pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
309
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-zinc-500", children: "Version Loading & Reuse" }),
310
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-2xl font-semibold flex items-center gap-2", children: [
311
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Package2, { className: "h-5 w-5 text-zinc-400" }),
312
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: stats.totalVersions })
313
+ ] })
314
+ ] }) }),
315
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-col gap-1 text-xs text-zinc-500", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [
316
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { className: "flex items-center gap-1 loaded-status-tag", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center", children: [
317
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Network, { className: "h-3 w-3 mr-1" }),
318
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Loaded" }),
319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-zinc-900 ml-1", children: stats.loadedCount })
320
+ ] }) }),
321
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Tag, { className: "flex items-center gap-1 reused-status-tag", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center", children: [
322
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Repeat, { className: "h-3 w-3 mr-1" }),
323
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Reused" }),
324
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-zinc-900 ml-1", children: stats.reusedCount })
325
+ ] }) })
326
+ ] }) })
327
+ ] })
328
+ ] }) }),
329
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { className: "flex flex-col gap-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
330
+ import_web_react.Card,
331
+ {
332
+ className: "rounded-xl shadow-sm border-zinc-200",
333
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-base flex items-center gap-2", children: [
334
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Box, { className: "h-4 w-4 text-zinc-500" }),
335
+ "Who provides the current shared: '",
336
+ focusPackage,
337
+ "'?"
338
+ ] }),
339
+ children: [
340
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-3 md:grid-cols-2 mb-3 p-2", children: [
341
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Package Name" }),
343
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
344
+ import_web_react.Select,
345
+ {
346
+ showSearch: true,
347
+ value: focusPackage,
348
+ onChange: (value) => {
349
+ setFocusPackage(value);
350
+ setFocusVersion("");
351
+ },
352
+ placeholder: "Select Shared Dependency Package Name",
353
+ className: "w-full",
354
+ children: filterOptions.packages.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: name, children: name }, name))
355
+ }
356
+ )
357
+ ] }),
358
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
359
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Version (Optional, inferred if empty)" }),
360
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
361
+ import_web_react.Select,
362
+ {
363
+ showSearch: true,
364
+ value: focusVersion || ALL_VALUE,
365
+ onChange: (value) => setFocusVersion(value === ALL_VALUE ? "" : value),
366
+ placeholder: "All Versions",
367
+ className: "w-full",
368
+ children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: ALL_VALUE, children: "All Versions" }),
370
+ focusVersionsForPackage.map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: v, children: v }, v))
371
+ ]
372
+ }
373
+ )
374
+ ] })
375
+ ] }),
376
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "rounded-md border border-dashed border-zinc-200 bg-zinc-50 px-3 py-2 text-xs", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
377
+ import_FocusResultDisplay.default,
378
+ {
379
+ focusResult,
380
+ hasData,
381
+ loadedStatusLabel
382
+ }
383
+ ) })
384
+ ]
385
+ }
386
+ ) }) }),
387
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
388
+ import_web_react.Card,
389
+ {
390
+ className: "rounded-xl shadow-sm border-zinc-200",
391
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-base flex items-center gap-2", children: [
392
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { className: "h-4 w-4 text-zinc-500" }),
393
+ "Filter / Search"
394
+ ] }),
395
+ children: [
396
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-3 md:grid-cols-2 lg:grid-cols-3 mb-3", children: [
397
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1 p-2", children: [
398
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Provider" }),
399
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
400
+ import_web_react.Select,
401
+ {
402
+ value: selectedProvider || void 0,
403
+ onChange: (value) => setSelectedProvider(value === ALL_VALUE ? "" : value),
404
+ placeholder: "All Providers",
405
+ className: "w-full",
406
+ allowClear: true,
407
+ children: filterOptions.providers.map((p) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: p, children: p }, p))
408
+ }
409
+ )
410
+ ] }),
411
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1 p-2", children: [
412
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Package Name" }),
413
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
414
+ import_web_react.Select,
415
+ {
416
+ value: selectedPackage || void 0,
417
+ onChange: (value) => setSelectedPackage(value === ALL_VALUE ? "" : value),
418
+ placeholder: "All Packages",
419
+ className: "w-full",
420
+ allowClear: true,
421
+ children: filterOptions.packages.map((name) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: name, children: name }, name))
422
+ }
423
+ )
424
+ ] }),
425
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1 p-2", children: [
426
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Version" }),
427
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
428
+ import_web_react.Select,
429
+ {
430
+ value: selectedVersion || void 0,
431
+ onChange: (value) => setSelectedVersion(value === ALL_VALUE ? "" : value),
432
+ placeholder: "All Versions",
433
+ className: "w-full",
434
+ disabled: !selectedPackage,
435
+ allowClear: true,
436
+ children: versionsForSelectedPackage.map((v) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Select.Option, { value: v, children: v }, v))
437
+ }
438
+ )
439
+ ] })
440
+ ] }),
441
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "grid gap-3 md:grid-cols-2 p-2", children: [
442
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-1", children: [
443
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-zinc-500", children: "Package Name Keyword (Fuzzy Match)" }),
444
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
445
+ import_web_react.Input,
446
+ {
447
+ prefix: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Search, { className: "text-zinc-400 h-3.5 w-3.5" }),
448
+ className: "text-xs",
449
+ placeholder: "e.g., react / axios",
450
+ value: searchText,
451
+ onChange: (val) => setSearchText(val)
452
+ }
453
+ )
454
+ ] }),
455
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex items-end justify-end gap-2 text-xs text-zinc-500", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
456
+ "Currently Matched Versions:",
457
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "font-semibold text-zinc-900 ml-1", children: filteredVersions.length })
458
+ ] }) })
459
+ ] }),
460
+ !hasData && loadingState === "loading" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "py-4 text-xs text-zinc-500", children: "Parsing shared dependency data..." }),
461
+ loadingState === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "py-3 text-xs text-red-600", children: [
462
+ "Failed to load shared dependency data:",
463
+ " ",
464
+ errorMessage != null ? errorMessage : "Unknown Error"
465
+ ] }),
466
+ hasData && Object.keys(tree).length === 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "py-3 text-xs text-zinc-500", children: "No matching shared dependency versions under current filter conditions, try relaxing the filter conditions." }),
467
+ hasData && Object.keys(tree).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "max-h-80 overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-2", style: { border: 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_web_react.Collapse, { children: Object.entries(tree).map(([provider, scopes]) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
468
+ import_web_react.Collapse.Item,
469
+ {
470
+ name: provider,
471
+ header: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col items-start gap-1 text-left", children: [
472
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-sm font-medium", children: [
473
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Server, { className: "h-3.5 w-3.5 text-zinc-500" }),
474
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: provider })
475
+ ] }),
476
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2 text-[10px] text-zinc-500", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
477
+ "Scope Count: ",
478
+ Object.keys(scopes).length
479
+ ] }) })
480
+ ] }),
481
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "space-y-4", children: Object.entries(scopes).map(([scopeName, packages]) => {
482
+ const list = Object.values(packages).flat();
483
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "space-y-2", children: [
484
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-xs font-medium text-zinc-600", children: [
485
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Layers, { className: "h-3 w-3 text-zinc-500" }),
486
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
487
+ "Scope: ",
488
+ scopeName
489
+ ] })
490
+ ] }),
491
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "overflow-hidden rounded-md border border-zinc-200 bg-zinc-50/40", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
492
+ import_web_react.Table,
493
+ {
494
+ columns,
495
+ data: list,
496
+ pagination: false,
497
+ rowKey: "id",
498
+ border: false,
499
+ size: "small"
500
+ }
501
+ ) })
502
+ ] }, scopeName);
503
+ }) })
504
+ },
505
+ provider
506
+ )) }) }) })
507
+ ]
508
+ }
509
+ ) })
510
+ ] });
511
+ }
512
+ var SharedDepsExplorer_default = SharedDepsExplorer;