@industry-theme/repository-composition-panels 0.2.0 → 0.2.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.
@@ -1,5 +1,157 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import React2, { createContext, useContext, forwardRef, createElement, useRef, useEffect, memo, PureComponent, isValidElement, cloneElement, useLayoutEffect, useMemo, useState, useCallback, useImperativeHandle } from "react";
2
+ import React2, { createContext, useState, useEffect, useContext, forwardRef, createElement, useRef, memo, PureComponent, isValidElement, cloneElement, useLayoutEffect, useMemo, useCallback, useImperativeHandle } from "react";
3
+ var terminalTheme = {
4
+ space: [0, 4, 8, 16, 32, 64, 128, 256, 512],
5
+ fonts: {
6
+ body: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace',
7
+ heading: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace',
8
+ monospace: '"SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace'
9
+ },
10
+ fontSizes: [12, 14, 16, 18, 20, 24, 32, 48, 64, 96],
11
+ fontScale: 1,
12
+ fontWeights: {
13
+ body: 400,
14
+ heading: 500,
15
+ bold: 600,
16
+ light: 300,
17
+ medium: 500,
18
+ semibold: 600
19
+ },
20
+ lineHeights: {
21
+ body: 1.6,
22
+ heading: 1.3,
23
+ tight: 1.4,
24
+ relaxed: 1.8
25
+ },
26
+ breakpoints: ["640px", "768px", "1024px", "1280px"],
27
+ sizes: [16, 32, 64, 128, 256, 512, 768, 1024, 1536],
28
+ radii: [0, 2, 4, 6, 8, 12, 16, 24],
29
+ shadows: [
30
+ "none",
31
+ "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
32
+ "0 2px 4px 0 rgba(0, 0, 0, 0.06)",
33
+ "0 4px 6px 0 rgba(0, 0, 0, 0.07)",
34
+ "0 8px 12px 0 rgba(0, 0, 0, 0.08)",
35
+ "0 16px 24px 0 rgba(0, 0, 0, 0.10)"
36
+ ],
37
+ zIndices: [0, 1, 10, 20, 30, 40, 50],
38
+ colors: {
39
+ text: "#e4e4e4",
40
+ background: "rgba(10, 10, 10, 0.85)",
41
+ primary: "#66b3ff",
42
+ secondary: "#80c4ff",
43
+ accent: "#66ff99",
44
+ highlight: "rgba(102, 179, 255, 0.15)",
45
+ muted: "rgba(26, 26, 26, 0.8)",
46
+ success: "#66ff99",
47
+ warning: "#ffcc66",
48
+ error: "#ff6666",
49
+ info: "#66b3ff",
50
+ border: "rgba(255, 255, 255, 0.1)",
51
+ backgroundSecondary: "rgba(15, 15, 15, 0.9)",
52
+ backgroundTertiary: "rgba(20, 20, 20, 0.9)",
53
+ backgroundLight: "rgba(255, 255, 255, 0.05)",
54
+ backgroundHover: "rgba(102, 179, 255, 0.08)",
55
+ surface: "rgba(15, 15, 15, 0.95)",
56
+ textSecondary: "rgba(255, 255, 255, 0.7)",
57
+ textTertiary: "rgba(255, 255, 255, 0.5)",
58
+ textMuted: "rgba(255, 255, 255, 0.4)",
59
+ highlightBg: "rgba(255, 235, 59, 0.25)",
60
+ highlightBorder: "rgba(255, 235, 59, 0.5)"
61
+ },
62
+ modes: {
63
+ light: {
64
+ text: "#1a1a1a",
65
+ background: "rgba(255, 255, 255, 0.9)",
66
+ primary: "#0066cc",
67
+ secondary: "#0052a3",
68
+ accent: "#00cc88",
69
+ highlight: "rgba(0, 102, 204, 0.08)",
70
+ muted: "rgba(245, 245, 245, 0.8)",
71
+ success: "#00cc88",
72
+ warning: "#ffaa00",
73
+ error: "#ff3333",
74
+ info: "#0066cc",
75
+ border: "rgba(0, 0, 0, 0.1)",
76
+ backgroundSecondary: "rgba(250, 250, 250, 0.9)",
77
+ backgroundTertiary: "rgba(245, 245, 245, 0.9)",
78
+ backgroundLight: "rgba(0, 0, 0, 0.02)",
79
+ backgroundHover: "rgba(0, 102, 204, 0.04)",
80
+ surface: "rgba(255, 255, 255, 0.95)",
81
+ textSecondary: "rgba(0, 0, 0, 0.6)",
82
+ textTertiary: "rgba(0, 0, 0, 0.4)",
83
+ textMuted: "rgba(0, 0, 0, 0.3)",
84
+ highlightBg: "rgba(255, 235, 59, 0.3)",
85
+ highlightBorder: "rgba(255, 235, 59, 0.6)"
86
+ }
87
+ },
88
+ buttons: {
89
+ primary: {
90
+ color: "white",
91
+ bg: "primary",
92
+ borderWidth: 0,
93
+ "&:hover": {
94
+ bg: "secondary"
95
+ }
96
+ },
97
+ secondary: {
98
+ color: "primary",
99
+ bg: "transparent",
100
+ borderWidth: 1,
101
+ borderStyle: "solid",
102
+ borderColor: "primary",
103
+ "&:hover": {
104
+ bg: "highlight"
105
+ }
106
+ },
107
+ ghost: {
108
+ color: "text",
109
+ bg: "transparent",
110
+ "&:hover": {
111
+ bg: "backgroundHover"
112
+ }
113
+ }
114
+ },
115
+ text: {
116
+ heading: {
117
+ fontFamily: "heading",
118
+ fontWeight: "heading",
119
+ lineHeight: "heading"
120
+ },
121
+ body: {
122
+ fontFamily: "body",
123
+ fontWeight: "body",
124
+ lineHeight: "body"
125
+ },
126
+ caption: {
127
+ fontSize: 1,
128
+ color: "textSecondary"
129
+ }
130
+ },
131
+ cards: {
132
+ primary: {
133
+ bg: "surface",
134
+ border: "1px solid",
135
+ borderColor: "border",
136
+ borderRadius: 1
137
+ },
138
+ secondary: {
139
+ bg: "backgroundSecondary",
140
+ border: "1px solid",
141
+ borderColor: "border",
142
+ borderRadius: 1
143
+ }
144
+ }
145
+ };
146
+ function getMode(theme2, mode) {
147
+ if (!mode || !theme2.modes || !theme2.modes[mode]) {
148
+ return theme2.colors;
149
+ }
150
+ return {
151
+ ...theme2.colors,
152
+ ...theme2.modes[mode]
153
+ };
154
+ }
3
155
  var ThemeContext;
4
156
  var getThemeContext = () => {
5
157
  if (typeof window !== "undefined") {
@@ -23,6 +175,46 @@ var useTheme = () => {
23
175
  }
24
176
  return context;
25
177
  };
178
+ var ThemeProvider = ({
179
+ children,
180
+ theme: customTheme = theme,
181
+ initialMode
182
+ }) => {
183
+ const [mode, setMode] = useState(initialMode);
184
+ const activeTheme = React2.useMemo(() => {
185
+ if (!mode || !customTheme.modes || !customTheme.modes[mode]) {
186
+ return customTheme;
187
+ }
188
+ return {
189
+ ...customTheme,
190
+ colors: getMode(customTheme, mode)
191
+ };
192
+ }, [customTheme, mode]);
193
+ useEffect(() => {
194
+ if (!initialMode) {
195
+ const savedMode = localStorage.getItem("principlemd-theme-mode");
196
+ if (savedMode) {
197
+ setMode(savedMode);
198
+ }
199
+ }
200
+ }, [initialMode]);
201
+ useEffect(() => {
202
+ if (mode) {
203
+ localStorage.setItem("principlemd-theme-mode", mode);
204
+ } else {
205
+ localStorage.removeItem("principlemd-theme-mode");
206
+ }
207
+ }, [mode]);
208
+ const value = {
209
+ theme: activeTheme,
210
+ mode,
211
+ setMode
212
+ };
213
+ return /* @__PURE__ */ React2.createElement(ThemeContextSingleton.Provider, {
214
+ value
215
+ }, children);
216
+ };
217
+ var theme = terminalTheme;
26
218
  /**
27
219
  * @license lucide-react v0.552.0 - ISC
28
220
  *
@@ -128,35 +320,117 @@ const createLucideIcon = (iconName, iconNode) => {
128
320
  * This source code is licensed under the ISC license.
129
321
  * See the LICENSE file in the root directory of this source tree.
130
322
  */
131
- const __iconNode$7 = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
132
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$7);
323
+ const __iconNode$i = [
324
+ [
325
+ "path",
326
+ {
327
+ d: "M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",
328
+ key: "lc1i9w"
329
+ }
330
+ ],
331
+ ["path", { d: "m7 16.5-4.74-2.85", key: "1o9zyk" }],
332
+ ["path", { d: "m7 16.5 5-3", key: "va8pkn" }],
333
+ ["path", { d: "M7 16.5v5.17", key: "jnp8gn" }],
334
+ [
335
+ "path",
336
+ {
337
+ d: "M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",
338
+ key: "8zsnat"
339
+ }
340
+ ],
341
+ ["path", { d: "m17 16.5-5-3", key: "8arw3v" }],
342
+ ["path", { d: "m17 16.5 4.74-2.85", key: "8rfmw" }],
343
+ ["path", { d: "M17 16.5v5.17", key: "k6z78m" }],
344
+ [
345
+ "path",
346
+ {
347
+ d: "M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",
348
+ key: "1xygjf"
349
+ }
350
+ ],
351
+ ["path", { d: "M12 8 7.26 5.15", key: "1vbdud" }],
352
+ ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
353
+ ["path", { d: "M12 13.5V8", key: "1io7kd" }]
354
+ ];
355
+ const Boxes = createLucideIcon("boxes", __iconNode$i);
133
356
  /**
134
357
  * @license lucide-react v0.552.0 - ISC
135
358
  *
136
359
  * This source code is licensed under the ISC license.
137
360
  * See the LICENSE file in the root directory of this source tree.
138
361
  */
139
- const __iconNode$6 = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
140
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$6);
362
+ const __iconNode$h = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
363
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$h);
141
364
  /**
142
365
  * @license lucide-react v0.552.0 - ISC
143
366
  *
144
367
  * This source code is licensed under the ISC license.
145
368
  * See the LICENSE file in the root directory of this source tree.
146
369
  */
147
- const __iconNode$5 = [
370
+ const __iconNode$g = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
371
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$g);
372
+ /**
373
+ * @license lucide-react v0.552.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */
378
+ const __iconNode$f = [
148
379
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
149
380
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
150
381
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
151
382
  ];
152
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$5);
383
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$f);
153
384
  /**
154
385
  * @license lucide-react v0.552.0 - ISC
155
386
  *
156
387
  * This source code is licensed under the ISC license.
157
388
  * See the LICENSE file in the root directory of this source tree.
158
389
  */
159
- const __iconNode$4 = [
390
+ const __iconNode$e = [
391
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
392
+ ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
393
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
394
+ ];
395
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$e);
396
+ /**
397
+ * @license lucide-react v0.552.0 - ISC
398
+ *
399
+ * This source code is licensed under the ISC license.
400
+ * See the LICENSE file in the root directory of this source tree.
401
+ */
402
+ const __iconNode$d = [
403
+ ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
404
+ ["path", { d: "M10 14 21 3", key: "gplh6r" }],
405
+ ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
406
+ ];
407
+ const ExternalLink = createLucideIcon("external-link", __iconNode$d);
408
+ /**
409
+ * @license lucide-react v0.552.0 - ISC
410
+ *
411
+ * This source code is licensed under the ISC license.
412
+ * See the LICENSE file in the root directory of this source tree.
413
+ */
414
+ const __iconNode$c = [
415
+ [
416
+ "path",
417
+ {
418
+ d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
419
+ key: "1oefj6"
420
+ }
421
+ ],
422
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
423
+ ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
424
+ ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
425
+ ];
426
+ const FileCode = createLucideIcon("file-code", __iconNode$c);
427
+ /**
428
+ * @license lucide-react v0.552.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */
433
+ const __iconNode$b = [
160
434
  [
161
435
  "path",
162
436
  {
@@ -167,46 +441,123 @@ const __iconNode$4 = [
167
441
  ["path", { d: "M12 17h.01", key: "p32p05" }],
168
442
  ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
169
443
  ];
170
- const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$4);
444
+ const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$b);
171
445
  /**
172
446
  * @license lucide-react v0.552.0 - ISC
173
447
  *
174
448
  * This source code is licensed under the ISC license.
175
449
  * See the LICENSE file in the root directory of this source tree.
176
450
  */
177
- const __iconNode$3 = [
451
+ const __iconNode$a = [
452
+ [
453
+ "path",
454
+ {
455
+ d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
456
+ key: "1kt360"
457
+ }
458
+ ]
459
+ ];
460
+ const Folder = createLucideIcon("folder", __iconNode$a);
461
+ /**
462
+ * @license lucide-react v0.552.0 - ISC
463
+ *
464
+ * This source code is licensed under the ISC license.
465
+ * See the LICENSE file in the root directory of this source tree.
466
+ */
467
+ const __iconNode$9 = [
178
468
  ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
179
469
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
180
470
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
181
471
  ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
182
472
  ];
183
- const GitBranch = createLucideIcon("git-branch", __iconNode$3);
473
+ const GitBranch = createLucideIcon("git-branch", __iconNode$9);
184
474
  /**
185
475
  * @license lucide-react v0.552.0 - ISC
186
476
  *
187
477
  * This source code is licensed under the ISC license.
188
478
  * See the LICENSE file in the root directory of this source tree.
189
479
  */
190
- const __iconNode$2 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
191
- const Minus = createLucideIcon("minus", __iconNode$2);
480
+ const __iconNode$8 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
481
+ const Minus = createLucideIcon("minus", __iconNode$8);
192
482
  /**
193
483
  * @license lucide-react v0.552.0 - ISC
194
484
  *
195
485
  * This source code is licensed under the ISC license.
196
486
  * See the LICENSE file in the root directory of this source tree.
197
487
  */
198
- const __iconNode$1 = [
488
+ const __iconNode$7 = [
489
+ [
490
+ "path",
491
+ {
492
+ d: "M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",
493
+ key: "1a0edw"
494
+ }
495
+ ],
496
+ ["path", { d: "M12 22V12", key: "d0xqtd" }],
497
+ ["polyline", { points: "3.29 7 12 12 20.71 7", key: "ousv84" }],
498
+ ["path", { d: "m7.5 4.27 9 5.15", key: "1c824w" }]
499
+ ];
500
+ const Package = createLucideIcon("package", __iconNode$7);
501
+ /**
502
+ * @license lucide-react v0.552.0 - ISC
503
+ *
504
+ * This source code is licensed under the ISC license.
505
+ * See the LICENSE file in the root directory of this source tree.
506
+ */
507
+ const __iconNode$6 = [
199
508
  ["path", { d: "M5 12h14", key: "1ays0h" }],
200
509
  ["path", { d: "M12 5v14", key: "s699le" }]
201
510
  ];
202
- const Plus = createLucideIcon("plus", __iconNode$1);
511
+ const Plus = createLucideIcon("plus", __iconNode$6);
203
512
  /**
204
513
  * @license lucide-react v0.552.0 - ISC
205
514
  *
206
515
  * This source code is licensed under the ISC license.
207
516
  * See the LICENSE file in the root directory of this source tree.
208
517
  */
209
- const __iconNode = [
518
+ const __iconNode$5 = [
519
+ ["path", { d: "m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "7g6ntu" }],
520
+ ["path", { d: "m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z", key: "ijws7r" }],
521
+ ["path", { d: "M7 21h10", key: "1b0cd5" }],
522
+ ["path", { d: "M12 3v18", key: "108xh3" }],
523
+ ["path", { d: "M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2", key: "3gwbw2" }]
524
+ ];
525
+ const Scale = createLucideIcon("scale", __iconNode$5);
526
+ /**
527
+ * @license lucide-react v0.552.0 - ISC
528
+ *
529
+ * This source code is licensed under the ISC license.
530
+ * See the LICENSE file in the root directory of this source tree.
531
+ */
532
+ const __iconNode$4 = [
533
+ ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
534
+ ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
535
+ ];
536
+ const Search = createLucideIcon("search", __iconNode$4);
537
+ /**
538
+ * @license lucide-react v0.552.0 - ISC
539
+ *
540
+ * This source code is licensed under the ISC license.
541
+ * See the LICENSE file in the root directory of this source tree.
542
+ */
543
+ const __iconNode$3 = [
544
+ [
545
+ "path",
546
+ {
547
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
548
+ key: "1i5ecw"
549
+ }
550
+ ],
551
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
552
+ ];
553
+ const Settings = createLucideIcon("settings", __iconNode$3);
554
+ /**
555
+ * @license lucide-react v0.552.0 - ISC
556
+ *
557
+ * This source code is licensed under the ISC license.
558
+ * See the LICENSE file in the root directory of this source tree.
559
+ */
560
+ const __iconNode$2 = [
210
561
  ["path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7", key: "1m0v6g" }],
211
562
  [
212
563
  "path",
@@ -216,7 +567,29 @@ const __iconNode = [
216
567
  }
217
568
  ]
218
569
  ];
219
- const SquarePen = createLucideIcon("square-pen", __iconNode);
570
+ const SquarePen = createLucideIcon("square-pen", __iconNode$2);
571
+ /**
572
+ * @license lucide-react v0.552.0 - ISC
573
+ *
574
+ * This source code is licensed under the ISC license.
575
+ * See the LICENSE file in the root directory of this source tree.
576
+ */
577
+ const __iconNode$1 = [
578
+ ["path", { d: "M12 19h8", key: "baeox8" }],
579
+ ["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
580
+ ];
581
+ const Terminal = createLucideIcon("terminal", __iconNode$1);
582
+ /**
583
+ * @license lucide-react v0.552.0 - ISC
584
+ *
585
+ * This source code is licensed under the ISC license.
586
+ * See the LICENSE file in the root directory of this source tree.
587
+ */
588
+ const __iconNode = [
589
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
590
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
591
+ ];
592
+ const X = createLucideIcon("x", __iconNode);
220
593
  function getDefaultExportFromCjs(x) {
221
594
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
222
595
  }
@@ -7404,7 +7777,7 @@ function TreeNode({
7404
7777
  node,
7405
7778
  style,
7406
7779
  dragHandle,
7407
- theme,
7780
+ theme: theme2,
7408
7781
  rightContent,
7409
7782
  extraContent,
7410
7783
  isSelectedDirectory = false,
@@ -7418,14 +7791,14 @@ function TreeNode({
7418
7791
  style: { marginRight: "4px", display: "flex", alignItems: "center" }
7419
7792
  }, node.isOpen ? /* @__PURE__ */ React2.createElement(ChevronDown, {
7420
7793
  size: 16,
7421
- color: theme.colors.text
7794
+ color: theme2.colors.text
7422
7795
  }) : /* @__PURE__ */ React2.createElement(ChevronRight, {
7423
7796
  size: 16,
7424
- color: theme.colors.text
7797
+ color: theme2.colors.text
7425
7798
  })) : null;
7426
- const backgroundColor = node.isSelected ? `${theme.colors.primary}20` : isSelectedDirectory ? `${theme.colors.primary}15` : isHovered ? `${theme.colors.text}10` : "transparent";
7427
- const border = node.isSelected ? `1px solid ${theme.colors.primary}` : "1px solid transparent";
7428
- const color = nameColor ? nameColor : node.isSelected || isSelectedDirectory ? theme.colors.primary : theme.colors.text;
7799
+ const backgroundColor = node.isSelected ? `${theme2.colors.primary}20` : isSelectedDirectory ? `${theme2.colors.primary}15` : isHovered ? `${theme2.colors.text}10` : "transparent";
7800
+ const border = node.isSelected ? `1px solid ${theme2.colors.primary}` : "1px solid transparent";
7801
+ const color = nameColor ? nameColor : node.isSelected || isSelectedDirectory ? theme2.colors.primary : theme2.colors.text;
7429
7802
  return /* @__PURE__ */ React2.createElement("div", {
7430
7803
  style: {
7431
7804
  ...style,
@@ -7467,7 +7840,7 @@ function TreeNode({
7467
7840
  style: { flexShrink: 0 }
7468
7841
  }, rightContent));
7469
7842
  }
7470
- var getGitStatusDisplay2 = (status, theme) => {
7843
+ var getGitStatusDisplay2 = (status, theme2) => {
7471
7844
  switch (status) {
7472
7845
  case "M":
7473
7846
  case "MM":
@@ -7475,7 +7848,7 @@ var getGitStatusDisplay2 = (status, theme) => {
7475
7848
  icon: /* @__PURE__ */ React2.createElement(SquarePen, {
7476
7849
  size: 14
7477
7850
  }),
7478
- color: theme.colors.primary || "#007bff",
7851
+ color: theme2.colors.primary || "#007bff",
7479
7852
  label: "Modified"
7480
7853
  };
7481
7854
  case "A":
@@ -7600,7 +7973,7 @@ var countVisibleNodes2 = (nodes, openByDefault) => {
7600
7973
  };
7601
7974
  var GitStatusFileTree = ({
7602
7975
  fileTree,
7603
- theme,
7976
+ theme: theme2,
7604
7977
  gitStatusData,
7605
7978
  selectedDirectories = [],
7606
7979
  selectedFile,
@@ -7623,12 +7996,12 @@ var GitStatusFileTree = ({
7623
7996
  }, [gitStatusData]);
7624
7997
  const NodeRenderer = (props) => {
7625
7998
  const { node } = props;
7626
- const gitDisplay = node.data.gitStatus ? getGitStatusDisplay2(node.data.gitStatus, theme) : null;
7999
+ const gitDisplay = node.data.gitStatus ? getGitStatusDisplay2(node.data.gitStatus, theme2) : null;
7627
8000
  let nameColor;
7628
8001
  if (gitDisplay) {
7629
8002
  nameColor = gitDisplay.color;
7630
8003
  } else if (node.data.hasChangedChildren) {
7631
- const baseColor = theme.colors.primary || "#007bff";
8004
+ const baseColor = theme2.colors.primary || "#007bff";
7632
8005
  nameColor = baseColor + "80";
7633
8006
  }
7634
8007
  const rightContent = gitDisplay ? /* @__PURE__ */ React2.createElement("div", {
@@ -7648,7 +8021,7 @@ var GitStatusFileTree = ({
7648
8021
  }, node.data.gitStatus)) : null;
7649
8022
  return /* @__PURE__ */ React2.createElement(TreeNode, {
7650
8023
  ...props,
7651
- theme,
8024
+ theme: theme2,
7652
8025
  rightContent,
7653
8026
  nameColor,
7654
8027
  horizontalNodePadding,
@@ -7689,9 +8062,9 @@ var GitStatusFileTree = ({
7689
8062
  return /* @__PURE__ */ React2.createElement("div", {
7690
8063
  ref: containerRef,
7691
8064
  style: {
7692
- backgroundColor: transparentBackground ? "transparent" : theme.colors.background,
7693
- color: theme.colors.text,
7694
- fontFamily: theme.fonts.body,
8065
+ backgroundColor: transparentBackground ? "transparent" : theme2.colors.background,
8066
+ color: theme2.colors.text,
8067
+ fontFamily: theme2.fonts.body,
7695
8068
  ...autoHeight ? {} : { height: "100%" }
7696
8069
  }
7697
8070
  }, /* @__PURE__ */ React2.createElement(Tree, {
@@ -7706,11 +8079,11 @@ var GitStatusFileTree = ({
7706
8079
  };
7707
8080
  class _ {
7708
8081
  static buildTreeFromPaths(j, k = "") {
7709
- let q = k.endsWith("/") ? k.slice(0, -1) : k, E = /* @__PURE__ */ new Map(), J = [], O = [], X = /* @__PURE__ */ new Set();
8082
+ let q = k.endsWith("/") ? k.slice(0, -1) : k, E = /* @__PURE__ */ new Map(), J = [], O = [], X2 = /* @__PURE__ */ new Set();
7710
8083
  j.forEach((K) => {
7711
8084
  let Q = K.split("/");
7712
- for (let W = 1; W < Q.length; W++) X.add(Q.slice(0, W).join("/"));
7713
- }), Array.from(X).forEach((K) => {
8085
+ for (let W = 1; W < Q.length; W++) X2.add(Q.slice(0, W).join("/"));
8086
+ }), Array.from(X2).forEach((K) => {
7714
8087
  let Q = K.split("/"), W = Q[Q.length - 1] || "", Y = Q.length - 1, M = { path: K, name: W, children: [], fileCount: 0, totalSize: 0, depth: Y, relativePath: this.calculateRelativePath(K, q) };
7715
8088
  E.set(K, M), O.push(M);
7716
8089
  }), j.forEach((K) => {
@@ -7718,7 +8091,7 @@ class _ {
7718
8091
  J.push(A);
7719
8092
  let H = E.get(M);
7720
8093
  if (H && "children" in H) H.children.push(A), H.fileCount++;
7721
- }), Array.from(X).sort((K, Q) => Q.length - K.length).forEach((K) => {
8094
+ }), Array.from(X2).sort((K, Q) => Q.length - K.length).forEach((K) => {
7722
8095
  let Q = K.split("/");
7723
8096
  if (Q.length > 1) {
7724
8097
  let W = Q.slice(0, -1).join("/"), Y = E.get(W), M = E.get(K);
@@ -7750,12 +8123,12 @@ class _ {
7750
8123
  if (W && Y) W.children.push(Y), W.fileCount += Y.fileCount, W.totalSize += Y.totalSize;
7751
8124
  }
7752
8125
  });
7753
- let X = q ? q.split("/").pop() || "root" : "root", $ = [];
8126
+ let X2 = q ? q.split("/").pop() || "root" : "root", $ = [];
7754
8127
  return J.forEach((V) => {
7755
8128
  if (V.path.split("/").length === 1) $.push(V);
7756
8129
  }), j.forEach((V) => {
7757
8130
  if (V.path.split("/").length === 1) $.push(V);
7758
- }), { root: { path: q || ".", name: X, children: $, fileCount: j.length, totalSize: j.reduce((V, K) => V + (K.size || 0), 0), depth: 0, relativePath: "" }, allFiles: j, allDirectories: J };
8131
+ }), { root: { path: q || ".", name: X2, children: $, fileCount: j.length, totalSize: j.reduce((V, K) => V + (K.size || 0), 0), depth: 0, relativePath: "" }, allFiles: j, allDirectories: J };
7759
8132
  }
7760
8133
  static calculateStats(j, k) {
7761
8134
  return { totalFiles: j.length, totalDirectories: k.length, totalSize: j.reduce((q, E) => q + (E.size || 0), 0), maxDepth: this.calculateMaxDepth(k) };
@@ -7811,8 +8184,8 @@ class G {
7811
8184
  }
7812
8185
  class N extends G {
7813
8186
  build(j) {
7814
- let { files: k, rootPath: q = "" } = j, { root: E, allFiles: J, allDirectories: O } = _.buildTreeFromPaths(k, q), X = _.calculateStats(J, O);
7815
- return { sha: this.calculateSha(j), metadata: this.generateMetadata(j), root: E, allFiles: J, allDirectories: O, stats: X };
8187
+ let { files: k, rootPath: q = "" } = j, { root: E, allFiles: J, allDirectories: O } = _.buildTreeFromPaths(k, q), X2 = _.calculateStats(J, O);
8188
+ return { sha: this.calculateSha(j), metadata: this.generateMetadata(j), root: E, allFiles: J, allDirectories: O, stats: X2 };
7816
8189
  }
7817
8190
  generateMetadata(j) {
7818
8191
  let { files: k, rootPath: q = "" } = j, E = this.calculateSha(j);
@@ -7832,7 +8205,7 @@ const GitChangesPanelContent = ({
7832
8205
  loadingMessage = "Loading git changes...",
7833
8206
  selectedFile
7834
8207
  }) => {
7835
- const { theme } = useTheme();
8208
+ const { theme: theme2 } = useTheme();
7836
8209
  const hasChanges = gitStatus.staged.length > 0 || gitStatus.unstaged.length > 0 || gitStatus.untracked.length > 0 || gitStatus.deleted.length > 0;
7837
8210
  const [showFullTree, setShowFullTree] = useState(false);
7838
8211
  const userHasToggledView = useRef(false);
@@ -7938,7 +8311,7 @@ const GitChangesPanelContent = ({
7938
8311
  style: {
7939
8312
  display: "flex",
7940
8313
  alignItems: "stretch",
7941
- backgroundColor: theme.colors.backgroundTertiary,
8314
+ backgroundColor: theme2.colors.backgroundTertiary,
7942
8315
  width: "100%"
7943
8316
  },
7944
8317
  children: [
@@ -7952,10 +8325,10 @@ const GitChangesPanelContent = ({
7952
8325
  style: {
7953
8326
  flex: 1,
7954
8327
  padding: "6px 12px",
7955
- fontSize: theme.fontSizes[1],
7956
- backgroundColor: showFullTree ? theme.colors.backgroundSecondary : "transparent",
7957
- color: showFullTree ? theme.colors.text : theme.colors.textSecondary,
7958
- border: showFullTree ? `1px solid ${theme.colors.border}` : "1px solid transparent",
8328
+ fontSize: theme2.fontSizes[1],
8329
+ backgroundColor: showFullTree ? theme2.colors.backgroundSecondary : "transparent",
8330
+ color: showFullTree ? theme2.colors.text : theme2.colors.textSecondary,
8331
+ border: showFullTree ? `1px solid ${theme2.colors.border}` : "1px solid transparent",
7959
8332
  cursor: "pointer",
7960
8333
  fontWeight: showFullTree ? 600 : 400,
7961
8334
  transition: "all 0.2s"
@@ -7973,10 +8346,10 @@ const GitChangesPanelContent = ({
7973
8346
  style: {
7974
8347
  flex: 1,
7975
8348
  padding: "6px 12px",
7976
- fontSize: theme.fontSizes[1],
7977
- backgroundColor: !showFullTree ? theme.colors.backgroundSecondary : "transparent",
7978
- color: !showFullTree ? theme.colors.text : theme.colors.textSecondary,
7979
- border: !showFullTree ? `1px solid ${theme.colors.border}` : "1px solid transparent",
8349
+ fontSize: theme2.fontSizes[1],
8350
+ backgroundColor: !showFullTree ? theme2.colors.backgroundSecondary : "transparent",
8351
+ color: !showFullTree ? theme2.colors.text : theme2.colors.textSecondary,
8352
+ border: !showFullTree ? `1px solid ${theme2.colors.border}` : "1px solid transparent",
7980
8353
  cursor: "pointer",
7981
8354
  fontWeight: !showFullTree ? 600 : 400,
7982
8355
  transition: "all 0.2s"
@@ -7995,7 +8368,7 @@ const GitChangesPanelContent = ({
7995
8368
  style: {
7996
8369
  padding: "20px",
7997
8370
  textAlign: "center",
7998
- color: theme.colors.textSecondary
8371
+ color: theme2.colors.textSecondary
7999
8372
  },
8000
8373
  children: loadingMessage
8001
8374
  }
@@ -8008,7 +8381,7 @@ const GitChangesPanelContent = ({
8008
8381
  style: {
8009
8382
  padding: "20px",
8010
8383
  textAlign: "center",
8011
- color: theme.colors.textSecondary
8384
+ color: theme2.colors.textSecondary
8012
8385
  },
8013
8386
  children: emptyMessage
8014
8387
  }
@@ -8021,7 +8394,7 @@ const GitChangesPanelContent = ({
8021
8394
  GitStatusFileTree,
8022
8395
  {
8023
8396
  fileTree: gitChangesData.tree,
8024
- theme,
8397
+ theme: theme2,
8025
8398
  gitStatusData: gitChangesData.statusData,
8026
8399
  onFileSelect: handleFileSelect,
8027
8400
  selectedFile,
@@ -8033,19 +8406,19 @@ const GitChangesPanelContent = ({
8033
8406
  );
8034
8407
  };
8035
8408
  return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
8036
- /* @__PURE__ */ jsx("div", { style: { borderBottom: `1px solid ${theme.colors.border}` }, children: /* @__PURE__ */ jsx(ToggleButtons, {}) }),
8409
+ /* @__PURE__ */ jsx("div", { style: { borderBottom: `1px solid ${theme2.colors.border}` }, children: /* @__PURE__ */ jsx(ToggleButtons, {}) }),
8037
8410
  /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto" }, children: /* @__PURE__ */ jsx(Content, {}) })
8038
8411
  ] });
8039
8412
  };
8040
8413
  const GitChangesPanelPreview = () => {
8041
- const { theme } = useTheme();
8414
+ const { theme: theme2 } = useTheme();
8042
8415
  return /* @__PURE__ */ jsxs(
8043
8416
  "div",
8044
8417
  {
8045
8418
  style: {
8046
8419
  padding: "12px",
8047
8420
  fontSize: "12px",
8048
- color: theme.colors.text,
8421
+ color: theme2.colors.text,
8049
8422
  display: "flex",
8050
8423
  flexDirection: "column",
8051
8424
  gap: "6px"
@@ -8123,6 +8496,1281 @@ const GitChangesPanel = ({ context }) => {
8123
8496
  }
8124
8497
  );
8125
8498
  };
8499
+ const PackageCard = ({
8500
+ pkg,
8501
+ isExpanded,
8502
+ onToggle,
8503
+ onCommandClick,
8504
+ onConfigClick,
8505
+ onPackageClick
8506
+ }) => {
8507
+ const { theme: theme2 } = useTheme();
8508
+ const [activeTab, setActiveTab] = useState("commands");
8509
+ const configFiles = useMemo(() => {
8510
+ if (!pkg.configFiles) return [];
8511
+ return Object.entries(pkg.configFiles).filter(([, config]) => config == null ? void 0 : config.exists).map(([name, config]) => ({ name, ...config }));
8512
+ }, [pkg.configFiles]);
8513
+ const commands = pkg.packageData.availableCommands || [];
8514
+ return /* @__PURE__ */ jsxs(
8515
+ "div",
8516
+ {
8517
+ style: {
8518
+ backgroundColor: theme2.colors.backgroundSecondary,
8519
+ borderRadius: "8px",
8520
+ border: `1px solid ${theme2.colors.border}`,
8521
+ overflow: "hidden"
8522
+ },
8523
+ children: [
8524
+ /* @__PURE__ */ jsxs(
8525
+ "button",
8526
+ {
8527
+ onClick: onToggle,
8528
+ style: {
8529
+ width: "100%",
8530
+ display: "flex",
8531
+ alignItems: "center",
8532
+ gap: "8px",
8533
+ padding: "12px 16px",
8534
+ backgroundColor: "transparent",
8535
+ border: "none",
8536
+ cursor: "pointer",
8537
+ color: theme2.colors.text,
8538
+ textAlign: "left"
8539
+ },
8540
+ children: [
8541
+ isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: theme2.colors.textSecondary }) : /* @__PURE__ */ jsx(ChevronRight, { size: 16, color: theme2.colors.textSecondary }),
8542
+ /* @__PURE__ */ jsx(Package, { size: 18, color: theme2.colors.accent }),
8543
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
8544
+ /* @__PURE__ */ jsx(
8545
+ "div",
8546
+ {
8547
+ style: {
8548
+ fontSize: theme2.fontSizes[2],
8549
+ fontWeight: 600,
8550
+ overflow: "hidden",
8551
+ textOverflow: "ellipsis",
8552
+ whiteSpace: "nowrap"
8553
+ },
8554
+ children: pkg.packageData.name
8555
+ }
8556
+ ),
8557
+ pkg.packageData.version && /* @__PURE__ */ jsxs(
8558
+ "div",
8559
+ {
8560
+ style: {
8561
+ fontSize: theme2.fontSizes[0],
8562
+ color: theme2.colors.textSecondary
8563
+ },
8564
+ children: [
8565
+ "v",
8566
+ pkg.packageData.version
8567
+ ]
8568
+ }
8569
+ )
8570
+ ] }),
8571
+ pkg.packageData.path && /* @__PURE__ */ jsxs(
8572
+ "button",
8573
+ {
8574
+ onClick: (e) => {
8575
+ e.stopPropagation();
8576
+ onPackageClick == null ? void 0 : onPackageClick(pkg.packageData.path);
8577
+ },
8578
+ style: {
8579
+ display: "flex",
8580
+ alignItems: "center",
8581
+ gap: "4px",
8582
+ padding: "4px 8px",
8583
+ backgroundColor: theme2.colors.backgroundTertiary,
8584
+ border: `1px solid ${theme2.colors.border}`,
8585
+ borderRadius: "4px",
8586
+ color: theme2.colors.textSecondary,
8587
+ fontSize: theme2.fontSizes[0],
8588
+ cursor: "pointer"
8589
+ },
8590
+ title: "Open package folder",
8591
+ children: [
8592
+ /* @__PURE__ */ jsx(Folder, { size: 12 }),
8593
+ pkg.packageData.path || "/"
8594
+ ]
8595
+ }
8596
+ )
8597
+ ]
8598
+ }
8599
+ ),
8600
+ isExpanded && /* @__PURE__ */ jsxs("div", { style: { borderTop: `1px solid ${theme2.colors.border}` }, children: [
8601
+ /* @__PURE__ */ jsx(
8602
+ "div",
8603
+ {
8604
+ style: {
8605
+ display: "flex",
8606
+ backgroundColor: theme2.colors.backgroundTertiary,
8607
+ borderBottom: `1px solid ${theme2.colors.border}`
8608
+ },
8609
+ children: [
8610
+ { id: "commands", label: "Commands", count: commands.length },
8611
+ { id: "configs", label: "Configs", count: configFiles.length }
8612
+ ].map((tab) => /* @__PURE__ */ jsxs(
8613
+ "button",
8614
+ {
8615
+ onClick: () => setActiveTab(tab.id),
8616
+ style: {
8617
+ flex: 1,
8618
+ padding: "8px 12px",
8619
+ backgroundColor: activeTab === tab.id ? theme2.colors.backgroundSecondary : "transparent",
8620
+ border: "none",
8621
+ borderBottom: activeTab === tab.id ? `2px solid ${theme2.colors.accent}` : "2px solid transparent",
8622
+ color: activeTab === tab.id ? theme2.colors.text : theme2.colors.textSecondary,
8623
+ fontSize: theme2.fontSizes[1],
8624
+ cursor: "pointer",
8625
+ display: "flex",
8626
+ alignItems: "center",
8627
+ justifyContent: "center",
8628
+ gap: "6px"
8629
+ },
8630
+ children: [
8631
+ tab.label,
8632
+ /* @__PURE__ */ jsx(
8633
+ "span",
8634
+ {
8635
+ style: {
8636
+ backgroundColor: theme2.colors.backgroundTertiary,
8637
+ padding: "1px 6px",
8638
+ borderRadius: "10px",
8639
+ fontSize: theme2.fontSizes[0]
8640
+ },
8641
+ children: tab.count
8642
+ }
8643
+ )
8644
+ ]
8645
+ },
8646
+ tab.id
8647
+ ))
8648
+ }
8649
+ ),
8650
+ /* @__PURE__ */ jsxs("div", { style: { padding: "12px", maxHeight: "300px", overflow: "auto" }, children: [
8651
+ activeTab === "commands" && /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: commands.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: theme2.colors.textSecondary, fontSize: theme2.fontSizes[1] }, children: "No commands available" }) : commands.map((cmd, idx) => /* @__PURE__ */ jsxs(
8652
+ "button",
8653
+ {
8654
+ onClick: () => onCommandClick == null ? void 0 : onCommandClick(cmd, pkg.packageData.path),
8655
+ style: {
8656
+ display: "flex",
8657
+ alignItems: "center",
8658
+ gap: "8px",
8659
+ padding: "8px 12px",
8660
+ backgroundColor: theme2.colors.backgroundTertiary,
8661
+ border: `1px solid ${theme2.colors.border}`,
8662
+ borderRadius: "6px",
8663
+ color: theme2.colors.text,
8664
+ cursor: "pointer",
8665
+ textAlign: "left"
8666
+ },
8667
+ children: [
8668
+ /* @__PURE__ */ jsx(Terminal, { size: 14, color: theme2.colors.accent }),
8669
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
8670
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: cmd.name }),
8671
+ /* @__PURE__ */ jsx(
8672
+ "div",
8673
+ {
8674
+ style: {
8675
+ fontSize: theme2.fontSizes[0],
8676
+ color: theme2.colors.textSecondary,
8677
+ fontFamily: "monospace",
8678
+ overflow: "hidden",
8679
+ textOverflow: "ellipsis",
8680
+ whiteSpace: "nowrap"
8681
+ },
8682
+ children: cmd.command
8683
+ }
8684
+ )
8685
+ ] }),
8686
+ cmd.isLensCommand && /* @__PURE__ */ jsx(
8687
+ "span",
8688
+ {
8689
+ style: {
8690
+ padding: "2px 6px",
8691
+ backgroundColor: theme2.colors.accent + "20",
8692
+ color: theme2.colors.accent,
8693
+ borderRadius: "4px",
8694
+ fontSize: theme2.fontSizes[0]
8695
+ },
8696
+ children: cmd.lensId
8697
+ }
8698
+ ),
8699
+ /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
8700
+ ]
8701
+ },
8702
+ idx
8703
+ )) }),
8704
+ activeTab === "configs" && /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: configFiles.length === 0 ? /* @__PURE__ */ jsx("div", { style: { color: theme2.colors.textSecondary, fontSize: theme2.fontSizes[1] }, children: "No config files detected" }) : configFiles.map((config, idx) => /* @__PURE__ */ jsxs(
8705
+ "button",
8706
+ {
8707
+ onClick: () => onConfigClick == null ? void 0 : onConfigClick(config),
8708
+ style: {
8709
+ display: "flex",
8710
+ alignItems: "center",
8711
+ gap: "8px",
8712
+ padding: "8px 12px",
8713
+ backgroundColor: theme2.colors.backgroundTertiary,
8714
+ border: `1px solid ${theme2.colors.border}`,
8715
+ borderRadius: "6px",
8716
+ color: theme2.colors.text,
8717
+ cursor: "pointer",
8718
+ textAlign: "left"
8719
+ },
8720
+ children: [
8721
+ /* @__PURE__ */ jsx(Settings, { size: 14, color: theme2.colors.textSecondary }),
8722
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
8723
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: config.name }),
8724
+ /* @__PURE__ */ jsx(
8725
+ "div",
8726
+ {
8727
+ style: {
8728
+ fontSize: theme2.fontSizes[0],
8729
+ color: theme2.colors.textSecondary,
8730
+ fontFamily: "monospace"
8731
+ },
8732
+ children: config.path
8733
+ }
8734
+ )
8735
+ ] }),
8736
+ config.isInline && /* @__PURE__ */ jsx(
8737
+ "span",
8738
+ {
8739
+ style: {
8740
+ padding: "2px 6px",
8741
+ backgroundColor: theme2.colors.textSecondary + "20",
8742
+ color: theme2.colors.textSecondary,
8743
+ borderRadius: "4px",
8744
+ fontSize: theme2.fontSizes[0]
8745
+ },
8746
+ children: "inline"
8747
+ }
8748
+ )
8749
+ ]
8750
+ },
8751
+ idx
8752
+ )) })
8753
+ ] })
8754
+ ] })
8755
+ ]
8756
+ }
8757
+ );
8758
+ };
8759
+ const PackageCompositionPanelContent = ({
8760
+ packages,
8761
+ isLoading = false,
8762
+ emptyMessage = "No packages detected",
8763
+ onCommandClick,
8764
+ onConfigClick,
8765
+ onPackageClick
8766
+ }) => {
8767
+ const { theme: theme2 } = useTheme();
8768
+ const [expandedPackages, setExpandedPackages] = useState(/* @__PURE__ */ new Set());
8769
+ const togglePackage = (packageId) => {
8770
+ setExpandedPackages((prev) => {
8771
+ const next = new Set(prev);
8772
+ if (next.has(packageId)) {
8773
+ next.delete(packageId);
8774
+ } else {
8775
+ next.add(packageId);
8776
+ }
8777
+ return next;
8778
+ });
8779
+ };
8780
+ React2.useEffect(() => {
8781
+ if (packages.length > 0 && expandedPackages.size === 0) {
8782
+ setExpandedPackages(/* @__PURE__ */ new Set([packages[0].id]));
8783
+ }
8784
+ }, [packages, expandedPackages.size]);
8785
+ if (isLoading) {
8786
+ return /* @__PURE__ */ jsx(
8787
+ "div",
8788
+ {
8789
+ style: {
8790
+ padding: "20px",
8791
+ textAlign: "center",
8792
+ color: theme2.colors.textSecondary
8793
+ },
8794
+ children: "Loading packages..."
8795
+ }
8796
+ );
8797
+ }
8798
+ if (packages.length === 0) {
8799
+ return /* @__PURE__ */ jsx(
8800
+ "div",
8801
+ {
8802
+ style: {
8803
+ padding: "20px",
8804
+ textAlign: "center",
8805
+ color: theme2.colors.textSecondary
8806
+ },
8807
+ children: emptyMessage
8808
+ }
8809
+ );
8810
+ }
8811
+ const sortedPackages = [...packages].sort((a, b) => {
8812
+ if (a.packageData.isMonorepoRoot && !b.packageData.isMonorepoRoot) return -1;
8813
+ if (!a.packageData.isMonorepoRoot && b.packageData.isMonorepoRoot) return 1;
8814
+ return a.packageData.path.localeCompare(b.packageData.path);
8815
+ });
8816
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
8817
+ /* @__PURE__ */ jsxs(
8818
+ "div",
8819
+ {
8820
+ style: {
8821
+ padding: "12px 16px",
8822
+ borderBottom: `1px solid ${theme2.colors.border}`,
8823
+ display: "flex",
8824
+ alignItems: "center",
8825
+ gap: "8px"
8826
+ },
8827
+ children: [
8828
+ /* @__PURE__ */ jsx(FileCode, { size: 16, color: theme2.colors.accent }),
8829
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: theme2.fontSizes[1], color: theme2.colors.textSecondary }, children: [
8830
+ packages.length,
8831
+ " package",
8832
+ packages.length !== 1 ? "s" : "",
8833
+ " detected"
8834
+ ] })
8835
+ ]
8836
+ }
8837
+ ),
8838
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: sortedPackages.map((pkg) => /* @__PURE__ */ jsx(
8839
+ PackageCard,
8840
+ {
8841
+ pkg,
8842
+ isExpanded: expandedPackages.has(pkg.id),
8843
+ onToggle: () => togglePackage(pkg.id),
8844
+ onCommandClick,
8845
+ onConfigClick,
8846
+ onPackageClick
8847
+ },
8848
+ pkg.id
8849
+ )) })
8850
+ ] });
8851
+ };
8852
+ const PackageCompositionPanelPreview = () => {
8853
+ const { theme: theme2 } = useTheme();
8854
+ return /* @__PURE__ */ jsxs(
8855
+ "div",
8856
+ {
8857
+ style: {
8858
+ padding: "12px",
8859
+ fontSize: "12px",
8860
+ color: theme2.colors.text,
8861
+ display: "flex",
8862
+ flexDirection: "column",
8863
+ gap: "6px"
8864
+ },
8865
+ children: [
8866
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
8867
+ /* @__PURE__ */ jsx(Package, { size: 14, color: theme2.colors.accent }),
8868
+ /* @__PURE__ */ jsx("span", { children: "my-app" })
8869
+ ] }),
8870
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
8871
+ /* @__PURE__ */ jsx(Terminal, { size: 12, color: theme2.colors.textSecondary }),
8872
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "5 commands" })
8873
+ ] }),
8874
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
8875
+ /* @__PURE__ */ jsx(Settings, { size: 12, color: theme2.colors.textSecondary }),
8876
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "3 configs" })
8877
+ ] })
8878
+ ]
8879
+ }
8880
+ );
8881
+ };
8882
+ const PackageCompositionPanel = ({ context }) => {
8883
+ const packagesSlice = context.getSlice("packages");
8884
+ const packages = (packagesSlice == null ? void 0 : packagesSlice.data) ?? [];
8885
+ const isLoading = (packagesSlice == null ? void 0 : packagesSlice.loading) || false;
8886
+ return /* @__PURE__ */ jsx(
8887
+ PackageCompositionPanelContent,
8888
+ {
8889
+ packages,
8890
+ isLoading
8891
+ }
8892
+ );
8893
+ };
8894
+ const DependencyInfoModal = ({
8895
+ isOpen,
8896
+ onClose
8897
+ }) => {
8898
+ const { theme: theme2 } = useTheme();
8899
+ if (!isOpen) return null;
8900
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
8901
+ "div",
8902
+ {
8903
+ style: {
8904
+ position: "fixed",
8905
+ top: 0,
8906
+ left: 0,
8907
+ right: 0,
8908
+ bottom: 0,
8909
+ backgroundColor: theme2.colors.muted,
8910
+ zIndex: theme2.zIndices[4],
8911
+ display: "flex",
8912
+ alignItems: "center",
8913
+ justifyContent: "center"
8914
+ },
8915
+ onClick: onClose,
8916
+ children: /* @__PURE__ */ jsxs(
8917
+ "div",
8918
+ {
8919
+ style: {
8920
+ backgroundColor: theme2.colors.background,
8921
+ borderRadius: `${theme2.radii[3]}px`,
8922
+ maxWidth: "600px",
8923
+ maxHeight: "80vh",
8924
+ width: "90%",
8925
+ overflow: "hidden",
8926
+ display: "flex",
8927
+ flexDirection: "column",
8928
+ boxShadow: theme2.shadows[3]
8929
+ },
8930
+ onClick: (e) => e.stopPropagation(),
8931
+ children: [
8932
+ /* @__PURE__ */ jsxs(
8933
+ "div",
8934
+ {
8935
+ style: {
8936
+ padding: `${theme2.space[4]}px`,
8937
+ borderBottom: `1px solid ${theme2.colors.border}`,
8938
+ display: "flex",
8939
+ alignItems: "center",
8940
+ justifyContent: "space-between"
8941
+ },
8942
+ children: [
8943
+ /* @__PURE__ */ jsxs(
8944
+ "h2",
8945
+ {
8946
+ style: {
8947
+ fontSize: `${theme2.fontSizes[4]}px`,
8948
+ fontWeight: theme2.fontWeights.semibold,
8949
+ color: theme2.colors.text,
8950
+ display: "flex",
8951
+ alignItems: "center",
8952
+ gap: `${theme2.space[2]}px`,
8953
+ margin: 0
8954
+ },
8955
+ children: [
8956
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 20 }),
8957
+ "Understanding Dependencies"
8958
+ ]
8959
+ }
8960
+ ),
8961
+ /* @__PURE__ */ jsx(
8962
+ "button",
8963
+ {
8964
+ onClick: onClose,
8965
+ style: {
8966
+ background: "none",
8967
+ border: "none",
8968
+ color: theme2.colors.textSecondary,
8969
+ cursor: "pointer",
8970
+ padding: `${theme2.space[1]}px`
8971
+ },
8972
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
8973
+ }
8974
+ )
8975
+ ]
8976
+ }
8977
+ ),
8978
+ /* @__PURE__ */ jsxs(
8979
+ "div",
8980
+ {
8981
+ style: {
8982
+ padding: `${theme2.space[4]}px`,
8983
+ overflow: "auto",
8984
+ flex: 1
8985
+ },
8986
+ children: [
8987
+ /* @__PURE__ */ jsxs(
8988
+ Section,
8989
+ {
8990
+ icon: /* @__PURE__ */ jsx(Package, { size: 18 }),
8991
+ title: "Dependency Types",
8992
+ theme: theme2,
8993
+ children: [
8994
+ /* @__PURE__ */ jsx(
8995
+ InfoItem,
8996
+ {
8997
+ badge: { text: "prod", color: theme2.colors.primary },
8998
+ title: "Production Dependencies",
8999
+ description: "Required for your application to run in production. These are bundled with your app and affect its size and security.",
9000
+ theme: theme2
9001
+ }
9002
+ ),
9003
+ /* @__PURE__ */ jsx(
9004
+ InfoItem,
9005
+ {
9006
+ badge: { text: "dev", color: theme2.colors.secondary },
9007
+ title: "Development Dependencies",
9008
+ description: "Only needed during development (build tools, testing, linters). Not included in production builds.",
9009
+ theme: theme2
9010
+ }
9011
+ ),
9012
+ /* @__PURE__ */ jsx(
9013
+ InfoItem,
9014
+ {
9015
+ badge: { text: "peer", color: theme2.colors.accent },
9016
+ title: "Peer Dependencies",
9017
+ description: "Expected to be provided by the consumer of your package. Important for library authors to specify compatibility.",
9018
+ theme: theme2
9019
+ }
9020
+ )
9021
+ ]
9022
+ }
9023
+ ),
9024
+ /* @__PURE__ */ jsxs(
9025
+ Section,
9026
+ {
9027
+ icon: /* @__PURE__ */ jsx(Scale, { size: 18 }),
9028
+ title: "Common Licenses",
9029
+ theme: theme2,
9030
+ children: [
9031
+ /* @__PURE__ */ jsx(
9032
+ InfoItem,
9033
+ {
9034
+ badge: { text: "MIT", color: theme2.colors.success },
9035
+ title: "Permissive Licenses (MIT, Apache, BSD)",
9036
+ description: "Few restrictions. Can use in commercial projects. Must include copyright notice.",
9037
+ theme: theme2
9038
+ }
9039
+ ),
9040
+ /* @__PURE__ */ jsx(
9041
+ InfoItem,
9042
+ {
9043
+ badge: { text: "GPL", color: theme2.colors.warning },
9044
+ title: "Copyleft Licenses (GPL, LGPL, AGPL)",
9045
+ description: "Requires sharing source code of derivative works. Can impact your project's licensing.",
9046
+ theme: theme2
9047
+ }
9048
+ )
9049
+ ]
9050
+ }
9051
+ )
9052
+ ]
9053
+ }
9054
+ )
9055
+ ]
9056
+ }
9057
+ )
9058
+ }
9059
+ ) });
9060
+ };
9061
+ const Section = ({ icon, title, theme: theme2, children }) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: `${theme2.space[5]}px` }, children: [
9062
+ /* @__PURE__ */ jsxs(
9063
+ "h3",
9064
+ {
9065
+ style: {
9066
+ fontSize: `${theme2.fontSizes[2]}px`,
9067
+ fontWeight: theme2.fontWeights.semibold,
9068
+ color: theme2.colors.text,
9069
+ marginBottom: `${theme2.space[3]}px`,
9070
+ display: "flex",
9071
+ alignItems: "center",
9072
+ gap: `${theme2.space[2]}px`
9073
+ },
9074
+ children: [
9075
+ icon,
9076
+ title
9077
+ ]
9078
+ }
9079
+ ),
9080
+ /* @__PURE__ */ jsx(
9081
+ "div",
9082
+ {
9083
+ style: {
9084
+ display: "flex",
9085
+ flexDirection: "column",
9086
+ gap: `${theme2.space[2]}px`
9087
+ },
9088
+ children
9089
+ }
9090
+ )
9091
+ ] });
9092
+ const InfoItem = ({ badge, title, description, theme: theme2 }) => /* @__PURE__ */ jsxs(
9093
+ "div",
9094
+ {
9095
+ style: {
9096
+ padding: `${theme2.space[3]}px`,
9097
+ backgroundColor: theme2.colors.backgroundSecondary,
9098
+ borderRadius: `${theme2.radii[2]}px`,
9099
+ border: `1px solid ${theme2.colors.border}`
9100
+ },
9101
+ children: [
9102
+ /* @__PURE__ */ jsxs(
9103
+ "div",
9104
+ {
9105
+ style: {
9106
+ display: "flex",
9107
+ alignItems: "center",
9108
+ gap: `${theme2.space[2]}px`,
9109
+ marginBottom: `${theme2.space[1]}px`
9110
+ },
9111
+ children: [
9112
+ /* @__PURE__ */ jsx(
9113
+ "span",
9114
+ {
9115
+ style: {
9116
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
9117
+ borderRadius: `${theme2.radii[1]}px`,
9118
+ fontSize: `${theme2.fontSizes[0]}px`,
9119
+ fontWeight: theme2.fontWeights.medium,
9120
+ backgroundColor: `${badge.color}20`,
9121
+ color: badge.color
9122
+ },
9123
+ children: badge.text
9124
+ }
9125
+ ),
9126
+ /* @__PURE__ */ jsx(
9127
+ "span",
9128
+ {
9129
+ style: {
9130
+ fontSize: `${theme2.fontSizes[1]}px`,
9131
+ fontWeight: theme2.fontWeights.medium,
9132
+ color: theme2.colors.text
9133
+ },
9134
+ children: title
9135
+ }
9136
+ )
9137
+ ]
9138
+ }
9139
+ ),
9140
+ /* @__PURE__ */ jsx(
9141
+ "div",
9142
+ {
9143
+ style: {
9144
+ fontSize: `${theme2.fontSizes[1]}px`,
9145
+ color: theme2.colors.textSecondary,
9146
+ lineHeight: theme2.lineHeights.relaxed
9147
+ },
9148
+ children: description
9149
+ }
9150
+ )
9151
+ ]
9152
+ }
9153
+ );
9154
+ const DependencyRow = ({ dependency }) => {
9155
+ const { theme: theme2 } = useTheme();
9156
+ const getDependencyTypeBadgeStyle = (type) => {
9157
+ const baseStyle = {
9158
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
9159
+ borderRadius: `${theme2.radii[1]}px`,
9160
+ fontSize: `${theme2.fontSizes[0]}px`,
9161
+ fontWeight: theme2.fontWeights.medium,
9162
+ minWidth: "36px",
9163
+ textAlign: "center"
9164
+ };
9165
+ switch (type) {
9166
+ case "production":
9167
+ return {
9168
+ ...baseStyle,
9169
+ backgroundColor: `${theme2.colors.primary}20`,
9170
+ color: theme2.colors.primary
9171
+ };
9172
+ case "development":
9173
+ return {
9174
+ ...baseStyle,
9175
+ backgroundColor: `${theme2.colors.secondary}20`,
9176
+ color: theme2.colors.secondary
9177
+ };
9178
+ case "peer":
9179
+ return {
9180
+ ...baseStyle,
9181
+ backgroundColor: `${theme2.colors.accent}20`,
9182
+ color: theme2.colors.accent
9183
+ };
9184
+ default:
9185
+ return {
9186
+ ...baseStyle,
9187
+ backgroundColor: theme2.colors.backgroundLight,
9188
+ color: theme2.colors.textSecondary
9189
+ };
9190
+ }
9191
+ };
9192
+ return /* @__PURE__ */ jsxs(
9193
+ "div",
9194
+ {
9195
+ style: {
9196
+ display: "flex",
9197
+ alignItems: "center",
9198
+ justifyContent: "space-between",
9199
+ padding: `${theme2.space[2]}px ${theme2.space[3]}px`,
9200
+ backgroundColor: theme2.colors.background,
9201
+ borderRadius: `${theme2.radii[1]}px`,
9202
+ fontSize: `${theme2.fontSizes[1]}px`,
9203
+ border: `1px solid ${theme2.colors.border}`,
9204
+ transition: "all 0.2s"
9205
+ },
9206
+ children: [
9207
+ /* @__PURE__ */ jsxs(
9208
+ "div",
9209
+ {
9210
+ style: {
9211
+ display: "flex",
9212
+ alignItems: "center",
9213
+ gap: `${theme2.space[2]}px`,
9214
+ flex: 1,
9215
+ minWidth: 0
9216
+ },
9217
+ children: [
9218
+ /* @__PURE__ */ jsx("span", { style: getDependencyTypeBadgeStyle(dependency.dependencyType), children: dependency.dependencyType === "production" ? "prod" : dependency.dependencyType === "development" ? "dev" : "peer" }),
9219
+ /* @__PURE__ */ jsx(
9220
+ "span",
9221
+ {
9222
+ style: {
9223
+ fontWeight: theme2.fontWeights.medium,
9224
+ color: theme2.colors.text,
9225
+ overflow: "hidden",
9226
+ textOverflow: "ellipsis",
9227
+ whiteSpace: "nowrap"
9228
+ },
9229
+ children: dependency.name
9230
+ }
9231
+ )
9232
+ ]
9233
+ }
9234
+ ),
9235
+ /* @__PURE__ */ jsxs(
9236
+ "div",
9237
+ {
9238
+ style: {
9239
+ display: "flex",
9240
+ alignItems: "center",
9241
+ gap: "8px"
9242
+ },
9243
+ children: [
9244
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version }),
9245
+ /* @__PURE__ */ jsx(
9246
+ "a",
9247
+ {
9248
+ href: `https://www.npmjs.com/package/${dependency.name}`,
9249
+ target: "_blank",
9250
+ rel: "noopener noreferrer",
9251
+ style: {
9252
+ padding: `${theme2.space[1]}px`,
9253
+ borderRadius: `${theme2.radii[1]}px`,
9254
+ display: "flex",
9255
+ alignItems: "center",
9256
+ transition: "background-color 0.2s"
9257
+ },
9258
+ title: "View on npm",
9259
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
9260
+ }
9261
+ )
9262
+ ]
9263
+ }
9264
+ )
9265
+ ]
9266
+ }
9267
+ );
9268
+ };
9269
+ const FilterBar = ({
9270
+ activeFilters,
9271
+ onToggleFilter,
9272
+ searchQuery,
9273
+ onSearchChange,
9274
+ counts
9275
+ }) => {
9276
+ const { theme: theme2 } = useTheme();
9277
+ const availableFilters = [
9278
+ ...counts.peer > 0 ? ["peer"] : [],
9279
+ ...counts.production > 0 ? ["production"] : [],
9280
+ ...counts.development > 0 ? ["development"] : []
9281
+ ];
9282
+ const showFilters = availableFilters.length > 1;
9283
+ return /* @__PURE__ */ jsxs(
9284
+ "div",
9285
+ {
9286
+ style: {
9287
+ display: "flex",
9288
+ flexDirection: "column",
9289
+ gap: `${theme2.space[2]}px`
9290
+ },
9291
+ children: [
9292
+ /* @__PURE__ */ jsxs(
9293
+ "div",
9294
+ {
9295
+ style: {
9296
+ position: "relative",
9297
+ display: "flex",
9298
+ alignItems: "center"
9299
+ },
9300
+ children: [
9301
+ /* @__PURE__ */ jsx(
9302
+ Search,
9303
+ {
9304
+ size: 14,
9305
+ style: {
9306
+ position: "absolute",
9307
+ left: `${theme2.space[3]}px`,
9308
+ color: theme2.colors.textSecondary,
9309
+ pointerEvents: "none"
9310
+ }
9311
+ }
9312
+ ),
9313
+ /* @__PURE__ */ jsx(
9314
+ "input",
9315
+ {
9316
+ type: "text",
9317
+ placeholder: "Search dependencies...",
9318
+ value: searchQuery,
9319
+ onChange: (e) => onSearchChange(e.target.value),
9320
+ style: {
9321
+ width: "100%",
9322
+ padding: `${theme2.space[2]}px ${theme2.space[5]}px`,
9323
+ borderRadius: `${theme2.radii[2]}px`,
9324
+ border: `1px solid ${theme2.colors.border}`,
9325
+ backgroundColor: theme2.colors.backgroundSecondary,
9326
+ color: theme2.colors.text,
9327
+ fontSize: `${theme2.fontSizes[1]}px`,
9328
+ fontFamily: theme2.fonts.body,
9329
+ outline: "none",
9330
+ transition: "all 0.2s"
9331
+ }
9332
+ }
9333
+ ),
9334
+ searchQuery && /* @__PURE__ */ jsx(
9335
+ "button",
9336
+ {
9337
+ onClick: () => onSearchChange(""),
9338
+ style: {
9339
+ position: "absolute",
9340
+ right: `${theme2.space[2]}px`,
9341
+ padding: `${theme2.space[1]}px`,
9342
+ display: "flex",
9343
+ alignItems: "center",
9344
+ justifyContent: "center",
9345
+ backgroundColor: "transparent",
9346
+ border: "none",
9347
+ cursor: "pointer",
9348
+ borderRadius: `${theme2.radii[1]}px`
9349
+ },
9350
+ title: "Clear search",
9351
+ children: /* @__PURE__ */ jsx(X, { size: 14, color: theme2.colors.textSecondary })
9352
+ }
9353
+ )
9354
+ ]
9355
+ }
9356
+ ),
9357
+ showFilters && /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: `${theme2.space[1]}px`, width: "100%" }, children: availableFilters.map((type) => {
9358
+ const isActive = activeFilters.has(type);
9359
+ return /* @__PURE__ */ jsxs(
9360
+ "button",
9361
+ {
9362
+ onClick: () => onToggleFilter(type),
9363
+ style: {
9364
+ flex: 1,
9365
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
9366
+ fontSize: `${theme2.fontSizes[0]}px`,
9367
+ fontWeight: theme2.fontWeights.medium,
9368
+ fontFamily: theme2.fonts.body,
9369
+ borderRadius: `${theme2.radii[1]}px`,
9370
+ border: `1px solid ${isActive ? theme2.colors.primary : theme2.colors.border}`,
9371
+ backgroundColor: isActive ? `${theme2.colors.primary}20` : theme2.colors.backgroundSecondary,
9372
+ color: isActive ? theme2.colors.primary : theme2.colors.text,
9373
+ cursor: "pointer",
9374
+ transition: "all 0.2s"
9375
+ },
9376
+ children: [
9377
+ type === "production" ? "Prod" : type === "development" ? "Dev" : "Peer",
9378
+ /* @__PURE__ */ jsxs(
9379
+ "span",
9380
+ {
9381
+ style: { marginLeft: `${theme2.space[1]}px`, opacity: 0.7 },
9382
+ children: [
9383
+ "(",
9384
+ counts[type],
9385
+ ")"
9386
+ ]
9387
+ }
9388
+ )
9389
+ ]
9390
+ },
9391
+ type
9392
+ );
9393
+ }) })
9394
+ ]
9395
+ }
9396
+ );
9397
+ };
9398
+ const dependencyTypeOrder = {
9399
+ peer: 0,
9400
+ production: 1,
9401
+ development: 2
9402
+ };
9403
+ function extractDependencies(packageLayer) {
9404
+ const { dependencies, devDependencies, peerDependencies } = packageLayer.packageData;
9405
+ const items2 = [];
9406
+ if (dependencies) {
9407
+ Object.entries(dependencies).forEach(([name, version]) => {
9408
+ items2.push({ name, version, dependencyType: "production" });
9409
+ });
9410
+ }
9411
+ if (devDependencies) {
9412
+ Object.entries(devDependencies).forEach(([name, version]) => {
9413
+ items2.push({ name, version, dependencyType: "development" });
9414
+ });
9415
+ }
9416
+ if (peerDependencies) {
9417
+ Object.entries(peerDependencies).forEach(([name, version]) => {
9418
+ items2.push({ name, version, dependencyType: "peer" });
9419
+ });
9420
+ }
9421
+ return items2.sort((a, b) => {
9422
+ const typeCompare = dependencyTypeOrder[a.dependencyType] - dependencyTypeOrder[b.dependencyType];
9423
+ if (typeCompare !== 0) return typeCompare;
9424
+ return a.name.localeCompare(b.name);
9425
+ });
9426
+ }
9427
+ const DependenciesPanelContent = ({
9428
+ context
9429
+ }) => {
9430
+ var _a;
9431
+ const { theme: theme2 } = useTheme();
9432
+ const [selectedPackagePath, setSelectedPackagePath] = useState(
9433
+ null
9434
+ );
9435
+ const [activeFilters, setActiveFilters] = useState(/* @__PURE__ */ new Set());
9436
+ const [searchQuery, setSearchQuery] = useState("");
9437
+ const [showInfoModal, setShowInfoModal] = useState(false);
9438
+ const packagesSlice = context.getSlice("packages");
9439
+ const isLoading = context.isSliceLoading("packages");
9440
+ const hasPackages = context.hasSlice("packages");
9441
+ const packages = useMemo(() => {
9442
+ var _a2;
9443
+ return ((_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.packages) ?? [];
9444
+ }, [(_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages]);
9445
+ const effectiveSelectedPath = useMemo(() => {
9446
+ if (selectedPackagePath !== null) return selectedPackagePath;
9447
+ if (packages.length === 1) return packages[0].packageData.path;
9448
+ const rootPackage = packages.find((p) => p.packageData.path === "");
9449
+ if (rootPackage) return "";
9450
+ return null;
9451
+ }, [selectedPackagePath, packages]);
9452
+ const selectedPackage = useMemo(() => {
9453
+ if (effectiveSelectedPath === null) return null;
9454
+ return packages.find((p) => p.packageData.path === effectiveSelectedPath);
9455
+ }, [effectiveSelectedPath, packages]);
9456
+ const dependencyItems = useMemo(() => {
9457
+ if (!selectedPackage) return [];
9458
+ return extractDependencies(selectedPackage);
9459
+ }, [selectedPackage]);
9460
+ const counts = useMemo(() => {
9461
+ return {
9462
+ all: dependencyItems.length,
9463
+ production: dependencyItems.filter((d) => d.dependencyType === "production").length,
9464
+ development: dependencyItems.filter(
9465
+ (d) => d.dependencyType === "development"
9466
+ ).length,
9467
+ peer: dependencyItems.filter((d) => d.dependencyType === "peer").length
9468
+ };
9469
+ }, [dependencyItems]);
9470
+ const handleToggleFilter = (type) => {
9471
+ setActiveFilters((prev) => {
9472
+ const next = new Set(prev);
9473
+ if (next.has(type)) {
9474
+ next.delete(type);
9475
+ } else {
9476
+ next.add(type);
9477
+ }
9478
+ return next;
9479
+ });
9480
+ };
9481
+ const filteredDependencies = useMemo(() => {
9482
+ let filtered = [...dependencyItems];
9483
+ if (searchQuery.trim()) {
9484
+ const query = searchQuery.toLowerCase();
9485
+ filtered = filtered.filter(
9486
+ (dep) => dep.name.toLowerCase().includes(query)
9487
+ );
9488
+ }
9489
+ const allTypes = ["production", "development", "peer"];
9490
+ const availableTypes = allTypes.filter((t) => counts[t] > 0);
9491
+ const isAllSelected = activeFilters.size === 0 || availableTypes.every((t) => activeFilters.has(t));
9492
+ if (!isAllSelected && activeFilters.size > 0) {
9493
+ filtered = filtered.filter((dep) => activeFilters.has(dep.dependencyType));
9494
+ }
9495
+ return filtered;
9496
+ }, [dependencyItems, searchQuery, activeFilters, counts]);
9497
+ if (isLoading) {
9498
+ return /* @__PURE__ */ jsx(
9499
+ "div",
9500
+ {
9501
+ style: {
9502
+ padding: `${theme2.space[3]}px`,
9503
+ height: "100%",
9504
+ display: "flex",
9505
+ alignItems: "center",
9506
+ justifyContent: "center",
9507
+ color: theme2.colors.textSecondary,
9508
+ backgroundColor: theme2.colors.background,
9509
+ fontFamily: theme2.fonts.body
9510
+ },
9511
+ children: "Loading packages..."
9512
+ }
9513
+ );
9514
+ }
9515
+ if (!hasPackages || packages.length === 0) {
9516
+ return /* @__PURE__ */ jsxs(
9517
+ "div",
9518
+ {
9519
+ style: {
9520
+ padding: `${theme2.space[3]}px`,
9521
+ height: "100%",
9522
+ display: "flex",
9523
+ flexDirection: "column",
9524
+ alignItems: "center",
9525
+ justifyContent: "center",
9526
+ gap: `${theme2.space[2]}px`,
9527
+ color: theme2.colors.textSecondary,
9528
+ backgroundColor: theme2.colors.background,
9529
+ fontFamily: theme2.fonts.body
9530
+ },
9531
+ children: [
9532
+ /* @__PURE__ */ jsx(Package, { size: 32 }),
9533
+ /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No package data available" })
9534
+ ]
9535
+ }
9536
+ );
9537
+ }
9538
+ return /* @__PURE__ */ jsxs(
9539
+ "div",
9540
+ {
9541
+ style: {
9542
+ height: "100%",
9543
+ display: "flex",
9544
+ flexDirection: "column",
9545
+ backgroundColor: theme2.colors.background,
9546
+ color: theme2.colors.text,
9547
+ fontFamily: theme2.fonts.body,
9548
+ overflow: "hidden"
9549
+ },
9550
+ children: [
9551
+ /* @__PURE__ */ jsxs(
9552
+ "div",
9553
+ {
9554
+ style: {
9555
+ flexShrink: 0,
9556
+ padding: `${theme2.space[3]}px`,
9557
+ paddingBottom: `${theme2.space[2]}px`,
9558
+ display: "flex",
9559
+ flexDirection: "column",
9560
+ gap: `${theme2.space[2]}px`,
9561
+ borderBottom: `1px solid ${theme2.colors.border}`
9562
+ },
9563
+ children: [
9564
+ /* @__PURE__ */ jsxs(
9565
+ "div",
9566
+ {
9567
+ style: {
9568
+ display: "flex",
9569
+ alignItems: "center",
9570
+ justifyContent: "space-between"
9571
+ },
9572
+ children: [
9573
+ /* @__PURE__ */ jsx(
9574
+ "h3",
9575
+ {
9576
+ style: {
9577
+ fontSize: `${theme2.fontSizes[2]}px`,
9578
+ fontWeight: theme2.fontWeights.semibold,
9579
+ color: theme2.colors.text,
9580
+ display: "flex",
9581
+ alignItems: "center",
9582
+ gap: `${theme2.space[2]}px`,
9583
+ margin: 0
9584
+ },
9585
+ children: packages.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
9586
+ /* @__PURE__ */ jsx(Boxes, { size: 16 }),
9587
+ "Monorepo Dependencies",
9588
+ /* @__PURE__ */ jsxs(
9589
+ "span",
9590
+ {
9591
+ style: {
9592
+ fontSize: `${theme2.fontSizes[0]}px`,
9593
+ fontWeight: theme2.fontWeights.body,
9594
+ color: theme2.colors.textSecondary
9595
+ },
9596
+ children: [
9597
+ "(",
9598
+ packages.length,
9599
+ ")"
9600
+ ]
9601
+ }
9602
+ )
9603
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
9604
+ /* @__PURE__ */ jsx(Package, { size: 16 }),
9605
+ "Dependencies"
9606
+ ] })
9607
+ }
9608
+ ),
9609
+ /* @__PURE__ */ jsxs(
9610
+ "button",
9611
+ {
9612
+ onClick: () => setShowInfoModal(true),
9613
+ style: {
9614
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
9615
+ fontSize: `${theme2.fontSizes[0]}px`,
9616
+ fontWeight: theme2.fontWeights.medium,
9617
+ fontFamily: theme2.fonts.body,
9618
+ borderRadius: `${theme2.radii[1]}px`,
9619
+ border: `1px solid ${theme2.colors.border}`,
9620
+ backgroundColor: theme2.colors.backgroundSecondary,
9621
+ color: theme2.colors.primary,
9622
+ cursor: "pointer",
9623
+ display: "flex",
9624
+ alignItems: "center",
9625
+ gap: `${theme2.space[1]}px`,
9626
+ transition: "all 0.2s"
9627
+ },
9628
+ children: [
9629
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 12 }),
9630
+ "Learn More"
9631
+ ]
9632
+ }
9633
+ )
9634
+ ]
9635
+ }
9636
+ ),
9637
+ packages.length > 1 && /* @__PURE__ */ jsx(
9638
+ "select",
9639
+ {
9640
+ value: effectiveSelectedPath ?? "__none__",
9641
+ onChange: (e) => setSelectedPackagePath(e.target.value === "__none__" ? null : e.target.value),
9642
+ style: {
9643
+ width: "100%",
9644
+ padding: `${theme2.space[2]}px`,
9645
+ borderRadius: `${theme2.radii[1]}px`,
9646
+ border: `1px solid ${theme2.colors.border}`,
9647
+ backgroundColor: theme2.colors.backgroundSecondary,
9648
+ color: theme2.colors.text,
9649
+ fontSize: `${theme2.fontSizes[1]}px`,
9650
+ fontFamily: theme2.fonts.body,
9651
+ cursor: "pointer"
9652
+ },
9653
+ children: packages.map((pkg) => /* @__PURE__ */ jsxs("option", { value: pkg.packageData.path, children: [
9654
+ pkg.packageData.name,
9655
+ " (",
9656
+ pkg.packageData.path || "root",
9657
+ ")"
9658
+ ] }, pkg.packageData.path || "__root__"))
9659
+ }
9660
+ ),
9661
+ packages.length === 1 && selectedPackage && /* @__PURE__ */ jsxs(
9662
+ "div",
9663
+ {
9664
+ style: {
9665
+ fontSize: `${theme2.fontSizes[0]}px`,
9666
+ color: theme2.colors.textSecondary
9667
+ },
9668
+ children: [
9669
+ selectedPackage.packageData.name,
9670
+ " • ",
9671
+ dependencyItems.length,
9672
+ " dependencies"
9673
+ ]
9674
+ }
9675
+ ),
9676
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsx(
9677
+ FilterBar,
9678
+ {
9679
+ activeFilters,
9680
+ onToggleFilter: handleToggleFilter,
9681
+ searchQuery,
9682
+ onSearchChange: setSearchQuery,
9683
+ counts
9684
+ }
9685
+ )
9686
+ ]
9687
+ }
9688
+ ),
9689
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsxs(
9690
+ "div",
9691
+ {
9692
+ style: {
9693
+ flex: 1,
9694
+ overflow: "auto",
9695
+ padding: `${theme2.space[2]}px ${theme2.space[3]}px ${theme2.space[3]}px`
9696
+ },
9697
+ children: [
9698
+ /* @__PURE__ */ jsxs(
9699
+ "div",
9700
+ {
9701
+ style: {
9702
+ fontSize: `${theme2.fontSizes[0]}px`,
9703
+ color: theme2.colors.textSecondary,
9704
+ marginBottom: `${theme2.space[2]}px`
9705
+ },
9706
+ children: [
9707
+ "Showing ",
9708
+ filteredDependencies.length,
9709
+ " of ",
9710
+ dependencyItems.length,
9711
+ " dependencies"
9712
+ ]
9713
+ }
9714
+ ),
9715
+ /* @__PURE__ */ jsx(
9716
+ "div",
9717
+ {
9718
+ style: {
9719
+ display: "flex",
9720
+ flexDirection: "column",
9721
+ gap: `${theme2.space[1]}px`
9722
+ },
9723
+ children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
9724
+ "div",
9725
+ {
9726
+ style: {
9727
+ padding: `${theme2.space[3]}px`,
9728
+ textAlign: "center",
9729
+ color: theme2.colors.textSecondary,
9730
+ fontSize: `${theme2.fontSizes[1]}px`
9731
+ },
9732
+ children: "No dependencies match your filters"
9733
+ }
9734
+ ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
9735
+ DependencyRow,
9736
+ {
9737
+ dependency: dep
9738
+ },
9739
+ `${dep.name}-${dep.dependencyType}`
9740
+ ))
9741
+ }
9742
+ )
9743
+ ]
9744
+ }
9745
+ ),
9746
+ !selectedPackage && packages.length > 1 && /* @__PURE__ */ jsx(
9747
+ "div",
9748
+ {
9749
+ style: {
9750
+ flex: 1,
9751
+ display: "flex",
9752
+ alignItems: "center",
9753
+ justifyContent: "center",
9754
+ color: theme2.colors.textSecondary,
9755
+ fontSize: `${theme2.fontSizes[1]}px`
9756
+ },
9757
+ children: "Select a package to view its dependencies"
9758
+ }
9759
+ ),
9760
+ /* @__PURE__ */ jsx(
9761
+ DependencyInfoModal,
9762
+ {
9763
+ isOpen: showInfoModal,
9764
+ onClose: () => setShowInfoModal(false)
9765
+ }
9766
+ )
9767
+ ]
9768
+ }
9769
+ );
9770
+ };
9771
+ const DependenciesPanel = (props) => {
9772
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
9773
+ };
8126
9774
  const panels = [
8127
9775
  {
8128
9776
  metadata: {
@@ -8144,6 +9792,48 @@ const panels = [
8144
9792
  onUnmount: async (_context) => {
8145
9793
  console.log("Git Changes Panel unmounting");
8146
9794
  }
9795
+ },
9796
+ {
9797
+ metadata: {
9798
+ id: "industry-theme.package-composition",
9799
+ name: "Package Composition",
9800
+ icon: "Package",
9801
+ version: "0.1.0",
9802
+ author: "Industry Theme",
9803
+ description: "View detected packages, dependencies, configs, and available commands",
9804
+ slices: ["packages"]
9805
+ },
9806
+ component: PackageCompositionPanel,
9807
+ onMount: async (context) => {
9808
+ console.log("Package Composition Panel mounted");
9809
+ if (context.hasSlice("packages") && !context.isSliceLoading("packages")) {
9810
+ await context.refresh("repository", "packages");
9811
+ }
9812
+ },
9813
+ onUnmount: async (_context) => {
9814
+ console.log("Package Composition Panel unmounting");
9815
+ }
9816
+ },
9817
+ {
9818
+ metadata: {
9819
+ id: "industry-theme.dependencies",
9820
+ name: "Dependencies",
9821
+ icon: "Package",
9822
+ version: "0.1.0",
9823
+ author: "Industry Theme",
9824
+ description: "View and explore package dependencies",
9825
+ slices: ["packages"]
9826
+ },
9827
+ component: DependenciesPanel,
9828
+ onMount: async (context) => {
9829
+ console.log("Dependencies Panel mounted");
9830
+ if (context.hasSlice("packages") && !context.isSliceLoading("packages")) {
9831
+ await context.refresh("repository", "packages");
9832
+ }
9833
+ },
9834
+ onUnmount: async (_context) => {
9835
+ console.log("Dependencies Panel unmounting");
9836
+ }
8147
9837
  }
8148
9838
  ];
8149
9839
  const onPackageLoad = async () => {
@@ -8153,9 +9843,13 @@ const onPackageUnload = async () => {
8153
9843
  console.log("Repository Composition Panels package unloading");
8154
9844
  };
8155
9845
  export {
9846
+ DependenciesPanel,
8156
9847
  GitChangesPanel,
8157
9848
  GitChangesPanelContent,
8158
9849
  GitChangesPanelPreview,
9850
+ PackageCompositionPanel,
9851
+ PackageCompositionPanelContent,
9852
+ PackageCompositionPanelPreview,
8159
9853
  onPackageLoad,
8160
9854
  onPackageUnload,
8161
9855
  panels