@industry-theme/repository-composition-panels 0.2.2 → 0.2.4

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.
@@ -320,7 +320,36 @@ const createLucideIcon = (iconName, iconNode) => {
320
320
  * This source code is licensed under the ISC license.
321
321
  * See the LICENSE file in the root directory of this source tree.
322
322
  */
323
- const __iconNode$k = [
323
+ const __iconNode$q = [
324
+ ["path", { d: "M5 12h14", key: "1ays0h" }],
325
+ ["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
326
+ ];
327
+ const ArrowRight = createLucideIcon("arrow-right", __iconNode$q);
328
+ /**
329
+ * @license lucide-react v0.552.0 - ISC
330
+ *
331
+ * This source code is licensed under the ISC license.
332
+ * See the LICENSE file in the root directory of this source tree.
333
+ */
334
+ const __iconNode$p = [
335
+ [
336
+ "path",
337
+ {
338
+ d: "M21 8a2 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.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
339
+ key: "hh9hay"
340
+ }
341
+ ],
342
+ ["path", { d: "m3.3 7 8.7 5 8.7-5", key: "g66t2b" }],
343
+ ["path", { d: "M12 22V12", key: "d0xqtd" }]
344
+ ];
345
+ const Box = createLucideIcon("box", __iconNode$p);
346
+ /**
347
+ * @license lucide-react v0.552.0 - ISC
348
+ *
349
+ * This source code is licensed under the ISC license.
350
+ * See the LICENSE file in the root directory of this source tree.
351
+ */
352
+ const __iconNode$o = [
324
353
  [
325
354
  "path",
326
355
  {
@@ -352,85 +381,93 @@ const __iconNode$k = [
352
381
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
353
382
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
354
383
  ];
355
- const Boxes = createLucideIcon("boxes", __iconNode$k);
384
+ const Boxes = createLucideIcon("boxes", __iconNode$o);
356
385
  /**
357
386
  * @license lucide-react v0.552.0 - ISC
358
387
  *
359
388
  * This source code is licensed under the ISC license.
360
389
  * See the LICENSE file in the root directory of this source tree.
361
390
  */
362
- const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
363
- const Check = createLucideIcon("check", __iconNode$j);
391
+ const __iconNode$n = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
392
+ const Check = createLucideIcon("check", __iconNode$n);
364
393
  /**
365
394
  * @license lucide-react v0.552.0 - ISC
366
395
  *
367
396
  * This source code is licensed under the ISC license.
368
397
  * See the LICENSE file in the root directory of this source tree.
369
398
  */
370
- const __iconNode$i = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
371
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$i);
399
+ const __iconNode$m = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
400
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$m);
372
401
  /**
373
402
  * @license lucide-react v0.552.0 - ISC
374
403
  *
375
404
  * This source code is licensed under the ISC license.
376
405
  * See the LICENSE file in the root directory of this source tree.
377
406
  */
378
- const __iconNode$h = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
379
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$h);
407
+ const __iconNode$l = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
408
+ const ChevronLeft = createLucideIcon("chevron-left", __iconNode$l);
380
409
  /**
381
410
  * @license lucide-react v0.552.0 - ISC
382
411
  *
383
412
  * This source code is licensed under the ISC license.
384
413
  * See the LICENSE file in the root directory of this source tree.
385
414
  */
386
- const __iconNode$g = [
415
+ const __iconNode$k = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
416
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$k);
417
+ /**
418
+ * @license lucide-react v0.552.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */
423
+ const __iconNode$j = [
387
424
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
388
425
  ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
389
426
  ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
390
427
  ];
391
- const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
428
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$j);
392
429
  /**
393
430
  * @license lucide-react v0.552.0 - ISC
394
431
  *
395
432
  * This source code is licensed under the ISC license.
396
433
  * See the LICENSE file in the root directory of this source tree.
397
434
  */
398
- const __iconNode$f = [
435
+ const __iconNode$i = [
399
436
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
400
437
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
401
438
  ["path", { d: "M12 17h.01", key: "p32p05" }]
402
439
  ];
403
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$f);
440
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$i);
404
441
  /**
405
442
  * @license lucide-react v0.552.0 - ISC
406
443
  *
407
444
  * This source code is licensed under the ISC license.
408
445
  * See the LICENSE file in the root directory of this source tree.
409
446
  */
410
- const __iconNode$e = [
447
+ const __iconNode$h = [
411
448
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
412
449
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
413
450
  ];
414
- const Copy = createLucideIcon("copy", __iconNode$e);
451
+ const Copy = createLucideIcon("copy", __iconNode$h);
415
452
  /**
416
453
  * @license lucide-react v0.552.0 - ISC
417
454
  *
418
455
  * This source code is licensed under the ISC license.
419
456
  * See the LICENSE file in the root directory of this source tree.
420
457
  */
421
- const __iconNode$d = [
458
+ const __iconNode$g = [
422
459
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
423
460
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
424
461
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
425
462
  ];
426
- const ExternalLink = createLucideIcon("external-link", __iconNode$d);
463
+ const ExternalLink = createLucideIcon("external-link", __iconNode$g);
427
464
  /**
428
465
  * @license lucide-react v0.552.0 - ISC
429
466
  *
430
467
  * This source code is licensed under the ISC license.
431
468
  * See the LICENSE file in the root directory of this source tree.
432
469
  */
433
- const __iconNode$c = [
470
+ const __iconNode$f = [
434
471
  [
435
472
  "path",
436
473
  {
@@ -442,14 +479,14 @@ const __iconNode$c = [
442
479
  ["path", { d: "M10 12.5 8 15l2 2.5", key: "1tg20x" }],
443
480
  ["path", { d: "m14 12.5 2 2.5-2 2.5", key: "yinavb" }]
444
481
  ];
445
- const FileCode = createLucideIcon("file-code", __iconNode$c);
482
+ const FileCode = createLucideIcon("file-code", __iconNode$f);
446
483
  /**
447
484
  * @license lucide-react v0.552.0 - ISC
448
485
  *
449
486
  * This source code is licensed under the ISC license.
450
487
  * See the LICENSE file in the root directory of this source tree.
451
488
  */
452
- const __iconNode$b = [
489
+ const __iconNode$e = [
453
490
  [
454
491
  "path",
455
492
  {
@@ -460,14 +497,34 @@ const __iconNode$b = [
460
497
  ["path", { d: "M12 17h.01", key: "p32p05" }],
461
498
  ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }]
462
499
  ];
463
- const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$b);
500
+ const FileQuestionMark = createLucideIcon("file-question-mark", __iconNode$e);
464
501
  /**
465
502
  * @license lucide-react v0.552.0 - ISC
466
503
  *
467
504
  * This source code is licensed under the ISC license.
468
505
  * See the LICENSE file in the root directory of this source tree.
469
506
  */
470
- const __iconNode$a = [
507
+ const __iconNode$d = [
508
+ [
509
+ "path",
510
+ {
511
+ 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",
512
+ key: "1oefj6"
513
+ }
514
+ ],
515
+ ["path", { d: "M14 2v5a1 1 0 0 0 1 1h5", key: "wfsgrz" }],
516
+ ["path", { d: "M10 9H8", key: "b1mrlr" }],
517
+ ["path", { d: "M16 13H8", key: "t4e002" }],
518
+ ["path", { d: "M16 17H8", key: "z1uh3a" }]
519
+ ];
520
+ const FileText = createLucideIcon("file-text", __iconNode$d);
521
+ /**
522
+ * @license lucide-react v0.552.0 - ISC
523
+ *
524
+ * This source code is licensed under the ISC license.
525
+ * See the LICENSE file in the root directory of this source tree.
526
+ */
527
+ const __iconNode$c = [
471
528
  [
472
529
  "path",
473
530
  {
@@ -476,20 +533,63 @@ const __iconNode$a = [
476
533
  }
477
534
  ]
478
535
  ];
479
- const Folder = createLucideIcon("folder", __iconNode$a);
536
+ const Folder = createLucideIcon("folder", __iconNode$c);
480
537
  /**
481
538
  * @license lucide-react v0.552.0 - ISC
482
539
  *
483
540
  * This source code is licensed under the ISC license.
484
541
  * See the LICENSE file in the root directory of this source tree.
485
542
  */
486
- const __iconNode$9 = [
543
+ const __iconNode$b = [
487
544
  ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
488
545
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
489
546
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
490
547
  ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
491
548
  ];
492
- const GitBranch = createLucideIcon("git-branch", __iconNode$9);
549
+ const GitBranch = createLucideIcon("git-branch", __iconNode$b);
550
+ /**
551
+ * @license lucide-react v0.552.0 - ISC
552
+ *
553
+ * This source code is licensed under the ISC license.
554
+ * See the LICENSE file in the root directory of this source tree.
555
+ */
556
+ const __iconNode$a = [
557
+ [
558
+ "path",
559
+ {
560
+ d: "M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",
561
+ key: "zw3jo"
562
+ }
563
+ ],
564
+ [
565
+ "path",
566
+ {
567
+ d: "M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",
568
+ key: "1wduqc"
569
+ }
570
+ ],
571
+ [
572
+ "path",
573
+ {
574
+ d: "M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",
575
+ key: "kqbvx6"
576
+ }
577
+ ]
578
+ ];
579
+ const Layers = createLucideIcon("layers", __iconNode$a);
580
+ /**
581
+ * @license lucide-react v0.552.0 - ISC
582
+ *
583
+ * This source code is licensed under the ISC license.
584
+ * See the LICENSE file in the root directory of this source tree.
585
+ */
586
+ const __iconNode$9 = [
587
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
588
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
589
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
590
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
591
+ ];
592
+ const LayoutGrid = createLucideIcon("layout-grid", __iconNode$9);
493
593
  /**
494
594
  * @license lucide-react v0.552.0 - ISC
495
595
  *
@@ -8515,567 +8615,303 @@ const GitChangesPanel = ({ context }) => {
8515
8615
  }
8516
8616
  );
8517
8617
  };
8518
- const PackageCard = ({
8519
- pkg,
8520
- isExpanded,
8521
- onToggle,
8522
- onCommandClick,
8523
- onConfigClick,
8524
- onPackageClick
8618
+ const NpmIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8619
+ "svg",
8620
+ {
8621
+ width: size2,
8622
+ height: size2,
8623
+ viewBox: "0 0 24 24",
8624
+ fill: "#CB3837",
8625
+ role: "img",
8626
+ xmlns: "http://www.w3.org/2000/svg",
8627
+ children: [
8628
+ /* @__PURE__ */ jsx("title", { children: "npm" }),
8629
+ /* @__PURE__ */ jsx("path", { d: "M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z" })
8630
+ ]
8631
+ }
8632
+ );
8633
+ const YarnIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8634
+ "svg",
8635
+ {
8636
+ width: size2,
8637
+ height: size2,
8638
+ viewBox: "0 0 24 24",
8639
+ fill: "#2C8EBB",
8640
+ role: "img",
8641
+ xmlns: "http://www.w3.org/2000/svg",
8642
+ children: [
8643
+ /* @__PURE__ */ jsx("title", { children: "Yarn" }),
8644
+ /* @__PURE__ */ jsx("path", { d: "M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z" })
8645
+ ]
8646
+ }
8647
+ );
8648
+ const PnpmIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8649
+ "svg",
8650
+ {
8651
+ width: size2,
8652
+ height: size2,
8653
+ viewBox: "0 0 24 24",
8654
+ fill: "#F69220",
8655
+ role: "img",
8656
+ xmlns: "http://www.w3.org/2000/svg",
8657
+ children: [
8658
+ /* @__PURE__ */ jsx("title", { children: "pnpm" }),
8659
+ /* @__PURE__ */ jsx("path", { d: "M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z" })
8660
+ ]
8661
+ }
8662
+ );
8663
+ const BunIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8664
+ "svg",
8665
+ {
8666
+ width: size2,
8667
+ height: size2,
8668
+ viewBox: "0 0 24 24",
8669
+ fill: "#FBF0DF",
8670
+ role: "img",
8671
+ xmlns: "http://www.w3.org/2000/svg",
8672
+ children: [
8673
+ /* @__PURE__ */ jsx("title", { children: "Bun" }),
8674
+ /* @__PURE__ */ jsx("path", { d: "M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z" })
8675
+ ]
8676
+ }
8677
+ );
8678
+ const PythonIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8679
+ "svg",
8680
+ {
8681
+ width: size2,
8682
+ height: size2,
8683
+ viewBox: "0 0 24 24",
8684
+ fill: "#3776AB",
8685
+ role: "img",
8686
+ xmlns: "http://www.w3.org/2000/svg",
8687
+ children: [
8688
+ /* @__PURE__ */ jsx("title", { children: "Python" }),
8689
+ /* @__PURE__ */ jsx("path", { d: "M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z" })
8690
+ ]
8691
+ }
8692
+ );
8693
+ const PoetryIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8694
+ "svg",
8695
+ {
8696
+ width: size2,
8697
+ height: size2,
8698
+ viewBox: "0 0 24 24",
8699
+ fill: "#60A5FA",
8700
+ role: "img",
8701
+ xmlns: "http://www.w3.org/2000/svg",
8702
+ children: [
8703
+ /* @__PURE__ */ jsx("title", { children: "Poetry" }),
8704
+ /* @__PURE__ */ jsx("path", { d: "M21.604 0a19.144 19.144 0 0 1-5.268 13.213L2.396 0l13.583 13.583a19.149 19.149 0 0 1-13.583 5.624V0h19.208Zm-1.911 17.297A24.455 24.455 0 0 1 7.189 24l-4.053-4.053a19.91 19.91 0 0 0 13.37-5.838l3.187 3.188Z" })
8705
+ ]
8706
+ }
8707
+ );
8708
+ const RustIcon = ({ size: size2 }) => /* @__PURE__ */ jsxs(
8709
+ "svg",
8710
+ {
8711
+ width: size2,
8712
+ height: size2,
8713
+ viewBox: "0 0 24 24",
8714
+ fill: "#000000",
8715
+ role: "img",
8716
+ xmlns: "http://www.w3.org/2000/svg",
8717
+ children: [
8718
+ /* @__PURE__ */ jsx("title", { children: "Rust" }),
8719
+ /* @__PURE__ */ jsx("path", { d: "M23.8346 11.7033l-1.0073-.6236a13.7268 13.7268 0 00-.0283-.2936l.8656-.8069a.3483.3483 0 00-.1154-.578l-1.1066-.414a8.4958 8.4958 0 00-.087-.2856l.6904-.9587a.3462.3462 0 00-.2257-.5446l-1.1663-.1894a9.3574 9.3574 0 00-.1407-.2622l.49-1.0761a.3437.3437 0 00-.0274-.3361.3486.3486 0 00-.3006-.154l-1.1845.0416a6.7444 6.7444 0 00-.1873-.2268l.2723-1.153a.3472.3472 0 00-.417-.4172l-1.1532.2724a14.0183 14.0183 0 00-.2278-.1873l.0415-1.1845a.3442.3442 0 00-.49-.328l-1.076.491c-.0872-.0476-.1742-.0952-.2623-.1407l-.1903-1.1673A.3483.3483 0 0016.256.955l-.9597.6905a8.4867 8.4867 0 00-.2855-.086l-.414-1.1066a.3483.3483 0 00-.5781-.1154l-.8069.8666a9.2936 9.2936 0 00-.2936-.0284L12.2946.1683a.3462.3462 0 00-.5892 0l-.6236 1.0073a13.7383 13.7383 0 00-.2936.0284L9.9803.3374a.3462.3462 0 00-.578.1154l-.4141 1.1065c-.0962.0274-.1903.0567-.2855.086L7.744.955a.3483.3483 0 00-.5447.2258L7.009 2.348a9.3574 9.3574 0 00-.2622.1407l-1.0762-.491a.3462.3462 0 00-.49.328l.0416 1.1845a7.9826 7.9826 0 00-.2278.1873L3.8413 3.425a.3472.3472 0 00-.4171.4171l.2713 1.1531c-.0628.075-.1255.1509-.1863.2268l-1.1845-.0415a.3462.3462 0 00-.328.49l.491 1.0761a9.167 9.167 0 00-.1407.2622l-1.1662.1894a.3483.3483 0 00-.2258.5446l.6904.9587a13.303 13.303 0 00-.087.2855l-1.1065.414a.3483.3483 0 00-.1155.5781l.8656.807a9.2936 9.2936 0 00-.0283.2935l-1.0073.6236a.3442.3442 0 000 .5892l1.0073.6236c.008.0982.0182.1964.0283.2936l-.8656.8079a.3462.3462 0 00.1155.578l1.1065.4141c.0273.0962.0567.1914.087.2855l-.6904.9587a.3452.3452 0 00.2268.5447l1.1662.1893c.0456.088.0922.1751.1408.2622l-.491 1.0762a.3462.3462 0 00.328.49l1.1834-.0415c.0618.0769.1235.1528.1873.2277l-.2713 1.1541a.3462.3462 0 00.4171.4161l1.153-.2713c.075.0638.151.1255.2279.1863l-.0415 1.1845a.3442.3442 0 00.49.327l1.0761-.49c.087.0486.1741.0951.2622.1407l.1903 1.1662a.3483.3483 0 00.5447.2268l.9587-.6904a9.299 9.299 0 00.2855.087l.414 1.1066a.3452.3452 0 00.5781.1154l.8079-.8656c.0972.0111.1954.0203.2936.0294l.6236 1.0073a.3472.3472 0 00.5892 0l.6236-1.0073c.0982-.0091.1964-.0183.2936-.0294l.8069.8656a.3483.3483 0 00.578-.1154l.4141-1.1066a8.4626 8.4626 0 00.2855-.087l.9587.6904a.3452.3452 0 00.5447-.2268l.1903-1.1662c.088-.0456.1751-.0931.2622-.1407l1.0762.49a.3472.3472 0 00.49-.327l-.0415-1.1845a6.7267 6.7267 0 00.2267-.1863l1.1531.2713a.3472.3472 0 00.4171-.416l-.2713-1.1542c.0628-.0749.1255-.1508.1863-.2278l1.1845.0415a.3442.3442 0 00.328-.49l-.49-1.076c.0475-.0872.0951-.1742.1407-.2623l1.1662-.1893a.3483.3483 0 00.2258-.5447l-.6904-.9587.087-.2855 1.1066-.414a.3462.3462 0 00.1154-.5781l-.8656-.8079c.0101-.0972.0202-.1954.0283-.2936l1.0073-.6236a.3442.3442 0 000-.5892zm-6.7413 8.3551a.7138.7138 0 01.2986-1.396.714.714 0 11-.2997 1.396zm-.3422-2.3142a.649.649 0 00-.7715.5l-.3573 1.6685c-1.1035.501-2.3285.7795-3.6193.7795a8.7368 8.7368 0 01-3.6951-.814l-.3574-1.6684a.648.648 0 00-.7714-.499l-1.473.3158a8.7216 8.7216 0 01-.7613-.898h7.1676c.081 0 .1356-.0141.1356-.088v-2.536c0-.074-.0536-.0881-.1356-.0881h-2.0966v-1.6077h2.2677c.2065 0 1.1065.0587 1.394 1.2088.0901.3533.2875 1.5044.4232 1.8729.1346.413.6833 1.2381 1.2685 1.2381h3.5716a.7492.7492 0 00.1296-.0131 8.7874 8.7874 0 01-.8119.9526zM6.8369 20.024a.714.714 0 11-.2997-1.396.714.714 0 01.2997 1.396zM4.1177 8.9972a.7137.7137 0 11-1.304.5791.7137.7137 0 011.304-.579zm-.8352 1.9813l1.5347-.6824a.65.65 0 00.33-.8585l-.3158-.7147h1.2432v5.6025H3.5669a8.7753 8.7753 0 01-.2834-3.348zm6.7343-.5437V8.7836h2.9601c.153 0 1.0792.1772 1.0792.8697 0 .575-.7107.7815-1.2948.7815zm10.7574 1.4862c0 .2187-.008.4363-.0243.651h-.9c-.09 0-.1265.0586-.1265.1477v.413c0 .973-.5487 1.1846-1.0296 1.2382-.4576.0517-.9648-.1913-1.0275-.4717-.2704-1.5186-.7198-1.8436-1.4305-2.4034.8817-.5599 1.799-1.386 1.799-2.4915 0-1.1936-.819-1.9458-1.3769-2.3153-.7825-.5163-1.6491-.6195-1.883-.6195H5.4682a8.7651 8.7651 0 014.907-2.7699l1.0974 1.151a.648.648 0 00.9182.0213l1.227-1.1743a8.7753 8.7753 0 016.0044 4.2762l-.8403 1.8982a.652.652 0 00.33.8585l1.6178.7188c.0283.2875.0425.577.0425.8717zm-9.3006-9.5993a.7128.7128 0 11.984 1.0316.7137.7137 0 01-.984-1.0316zm8.3389 6.71a.7107.7107 0 01.9395-.3625.7137.7137 0 11-.9405.3635z" })
8720
+ ]
8721
+ }
8722
+ );
8723
+ const PackageManagerIcon = ({
8724
+ packageManager,
8725
+ size: size2 = 18,
8726
+ color
8727
+ }) => {
8728
+ switch (packageManager) {
8729
+ case "npm":
8730
+ return /* @__PURE__ */ jsx(NpmIcon, { size: size2 });
8731
+ case "yarn":
8732
+ return /* @__PURE__ */ jsx(YarnIcon, { size: size2 });
8733
+ case "pnpm":
8734
+ return /* @__PURE__ */ jsx(PnpmIcon, { size: size2 });
8735
+ case "bun":
8736
+ return /* @__PURE__ */ jsx(BunIcon, { size: size2 });
8737
+ case "pip":
8738
+ case "pipenv":
8739
+ return /* @__PURE__ */ jsx(PythonIcon, { size: size2 });
8740
+ case "poetry":
8741
+ return /* @__PURE__ */ jsx(PoetryIcon, { size: size2 });
8742
+ case "cargo":
8743
+ return /* @__PURE__ */ jsx(RustIcon, { size: size2 });
8744
+ case "unknown":
8745
+ default:
8746
+ return /* @__PURE__ */ jsx(Package, { size: size2, color });
8747
+ }
8748
+ };
8749
+ const DependencyInfoModal = ({
8750
+ isOpen,
8751
+ onClose
8525
8752
  }) => {
8526
8753
  const { theme: theme2 } = useTheme();
8527
- const [activeTab, setActiveTab] = useState("commands");
8528
- const configFiles = useMemo(() => {
8529
- if (!pkg.configFiles) return [];
8530
- return Object.entries(pkg.configFiles).filter(([, config]) => config == null ? void 0 : config.exists).map(([name, config]) => ({ name, ...config }));
8531
- }, [pkg.configFiles]);
8532
- const commands = pkg.packageData.availableCommands || [];
8533
- return /* @__PURE__ */ jsxs(
8754
+ if (!isOpen) return null;
8755
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
8534
8756
  "div",
8535
8757
  {
8536
8758
  style: {
8537
- backgroundColor: theme2.colors.backgroundSecondary,
8538
- borderRadius: "8px",
8539
- border: `1px solid ${theme2.colors.border}`,
8540
- overflow: "hidden"
8759
+ position: "fixed",
8760
+ top: 0,
8761
+ left: 0,
8762
+ right: 0,
8763
+ bottom: 0,
8764
+ backgroundColor: theme2.colors.muted,
8765
+ zIndex: theme2.zIndices[4],
8766
+ display: "flex",
8767
+ alignItems: "center",
8768
+ justifyContent: "center"
8541
8769
  },
8542
- children: [
8543
- /* @__PURE__ */ jsxs(
8544
- "button",
8545
- {
8546
- onClick: onToggle,
8547
- style: {
8548
- width: "100%",
8549
- display: "flex",
8550
- alignItems: "center",
8551
- gap: "8px",
8552
- padding: "12px 16px",
8553
- backgroundColor: "transparent",
8554
- border: "none",
8555
- cursor: "pointer",
8556
- color: theme2.colors.text,
8557
- textAlign: "left"
8558
- },
8559
- children: [
8560
- isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: theme2.colors.textSecondary }) : /* @__PURE__ */ jsx(ChevronRight, { size: 16, color: theme2.colors.textSecondary }),
8561
- /* @__PURE__ */ jsx(Package, { size: 18, color: theme2.colors.accent }),
8562
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
8563
- /* @__PURE__ */ jsx(
8564
- "div",
8565
- {
8566
- style: {
8567
- fontSize: theme2.fontSizes[2],
8568
- fontWeight: 600,
8569
- overflow: "hidden",
8570
- textOverflow: "ellipsis",
8571
- whiteSpace: "nowrap"
8572
- },
8573
- children: pkg.packageData.name
8574
- }
8575
- ),
8576
- pkg.packageData.version && /* @__PURE__ */ jsxs(
8577
- "div",
8578
- {
8579
- style: {
8580
- fontSize: theme2.fontSizes[0],
8581
- color: theme2.colors.textSecondary
8582
- },
8583
- children: [
8584
- "v",
8585
- pkg.packageData.version
8586
- ]
8587
- }
8588
- )
8589
- ] }),
8590
- pkg.packageData.path && /* @__PURE__ */ jsxs(
8591
- "button",
8592
- {
8593
- onClick: (e) => {
8594
- e.stopPropagation();
8595
- onPackageClick == null ? void 0 : onPackageClick(pkg.packageData.path);
8596
- },
8597
- style: {
8598
- display: "flex",
8599
- alignItems: "center",
8600
- gap: "4px",
8601
- padding: "4px 8px",
8602
- backgroundColor: theme2.colors.backgroundTertiary,
8603
- border: `1px solid ${theme2.colors.border}`,
8604
- borderRadius: "4px",
8605
- color: theme2.colors.textSecondary,
8606
- fontSize: theme2.fontSizes[0],
8607
- cursor: "pointer"
8608
- },
8609
- title: "Open package folder",
8610
- children: [
8611
- /* @__PURE__ */ jsx(Folder, { size: 12 }),
8612
- pkg.packageData.path || "/"
8613
- ]
8614
- }
8615
- )
8616
- ]
8617
- }
8618
- ),
8619
- isExpanded && /* @__PURE__ */ jsxs("div", { style: { borderTop: `1px solid ${theme2.colors.border}` }, children: [
8620
- /* @__PURE__ */ jsx(
8621
- "div",
8622
- {
8623
- style: {
8624
- display: "flex",
8625
- backgroundColor: theme2.colors.backgroundTertiary,
8626
- borderBottom: `1px solid ${theme2.colors.border}`
8627
- },
8628
- children: [
8629
- { id: "commands", label: "Commands", count: commands.length },
8630
- { id: "configs", label: "Configs", count: configFiles.length }
8631
- ].map((tab) => /* @__PURE__ */ jsxs(
8632
- "button",
8633
- {
8634
- onClick: () => setActiveTab(tab.id),
8635
- style: {
8636
- flex: 1,
8637
- padding: "8px 12px",
8638
- backgroundColor: activeTab === tab.id ? theme2.colors.backgroundSecondary : "transparent",
8639
- border: "none",
8640
- borderBottom: activeTab === tab.id ? `2px solid ${theme2.colors.accent}` : "2px solid transparent",
8641
- color: activeTab === tab.id ? theme2.colors.text : theme2.colors.textSecondary,
8642
- fontSize: theme2.fontSizes[1],
8643
- cursor: "pointer",
8644
- display: "flex",
8645
- alignItems: "center",
8646
- justifyContent: "center",
8647
- gap: "6px"
8648
- },
8649
- children: [
8650
- tab.label,
8651
- /* @__PURE__ */ jsx(
8652
- "span",
8653
- {
8654
- style: {
8655
- backgroundColor: theme2.colors.backgroundTertiary,
8656
- padding: "1px 6px",
8657
- borderRadius: "10px",
8658
- fontSize: theme2.fontSizes[0]
8659
- },
8660
- children: tab.count
8661
- }
8662
- )
8663
- ]
8664
- },
8665
- tab.id
8666
- ))
8667
- }
8668
- ),
8669
- /* @__PURE__ */ jsxs("div", { style: { padding: "12px", maxHeight: "300px", overflow: "auto" }, children: [
8670
- 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(
8671
- "button",
8770
+ onClick: onClose,
8771
+ children: /* @__PURE__ */ jsxs(
8772
+ "div",
8773
+ {
8774
+ style: {
8775
+ backgroundColor: theme2.colors.background,
8776
+ borderRadius: `${theme2.radii[3]}px`,
8777
+ maxWidth: "600px",
8778
+ maxHeight: "80vh",
8779
+ width: "90%",
8780
+ overflow: "hidden",
8781
+ display: "flex",
8782
+ flexDirection: "column",
8783
+ boxShadow: theme2.shadows[3]
8784
+ },
8785
+ onClick: (e) => e.stopPropagation(),
8786
+ children: [
8787
+ /* @__PURE__ */ jsxs(
8788
+ "div",
8672
8789
  {
8673
- onClick: () => onCommandClick == null ? void 0 : onCommandClick(cmd, pkg.packageData.path),
8674
8790
  style: {
8791
+ padding: `${theme2.space[4]}px`,
8792
+ borderBottom: `1px solid ${theme2.colors.border}`,
8675
8793
  display: "flex",
8676
8794
  alignItems: "center",
8677
- gap: "8px",
8678
- padding: "8px 12px",
8679
- backgroundColor: theme2.colors.backgroundTertiary,
8680
- border: `1px solid ${theme2.colors.border}`,
8681
- borderRadius: "6px",
8682
- color: theme2.colors.text,
8683
- cursor: "pointer",
8684
- textAlign: "left"
8795
+ justifyContent: "space-between"
8685
8796
  },
8686
8797
  children: [
8687
- /* @__PURE__ */ jsx(Terminal, { size: 14, color: theme2.colors.accent }),
8688
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
8689
- /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: cmd.name }),
8690
- /* @__PURE__ */ jsx(
8691
- "div",
8692
- {
8693
- style: {
8694
- fontSize: theme2.fontSizes[0],
8695
- color: theme2.colors.textSecondary,
8696
- fontFamily: "monospace",
8697
- overflow: "hidden",
8698
- textOverflow: "ellipsis",
8699
- whiteSpace: "nowrap"
8700
- },
8701
- children: cmd.command
8702
- }
8703
- )
8704
- ] }),
8705
- cmd.isLensCommand && /* @__PURE__ */ jsx(
8706
- "span",
8798
+ /* @__PURE__ */ jsxs(
8799
+ "h2",
8707
8800
  {
8708
8801
  style: {
8709
- padding: "2px 6px",
8710
- backgroundColor: theme2.colors.accent + "20",
8711
- color: theme2.colors.accent,
8712
- borderRadius: "4px",
8713
- fontSize: theme2.fontSizes[0]
8802
+ fontSize: `${theme2.fontSizes[4]}px`,
8803
+ fontWeight: theme2.fontWeights.semibold,
8804
+ color: theme2.colors.text,
8805
+ display: "flex",
8806
+ alignItems: "center",
8807
+ gap: `${theme2.space[2]}px`,
8808
+ margin: 0
8714
8809
  },
8715
- children: cmd.lensId
8810
+ children: [
8811
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 20 }),
8812
+ "Understanding Dependencies"
8813
+ ]
8716
8814
  }
8717
8815
  ),
8718
- /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
8816
+ /* @__PURE__ */ jsx(
8817
+ "button",
8818
+ {
8819
+ onClick: onClose,
8820
+ style: {
8821
+ background: "none",
8822
+ border: "none",
8823
+ color: theme2.colors.textSecondary,
8824
+ cursor: "pointer",
8825
+ padding: `${theme2.space[1]}px`
8826
+ },
8827
+ children: /* @__PURE__ */ jsx(X, { size: 20 })
8828
+ }
8829
+ )
8719
8830
  ]
8720
- },
8721
- idx
8722
- )) }),
8723
- 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(
8724
- "button",
8831
+ }
8832
+ ),
8833
+ /* @__PURE__ */ jsxs(
8834
+ "div",
8725
8835
  {
8726
- onClick: () => onConfigClick == null ? void 0 : onConfigClick(config),
8727
8836
  style: {
8728
- display: "flex",
8729
- alignItems: "center",
8730
- gap: "8px",
8731
- padding: "8px 12px",
8732
- backgroundColor: theme2.colors.backgroundTertiary,
8733
- border: `1px solid ${theme2.colors.border}`,
8734
- borderRadius: "6px",
8735
- color: theme2.colors.text,
8736
- cursor: "pointer",
8737
- textAlign: "left"
8837
+ padding: `${theme2.space[4]}px`,
8838
+ overflow: "auto",
8839
+ flex: 1
8738
8840
  },
8739
8841
  children: [
8740
- /* @__PURE__ */ jsx(Settings, { size: 14, color: theme2.colors.textSecondary }),
8741
- /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
8742
- /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: config.name }),
8743
- /* @__PURE__ */ jsx(
8744
- "div",
8745
- {
8746
- style: {
8747
- fontSize: theme2.fontSizes[0],
8748
- color: theme2.colors.textSecondary,
8749
- fontFamily: "monospace"
8750
- },
8751
- children: config.path
8752
- }
8753
- )
8754
- ] }),
8755
- config.isInline && /* @__PURE__ */ jsx(
8756
- "span",
8842
+ /* @__PURE__ */ jsxs(
8843
+ Section,
8757
8844
  {
8758
- style: {
8759
- padding: "2px 6px",
8760
- backgroundColor: theme2.colors.textSecondary + "20",
8761
- color: theme2.colors.textSecondary,
8762
- borderRadius: "4px",
8763
- fontSize: theme2.fontSizes[0]
8764
- },
8765
- children: "inline"
8845
+ icon: /* @__PURE__ */ jsx(Package, { size: 18 }),
8846
+ title: "Dependency Types",
8847
+ theme: theme2,
8848
+ children: [
8849
+ /* @__PURE__ */ jsx(
8850
+ InfoItem,
8851
+ {
8852
+ badge: { text: "prod", color: theme2.colors.primary },
8853
+ title: "Production Dependencies",
8854
+ description: "Required for your application to run in production. These are bundled with your app and affect its size and security.",
8855
+ theme: theme2
8856
+ }
8857
+ ),
8858
+ /* @__PURE__ */ jsx(
8859
+ InfoItem,
8860
+ {
8861
+ badge: { text: "dev", color: theme2.colors.secondary },
8862
+ title: "Development Dependencies",
8863
+ description: "Only needed during development (build tools, testing, linters). Not included in production builds.",
8864
+ theme: theme2
8865
+ }
8866
+ ),
8867
+ /* @__PURE__ */ jsx(
8868
+ InfoItem,
8869
+ {
8870
+ badge: { text: "peer", color: theme2.colors.accent },
8871
+ title: "Peer Dependencies",
8872
+ description: "Expected to be provided by the consumer of your package. Important for library authors to specify compatibility.",
8873
+ theme: theme2
8874
+ }
8875
+ )
8876
+ ]
8877
+ }
8878
+ ),
8879
+ /* @__PURE__ */ jsxs(
8880
+ Section,
8881
+ {
8882
+ icon: /* @__PURE__ */ jsx(Scale, { size: 18 }),
8883
+ title: "Common Licenses",
8884
+ theme: theme2,
8885
+ children: [
8886
+ /* @__PURE__ */ jsx(
8887
+ InfoItem,
8888
+ {
8889
+ badge: { text: "MIT", color: theme2.colors.success },
8890
+ title: "Permissive Licenses (MIT, Apache, BSD)",
8891
+ description: "Few restrictions. Can use in commercial projects. Must include copyright notice.",
8892
+ theme: theme2
8893
+ }
8894
+ ),
8895
+ /* @__PURE__ */ jsx(
8896
+ InfoItem,
8897
+ {
8898
+ badge: { text: "GPL", color: theme2.colors.warning },
8899
+ title: "Copyleft Licenses (GPL, LGPL, AGPL)",
8900
+ description: "Requires sharing source code of derivative works. Can impact your project's licensing.",
8901
+ theme: theme2
8902
+ }
8903
+ )
8904
+ ]
8766
8905
  }
8767
8906
  )
8768
8907
  ]
8769
- },
8770
- idx
8771
- )) })
8772
- ] })
8773
- ] })
8774
- ]
8908
+ }
8909
+ )
8910
+ ]
8911
+ }
8912
+ )
8775
8913
  }
8776
- );
8777
- };
8778
- const PackageCompositionPanelContent = ({
8779
- packages,
8780
- isLoading = false,
8781
- emptyMessage = "No packages detected",
8782
- onCommandClick,
8783
- onConfigClick,
8784
- onPackageClick
8785
- }) => {
8786
- const { theme: theme2 } = useTheme();
8787
- const [expandedPackages, setExpandedPackages] = useState(/* @__PURE__ */ new Set());
8788
- const togglePackage = (packageId) => {
8789
- setExpandedPackages((prev) => {
8790
- const next = new Set(prev);
8791
- if (next.has(packageId)) {
8792
- next.delete(packageId);
8793
- } else {
8794
- next.add(packageId);
8795
- }
8796
- return next;
8797
- });
8798
- };
8799
- React2.useEffect(() => {
8800
- if (packages.length > 0 && expandedPackages.size === 0) {
8801
- setExpandedPackages(/* @__PURE__ */ new Set([packages[0].id]));
8802
- }
8803
- }, [packages, expandedPackages.size]);
8804
- if (isLoading) {
8805
- return /* @__PURE__ */ jsx(
8806
- "div",
8807
- {
8808
- style: {
8809
- padding: "20px",
8810
- textAlign: "center",
8811
- color: theme2.colors.textSecondary
8812
- },
8813
- children: "Loading packages..."
8814
- }
8815
- );
8816
- }
8817
- if (packages.length === 0) {
8818
- return /* @__PURE__ */ jsx(
8819
- "div",
8820
- {
8821
- style: {
8822
- padding: "20px",
8823
- textAlign: "center",
8824
- color: theme2.colors.textSecondary
8825
- },
8826
- children: emptyMessage
8827
- }
8828
- );
8829
- }
8830
- const sortedPackages = [...packages].sort((a, b) => {
8831
- if (a.packageData.isMonorepoRoot && !b.packageData.isMonorepoRoot) return -1;
8832
- if (!a.packageData.isMonorepoRoot && b.packageData.isMonorepoRoot) return 1;
8833
- return a.packageData.path.localeCompare(b.packageData.path);
8834
- });
8835
- return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
8836
- /* @__PURE__ */ jsxs(
8837
- "div",
8838
- {
8839
- style: {
8840
- padding: "12px 16px",
8841
- borderBottom: `1px solid ${theme2.colors.border}`,
8842
- display: "flex",
8843
- alignItems: "center",
8844
- gap: "8px"
8845
- },
8846
- children: [
8847
- /* @__PURE__ */ jsx(FileCode, { size: 16, color: theme2.colors.accent }),
8848
- /* @__PURE__ */ jsxs("span", { style: { fontSize: theme2.fontSizes[1], color: theme2.colors.textSecondary }, children: [
8849
- packages.length,
8850
- " package",
8851
- packages.length !== 1 ? "s" : "",
8852
- " detected"
8853
- ] })
8854
- ]
8855
- }
8856
- ),
8857
- /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "auto", padding: "12px", display: "flex", flexDirection: "column", gap: "8px" }, children: sortedPackages.map((pkg) => /* @__PURE__ */ jsx(
8858
- PackageCard,
8859
- {
8860
- pkg,
8861
- isExpanded: expandedPackages.has(pkg.id),
8862
- onToggle: () => togglePackage(pkg.id),
8863
- onCommandClick,
8864
- onConfigClick,
8865
- onPackageClick
8866
- },
8867
- pkg.id
8868
- )) })
8869
- ] });
8870
- };
8871
- const PackageCompositionPanelPreview = () => {
8872
- const { theme: theme2 } = useTheme();
8873
- return /* @__PURE__ */ jsxs(
8874
- "div",
8875
- {
8876
- style: {
8877
- padding: "12px",
8878
- fontSize: "12px",
8879
- color: theme2.colors.text,
8880
- display: "flex",
8881
- flexDirection: "column",
8882
- gap: "6px"
8883
- },
8884
- children: [
8885
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
8886
- /* @__PURE__ */ jsx(Package, { size: 14, color: theme2.colors.accent }),
8887
- /* @__PURE__ */ jsx("span", { children: "my-app" })
8888
- ] }),
8889
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
8890
- /* @__PURE__ */ jsx(Terminal, { size: 12, color: theme2.colors.textSecondary }),
8891
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "5 commands" })
8892
- ] }),
8893
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
8894
- /* @__PURE__ */ jsx(Settings, { size: 12, color: theme2.colors.textSecondary }),
8895
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "3 configs" })
8896
- ] })
8897
- ]
8898
- }
8899
- );
8900
- };
8901
- const PackageCompositionPanel = ({ context }) => {
8902
- const packagesSlice = context.getSlice("packages");
8903
- const packages = (packagesSlice == null ? void 0 : packagesSlice.data) ?? [];
8904
- const isLoading = (packagesSlice == null ? void 0 : packagesSlice.loading) || false;
8905
- return /* @__PURE__ */ jsx(
8906
- PackageCompositionPanelContent,
8907
- {
8908
- packages,
8909
- isLoading
8910
- }
8911
- );
8912
- };
8913
- const DependencyInfoModal = ({
8914
- isOpen,
8915
- onClose
8916
- }) => {
8917
- const { theme: theme2 } = useTheme();
8918
- if (!isOpen) return null;
8919
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
8920
- "div",
8921
- {
8922
- style: {
8923
- position: "fixed",
8924
- top: 0,
8925
- left: 0,
8926
- right: 0,
8927
- bottom: 0,
8928
- backgroundColor: theme2.colors.muted,
8929
- zIndex: theme2.zIndices[4],
8930
- display: "flex",
8931
- alignItems: "center",
8932
- justifyContent: "center"
8933
- },
8934
- onClick: onClose,
8935
- children: /* @__PURE__ */ jsxs(
8936
- "div",
8937
- {
8938
- style: {
8939
- backgroundColor: theme2.colors.background,
8940
- borderRadius: `${theme2.radii[3]}px`,
8941
- maxWidth: "600px",
8942
- maxHeight: "80vh",
8943
- width: "90%",
8944
- overflow: "hidden",
8945
- display: "flex",
8946
- flexDirection: "column",
8947
- boxShadow: theme2.shadows[3]
8948
- },
8949
- onClick: (e) => e.stopPropagation(),
8950
- children: [
8951
- /* @__PURE__ */ jsxs(
8952
- "div",
8953
- {
8954
- style: {
8955
- padding: `${theme2.space[4]}px`,
8956
- borderBottom: `1px solid ${theme2.colors.border}`,
8957
- display: "flex",
8958
- alignItems: "center",
8959
- justifyContent: "space-between"
8960
- },
8961
- children: [
8962
- /* @__PURE__ */ jsxs(
8963
- "h2",
8964
- {
8965
- style: {
8966
- fontSize: `${theme2.fontSizes[4]}px`,
8967
- fontWeight: theme2.fontWeights.semibold,
8968
- color: theme2.colors.text,
8969
- display: "flex",
8970
- alignItems: "center",
8971
- gap: `${theme2.space[2]}px`,
8972
- margin: 0
8973
- },
8974
- children: [
8975
- /* @__PURE__ */ jsx(CircleQuestionMark, { size: 20 }),
8976
- "Understanding Dependencies"
8977
- ]
8978
- }
8979
- ),
8980
- /* @__PURE__ */ jsx(
8981
- "button",
8982
- {
8983
- onClick: onClose,
8984
- style: {
8985
- background: "none",
8986
- border: "none",
8987
- color: theme2.colors.textSecondary,
8988
- cursor: "pointer",
8989
- padding: `${theme2.space[1]}px`
8990
- },
8991
- children: /* @__PURE__ */ jsx(X, { size: 20 })
8992
- }
8993
- )
8994
- ]
8995
- }
8996
- ),
8997
- /* @__PURE__ */ jsxs(
8998
- "div",
8999
- {
9000
- style: {
9001
- padding: `${theme2.space[4]}px`,
9002
- overflow: "auto",
9003
- flex: 1
9004
- },
9005
- children: [
9006
- /* @__PURE__ */ jsxs(
9007
- Section,
9008
- {
9009
- icon: /* @__PURE__ */ jsx(Package, { size: 18 }),
9010
- title: "Dependency Types",
9011
- theme: theme2,
9012
- children: [
9013
- /* @__PURE__ */ jsx(
9014
- InfoItem,
9015
- {
9016
- badge: { text: "prod", color: theme2.colors.primary },
9017
- title: "Production Dependencies",
9018
- description: "Required for your application to run in production. These are bundled with your app and affect its size and security.",
9019
- theme: theme2
9020
- }
9021
- ),
9022
- /* @__PURE__ */ jsx(
9023
- InfoItem,
9024
- {
9025
- badge: { text: "dev", color: theme2.colors.secondary },
9026
- title: "Development Dependencies",
9027
- description: "Only needed during development (build tools, testing, linters). Not included in production builds.",
9028
- theme: theme2
9029
- }
9030
- ),
9031
- /* @__PURE__ */ jsx(
9032
- InfoItem,
9033
- {
9034
- badge: { text: "peer", color: theme2.colors.accent },
9035
- title: "Peer Dependencies",
9036
- description: "Expected to be provided by the consumer of your package. Important for library authors to specify compatibility.",
9037
- theme: theme2
9038
- }
9039
- )
9040
- ]
9041
- }
9042
- ),
9043
- /* @__PURE__ */ jsxs(
9044
- Section,
9045
- {
9046
- icon: /* @__PURE__ */ jsx(Scale, { size: 18 }),
9047
- title: "Common Licenses",
9048
- theme: theme2,
9049
- children: [
9050
- /* @__PURE__ */ jsx(
9051
- InfoItem,
9052
- {
9053
- badge: { text: "MIT", color: theme2.colors.success },
9054
- title: "Permissive Licenses (MIT, Apache, BSD)",
9055
- description: "Few restrictions. Can use in commercial projects. Must include copyright notice.",
9056
- theme: theme2
9057
- }
9058
- ),
9059
- /* @__PURE__ */ jsx(
9060
- InfoItem,
9061
- {
9062
- badge: { text: "GPL", color: theme2.colors.warning },
9063
- title: "Copyleft Licenses (GPL, LGPL, AGPL)",
9064
- description: "Requires sharing source code of derivative works. Can impact your project's licensing.",
9065
- theme: theme2
9066
- }
9067
- )
9068
- ]
9069
- }
9070
- )
9071
- ]
9072
- }
9073
- )
9074
- ]
9075
- }
9076
- )
9077
- }
9078
- ) });
8914
+ ) });
9079
8915
  };
9080
8916
  const Section = ({ icon, title, theme: theme2, children }) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: `${theme2.space[5]}px` }, children: [
9081
8917
  /* @__PURE__ */ jsxs(
@@ -9455,12 +9291,12 @@ const FilterBar = ({
9455
9291
  }
9456
9292
  );
9457
9293
  };
9458
- const dependencyTypeOrder = {
9294
+ const dependencyTypeOrder$1 = {
9459
9295
  peer: 0,
9460
9296
  production: 1,
9461
9297
  development: 2
9462
9298
  };
9463
- function extractDependencies(packageLayer) {
9299
+ function extractDependencies$1(packageLayer) {
9464
9300
  const { dependencies, devDependencies, peerDependencies } = packageLayer.packageData;
9465
9301
  const items2 = [];
9466
9302
  if (dependencies) {
@@ -9479,54 +9315,243 @@ function extractDependencies(packageLayer) {
9479
9315
  });
9480
9316
  }
9481
9317
  return items2.sort((a, b) => {
9482
- const typeCompare = dependencyTypeOrder[a.dependencyType] - dependencyTypeOrder[b.dependencyType];
9318
+ const typeCompare = dependencyTypeOrder$1[a.dependencyType] - dependencyTypeOrder$1[b.dependencyType];
9483
9319
  if (typeCompare !== 0) return typeCompare;
9484
9320
  return a.name.localeCompare(b.name);
9485
9321
  });
9486
9322
  }
9487
- const DependenciesPanelContent = ({
9488
- context
9489
- }) => {
9490
- var _a;
9323
+ function findInternalDependencies(pkg, allPackages) {
9324
+ const currentName = pkg.packageData.name;
9325
+ const allDeps = /* @__PURE__ */ new Set([
9326
+ ...Object.keys(pkg.packageData.dependencies || {}),
9327
+ ...Object.keys(pkg.packageData.devDependencies || {}),
9328
+ ...Object.keys(pkg.packageData.peerDependencies || {})
9329
+ ]);
9330
+ const dependsOn = allPackages.filter(
9331
+ (p) => p.packageData.name !== currentName && allDeps.has(p.packageData.name)
9332
+ );
9333
+ const usedBy = allPackages.filter((other) => {
9334
+ if (other.packageData.name === currentName) return false;
9335
+ const otherDeps = /* @__PURE__ */ new Set([
9336
+ ...Object.keys(other.packageData.dependencies || {}),
9337
+ ...Object.keys(other.packageData.devDependencies || {}),
9338
+ ...Object.keys(other.packageData.peerDependencies || {})
9339
+ ]);
9340
+ return otherDeps.has(currentName);
9341
+ });
9342
+ return { dependsOn, usedBy };
9343
+ }
9344
+ const PackageSummaryCard = ({ pkg, allPackages, onClick }) => {
9345
+ var _a;
9491
9346
  const { theme: theme2 } = useTheme();
9492
- const [selectedPackagePath, setSelectedPackagePath] = useState(
9493
- null
9347
+ const deps = pkg.packageData.dependencies || {};
9348
+ const devDeps = pkg.packageData.devDependencies || {};
9349
+ const peerDeps = pkg.packageData.peerDependencies || {};
9350
+ const totalDeps = Object.keys(deps).length + Object.keys(devDeps).length + Object.keys(peerDeps).length;
9351
+ const configFiles = pkg.configFiles ? Object.values(pkg.configFiles).filter((c) => c == null ? void 0 : c.exists).length : 0;
9352
+ const commands = ((_a = pkg.packageData.availableCommands) == null ? void 0 : _a.length) || 0;
9353
+ const { dependsOn, usedBy } = useMemo(
9354
+ () => findInternalDependencies(pkg, allPackages),
9355
+ [pkg, allPackages]
9356
+ );
9357
+ const hasInternalDeps = dependsOn.length > 0 || usedBy.length > 0;
9358
+ const packageRole = useMemo(() => {
9359
+ if (dependsOn.length === 0 && usedBy.length === 0) {
9360
+ return null;
9361
+ }
9362
+ if (dependsOn.length === 0 && usedBy.length > 0) {
9363
+ return { label: "core", icon: Box, color: "#10b981" };
9364
+ }
9365
+ if (dependsOn.length > 0 && usedBy.length === 0) {
9366
+ return { label: "app", icon: Layers, color: "#8b5cf6" };
9367
+ }
9368
+ return { label: "shared", icon: LayoutGrid, color: "#f59e0b" };
9369
+ }, [dependsOn.length, usedBy.length]);
9370
+ return /* @__PURE__ */ jsxs(
9371
+ "button",
9372
+ {
9373
+ onClick,
9374
+ style: {
9375
+ display: "flex",
9376
+ flexDirection: "column",
9377
+ gap: "8px",
9378
+ padding: "12px",
9379
+ backgroundColor: theme2.colors.backgroundSecondary,
9380
+ border: `1px solid ${theme2.colors.border}`,
9381
+ borderRadius: "8px",
9382
+ cursor: "pointer",
9383
+ textAlign: "left",
9384
+ transition: "all 0.15s ease",
9385
+ width: "100%"
9386
+ },
9387
+ onMouseEnter: (e) => {
9388
+ e.currentTarget.style.borderColor = theme2.colors.accent;
9389
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary;
9390
+ },
9391
+ onMouseLeave: (e) => {
9392
+ e.currentTarget.style.borderColor = theme2.colors.border;
9393
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundSecondary;
9394
+ },
9395
+ children: [
9396
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
9397
+ /* @__PURE__ */ jsx(PackageManagerIcon, { packageManager: pkg.packageData.packageManager, size: 20 }),
9398
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
9399
+ /* @__PURE__ */ jsx(
9400
+ "div",
9401
+ {
9402
+ style: {
9403
+ fontSize: theme2.fontSizes[2],
9404
+ fontWeight: 600,
9405
+ color: theme2.colors.text,
9406
+ overflow: "hidden",
9407
+ textOverflow: "ellipsis",
9408
+ whiteSpace: "nowrap"
9409
+ },
9410
+ children: pkg.packageData.name
9411
+ }
9412
+ ),
9413
+ /* @__PURE__ */ jsxs(
9414
+ "div",
9415
+ {
9416
+ style: {
9417
+ fontSize: theme2.fontSizes[0],
9418
+ color: theme2.colors.textSecondary
9419
+ },
9420
+ children: [
9421
+ pkg.packageData.path || "/",
9422
+ pkg.packageData.version && ` • v${pkg.packageData.version}`
9423
+ ]
9424
+ }
9425
+ )
9426
+ ] }),
9427
+ packageRole && /* @__PURE__ */ jsxs(
9428
+ "span",
9429
+ {
9430
+ style: {
9431
+ display: "flex",
9432
+ alignItems: "center",
9433
+ gap: "4px",
9434
+ padding: "3px 8px",
9435
+ backgroundColor: packageRole.color + "20",
9436
+ color: packageRole.color,
9437
+ borderRadius: "4px",
9438
+ fontSize: theme2.fontSizes[0],
9439
+ fontWeight: 500,
9440
+ flexShrink: 0
9441
+ },
9442
+ children: [
9443
+ /* @__PURE__ */ jsx(packageRole.icon, { size: 12 }),
9444
+ packageRole.label
9445
+ ]
9446
+ }
9447
+ ),
9448
+ /* @__PURE__ */ jsx(ChevronRight, { size: 16, color: theme2.colors.textSecondary })
9449
+ ] }),
9450
+ hasInternalDeps && /* @__PURE__ */ jsxs(
9451
+ "div",
9452
+ {
9453
+ style: {
9454
+ display: "flex",
9455
+ flexDirection: "column",
9456
+ gap: "4px",
9457
+ fontSize: theme2.fontSizes[0]
9458
+ },
9459
+ children: [
9460
+ dependsOn.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children: [
9461
+ /* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.textSecondary, display: "flex", alignItems: "center", gap: "2px" }, children: [
9462
+ /* @__PURE__ */ jsx(ArrowRight, { size: 10 }),
9463
+ "uses"
9464
+ ] }),
9465
+ dependsOn.map((dep) => /* @__PURE__ */ jsx(
9466
+ "span",
9467
+ {
9468
+ style: {
9469
+ padding: "2px 6px",
9470
+ backgroundColor: theme2.colors.accent + "15",
9471
+ color: theme2.colors.accent,
9472
+ borderRadius: "4px",
9473
+ fontWeight: 500
9474
+ },
9475
+ children: dep.packageData.name
9476
+ },
9477
+ dep.id
9478
+ ))
9479
+ ] }),
9480
+ usedBy.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children: [
9481
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "used by" }),
9482
+ usedBy.map((dep) => /* @__PURE__ */ jsx(
9483
+ "span",
9484
+ {
9485
+ style: {
9486
+ padding: "2px 6px",
9487
+ backgroundColor: theme2.colors.textSecondary + "20",
9488
+ color: theme2.colors.textSecondary,
9489
+ borderRadius: "4px",
9490
+ fontWeight: 500
9491
+ },
9492
+ children: dep.packageData.name
9493
+ },
9494
+ dep.id
9495
+ ))
9496
+ ] })
9497
+ ]
9498
+ }
9499
+ ),
9500
+ /* @__PURE__ */ jsxs(
9501
+ "div",
9502
+ {
9503
+ style: {
9504
+ display: "flex",
9505
+ gap: "12px",
9506
+ fontSize: theme2.fontSizes[0],
9507
+ color: theme2.colors.textSecondary
9508
+ },
9509
+ children: [
9510
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
9511
+ /* @__PURE__ */ jsx(Terminal, { size: 12 }),
9512
+ /* @__PURE__ */ jsx("span", { children: commands })
9513
+ ] }),
9514
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
9515
+ /* @__PURE__ */ jsx(Settings, { size: 12 }),
9516
+ /* @__PURE__ */ jsx("span", { children: configFiles })
9517
+ ] }),
9518
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
9519
+ /* @__PURE__ */ jsx(Package, { size: 12 }),
9520
+ /* @__PURE__ */ jsx("span", { children: totalDeps })
9521
+ ] })
9522
+ ]
9523
+ }
9524
+ )
9525
+ ]
9526
+ }
9494
9527
  );
9528
+ };
9529
+ const PackageCard = ({
9530
+ pkg,
9531
+ isExpanded,
9532
+ onToggle,
9533
+ onCommandClick,
9534
+ onConfigClick,
9535
+ onPackageClick,
9536
+ standalone = false
9537
+ }) => {
9538
+ const { theme: theme2 } = useTheme();
9539
+ const [activeTab, setActiveTab] = useState("commands");
9495
9540
  const [activeFilters, setActiveFilters] = useState(/* @__PURE__ */ new Set());
9496
9541
  const [searchQuery, setSearchQuery] = useState("");
9497
9542
  const [showInfoModal, setShowInfoModal] = useState(false);
9498
- const packagesSlice = context.getSlice("packages");
9499
- const isLoading = context.isSliceLoading("packages");
9500
- const hasPackages = context.hasSlice("packages");
9501
- const packages = useMemo(() => {
9502
- var _a2;
9503
- return ((_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.packages) ?? [];
9504
- }, [(_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages]);
9505
- const effectiveSelectedPath = useMemo(() => {
9506
- if (selectedPackagePath !== null) return selectedPackagePath;
9507
- if (packages.length === 1) return packages[0].packageData.path;
9508
- const rootPackage = packages.find((p) => p.packageData.path === "");
9509
- if (rootPackage) return "";
9510
- return null;
9511
- }, [selectedPackagePath, packages]);
9512
- const selectedPackage = useMemo(() => {
9513
- if (effectiveSelectedPath === null) return null;
9514
- return packages.find((p) => p.packageData.path === effectiveSelectedPath);
9515
- }, [effectiveSelectedPath, packages]);
9516
- const dependencyItems = useMemo(() => {
9517
- if (!selectedPackage) return [];
9518
- return extractDependencies(selectedPackage);
9519
- }, [selectedPackage]);
9520
- const counts = useMemo(() => {
9521
- return {
9522
- all: dependencyItems.length,
9523
- production: dependencyItems.filter((d) => d.dependencyType === "production").length,
9524
- development: dependencyItems.filter(
9525
- (d) => d.dependencyType === "development"
9526
- ).length,
9527
- peer: dependencyItems.filter((d) => d.dependencyType === "peer").length
9528
- };
9529
- }, [dependencyItems]);
9543
+ const configFiles = useMemo(() => {
9544
+ if (!pkg.configFiles) return [];
9545
+ return Object.entries(pkg.configFiles).filter(([, config]) => config == null ? void 0 : config.exists).map(([name, config]) => ({ name, ...config }));
9546
+ }, [pkg.configFiles]);
9547
+ const commands = pkg.packageData.availableCommands || [];
9548
+ const dependencyItems = useMemo(() => extractDependencies$1(pkg), [pkg]);
9549
+ const depCounts = useMemo(() => ({
9550
+ all: dependencyItems.length,
9551
+ production: dependencyItems.filter((d) => d.dependencyType === "production").length,
9552
+ development: dependencyItems.filter((d) => d.dependencyType === "development").length,
9553
+ peer: dependencyItems.filter((d) => d.dependencyType === "peer").length
9554
+ }), [dependencyItems]);
9530
9555
  const handleToggleFilter = (type) => {
9531
9556
  setActiveFilters((prev) => {
9532
9557
  const next = new Set(prev);
@@ -9542,119 +9567,1096 @@ const DependenciesPanelContent = ({
9542
9567
  let filtered = [...dependencyItems];
9543
9568
  if (searchQuery.trim()) {
9544
9569
  const query = searchQuery.toLowerCase();
9545
- filtered = filtered.filter(
9546
- (dep) => dep.name.toLowerCase().includes(query)
9547
- );
9570
+ filtered = filtered.filter((dep) => dep.name.toLowerCase().includes(query));
9548
9571
  }
9549
9572
  const allTypes = ["production", "development", "peer"];
9550
- const availableTypes = allTypes.filter((t) => counts[t] > 0);
9573
+ const availableTypes = allTypes.filter((t) => depCounts[t] > 0);
9551
9574
  const isAllSelected = activeFilters.size === 0 || availableTypes.every((t) => activeFilters.has(t));
9552
9575
  if (!isAllSelected && activeFilters.size > 0) {
9553
9576
  filtered = filtered.filter((dep) => activeFilters.has(dep.dependencyType));
9554
9577
  }
9555
9578
  return filtered;
9556
- }, [dependencyItems, searchQuery, activeFilters, counts]);
9557
- if (isLoading) {
9558
- return /* @__PURE__ */ jsx(
9559
- "div",
9560
- {
9561
- style: {
9562
- padding: `${theme2.space[3]}px`,
9563
- height: "100%",
9564
- display: "flex",
9565
- alignItems: "center",
9566
- justifyContent: "center",
9567
- color: theme2.colors.textSecondary,
9568
- backgroundColor: theme2.colors.background,
9569
- fontFamily: theme2.fonts.body
9570
- },
9571
- children: "Loading packages..."
9572
- }
9573
- );
9574
- }
9575
- if (!hasPackages || packages.length === 0) {
9576
- return /* @__PURE__ */ jsxs(
9577
- "div",
9578
- {
9579
- style: {
9580
- padding: `${theme2.space[3]}px`,
9581
- height: "100%",
9582
- display: "flex",
9583
- flexDirection: "column",
9584
- alignItems: "center",
9585
- justifyContent: "center",
9586
- gap: `${theme2.space[2]}px`,
9587
- color: theme2.colors.textSecondary,
9588
- backgroundColor: theme2.colors.background,
9589
- fontFamily: theme2.fonts.body
9590
- },
9591
- children: [
9592
- /* @__PURE__ */ jsx(Package, { size: 32 }),
9593
- /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No package data available" })
9594
- ]
9595
- }
9596
- );
9597
- }
9598
- return /* @__PURE__ */ jsxs(
9599
- "div",
9600
- {
9601
- style: {
9602
- height: "100%",
9603
- display: "flex",
9604
- flexDirection: "column",
9605
- backgroundColor: theme2.colors.background,
9606
- color: theme2.colors.text,
9607
- fontFamily: theme2.fonts.body,
9608
- overflow: "hidden"
9609
- },
9610
- children: [
9611
- /* @__PURE__ */ jsxs(
9612
- "div",
9613
- {
9614
- style: {
9615
- flexShrink: 0,
9616
- padding: `${theme2.space[3]}px`,
9617
- paddingBottom: `${theme2.space[2]}px`,
9618
- display: "flex",
9619
- flexDirection: "column",
9620
- gap: `${theme2.space[2]}px`,
9621
- borderBottom: `1px solid ${theme2.colors.border}`
9622
- },
9623
- children: [
9624
- /* @__PURE__ */ jsxs(
9579
+ }, [dependencyItems, searchQuery, activeFilters, depCounts]);
9580
+ if (standalone) {
9581
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
9582
+ /* @__PURE__ */ jsxs(
9583
+ "div",
9584
+ {
9585
+ style: {
9586
+ display: "flex",
9587
+ alignItems: "center",
9588
+ gap: "8px",
9589
+ padding: "12px 16px",
9590
+ borderBottom: `1px solid ${theme2.colors.border}`
9591
+ },
9592
+ children: [
9593
+ /* @__PURE__ */ jsx(PackageManagerIcon, { packageManager: pkg.packageData.packageManager, size: 18 }),
9594
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
9595
+ /* @__PURE__ */ jsx(
9625
9596
  "div",
9626
9597
  {
9627
9598
  style: {
9628
- display: "flex",
9629
- alignItems: "center",
9630
- justifyContent: "space-between"
9599
+ fontSize: theme2.fontSizes[2],
9600
+ fontWeight: 600,
9601
+ color: theme2.colors.text,
9602
+ overflow: "hidden",
9603
+ textOverflow: "ellipsis",
9604
+ whiteSpace: "nowrap"
9605
+ },
9606
+ children: pkg.packageData.name
9607
+ }
9608
+ ),
9609
+ pkg.packageData.version && /* @__PURE__ */ jsxs(
9610
+ "div",
9611
+ {
9612
+ style: {
9613
+ fontSize: theme2.fontSizes[0],
9614
+ color: theme2.colors.textSecondary
9631
9615
  },
9632
9616
  children: [
9633
- /* @__PURE__ */ jsx(
9634
- "h3",
9635
- {
9636
- style: {
9637
- fontSize: `${theme2.fontSizes[2]}px`,
9638
- fontWeight: theme2.fontWeights.semibold,
9639
- color: theme2.colors.text,
9640
- display: "flex",
9641
- alignItems: "center",
9642
- gap: `${theme2.space[2]}px`,
9643
- margin: 0
9644
- },
9645
- children: packages.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
9646
- /* @__PURE__ */ jsx(Boxes, { size: 16 }),
9647
- "Monorepo Dependencies",
9648
- /* @__PURE__ */ jsxs(
9649
- "span",
9650
- {
9651
- style: {
9652
- fontSize: `${theme2.fontSizes[0]}px`,
9653
- fontWeight: theme2.fontWeights.body,
9654
- color: theme2.colors.textSecondary
9655
- },
9656
- children: [
9657
- "(",
9617
+ "v",
9618
+ pkg.packageData.version
9619
+ ]
9620
+ }
9621
+ )
9622
+ ] }),
9623
+ pkg.packageData.path && /* @__PURE__ */ jsxs(
9624
+ "button",
9625
+ {
9626
+ onClick: () => onPackageClick == null ? void 0 : onPackageClick(pkg.packageData.path),
9627
+ style: {
9628
+ display: "flex",
9629
+ alignItems: "center",
9630
+ gap: "4px",
9631
+ padding: "4px 8px",
9632
+ backgroundColor: theme2.colors.backgroundTertiary,
9633
+ border: `1px solid ${theme2.colors.border}`,
9634
+ borderRadius: "4px",
9635
+ color: theme2.colors.textSecondary,
9636
+ fontSize: theme2.fontSizes[0],
9637
+ cursor: "pointer"
9638
+ },
9639
+ title: "Open package folder",
9640
+ children: [
9641
+ /* @__PURE__ */ jsx(Folder, { size: 12 }),
9642
+ pkg.packageData.path || "/"
9643
+ ]
9644
+ }
9645
+ )
9646
+ ]
9647
+ }
9648
+ ),
9649
+ /* @__PURE__ */ jsx(
9650
+ "div",
9651
+ {
9652
+ style: {
9653
+ display: "flex",
9654
+ backgroundColor: theme2.colors.backgroundTertiary,
9655
+ borderBottom: `1px solid ${theme2.colors.border}`
9656
+ },
9657
+ children: [
9658
+ { id: "commands", label: "Commands", count: commands.length },
9659
+ { id: "configs", label: "Configs", count: configFiles.length },
9660
+ { id: "dependencies", label: "Dependencies", count: dependencyItems.length }
9661
+ ].map((tab) => /* @__PURE__ */ jsxs(
9662
+ "button",
9663
+ {
9664
+ onClick: () => setActiveTab(tab.id),
9665
+ style: {
9666
+ flex: 1,
9667
+ padding: "8px 12px",
9668
+ backgroundColor: activeTab === tab.id ? theme2.colors.backgroundSecondary : "transparent",
9669
+ border: "none",
9670
+ borderBottom: activeTab === tab.id ? `2px solid ${theme2.colors.accent}` : "2px solid transparent",
9671
+ color: activeTab === tab.id ? theme2.colors.text : theme2.colors.textSecondary,
9672
+ fontSize: theme2.fontSizes[1],
9673
+ cursor: "pointer",
9674
+ display: "flex",
9675
+ alignItems: "center",
9676
+ justifyContent: "center",
9677
+ gap: "6px"
9678
+ },
9679
+ children: [
9680
+ tab.label,
9681
+ /* @__PURE__ */ jsx(
9682
+ "span",
9683
+ {
9684
+ style: {
9685
+ backgroundColor: theme2.colors.backgroundTertiary,
9686
+ padding: "1px 6px",
9687
+ borderRadius: "10px",
9688
+ fontSize: theme2.fontSizes[0]
9689
+ },
9690
+ children: tab.count
9691
+ }
9692
+ )
9693
+ ]
9694
+ },
9695
+ tab.id
9696
+ ))
9697
+ }
9698
+ ),
9699
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, padding: activeTab === "dependencies" ? "0" : "12px", overflow: "auto" }, children: [
9700
+ 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(
9701
+ "button",
9702
+ {
9703
+ onClick: () => onCommandClick == null ? void 0 : onCommandClick(cmd, pkg.packageData.path),
9704
+ style: {
9705
+ display: "flex",
9706
+ alignItems: "center",
9707
+ gap: "8px",
9708
+ padding: "8px 12px",
9709
+ backgroundColor: theme2.colors.backgroundTertiary,
9710
+ border: `1px solid ${theme2.colors.border}`,
9711
+ borderRadius: "6px",
9712
+ color: theme2.colors.text,
9713
+ cursor: "pointer",
9714
+ textAlign: "left"
9715
+ },
9716
+ children: [
9717
+ /* @__PURE__ */ jsx(Terminal, { size: 14, color: theme2.colors.accent }),
9718
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
9719
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: cmd.name }),
9720
+ /* @__PURE__ */ jsx(
9721
+ "div",
9722
+ {
9723
+ style: {
9724
+ fontSize: theme2.fontSizes[0],
9725
+ color: theme2.colors.textSecondary,
9726
+ fontFamily: "monospace",
9727
+ overflow: "hidden",
9728
+ textOverflow: "ellipsis",
9729
+ whiteSpace: "nowrap"
9730
+ },
9731
+ children: cmd.command
9732
+ }
9733
+ )
9734
+ ] }),
9735
+ cmd.isLensCommand && /* @__PURE__ */ jsx(
9736
+ "span",
9737
+ {
9738
+ style: {
9739
+ padding: "2px 6px",
9740
+ backgroundColor: theme2.colors.accent + "20",
9741
+ color: theme2.colors.accent,
9742
+ borderRadius: "4px",
9743
+ fontSize: theme2.fontSizes[0]
9744
+ },
9745
+ children: cmd.lensId
9746
+ }
9747
+ ),
9748
+ /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
9749
+ ]
9750
+ },
9751
+ idx
9752
+ )) }),
9753
+ 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(
9754
+ "button",
9755
+ {
9756
+ onClick: () => onConfigClick == null ? void 0 : onConfigClick(config),
9757
+ style: {
9758
+ display: "flex",
9759
+ alignItems: "center",
9760
+ gap: "8px",
9761
+ padding: "8px 12px",
9762
+ backgroundColor: theme2.colors.backgroundTertiary,
9763
+ border: `1px solid ${theme2.colors.border}`,
9764
+ borderRadius: "6px",
9765
+ color: theme2.colors.text,
9766
+ cursor: "pointer",
9767
+ textAlign: "left"
9768
+ },
9769
+ children: [
9770
+ /* @__PURE__ */ jsx(Settings, { size: 14, color: theme2.colors.textSecondary }),
9771
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
9772
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: config.name }),
9773
+ /* @__PURE__ */ jsx(
9774
+ "div",
9775
+ {
9776
+ style: {
9777
+ fontSize: theme2.fontSizes[0],
9778
+ color: theme2.colors.textSecondary,
9779
+ fontFamily: "monospace"
9780
+ },
9781
+ children: config.path
9782
+ }
9783
+ )
9784
+ ] }),
9785
+ config.isInline && /* @__PURE__ */ jsx(
9786
+ "span",
9787
+ {
9788
+ style: {
9789
+ padding: "2px 6px",
9790
+ backgroundColor: theme2.colors.textSecondary + "20",
9791
+ color: theme2.colors.textSecondary,
9792
+ borderRadius: "4px",
9793
+ fontSize: theme2.fontSizes[0]
9794
+ },
9795
+ children: "inline"
9796
+ }
9797
+ )
9798
+ ]
9799
+ },
9800
+ idx
9801
+ )) }),
9802
+ activeTab === "dependencies" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
9803
+ dependencyItems.length === 0 ? /* @__PURE__ */ jsxs(
9804
+ "div",
9805
+ {
9806
+ style: {
9807
+ padding: "12px",
9808
+ color: theme2.colors.textSecondary,
9809
+ fontSize: theme2.fontSizes[1],
9810
+ display: "flex",
9811
+ alignItems: "center",
9812
+ justifyContent: "center",
9813
+ gap: "8px"
9814
+ },
9815
+ children: [
9816
+ /* @__PURE__ */ jsx(Package, { size: 16 }),
9817
+ "No dependencies"
9818
+ ]
9819
+ }
9820
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
9821
+ /* @__PURE__ */ jsx("div", { style: { padding: "12px", borderBottom: `1px solid ${theme2.colors.border}` }, children: /* @__PURE__ */ jsx(
9822
+ FilterBar,
9823
+ {
9824
+ activeFilters,
9825
+ onToggleFilter: handleToggleFilter,
9826
+ searchQuery,
9827
+ onSearchChange: setSearchQuery,
9828
+ counts: depCounts
9829
+ }
9830
+ ) }),
9831
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "auto", padding: "8px 12px" }, children: [
9832
+ /* @__PURE__ */ jsxs(
9833
+ "div",
9834
+ {
9835
+ style: {
9836
+ fontSize: theme2.fontSizes[0],
9837
+ color: theme2.colors.textSecondary,
9838
+ marginBottom: "8px"
9839
+ },
9840
+ children: [
9841
+ "Showing ",
9842
+ filteredDependencies.length,
9843
+ " of ",
9844
+ dependencyItems.length
9845
+ ]
9846
+ }
9847
+ ),
9848
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
9849
+ "div",
9850
+ {
9851
+ style: {
9852
+ padding: "12px",
9853
+ textAlign: "center",
9854
+ color: theme2.colors.textSecondary,
9855
+ fontSize: theme2.fontSizes[1]
9856
+ },
9857
+ children: "No dependencies match your filters"
9858
+ }
9859
+ ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
9860
+ DependencyRow,
9861
+ {
9862
+ dependency: dep
9863
+ },
9864
+ `${dep.name}-${dep.dependencyType}`
9865
+ )) })
9866
+ ] })
9867
+ ] }),
9868
+ /* @__PURE__ */ jsx(
9869
+ DependencyInfoModal,
9870
+ {
9871
+ isOpen: showInfoModal,
9872
+ onClose: () => setShowInfoModal(false)
9873
+ }
9874
+ )
9875
+ ] })
9876
+ ] })
9877
+ ] });
9878
+ }
9879
+ return /* @__PURE__ */ jsxs(
9880
+ "div",
9881
+ {
9882
+ style: {
9883
+ backgroundColor: theme2.colors.backgroundSecondary,
9884
+ borderRadius: "8px",
9885
+ border: `1px solid ${theme2.colors.border}`,
9886
+ overflow: "hidden"
9887
+ },
9888
+ children: [
9889
+ /* @__PURE__ */ jsxs(
9890
+ "button",
9891
+ {
9892
+ onClick: onToggle,
9893
+ style: {
9894
+ width: "100%",
9895
+ display: "flex",
9896
+ alignItems: "center",
9897
+ gap: "8px",
9898
+ padding: "12px 16px",
9899
+ backgroundColor: "transparent",
9900
+ border: "none",
9901
+ cursor: "pointer",
9902
+ color: theme2.colors.text,
9903
+ textAlign: "left"
9904
+ },
9905
+ children: [
9906
+ isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 16, color: theme2.colors.textSecondary }) : /* @__PURE__ */ jsx(ChevronRight, { size: 16, color: theme2.colors.textSecondary }),
9907
+ /* @__PURE__ */ jsx(PackageManagerIcon, { packageManager: pkg.packageData.packageManager, size: 18 }),
9908
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
9909
+ /* @__PURE__ */ jsx(
9910
+ "div",
9911
+ {
9912
+ style: {
9913
+ fontSize: theme2.fontSizes[2],
9914
+ fontWeight: 600,
9915
+ overflow: "hidden",
9916
+ textOverflow: "ellipsis",
9917
+ whiteSpace: "nowrap"
9918
+ },
9919
+ children: pkg.packageData.name
9920
+ }
9921
+ ),
9922
+ pkg.packageData.version && /* @__PURE__ */ jsxs(
9923
+ "div",
9924
+ {
9925
+ style: {
9926
+ fontSize: theme2.fontSizes[0],
9927
+ color: theme2.colors.textSecondary
9928
+ },
9929
+ children: [
9930
+ "v",
9931
+ pkg.packageData.version
9932
+ ]
9933
+ }
9934
+ )
9935
+ ] }),
9936
+ pkg.packageData.path && /* @__PURE__ */ jsxs(
9937
+ "button",
9938
+ {
9939
+ onClick: (e) => {
9940
+ e.stopPropagation();
9941
+ onPackageClick == null ? void 0 : onPackageClick(pkg.packageData.path);
9942
+ },
9943
+ style: {
9944
+ display: "flex",
9945
+ alignItems: "center",
9946
+ gap: "4px",
9947
+ padding: "4px 8px",
9948
+ backgroundColor: theme2.colors.backgroundTertiary,
9949
+ border: `1px solid ${theme2.colors.border}`,
9950
+ borderRadius: "4px",
9951
+ color: theme2.colors.textSecondary,
9952
+ fontSize: theme2.fontSizes[0],
9953
+ cursor: "pointer"
9954
+ },
9955
+ title: "Open package folder",
9956
+ children: [
9957
+ /* @__PURE__ */ jsx(Folder, { size: 12 }),
9958
+ pkg.packageData.path || "/"
9959
+ ]
9960
+ }
9961
+ )
9962
+ ]
9963
+ }
9964
+ ),
9965
+ isExpanded && /* @__PURE__ */ jsxs("div", { style: { borderTop: `1px solid ${theme2.colors.border}` }, children: [
9966
+ /* @__PURE__ */ jsx(
9967
+ "div",
9968
+ {
9969
+ style: {
9970
+ display: "flex",
9971
+ backgroundColor: theme2.colors.backgroundTertiary,
9972
+ borderBottom: `1px solid ${theme2.colors.border}`
9973
+ },
9974
+ children: [
9975
+ { id: "commands", label: "Commands", count: commands.length },
9976
+ { id: "configs", label: "Configs", count: configFiles.length },
9977
+ { id: "dependencies", label: "Deps", count: dependencyItems.length }
9978
+ ].map((tab) => /* @__PURE__ */ jsxs(
9979
+ "button",
9980
+ {
9981
+ onClick: () => setActiveTab(tab.id),
9982
+ style: {
9983
+ flex: 1,
9984
+ padding: "8px 12px",
9985
+ backgroundColor: activeTab === tab.id ? theme2.colors.backgroundSecondary : "transparent",
9986
+ border: "none",
9987
+ borderBottom: activeTab === tab.id ? `2px solid ${theme2.colors.accent}` : "2px solid transparent",
9988
+ color: activeTab === tab.id ? theme2.colors.text : theme2.colors.textSecondary,
9989
+ fontSize: theme2.fontSizes[1],
9990
+ cursor: "pointer",
9991
+ display: "flex",
9992
+ alignItems: "center",
9993
+ justifyContent: "center",
9994
+ gap: "6px"
9995
+ },
9996
+ children: [
9997
+ tab.label,
9998
+ /* @__PURE__ */ jsx(
9999
+ "span",
10000
+ {
10001
+ style: {
10002
+ backgroundColor: theme2.colors.backgroundTertiary,
10003
+ padding: "1px 6px",
10004
+ borderRadius: "10px",
10005
+ fontSize: theme2.fontSizes[0]
10006
+ },
10007
+ children: tab.count
10008
+ }
10009
+ )
10010
+ ]
10011
+ },
10012
+ tab.id
10013
+ ))
10014
+ }
10015
+ ),
10016
+ /* @__PURE__ */ jsxs("div", { style: { padding: activeTab === "dependencies" ? "0" : "12px", maxHeight: "300px", overflow: "auto" }, children: [
10017
+ 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(
10018
+ "button",
10019
+ {
10020
+ onClick: () => onCommandClick == null ? void 0 : onCommandClick(cmd, pkg.packageData.path),
10021
+ style: {
10022
+ display: "flex",
10023
+ alignItems: "center",
10024
+ gap: "8px",
10025
+ padding: "8px 12px",
10026
+ backgroundColor: theme2.colors.backgroundTertiary,
10027
+ border: `1px solid ${theme2.colors.border}`,
10028
+ borderRadius: "6px",
10029
+ color: theme2.colors.text,
10030
+ cursor: "pointer",
10031
+ textAlign: "left"
10032
+ },
10033
+ children: [
10034
+ /* @__PURE__ */ jsx(Terminal, { size: 14, color: theme2.colors.accent }),
10035
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
10036
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: cmd.name }),
10037
+ /* @__PURE__ */ jsx(
10038
+ "div",
10039
+ {
10040
+ style: {
10041
+ fontSize: theme2.fontSizes[0],
10042
+ color: theme2.colors.textSecondary,
10043
+ fontFamily: "monospace",
10044
+ overflow: "hidden",
10045
+ textOverflow: "ellipsis",
10046
+ whiteSpace: "nowrap"
10047
+ },
10048
+ children: cmd.command
10049
+ }
10050
+ )
10051
+ ] }),
10052
+ cmd.isLensCommand && /* @__PURE__ */ jsx(
10053
+ "span",
10054
+ {
10055
+ style: {
10056
+ padding: "2px 6px",
10057
+ backgroundColor: theme2.colors.accent + "20",
10058
+ color: theme2.colors.accent,
10059
+ borderRadius: "4px",
10060
+ fontSize: theme2.fontSizes[0]
10061
+ },
10062
+ children: cmd.lensId
10063
+ }
10064
+ ),
10065
+ /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
10066
+ ]
10067
+ },
10068
+ idx
10069
+ )) }),
10070
+ 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(
10071
+ "button",
10072
+ {
10073
+ onClick: () => onConfigClick == null ? void 0 : onConfigClick(config),
10074
+ style: {
10075
+ display: "flex",
10076
+ alignItems: "center",
10077
+ gap: "8px",
10078
+ padding: "8px 12px",
10079
+ backgroundColor: theme2.colors.backgroundTertiary,
10080
+ border: `1px solid ${theme2.colors.border}`,
10081
+ borderRadius: "6px",
10082
+ color: theme2.colors.text,
10083
+ cursor: "pointer",
10084
+ textAlign: "left"
10085
+ },
10086
+ children: [
10087
+ /* @__PURE__ */ jsx(Settings, { size: 14, color: theme2.colors.textSecondary }),
10088
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
10089
+ /* @__PURE__ */ jsx("div", { style: { fontWeight: 500, fontSize: theme2.fontSizes[1] }, children: config.name }),
10090
+ /* @__PURE__ */ jsx(
10091
+ "div",
10092
+ {
10093
+ style: {
10094
+ fontSize: theme2.fontSizes[0],
10095
+ color: theme2.colors.textSecondary,
10096
+ fontFamily: "monospace"
10097
+ },
10098
+ children: config.path
10099
+ }
10100
+ )
10101
+ ] }),
10102
+ config.isInline && /* @__PURE__ */ jsx(
10103
+ "span",
10104
+ {
10105
+ style: {
10106
+ padding: "2px 6px",
10107
+ backgroundColor: theme2.colors.textSecondary + "20",
10108
+ color: theme2.colors.textSecondary,
10109
+ borderRadius: "4px",
10110
+ fontSize: theme2.fontSizes[0]
10111
+ },
10112
+ children: "inline"
10113
+ }
10114
+ )
10115
+ ]
10116
+ },
10117
+ idx
10118
+ )) }),
10119
+ activeTab === "dependencies" && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
10120
+ dependencyItems.length === 0 ? /* @__PURE__ */ jsxs(
10121
+ "div",
10122
+ {
10123
+ style: {
10124
+ padding: "12px",
10125
+ color: theme2.colors.textSecondary,
10126
+ fontSize: theme2.fontSizes[1],
10127
+ display: "flex",
10128
+ alignItems: "center",
10129
+ justifyContent: "center",
10130
+ gap: "8px"
10131
+ },
10132
+ children: [
10133
+ /* @__PURE__ */ jsx(Package, { size: 16 }),
10134
+ "No dependencies"
10135
+ ]
10136
+ }
10137
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
10138
+ /* @__PURE__ */ jsx("div", { style: { padding: "12px", borderBottom: `1px solid ${theme2.colors.border}` }, children: /* @__PURE__ */ jsx(
10139
+ FilterBar,
10140
+ {
10141
+ activeFilters,
10142
+ onToggleFilter: handleToggleFilter,
10143
+ searchQuery,
10144
+ onSearchChange: setSearchQuery,
10145
+ counts: depCounts
10146
+ }
10147
+ ) }),
10148
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, overflow: "auto", padding: "8px 12px" }, children: [
10149
+ /* @__PURE__ */ jsxs(
10150
+ "div",
10151
+ {
10152
+ style: {
10153
+ fontSize: theme2.fontSizes[0],
10154
+ color: theme2.colors.textSecondary,
10155
+ marginBottom: "8px"
10156
+ },
10157
+ children: [
10158
+ "Showing ",
10159
+ filteredDependencies.length,
10160
+ " of ",
10161
+ dependencyItems.length
10162
+ ]
10163
+ }
10164
+ ),
10165
+ /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
10166
+ "div",
10167
+ {
10168
+ style: {
10169
+ padding: "12px",
10170
+ textAlign: "center",
10171
+ color: theme2.colors.textSecondary,
10172
+ fontSize: theme2.fontSizes[1]
10173
+ },
10174
+ children: "No dependencies match your filters"
10175
+ }
10176
+ ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
10177
+ DependencyRow,
10178
+ {
10179
+ dependency: dep
10180
+ },
10181
+ `${dep.name}-${dep.dependencyType}`
10182
+ )) })
10183
+ ] })
10184
+ ] }),
10185
+ /* @__PURE__ */ jsx(
10186
+ DependencyInfoModal,
10187
+ {
10188
+ isOpen: showInfoModal,
10189
+ onClose: () => setShowInfoModal(false)
10190
+ }
10191
+ )
10192
+ ] })
10193
+ ] })
10194
+ ] })
10195
+ ]
10196
+ }
10197
+ );
10198
+ };
10199
+ const PackageCompositionPanelContent = ({
10200
+ packages,
10201
+ isLoading = false,
10202
+ emptyMessage = "No packages detected",
10203
+ onCommandClick,
10204
+ onConfigClick,
10205
+ onPackageClick
10206
+ }) => {
10207
+ const { theme: theme2 } = useTheme();
10208
+ const [selectedPackageId, setSelectedPackageId] = useState(null);
10209
+ const sortedPackages = useMemo(() => {
10210
+ return [...packages].sort((a, b) => {
10211
+ if (a.packageData.isMonorepoRoot && !b.packageData.isMonorepoRoot) return -1;
10212
+ if (!a.packageData.isMonorepoRoot && b.packageData.isMonorepoRoot) return 1;
10213
+ return a.packageData.path.localeCompare(b.packageData.path);
10214
+ });
10215
+ }, [packages]);
10216
+ const selectedPackage = useMemo(() => {
10217
+ if (!selectedPackageId) return null;
10218
+ return packages.find((p) => p.id === selectedPackageId) || null;
10219
+ }, [selectedPackageId, packages]);
10220
+ if (isLoading) {
10221
+ return /* @__PURE__ */ jsx(
10222
+ "div",
10223
+ {
10224
+ style: {
10225
+ padding: "20px",
10226
+ textAlign: "center",
10227
+ color: theme2.colors.textSecondary
10228
+ },
10229
+ children: "Loading packages..."
10230
+ }
10231
+ );
10232
+ }
10233
+ if (packages.length === 0) {
10234
+ return /* @__PURE__ */ jsx(
10235
+ "div",
10236
+ {
10237
+ style: {
10238
+ padding: "20px",
10239
+ textAlign: "center",
10240
+ color: theme2.colors.textSecondary
10241
+ },
10242
+ children: emptyMessage
10243
+ }
10244
+ );
10245
+ }
10246
+ if (packages.length === 1) {
10247
+ return /* @__PURE__ */ jsx(
10248
+ PackageCard,
10249
+ {
10250
+ pkg: packages[0],
10251
+ isExpanded: true,
10252
+ onToggle: () => {
10253
+ },
10254
+ onCommandClick,
10255
+ onConfigClick,
10256
+ onPackageClick,
10257
+ standalone: true
10258
+ }
10259
+ );
10260
+ }
10261
+ return /* @__PURE__ */ jsx(
10262
+ "div",
10263
+ {
10264
+ style: {
10265
+ display: "flex",
10266
+ flexDirection: "column",
10267
+ height: "100%",
10268
+ overflow: "hidden",
10269
+ position: "relative"
10270
+ },
10271
+ children: /* @__PURE__ */ jsxs(
10272
+ "div",
10273
+ {
10274
+ style: {
10275
+ display: "flex",
10276
+ width: "200%",
10277
+ height: "100%",
10278
+ transform: selectedPackage ? "translateX(-50%)" : "translateX(0)",
10279
+ transition: "transform 0.25s ease-in-out"
10280
+ },
10281
+ children: [
10282
+ /* @__PURE__ */ jsxs(
10283
+ "div",
10284
+ {
10285
+ style: {
10286
+ width: "50%",
10287
+ height: "100%",
10288
+ display: "flex",
10289
+ flexDirection: "column",
10290
+ overflow: "hidden"
10291
+ },
10292
+ children: [
10293
+ /* @__PURE__ */ jsxs(
10294
+ "div",
10295
+ {
10296
+ style: {
10297
+ padding: "12px 16px",
10298
+ borderBottom: `1px solid ${theme2.colors.border}`,
10299
+ display: "flex",
10300
+ alignItems: "center",
10301
+ gap: "8px",
10302
+ flexShrink: 0
10303
+ },
10304
+ children: [
10305
+ /* @__PURE__ */ jsx(FileCode, { size: 16, color: theme2.colors.accent }),
10306
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: theme2.fontSizes[1], color: theme2.colors.textSecondary }, children: [
10307
+ packages.length,
10308
+ " packages"
10309
+ ] })
10310
+ ]
10311
+ }
10312
+ ),
10313
+ /* @__PURE__ */ jsx(
10314
+ "div",
10315
+ {
10316
+ style: {
10317
+ flex: 1,
10318
+ overflow: "auto",
10319
+ padding: "12px",
10320
+ display: "flex",
10321
+ flexDirection: "column",
10322
+ gap: "8px"
10323
+ },
10324
+ children: sortedPackages.map((pkg) => /* @__PURE__ */ jsx(
10325
+ PackageSummaryCard,
10326
+ {
10327
+ pkg,
10328
+ allPackages: packages,
10329
+ onClick: () => setSelectedPackageId(pkg.id)
10330
+ },
10331
+ pkg.id
10332
+ ))
10333
+ }
10334
+ )
10335
+ ]
10336
+ }
10337
+ ),
10338
+ /* @__PURE__ */ jsxs(
10339
+ "div",
10340
+ {
10341
+ style: {
10342
+ width: "50%",
10343
+ height: "100%",
10344
+ display: "flex",
10345
+ flexDirection: "column",
10346
+ overflow: "hidden"
10347
+ },
10348
+ children: [
10349
+ /* @__PURE__ */ jsx(
10350
+ "div",
10351
+ {
10352
+ style: {
10353
+ padding: "8px 12px",
10354
+ borderBottom: `1px solid ${theme2.colors.border}`,
10355
+ display: "flex",
10356
+ alignItems: "center",
10357
+ gap: "8px",
10358
+ flexShrink: 0
10359
+ },
10360
+ children: /* @__PURE__ */ jsxs(
10361
+ "button",
10362
+ {
10363
+ onClick: () => setSelectedPackageId(null),
10364
+ style: {
10365
+ display: "flex",
10366
+ alignItems: "center",
10367
+ gap: "4px",
10368
+ padding: "4px 8px",
10369
+ backgroundColor: "transparent",
10370
+ border: "none",
10371
+ borderRadius: "4px",
10372
+ color: theme2.colors.accent,
10373
+ fontSize: theme2.fontSizes[1],
10374
+ cursor: "pointer",
10375
+ transition: "background-color 0.15s ease"
10376
+ },
10377
+ onMouseEnter: (e) => {
10378
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary;
10379
+ },
10380
+ onMouseLeave: (e) => {
10381
+ e.currentTarget.style.backgroundColor = "transparent";
10382
+ },
10383
+ children: [
10384
+ /* @__PURE__ */ jsx(ChevronLeft, { size: 16 }),
10385
+ "All Packages"
10386
+ ]
10387
+ }
10388
+ )
10389
+ }
10390
+ ),
10391
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, overflow: "hidden" }, children: selectedPackage && /* @__PURE__ */ jsx(
10392
+ PackageCard,
10393
+ {
10394
+ pkg: selectedPackage,
10395
+ isExpanded: true,
10396
+ onToggle: () => {
10397
+ },
10398
+ onCommandClick,
10399
+ onConfigClick,
10400
+ onPackageClick,
10401
+ standalone: true
10402
+ }
10403
+ ) })
10404
+ ]
10405
+ }
10406
+ )
10407
+ ]
10408
+ }
10409
+ )
10410
+ }
10411
+ );
10412
+ };
10413
+ const PackageCompositionPanelPreview = () => {
10414
+ const { theme: theme2 } = useTheme();
10415
+ return /* @__PURE__ */ jsxs(
10416
+ "div",
10417
+ {
10418
+ style: {
10419
+ padding: "12px",
10420
+ fontSize: "12px",
10421
+ color: theme2.colors.text,
10422
+ display: "flex",
10423
+ flexDirection: "column",
10424
+ gap: "6px"
10425
+ },
10426
+ children: [
10427
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
10428
+ /* @__PURE__ */ jsx(PackageManagerIcon, { packageManager: "npm", size: 14 }),
10429
+ /* @__PURE__ */ jsx("span", { children: "my-app" })
10430
+ ] }),
10431
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
10432
+ /* @__PURE__ */ jsx(Terminal, { size: 12, color: theme2.colors.textSecondary }),
10433
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "5 commands" })
10434
+ ] }),
10435
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
10436
+ /* @__PURE__ */ jsx(Settings, { size: 12, color: theme2.colors.textSecondary }),
10437
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "3 configs" })
10438
+ ] }),
10439
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", paddingLeft: "8px" }, children: [
10440
+ /* @__PURE__ */ jsx(Package, { size: 12, color: theme2.colors.textSecondary }),
10441
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: "12 deps" })
10442
+ ] })
10443
+ ]
10444
+ }
10445
+ );
10446
+ };
10447
+ const PackageCompositionPanel = ({ context }) => {
10448
+ var _a;
10449
+ const packagesSlice = context.getSlice("packages");
10450
+ const packages = ((_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages) ?? [];
10451
+ const isLoading = (packagesSlice == null ? void 0 : packagesSlice.loading) || false;
10452
+ return /* @__PURE__ */ jsx(
10453
+ PackageCompositionPanelContent,
10454
+ {
10455
+ packages,
10456
+ isLoading
10457
+ }
10458
+ );
10459
+ };
10460
+ const dependencyTypeOrder = {
10461
+ peer: 0,
10462
+ production: 1,
10463
+ development: 2
10464
+ };
10465
+ function extractDependencies(packageLayer) {
10466
+ const { dependencies, devDependencies, peerDependencies } = packageLayer.packageData;
10467
+ const items2 = [];
10468
+ if (dependencies) {
10469
+ Object.entries(dependencies).forEach(([name, version]) => {
10470
+ items2.push({ name, version, dependencyType: "production" });
10471
+ });
10472
+ }
10473
+ if (devDependencies) {
10474
+ Object.entries(devDependencies).forEach(([name, version]) => {
10475
+ items2.push({ name, version, dependencyType: "development" });
10476
+ });
10477
+ }
10478
+ if (peerDependencies) {
10479
+ Object.entries(peerDependencies).forEach(([name, version]) => {
10480
+ items2.push({ name, version, dependencyType: "peer" });
10481
+ });
10482
+ }
10483
+ return items2.sort((a, b) => {
10484
+ const typeCompare = dependencyTypeOrder[a.dependencyType] - dependencyTypeOrder[b.dependencyType];
10485
+ if (typeCompare !== 0) return typeCompare;
10486
+ return a.name.localeCompare(b.name);
10487
+ });
10488
+ }
10489
+ const DependenciesPanelContent = ({
10490
+ context
10491
+ }) => {
10492
+ var _a;
10493
+ const { theme: theme2 } = useTheme();
10494
+ const [selectedPackagePath, setSelectedPackagePath] = useState(
10495
+ null
10496
+ );
10497
+ const [activeFilters, setActiveFilters] = useState(/* @__PURE__ */ new Set());
10498
+ const [searchQuery, setSearchQuery] = useState("");
10499
+ const [showInfoModal, setShowInfoModal] = useState(false);
10500
+ const packagesSlice = context.getSlice("packages");
10501
+ const isLoading = context.isSliceLoading("packages");
10502
+ const hasPackages = context.hasSlice("packages");
10503
+ const packages = useMemo(() => {
10504
+ var _a2;
10505
+ return ((_a2 = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a2.packages) ?? [];
10506
+ }, [(_a = packagesSlice == null ? void 0 : packagesSlice.data) == null ? void 0 : _a.packages]);
10507
+ const effectiveSelectedPath = useMemo(() => {
10508
+ if (selectedPackagePath !== null) return selectedPackagePath;
10509
+ if (packages.length === 1) return packages[0].packageData.path;
10510
+ const rootPackage = packages.find((p) => p.packageData.path === "");
10511
+ if (rootPackage) return "";
10512
+ return null;
10513
+ }, [selectedPackagePath, packages]);
10514
+ const selectedPackage = useMemo(() => {
10515
+ if (effectiveSelectedPath === null) return null;
10516
+ return packages.find((p) => p.packageData.path === effectiveSelectedPath);
10517
+ }, [effectiveSelectedPath, packages]);
10518
+ const dependencyItems = useMemo(() => {
10519
+ if (!selectedPackage) return [];
10520
+ return extractDependencies(selectedPackage);
10521
+ }, [selectedPackage]);
10522
+ const counts = useMemo(() => {
10523
+ return {
10524
+ all: dependencyItems.length,
10525
+ production: dependencyItems.filter((d) => d.dependencyType === "production").length,
10526
+ development: dependencyItems.filter(
10527
+ (d) => d.dependencyType === "development"
10528
+ ).length,
10529
+ peer: dependencyItems.filter((d) => d.dependencyType === "peer").length
10530
+ };
10531
+ }, [dependencyItems]);
10532
+ const handleToggleFilter = (type) => {
10533
+ setActiveFilters((prev) => {
10534
+ const next = new Set(prev);
10535
+ if (next.has(type)) {
10536
+ next.delete(type);
10537
+ } else {
10538
+ next.add(type);
10539
+ }
10540
+ return next;
10541
+ });
10542
+ };
10543
+ const filteredDependencies = useMemo(() => {
10544
+ let filtered = [...dependencyItems];
10545
+ if (searchQuery.trim()) {
10546
+ const query = searchQuery.toLowerCase();
10547
+ filtered = filtered.filter(
10548
+ (dep) => dep.name.toLowerCase().includes(query)
10549
+ );
10550
+ }
10551
+ const allTypes = ["production", "development", "peer"];
10552
+ const availableTypes = allTypes.filter((t) => counts[t] > 0);
10553
+ const isAllSelected = activeFilters.size === 0 || availableTypes.every((t) => activeFilters.has(t));
10554
+ if (!isAllSelected && activeFilters.size > 0) {
10555
+ filtered = filtered.filter((dep) => activeFilters.has(dep.dependencyType));
10556
+ }
10557
+ return filtered;
10558
+ }, [dependencyItems, searchQuery, activeFilters, counts]);
10559
+ if (isLoading) {
10560
+ return /* @__PURE__ */ jsx(
10561
+ "div",
10562
+ {
10563
+ style: {
10564
+ padding: `${theme2.space[3]}px`,
10565
+ height: "100%",
10566
+ display: "flex",
10567
+ alignItems: "center",
10568
+ justifyContent: "center",
10569
+ color: theme2.colors.textSecondary,
10570
+ backgroundColor: theme2.colors.background,
10571
+ fontFamily: theme2.fonts.body
10572
+ },
10573
+ children: "Loading packages..."
10574
+ }
10575
+ );
10576
+ }
10577
+ if (!hasPackages || packages.length === 0) {
10578
+ return /* @__PURE__ */ jsxs(
10579
+ "div",
10580
+ {
10581
+ style: {
10582
+ padding: `${theme2.space[3]}px`,
10583
+ height: "100%",
10584
+ display: "flex",
10585
+ flexDirection: "column",
10586
+ alignItems: "center",
10587
+ justifyContent: "center",
10588
+ gap: `${theme2.space[2]}px`,
10589
+ color: theme2.colors.textSecondary,
10590
+ backgroundColor: theme2.colors.background,
10591
+ fontFamily: theme2.fonts.body
10592
+ },
10593
+ children: [
10594
+ /* @__PURE__ */ jsx(Package, { size: 32 }),
10595
+ /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No package data available" })
10596
+ ]
10597
+ }
10598
+ );
10599
+ }
10600
+ return /* @__PURE__ */ jsxs(
10601
+ "div",
10602
+ {
10603
+ style: {
10604
+ height: "100%",
10605
+ display: "flex",
10606
+ flexDirection: "column",
10607
+ backgroundColor: theme2.colors.background,
10608
+ color: theme2.colors.text,
10609
+ fontFamily: theme2.fonts.body,
10610
+ overflow: "hidden"
10611
+ },
10612
+ children: [
10613
+ /* @__PURE__ */ jsxs(
10614
+ "div",
10615
+ {
10616
+ style: {
10617
+ flexShrink: 0,
10618
+ padding: `${theme2.space[3]}px`,
10619
+ paddingBottom: `${theme2.space[2]}px`,
10620
+ display: "flex",
10621
+ flexDirection: "column",
10622
+ gap: `${theme2.space[2]}px`,
10623
+ borderBottom: `1px solid ${theme2.colors.border}`
10624
+ },
10625
+ children: [
10626
+ /* @__PURE__ */ jsxs(
10627
+ "div",
10628
+ {
10629
+ style: {
10630
+ display: "flex",
10631
+ alignItems: "center",
10632
+ justifyContent: "space-between"
10633
+ },
10634
+ children: [
10635
+ /* @__PURE__ */ jsx(
10636
+ "h3",
10637
+ {
10638
+ style: {
10639
+ fontSize: `${theme2.fontSizes[2]}px`,
10640
+ fontWeight: theme2.fontWeights.semibold,
10641
+ color: theme2.colors.text,
10642
+ display: "flex",
10643
+ alignItems: "center",
10644
+ gap: `${theme2.space[2]}px`,
10645
+ margin: 0
10646
+ },
10647
+ children: packages.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
10648
+ /* @__PURE__ */ jsx(Boxes, { size: 16 }),
10649
+ "Monorepo Dependencies",
10650
+ /* @__PURE__ */ jsxs(
10651
+ "span",
10652
+ {
10653
+ style: {
10654
+ fontSize: `${theme2.fontSizes[0]}px`,
10655
+ fontWeight: theme2.fontWeights.body,
10656
+ color: theme2.colors.textSecondary
10657
+ },
10658
+ children: [
10659
+ "(",
9658
10660
  packages.length,
9659
10661
  ")"
9660
10662
  ]
@@ -9666,170 +10668,1172 @@ const DependenciesPanelContent = ({
9666
10668
  ] })
9667
10669
  }
9668
10670
  ),
9669
- /* @__PURE__ */ jsxs(
9670
- "button",
10671
+ /* @__PURE__ */ jsxs(
10672
+ "button",
10673
+ {
10674
+ onClick: () => setShowInfoModal(true),
10675
+ style: {
10676
+ padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
10677
+ fontSize: `${theme2.fontSizes[0]}px`,
10678
+ fontWeight: theme2.fontWeights.medium,
10679
+ fontFamily: theme2.fonts.body,
10680
+ borderRadius: `${theme2.radii[1]}px`,
10681
+ border: `1px solid ${theme2.colors.border}`,
10682
+ backgroundColor: theme2.colors.backgroundSecondary,
10683
+ color: theme2.colors.primary,
10684
+ cursor: "pointer",
10685
+ display: "flex",
10686
+ alignItems: "center",
10687
+ gap: `${theme2.space[1]}px`,
10688
+ transition: "all 0.2s"
10689
+ },
10690
+ children: [
10691
+ /* @__PURE__ */ jsx(CircleQuestionMark, { size: 12 }),
10692
+ "Learn More"
10693
+ ]
10694
+ }
10695
+ )
10696
+ ]
10697
+ }
10698
+ ),
10699
+ packages.length > 1 && /* @__PURE__ */ jsx(
10700
+ "select",
10701
+ {
10702
+ value: effectiveSelectedPath ?? "__none__",
10703
+ onChange: (e) => setSelectedPackagePath(e.target.value === "__none__" ? null : e.target.value),
10704
+ style: {
10705
+ width: "100%",
10706
+ padding: `${theme2.space[2]}px`,
10707
+ borderRadius: `${theme2.radii[1]}px`,
10708
+ border: `1px solid ${theme2.colors.border}`,
10709
+ backgroundColor: theme2.colors.backgroundSecondary,
10710
+ color: theme2.colors.text,
10711
+ fontSize: `${theme2.fontSizes[1]}px`,
10712
+ fontFamily: theme2.fonts.body,
10713
+ cursor: "pointer"
10714
+ },
10715
+ children: packages.map((pkg) => /* @__PURE__ */ jsxs("option", { value: pkg.packageData.path, children: [
10716
+ pkg.packageData.name,
10717
+ " (",
10718
+ pkg.packageData.path || "root",
10719
+ ")"
10720
+ ] }, pkg.packageData.path || "__root__"))
10721
+ }
10722
+ ),
10723
+ packages.length === 1 && selectedPackage && /* @__PURE__ */ jsxs(
10724
+ "div",
10725
+ {
10726
+ style: {
10727
+ fontSize: `${theme2.fontSizes[0]}px`,
10728
+ color: theme2.colors.textSecondary
10729
+ },
10730
+ children: [
10731
+ selectedPackage.packageData.name,
10732
+ " • ",
10733
+ dependencyItems.length,
10734
+ " dependencies"
10735
+ ]
10736
+ }
10737
+ ),
10738
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsx(
10739
+ FilterBar,
10740
+ {
10741
+ activeFilters,
10742
+ onToggleFilter: handleToggleFilter,
10743
+ searchQuery,
10744
+ onSearchChange: setSearchQuery,
10745
+ counts
10746
+ }
10747
+ )
10748
+ ]
10749
+ }
10750
+ ),
10751
+ selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsxs(
10752
+ "div",
10753
+ {
10754
+ style: {
10755
+ flex: 1,
10756
+ overflow: "auto",
10757
+ padding: `${theme2.space[2]}px ${theme2.space[3]}px ${theme2.space[3]}px`
10758
+ },
10759
+ children: [
10760
+ /* @__PURE__ */ jsxs(
10761
+ "div",
10762
+ {
10763
+ style: {
10764
+ fontSize: `${theme2.fontSizes[0]}px`,
10765
+ color: theme2.colors.textSecondary,
10766
+ marginBottom: `${theme2.space[2]}px`
10767
+ },
10768
+ children: [
10769
+ "Showing ",
10770
+ filteredDependencies.length,
10771
+ " of ",
10772
+ dependencyItems.length,
10773
+ " dependencies"
10774
+ ]
10775
+ }
10776
+ ),
10777
+ /* @__PURE__ */ jsx(
10778
+ "div",
10779
+ {
10780
+ style: {
10781
+ display: "flex",
10782
+ flexDirection: "column",
10783
+ gap: `${theme2.space[1]}px`
10784
+ },
10785
+ children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
10786
+ "div",
10787
+ {
10788
+ style: {
10789
+ padding: `${theme2.space[3]}px`,
10790
+ textAlign: "center",
10791
+ color: theme2.colors.textSecondary,
10792
+ fontSize: `${theme2.fontSizes[1]}px`
10793
+ },
10794
+ children: "No dependencies match your filters"
10795
+ }
10796
+ ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
10797
+ DependencyRow,
10798
+ {
10799
+ dependency: dep
10800
+ },
10801
+ `${dep.name}-${dep.dependencyType}`
10802
+ ))
10803
+ }
10804
+ )
10805
+ ]
10806
+ }
10807
+ ),
10808
+ !selectedPackage && packages.length > 1 && /* @__PURE__ */ jsx(
10809
+ "div",
10810
+ {
10811
+ style: {
10812
+ flex: 1,
10813
+ display: "flex",
10814
+ alignItems: "center",
10815
+ justifyContent: "center",
10816
+ color: theme2.colors.textSecondary,
10817
+ fontSize: `${theme2.fontSizes[1]}px`
10818
+ },
10819
+ children: "Select a package to view its dependencies"
10820
+ }
10821
+ ),
10822
+ /* @__PURE__ */ jsx(
10823
+ DependencyInfoModal,
10824
+ {
10825
+ isOpen: showInfoModal,
10826
+ onClose: () => setShowInfoModal(false)
10827
+ }
10828
+ )
10829
+ ]
10830
+ }
10831
+ );
10832
+ };
10833
+ const DependenciesPanel = (props) => {
10834
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
10835
+ };
10836
+ class LocalSearchService {
10837
+ constructor() {
10838
+ this.documentsMap = /* @__PURE__ */ new Map();
10839
+ this.baseDirectory = "";
10840
+ this.initialized = false;
10841
+ }
10842
+ /**
10843
+ * Index files from FileTree
10844
+ */
10845
+ indexFileSystemTree(tree, baseDirectory) {
10846
+ this.baseDirectory = baseDirectory;
10847
+ this.documentsMap.clear();
10848
+ let index = 0;
10849
+ for (const file of tree.allFiles) {
10850
+ const absolutePath = file.path.startsWith("/") ? file.path : `${baseDirectory}/${file.path}`.replace(/\/+/g, "/");
10851
+ const doc = {
10852
+ id: index.toString(),
10853
+ path: absolutePath,
10854
+ name: file.name,
10855
+ relativePath: file.relativePath
10856
+ };
10857
+ this.documentsMap.set(doc.id, doc);
10858
+ index++;
10859
+ }
10860
+ this.initialized = true;
10861
+ }
10862
+ /**
10863
+ * Convert glob pattern to regex
10864
+ */
10865
+ globToRegex(pattern) {
10866
+ const escapedPattern = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
10867
+ return new RegExp(`^${escapedPattern}$`, "i");
10868
+ }
10869
+ /**
10870
+ * Check if query contains wildcards
10871
+ */
10872
+ hasWildcards(query) {
10873
+ return query.includes("*") || query.includes("?");
10874
+ }
10875
+ /**
10876
+ * Check if document matches filter options
10877
+ */
10878
+ matchesFilters(doc, options) {
10879
+ var _a;
10880
+ if ((options == null ? void 0 : options.directoryFilters) && options.directoryFilters.length > 0) {
10881
+ const includeFilters = options.directoryFilters.filter((f) => f.mode === "include");
10882
+ const excludeFilters = options.directoryFilters.filter((f) => f.mode === "exclude");
10883
+ for (const filter of excludeFilters) {
10884
+ if (doc.relativePath.toLowerCase().includes(filter.path.toLowerCase())) {
10885
+ return false;
10886
+ }
10887
+ }
10888
+ if (includeFilters.length > 0) {
10889
+ const matchesInclude = includeFilters.some(
10890
+ (filter) => doc.relativePath.toLowerCase().includes(filter.path.toLowerCase())
10891
+ );
10892
+ if (!matchesInclude) return false;
10893
+ }
10894
+ } else if (options == null ? void 0 : options.directoryFilter) {
10895
+ const shouldInclude = options.excludeDirectory ? !doc.relativePath.includes(options.directoryFilter) : doc.relativePath.includes(options.directoryFilter);
10896
+ if (!shouldInclude) return false;
10897
+ }
10898
+ if (options == null ? void 0 : options.fileType) {
10899
+ const fileExtension = ((_a = doc.name.split(".").pop()) == null ? void 0 : _a.toLowerCase()) || "";
10900
+ if (fileExtension !== options.fileType.toLowerCase()) {
10901
+ return false;
10902
+ }
10903
+ }
10904
+ return true;
10905
+ }
10906
+ /**
10907
+ * Calculate relevance score for a match
10908
+ */
10909
+ calculateScore(doc, query) {
10910
+ const lowerQuery = query.toLowerCase();
10911
+ const lowerName = doc.name.toLowerCase();
10912
+ const lowerPath = doc.relativePath.toLowerCase();
10913
+ let score = 0;
10914
+ if (lowerName === lowerQuery) {
10915
+ score += 100;
10916
+ } else if (lowerName.startsWith(lowerQuery)) {
10917
+ score += 80;
10918
+ } else if (lowerName.includes(lowerQuery)) {
10919
+ score += 60;
10920
+ } else if (lowerPath.includes(lowerQuery)) {
10921
+ score += 40;
10922
+ }
10923
+ score += Math.max(0, 20 - doc.relativePath.split("/").length * 2);
10924
+ return score;
10925
+ }
10926
+ /**
10927
+ * Search files by filename
10928
+ */
10929
+ search(query, options) {
10930
+ if (!this.initialized || !query.trim()) {
10931
+ return [];
10932
+ }
10933
+ const limit = (options == null ? void 0 : options.limit) || 100;
10934
+ const results = [];
10935
+ if (this.hasWildcards(query)) {
10936
+ const regex = this.globToRegex(query);
10937
+ this.documentsMap.forEach((doc) => {
10938
+ if (doc && doc.name && regex.test(doc.name)) {
10939
+ if (!this.matchesFilters(doc, options)) return;
10940
+ results.push({
10941
+ path: doc.path,
10942
+ name: doc.name,
10943
+ relativePath: doc.relativePath,
10944
+ score: 90
10945
+ });
10946
+ }
10947
+ });
10948
+ return results.slice(0, limit);
10949
+ }
10950
+ const lowerQuery = query.toLowerCase();
10951
+ this.documentsMap.forEach((doc) => {
10952
+ if (!doc) return;
10953
+ const lowerName = doc.name.toLowerCase();
10954
+ const lowerPath = doc.relativePath.toLowerCase();
10955
+ if (lowerName.includes(lowerQuery) || lowerPath.includes(lowerQuery)) {
10956
+ if (!this.matchesFilters(doc, options)) return;
10957
+ results.push({
10958
+ path: doc.path,
10959
+ name: doc.name,
10960
+ relativePath: doc.relativePath,
10961
+ score: this.calculateScore(doc, query)
10962
+ });
10963
+ }
10964
+ });
10965
+ results.sort((a, b) => b.score - a.score);
10966
+ return results.slice(0, limit);
10967
+ }
10968
+ /**
10969
+ * Get unique directories from indexed files
10970
+ */
10971
+ getDirectories() {
10972
+ const directories = /* @__PURE__ */ new Set();
10973
+ this.documentsMap.forEach((doc) => {
10974
+ const parts = doc.relativePath.split("/");
10975
+ let path = "";
10976
+ for (let i = 0; i < parts.length - 1; i++) {
10977
+ path = path ? `${path}/${parts[i]}` : parts[i];
10978
+ directories.add(path);
10979
+ }
10980
+ });
10981
+ return Array.from(directories).sort();
10982
+ }
10983
+ /**
10984
+ * Clear the search index
10985
+ */
10986
+ clear() {
10987
+ this.documentsMap.clear();
10988
+ this.initialized = false;
10989
+ }
10990
+ isInitialized() {
10991
+ return this.initialized;
10992
+ }
10993
+ }
10994
+ const localSearchService = new LocalSearchService();
10995
+ const SearchPanelContent = ({
10996
+ fileTree,
10997
+ baseDirectory = "",
10998
+ isLoading = false,
10999
+ onFileSelect,
11000
+ onSearchResultsChange,
11001
+ onSearchResultHover,
11002
+ onDirectoryFiltersChange,
11003
+ selectedFile
11004
+ }) => {
11005
+ const { theme: theme2 } = useTheme();
11006
+ const [searchQuery, setSearchQuery] = useState("");
11007
+ const [searchResults, setSearchResults] = useState([]);
11008
+ const [directoryFilter, setDirectoryFilter] = useState("");
11009
+ const [directoryFilters, setDirectoryFilters] = useState([]);
11010
+ const [excludeDirectory, setExcludeDirectory] = useState(false);
11011
+ const [showDirectoryDropdown, setShowDirectoryDropdown] = useState(false);
11012
+ const [selectedDirectoryIndex, setSelectedDirectoryIndex] = useState(0);
11013
+ const [selectedSearchIndex, setSelectedSearchIndex] = useState(-1);
11014
+ const [isSearchResultsFocused, setIsSearchResultsFocused] = useState(false);
11015
+ const [copiedPath, setCopiedPath] = useState(null);
11016
+ const searchInputRef = useRef(null);
11017
+ const directoryInputRef = useRef(null);
11018
+ const searchResultsRef = useRef(null);
11019
+ const suppressDropdownRef = useRef(false);
11020
+ useEffect(() => {
11021
+ var _a;
11022
+ (_a = searchInputRef.current) == null ? void 0 : _a.focus();
11023
+ }, []);
11024
+ useEffect(() => {
11025
+ if (fileTree && baseDirectory) {
11026
+ localSearchService.indexFileSystemTree(fileTree, baseDirectory);
11027
+ }
11028
+ }, [fileTree, baseDirectory]);
11029
+ useEffect(() => {
11030
+ onDirectoryFiltersChange == null ? void 0 : onDirectoryFiltersChange(directoryFilters);
11031
+ }, [directoryFilters, onDirectoryFiltersChange]);
11032
+ const matchingDirectories = useMemo(() => {
11033
+ if (!directoryFilter || !fileTree) return [];
11034
+ const directories = localSearchService.getDirectories();
11035
+ return directories.filter((dir) => {
11036
+ const lowerDir = dir.toLowerCase();
11037
+ const lowerFilter = directoryFilter.toLowerCase();
11038
+ return lowerDir.includes(lowerFilter) && lowerDir !== lowerFilter;
11039
+ }).map((dir) => ({
11040
+ path: dir,
11041
+ displayPath: dir,
11042
+ score: dir.toLowerCase().startsWith(directoryFilter.toLowerCase()) ? 100 : 80
11043
+ })).sort((a, b) => b.score - a.score).slice(0, 10);
11044
+ }, [directoryFilter, fileTree]);
11045
+ useEffect(() => {
11046
+ if (suppressDropdownRef.current) {
11047
+ suppressDropdownRef.current = false;
11048
+ return;
11049
+ }
11050
+ setShowDirectoryDropdown(directoryFilter.length > 0 && matchingDirectories.length > 0);
11051
+ setSelectedDirectoryIndex(0);
11052
+ }, [directoryFilter, matchingDirectories.length]);
11053
+ const addDirectoryFilter = useCallback(
11054
+ (path, mode = "include") => {
11055
+ if (!path.trim()) return;
11056
+ const existingFilter = directoryFilters.find((f) => f.path === path);
11057
+ if (existingFilter) {
11058
+ setDirectoryFilters(
11059
+ (filters) => filters.map(
11060
+ (f) => f.path === path ? { ...f, mode: f.mode === "include" ? "exclude" : "include" } : f
11061
+ )
11062
+ );
11063
+ } else {
11064
+ const newFilter = {
11065
+ id: `filter-${Date.now()}`,
11066
+ path: path.trim(),
11067
+ mode
11068
+ };
11069
+ setDirectoryFilters((filters) => [...filters, newFilter]);
11070
+ }
11071
+ },
11072
+ [directoryFilters]
11073
+ );
11074
+ const removeDirectoryFilter = useCallback((filterId) => {
11075
+ setDirectoryFilters((filters) => filters.filter((f) => f.id !== filterId));
11076
+ }, []);
11077
+ const toggleFilterMode = useCallback((filterId) => {
11078
+ setDirectoryFilters(
11079
+ (filters) => filters.map(
11080
+ (f) => f.id === filterId ? { ...f, mode: f.mode === "include" ? "exclude" : "include" } : f
11081
+ )
11082
+ );
11083
+ }, []);
11084
+ const handleDirectoryKeyDown = useCallback(
11085
+ (e) => {
11086
+ switch (e.key) {
11087
+ case "ArrowDown":
11088
+ if (showDirectoryDropdown && matchingDirectories.length > 0) {
11089
+ e.preventDefault();
11090
+ setSelectedDirectoryIndex(
11091
+ (prev) => prev < matchingDirectories.length - 1 ? prev + 1 : prev
11092
+ );
11093
+ }
11094
+ break;
11095
+ case "ArrowUp":
11096
+ if (showDirectoryDropdown && matchingDirectories.length > 0) {
11097
+ e.preventDefault();
11098
+ setSelectedDirectoryIndex((prev) => prev > 0 ? prev - 1 : prev);
11099
+ }
11100
+ break;
11101
+ case "Enter":
11102
+ e.preventDefault();
11103
+ setShowDirectoryDropdown(false);
11104
+ suppressDropdownRef.current = true;
11105
+ if (matchingDirectories.length > 0 && matchingDirectories[selectedDirectoryIndex]) {
11106
+ const dir = matchingDirectories[selectedDirectoryIndex];
11107
+ addDirectoryFilter(dir.path, excludeDirectory ? "exclude" : "include");
11108
+ setDirectoryFilter("");
11109
+ } else if (directoryFilter.trim()) {
11110
+ addDirectoryFilter(directoryFilter, excludeDirectory ? "exclude" : "include");
11111
+ setDirectoryFilter("");
11112
+ }
11113
+ break;
11114
+ case "Escape":
11115
+ if (showDirectoryDropdown) {
11116
+ e.preventDefault();
11117
+ setShowDirectoryDropdown(false);
11118
+ }
11119
+ break;
11120
+ }
11121
+ },
11122
+ [
11123
+ showDirectoryDropdown,
11124
+ matchingDirectories,
11125
+ selectedDirectoryIndex,
11126
+ directoryFilter,
11127
+ addDirectoryFilter,
11128
+ excludeDirectory
11129
+ ]
11130
+ );
11131
+ const performSearch = useCallback(
11132
+ (query) => {
11133
+ if (!query.trim()) {
11134
+ setSearchResults([]);
11135
+ onSearchResultsChange == null ? void 0 : onSearchResultsChange([]);
11136
+ return;
11137
+ }
11138
+ const results = localSearchService.search(query, {
11139
+ directoryFilters: directoryFilters.length > 0 ? directoryFilters : void 0,
11140
+ limit: 100
11141
+ });
11142
+ setSearchResults(results);
11143
+ onSearchResultsChange == null ? void 0 : onSearchResultsChange(results);
11144
+ },
11145
+ [directoryFilters, onSearchResultsChange]
11146
+ );
11147
+ useEffect(() => {
11148
+ performSearch(searchQuery);
11149
+ }, [searchQuery, performSearch]);
11150
+ useEffect(() => {
11151
+ setSelectedSearchIndex(-1);
11152
+ setIsSearchResultsFocused(false);
11153
+ }, [searchResults]);
11154
+ useEffect(() => {
11155
+ if (isSearchResultsFocused && selectedSearchIndex >= 0 && searchResultsRef.current) {
11156
+ const selectedElement = searchResultsRef.current.querySelector(
11157
+ `.search-result-item:nth-child(${selectedSearchIndex + 1})`
11158
+ );
11159
+ selectedElement == null ? void 0 : selectedElement.scrollIntoView({ behavior: "smooth", block: "nearest" });
11160
+ }
11161
+ }, [selectedSearchIndex, isSearchResultsFocused]);
11162
+ const handleSearchKeyDown = useCallback(
11163
+ (e) => {
11164
+ var _a, _b;
11165
+ switch (e.key) {
11166
+ case "Tab":
11167
+ if (e.target === searchInputRef.current && !e.shiftKey && searchResults.length > 0) {
11168
+ e.preventDefault();
11169
+ setIsSearchResultsFocused(true);
11170
+ setSelectedSearchIndex(0);
11171
+ (_a = searchResultsRef.current) == null ? void 0 : _a.focus();
11172
+ }
11173
+ break;
11174
+ case "ArrowDown":
11175
+ if (isSearchResultsFocused && searchResults.length > 0) {
11176
+ e.preventDefault();
11177
+ setSelectedSearchIndex(
11178
+ (prev) => prev < searchResults.length - 1 ? prev + 1 : prev
11179
+ );
11180
+ }
11181
+ break;
11182
+ case "ArrowUp":
11183
+ if (isSearchResultsFocused && searchResults.length > 0) {
11184
+ e.preventDefault();
11185
+ setSelectedSearchIndex((prev) => prev > 0 ? prev - 1 : 0);
11186
+ }
11187
+ break;
11188
+ case "Enter":
11189
+ if (isSearchResultsFocused && selectedSearchIndex >= 0) {
11190
+ e.preventDefault();
11191
+ const result = searchResults[selectedSearchIndex];
11192
+ onFileSelect == null ? void 0 : onFileSelect(result.relativePath);
11193
+ }
11194
+ break;
11195
+ case "Escape":
11196
+ if (isSearchResultsFocused) {
11197
+ e.preventDefault();
11198
+ setIsSearchResultsFocused(false);
11199
+ setSelectedSearchIndex(-1);
11200
+ (_b = searchInputRef.current) == null ? void 0 : _b.focus();
11201
+ }
11202
+ break;
11203
+ }
11204
+ },
11205
+ [searchResults, isSearchResultsFocused, selectedSearchIndex, onFileSelect]
11206
+ );
11207
+ const handleCopyPath = useCallback((path) => {
11208
+ navigator.clipboard.writeText(path).then(() => {
11209
+ setCopiedPath(path);
11210
+ setTimeout(() => setCopiedPath(null), 2e3);
11211
+ });
11212
+ }, []);
11213
+ const highlightMatch = (text2, match) => {
11214
+ if (!match) return text2;
11215
+ const escapedMatch = match.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
11216
+ const regex = new RegExp(`(${escapedMatch})`, "gi");
11217
+ const parts = text2.split(regex);
11218
+ return parts.map(
11219
+ (part, i) => regex.test(part) ? /* @__PURE__ */ jsx(
11220
+ "span",
11221
+ {
11222
+ style: {
11223
+ backgroundColor: `${theme2.colors.primary}40`,
11224
+ fontWeight: "bold"
11225
+ },
11226
+ children: part
11227
+ },
11228
+ i
11229
+ ) : part
11230
+ );
11231
+ };
11232
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100%" }, children: [
11233
+ /* @__PURE__ */ jsxs("div", { style: { borderBottom: `1px solid ${theme2.colors.border}` }, children: [
11234
+ /* @__PURE__ */ jsxs("div", { style: { padding: "12px", paddingBottom: "8px", position: "relative" }, children: [
11235
+ /* @__PURE__ */ jsx(
11236
+ "div",
11237
+ {
11238
+ style: {
11239
+ marginBottom: "4px",
11240
+ fontSize: theme2.fontSizes[0],
11241
+ color: theme2.colors.textSecondary,
11242
+ display: "flex",
11243
+ alignItems: "center",
11244
+ justifyContent: "space-between"
11245
+ },
11246
+ children: /* @__PURE__ */ jsx("span", { children: "Directory Filter" })
11247
+ }
11248
+ ),
11249
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
11250
+ /* @__PURE__ */ jsx(
11251
+ "input",
11252
+ {
11253
+ ref: directoryInputRef,
11254
+ type: "text",
11255
+ value: directoryFilter,
11256
+ onChange: (e) => {
11257
+ setDirectoryFilter(e.target.value);
11258
+ suppressDropdownRef.current = false;
11259
+ },
11260
+ onKeyDown: handleDirectoryKeyDown,
11261
+ onFocus: () => setShowDirectoryDropdown(
11262
+ directoryFilter.length > 0 && matchingDirectories.length > 0
11263
+ ),
11264
+ onBlur: () => {
11265
+ setTimeout(() => {
11266
+ var _a;
11267
+ if (!((_a = directoryInputRef.current) == null ? void 0 : _a.contains(document.activeElement))) {
11268
+ setShowDirectoryDropdown(false);
11269
+ }
11270
+ }, 200);
11271
+ },
11272
+ placeholder: "Type to filter by directory path",
11273
+ style: {
11274
+ flex: 1,
11275
+ padding: "8px 12px",
11276
+ fontSize: theme2.fontSizes[1],
11277
+ borderRadius: "4px",
11278
+ border: `1px solid ${directoryFilter && showDirectoryDropdown ? theme2.colors.primary : theme2.colors.border}`,
11279
+ backgroundColor: theme2.colors.backgroundSecondary || theme2.colors.background,
11280
+ color: theme2.colors.text,
11281
+ outline: "none"
11282
+ }
11283
+ }
11284
+ ),
11285
+ directoryFilter && /* @__PURE__ */ jsx(
11286
+ "button",
11287
+ {
11288
+ onClick: () => setExcludeDirectory(!excludeDirectory),
11289
+ style: {
11290
+ padding: "8px 12px",
11291
+ fontSize: theme2.fontSizes[0],
11292
+ fontWeight: 500,
11293
+ borderRadius: "4px",
11294
+ border: `1px solid ${excludeDirectory ? theme2.colors.primary : theme2.colors.border}`,
11295
+ backgroundColor: excludeDirectory ? `${theme2.colors.primary}20` : theme2.colors.backgroundSecondary || theme2.colors.background,
11296
+ color: excludeDirectory ? theme2.colors.text : theme2.colors.textSecondary,
11297
+ cursor: "pointer"
11298
+ },
11299
+ title: excludeDirectory ? "Excluding files in this directory" : "Including only files in this directory",
11300
+ children: excludeDirectory ? "Exclude" : "Include"
11301
+ }
11302
+ )
11303
+ ] }),
11304
+ showDirectoryDropdown && matchingDirectories.length > 0 && /* @__PURE__ */ jsx(
11305
+ "div",
11306
+ {
11307
+ style: {
11308
+ position: "absolute",
11309
+ zIndex: 10,
11310
+ width: "calc(100% - 24px)",
11311
+ marginTop: "4px",
11312
+ borderRadius: "4px",
11313
+ border: `1px solid ${theme2.colors.primary}`,
11314
+ backgroundColor: theme2.colors.background,
11315
+ boxShadow: `0 4px 6px -1px ${theme2.colors.border}40`,
11316
+ maxHeight: "256px",
11317
+ overflowY: "auto"
11318
+ },
11319
+ children: matchingDirectories.map((dir, index) => /* @__PURE__ */ jsx(
11320
+ "div",
11321
+ {
11322
+ style: {
11323
+ padding: "8px 12px",
11324
+ cursor: "pointer",
11325
+ fontSize: theme2.fontSizes[1],
11326
+ backgroundColor: index === selectedDirectoryIndex ? `${theme2.colors.primary}20` : "transparent",
11327
+ color: index === selectedDirectoryIndex ? theme2.colors.text : theme2.colors.textSecondary
11328
+ },
11329
+ onMouseEnter: () => setSelectedDirectoryIndex(index),
11330
+ onClick: () => {
11331
+ var _a;
11332
+ addDirectoryFilter(dir.path, excludeDirectory ? "exclude" : "include");
11333
+ setDirectoryFilter("");
11334
+ setShowDirectoryDropdown(false);
11335
+ (_a = directoryInputRef.current) == null ? void 0 : _a.focus();
11336
+ },
11337
+ children: dir.displayPath
11338
+ },
11339
+ dir.path
11340
+ ))
11341
+ }
11342
+ ),
11343
+ directoryFilters.length > 0 && /* @__PURE__ */ jsx("div", { style: { marginTop: "8px", display: "flex", flexWrap: "wrap", gap: "8px" }, children: directoryFilters.map((filter) => /* @__PURE__ */ jsxs(
11344
+ "div",
11345
+ {
11346
+ style: {
11347
+ display: "flex",
11348
+ alignItems: "center",
11349
+ gap: "4px",
11350
+ padding: "4px 8px",
11351
+ borderRadius: "4px",
11352
+ fontSize: theme2.fontSizes[0],
11353
+ backgroundColor: filter.mode === "include" ? `${theme2.colors.primary}20` : `${theme2.colors.error}20`,
11354
+ border: `1px solid ${filter.mode === "include" ? theme2.colors.primary : theme2.colors.error}`,
11355
+ color: theme2.colors.text
11356
+ },
11357
+ children: [
11358
+ /* @__PURE__ */ jsxs(
11359
+ "span",
11360
+ {
11361
+ style: { cursor: "pointer" },
11362
+ onClick: () => toggleFilterMode(filter.id),
11363
+ title: "Click to toggle include/exclude",
11364
+ children: [
11365
+ filter.mode === "include" ? "✓" : "✗",
11366
+ " ",
11367
+ filter.path
11368
+ ]
11369
+ }
11370
+ ),
11371
+ /* @__PURE__ */ jsx(
11372
+ "button",
11373
+ {
11374
+ onClick: () => removeDirectoryFilter(filter.id),
11375
+ style: {
11376
+ marginLeft: "4px",
11377
+ background: "none",
11378
+ border: "none",
11379
+ cursor: "pointer",
11380
+ color: theme2.colors.textSecondary,
11381
+ padding: 0,
11382
+ display: "flex",
11383
+ alignItems: "center"
11384
+ },
11385
+ title: "Remove filter",
11386
+ children: /* @__PURE__ */ jsx(X, { size: 12 })
11387
+ }
11388
+ )
11389
+ ]
11390
+ },
11391
+ filter.id
11392
+ )) })
11393
+ ] }),
11394
+ /* @__PURE__ */ jsxs(
11395
+ "div",
11396
+ {
11397
+ style: {
11398
+ padding: "12px",
11399
+ paddingTop: "8px",
11400
+ borderTop: `1px solid ${theme2.colors.border}40`
11401
+ },
11402
+ children: [
11403
+ /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
11404
+ /* @__PURE__ */ jsx(
11405
+ "input",
11406
+ {
11407
+ ref: searchInputRef,
11408
+ type: "text",
11409
+ value: searchQuery,
11410
+ onChange: (e) => setSearchQuery(e.target.value),
11411
+ onKeyDown: handleSearchKeyDown,
11412
+ placeholder: "Search files...",
11413
+ style: {
11414
+ width: "100%",
11415
+ padding: "8px 12px",
11416
+ paddingRight: "36px",
11417
+ fontSize: theme2.fontSizes[1],
11418
+ borderRadius: "4px",
11419
+ border: `1px solid ${theme2.colors.border}`,
11420
+ backgroundColor: theme2.colors.backgroundSecondary || theme2.colors.background,
11421
+ color: theme2.colors.text,
11422
+ outline: "none",
11423
+ boxSizing: "border-box"
11424
+ }
11425
+ }
11426
+ ),
11427
+ /* @__PURE__ */ jsx(
11428
+ "div",
11429
+ {
11430
+ style: {
11431
+ position: "absolute",
11432
+ right: "8px",
11433
+ top: "50%",
11434
+ transform: "translateY(-50%)"
11435
+ },
11436
+ children: /* @__PURE__ */ jsxs(
11437
+ "svg",
11438
+ {
11439
+ width: "16",
11440
+ height: "16",
11441
+ viewBox: "0 0 24 24",
11442
+ fill: "none",
11443
+ stroke: theme2.colors.textSecondary,
11444
+ strokeWidth: "2",
11445
+ children: [
11446
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
11447
+ /* @__PURE__ */ jsx("path", { d: "m21 21-4.35-4.35" })
11448
+ ]
11449
+ }
11450
+ )
11451
+ }
11452
+ )
11453
+ ] }),
11454
+ /* @__PURE__ */ jsx(
11455
+ "div",
11456
+ {
11457
+ style: {
11458
+ marginTop: "4px",
11459
+ fontSize: theme2.fontSizes[0],
11460
+ color: theme2.colors.textSecondary
11461
+ },
11462
+ children: "Supports wildcards: *.tsx, test?.js"
11463
+ }
11464
+ )
11465
+ ]
11466
+ }
11467
+ )
11468
+ ] }),
11469
+ /* @__PURE__ */ jsx(
11470
+ "div",
11471
+ {
11472
+ ref: searchResultsRef,
11473
+ tabIndex: -1,
11474
+ onKeyDown: handleSearchKeyDown,
11475
+ onBlur: () => {
11476
+ setTimeout(() => {
11477
+ if (document.activeElement !== searchInputRef.current) {
11478
+ setIsSearchResultsFocused(false);
11479
+ setSelectedSearchIndex(-1);
11480
+ }
11481
+ }, 100);
11482
+ },
11483
+ style: { flex: 1, overflowY: "auto", outline: "none" },
11484
+ children: isLoading ? /* @__PURE__ */ jsx(
11485
+ "div",
11486
+ {
11487
+ style: {
11488
+ padding: "40px 20px",
11489
+ textAlign: "center",
11490
+ color: theme2.colors.textSecondary
11491
+ },
11492
+ children: "Loading file tree..."
11493
+ }
11494
+ ) : !searchQuery && searchResults.length === 0 ? /* @__PURE__ */ jsx(
11495
+ "div",
11496
+ {
11497
+ style: {
11498
+ height: "100%",
11499
+ display: "flex",
11500
+ alignItems: "center",
11501
+ justifyContent: "center",
11502
+ padding: "32px"
11503
+ },
11504
+ children: /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", maxWidth: "320px" }, children: [
11505
+ /* @__PURE__ */ jsx("div", { style: { marginBottom: "24px", position: "relative", display: "inline-block" }, children: /* @__PURE__ */ jsxs(
11506
+ "svg",
11507
+ {
11508
+ width: "64",
11509
+ height: "64",
11510
+ viewBox: "0 0 24 24",
11511
+ fill: "none",
11512
+ style: { color: theme2.colors.primary, opacity: 0.8 },
11513
+ children: [
11514
+ /* @__PURE__ */ jsx(
11515
+ "circle",
11516
+ {
11517
+ cx: "11",
11518
+ cy: "11",
11519
+ r: "8",
11520
+ stroke: "currentColor",
11521
+ strokeWidth: "2",
11522
+ strokeDasharray: "4 2"
11523
+ }
11524
+ ),
11525
+ /* @__PURE__ */ jsx(
11526
+ "path",
9671
11527
  {
9672
- onClick: () => setShowInfoModal(true),
9673
- style: {
9674
- padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
9675
- fontSize: `${theme2.fontSizes[0]}px`,
9676
- fontWeight: theme2.fontWeights.medium,
9677
- fontFamily: theme2.fonts.body,
9678
- borderRadius: `${theme2.radii[1]}px`,
9679
- border: `1px solid ${theme2.colors.border}`,
9680
- backgroundColor: theme2.colors.backgroundSecondary,
9681
- color: theme2.colors.primary,
9682
- cursor: "pointer",
9683
- display: "flex",
9684
- alignItems: "center",
9685
- gap: `${theme2.space[1]}px`,
9686
- transition: "all 0.2s"
9687
- },
9688
- children: [
9689
- /* @__PURE__ */ jsx(CircleQuestionMark, { size: 12 }),
9690
- "Learn More"
9691
- ]
11528
+ d: "m21 21-4.35-4.35",
11529
+ stroke: "currentColor",
11530
+ strokeWidth: "2",
11531
+ strokeLinecap: "round"
9692
11532
  }
9693
11533
  )
9694
11534
  ]
9695
11535
  }
9696
- ),
9697
- packages.length > 1 && /* @__PURE__ */ jsx(
9698
- "select",
11536
+ ) }),
11537
+ /* @__PURE__ */ jsx(
11538
+ "h3",
9699
11539
  {
9700
- value: effectiveSelectedPath ?? "__none__",
9701
- onChange: (e) => setSelectedPackagePath(e.target.value === "__none__" ? null : e.target.value),
9702
11540
  style: {
9703
- width: "100%",
9704
- padding: `${theme2.space[2]}px`,
9705
- borderRadius: `${theme2.radii[1]}px`,
9706
- border: `1px solid ${theme2.colors.border}`,
9707
- backgroundColor: theme2.colors.backgroundSecondary,
9708
- color: theme2.colors.text,
9709
- fontSize: `${theme2.fontSizes[1]}px`,
9710
- fontFamily: theme2.fonts.body,
9711
- cursor: "pointer"
11541
+ fontSize: theme2.fontSizes[3],
11542
+ fontWeight: 600,
11543
+ marginBottom: "8px",
11544
+ color: theme2.colors.text
9712
11545
  },
9713
- children: packages.map((pkg) => /* @__PURE__ */ jsxs("option", { value: pkg.packageData.path, children: [
9714
- pkg.packageData.name,
9715
- " (",
9716
- pkg.packageData.path || "root",
9717
- ")"
9718
- ] }, pkg.packageData.path || "__root__"))
11546
+ children: "Search files"
9719
11547
  }
9720
11548
  ),
9721
- packages.length === 1 && selectedPackage && /* @__PURE__ */ jsxs(
9722
- "div",
11549
+ /* @__PURE__ */ jsx(
11550
+ "p",
9723
11551
  {
9724
11552
  style: {
9725
- fontSize: `${theme2.fontSizes[0]}px`,
11553
+ fontSize: theme2.fontSizes[1],
11554
+ marginBottom: "16px",
9726
11555
  color: theme2.colors.textSecondary
9727
11556
  },
9728
- children: [
9729
- selectedPackage.packageData.name,
9730
- " • ",
9731
- dependencyItems.length,
9732
- " dependencies"
9733
- ]
11557
+ children: "Search through filenames to find what you need"
9734
11558
  }
9735
11559
  ),
9736
- selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsx(
9737
- FilterBar,
9738
- {
9739
- activeFilters,
9740
- onToggleFilter: handleToggleFilter,
9741
- searchQuery,
9742
- onSearchChange: setSearchQuery,
9743
- counts
9744
- }
9745
- )
9746
- ]
11560
+ /* @__PURE__ */ jsxs("div", { style: { textAlign: "left" }, children: [
11561
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px", marginBottom: "8px" }, children: [
11562
+ /* @__PURE__ */ jsx("span", { style: { fontSize: theme2.fontSizes[0], color: theme2.colors.primary }, children: "💡" }),
11563
+ /* @__PURE__ */ jsxs("div", { children: [
11564
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[0], fontWeight: 500, color: theme2.colors.text }, children: "Quick search" }),
11565
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: "Type to instantly filter by filename" })
11566
+ ] })
11567
+ ] }),
11568
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px" }, children: [
11569
+ /* @__PURE__ */ jsx("span", { style: { fontSize: theme2.fontSizes[0], color: theme2.colors.primary }, children: "📁" }),
11570
+ /* @__PURE__ */ jsxs("div", { children: [
11571
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[0], fontWeight: 500, color: theme2.colors.text }, children: "Filter by directory" }),
11572
+ /* @__PURE__ */ jsx("div", { style: { fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: "Use the directory filter to narrow your search" })
11573
+ ] })
11574
+ ] })
11575
+ ] })
11576
+ ] })
9747
11577
  }
9748
- ),
9749
- selectedPackage && dependencyItems.length > 0 && /* @__PURE__ */ jsxs(
11578
+ ) : searchQuery && searchResults.length === 0 ? /* @__PURE__ */ jsx(
9750
11579
  "div",
9751
11580
  {
9752
11581
  style: {
9753
- flex: 1,
9754
- overflow: "auto",
9755
- padding: `${theme2.space[2]}px ${theme2.space[3]}px ${theme2.space[3]}px`
11582
+ height: "100%",
11583
+ display: "flex",
11584
+ alignItems: "center",
11585
+ justifyContent: "center",
11586
+ padding: "32px"
9756
11587
  },
9757
- children: [
9758
- /* @__PURE__ */ jsxs(
9759
- "div",
11588
+ children: /* @__PURE__ */ jsxs("div", { style: { textAlign: "center", maxWidth: "320px" }, children: [
11589
+ /* @__PURE__ */ jsx("div", { style: { marginBottom: "16px" }, children: /* @__PURE__ */ jsxs(
11590
+ "svg",
9760
11591
  {
9761
- style: {
9762
- fontSize: `${theme2.fontSizes[0]}px`,
9763
- color: theme2.colors.textSecondary,
9764
- marginBottom: `${theme2.space[2]}px`
9765
- },
11592
+ width: "64",
11593
+ height: "64",
11594
+ viewBox: "0 0 24 24",
11595
+ fill: "none",
11596
+ style: { color: theme2.colors.textSecondary, opacity: 0.5 },
9766
11597
  children: [
9767
- "Showing ",
9768
- filteredDependencies.length,
9769
- " of ",
9770
- dependencyItems.length,
9771
- " dependencies"
11598
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8", stroke: "currentColor", strokeWidth: "2" }),
11599
+ /* @__PURE__ */ jsx("path", { d: "m21 21-4.35-4.35", stroke: "currentColor", strokeWidth: "2" }),
11600
+ /* @__PURE__ */ jsx("path", { d: "M8 11h6M11 8v6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
9772
11601
  ]
9773
11602
  }
9774
- ),
11603
+ ) }),
9775
11604
  /* @__PURE__ */ jsx(
9776
- "div",
11605
+ "h3",
9777
11606
  {
9778
11607
  style: {
9779
- display: "flex",
9780
- flexDirection: "column",
9781
- gap: `${theme2.space[1]}px`
11608
+ fontSize: theme2.fontSizes[2],
11609
+ fontWeight: 500,
11610
+ marginBottom: "8px",
11611
+ color: theme2.colors.text
9782
11612
  },
9783
- children: filteredDependencies.length === 0 ? /* @__PURE__ */ jsx(
9784
- "div",
11613
+ children: "No results found"
11614
+ }
11615
+ ),
11616
+ /* @__PURE__ */ jsxs(
11617
+ "p",
11618
+ {
11619
+ style: {
11620
+ fontSize: theme2.fontSizes[1],
11621
+ color: theme2.colors.textSecondary
11622
+ },
11623
+ children: [
11624
+ "No files match",
11625
+ " ",
11626
+ /* @__PURE__ */ jsxs("span", { style: { fontFamily: "monospace", color: theme2.colors.primary }, children: [
11627
+ '"',
11628
+ searchQuery,
11629
+ '"'
11630
+ ] })
11631
+ ]
11632
+ }
11633
+ )
11634
+ ] })
11635
+ }
11636
+ ) : /* @__PURE__ */ jsx("div", { children: searchResults.map((result, index) => {
11637
+ const isCurrentFile = selectedFile === result.path || selectedFile === result.relativePath;
11638
+ const isSelected = isSearchResultsFocused && index === selectedSearchIndex;
11639
+ return /* @__PURE__ */ jsx(
11640
+ "div",
11641
+ {
11642
+ className: "search-result-item",
11643
+ style: {
11644
+ padding: "8px 12px",
11645
+ cursor: "pointer",
11646
+ backgroundColor: isSelected ? `${theme2.colors.primary}25` : isCurrentFile ? `${theme2.colors.primary}15` : "transparent",
11647
+ borderLeft: isCurrentFile ? `3px solid ${theme2.colors.primary}` : isSelected ? `3px solid ${theme2.colors.primary}80` : "3px solid transparent",
11648
+ borderBottom: `1px solid ${theme2.colors.border}20`,
11649
+ transition: "background-color 0.15s"
11650
+ },
11651
+ onClick: () => onFileSelect == null ? void 0 : onFileSelect(result.relativePath),
11652
+ onMouseEnter: () => {
11653
+ if (isSearchResultsFocused) {
11654
+ setSelectedSearchIndex(index);
11655
+ }
11656
+ onSearchResultHover == null ? void 0 : onSearchResultHover(result.relativePath);
11657
+ },
11658
+ onMouseLeave: () => onSearchResultHover == null ? void 0 : onSearchResultHover(null),
11659
+ children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "8px" }, children: [
11660
+ /* @__PURE__ */ jsx("div", { style: { flexShrink: 0, marginTop: "2px" }, children: /* @__PURE__ */ jsx(FileText, { size: 14, color: theme2.colors.textSecondary }) }),
11661
+ /* @__PURE__ */ jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "8px" }, children: [
11662
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
11663
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
11664
+ /* @__PURE__ */ jsx(
11665
+ "div",
11666
+ {
11667
+ style: {
11668
+ fontSize: theme2.fontSizes[1],
11669
+ fontWeight: 500,
11670
+ color: theme2.colors.text
11671
+ },
11672
+ children: highlightMatch(result.name, searchQuery)
11673
+ }
11674
+ ),
11675
+ isCurrentFile && /* @__PURE__ */ jsx(
11676
+ "span",
11677
+ {
11678
+ style: {
11679
+ fontSize: "10px",
11680
+ padding: "2px 6px",
11681
+ borderRadius: "4px",
11682
+ backgroundColor: `${theme2.colors.primary}20`,
11683
+ color: theme2.colors.primary
11684
+ },
11685
+ children: "CURRENT"
11686
+ }
11687
+ )
11688
+ ] }),
11689
+ /* @__PURE__ */ jsx(
11690
+ "div",
11691
+ {
11692
+ style: {
11693
+ fontSize: theme2.fontSizes[0],
11694
+ marginTop: "2px",
11695
+ color: theme2.colors.textSecondary,
11696
+ overflow: "hidden",
11697
+ textOverflow: "ellipsis",
11698
+ whiteSpace: "nowrap"
11699
+ },
11700
+ children: result.relativePath
11701
+ }
11702
+ )
11703
+ ] }),
11704
+ /* @__PURE__ */ jsx(
11705
+ "button",
9785
11706
  {
9786
11707
  style: {
9787
- padding: `${theme2.space[3]}px`,
9788
- textAlign: "center",
9789
- color: theme2.colors.textSecondary,
9790
- fontSize: `${theme2.fontSizes[1]}px`
11708
+ flexShrink: 0,
11709
+ padding: "4px",
11710
+ borderRadius: "4px",
11711
+ border: `1px solid ${copiedPath === result.path ? theme2.colors.success : theme2.colors.border}`,
11712
+ backgroundColor: copiedPath === result.path ? `${theme2.colors.success}20` : theme2.colors.backgroundSecondary || theme2.colors.background,
11713
+ color: copiedPath === result.path ? theme2.colors.success : theme2.colors.textSecondary,
11714
+ cursor: "pointer",
11715
+ opacity: isSelected || isCurrentFile ? 0.7 : 0,
11716
+ transition: "opacity 0.15s"
9791
11717
  },
9792
- children: "No dependencies match your filters"
11718
+ onMouseEnter: (e) => {
11719
+ e.currentTarget.style.opacity = "1";
11720
+ },
11721
+ onMouseLeave: (e) => {
11722
+ if (!isSelected && !isCurrentFile && copiedPath !== result.path) {
11723
+ e.currentTarget.style.opacity = "0";
11724
+ }
11725
+ },
11726
+ onClick: (e) => {
11727
+ e.stopPropagation();
11728
+ handleCopyPath(result.path);
11729
+ },
11730
+ title: copiedPath === result.path ? "Copied!" : "Copy full path",
11731
+ children: copiedPath === result.path ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
9793
11732
  }
9794
- ) : filteredDependencies.map((dep) => /* @__PURE__ */ jsx(
9795
- DependencyRow,
9796
- {
9797
- dependency: dep
9798
- },
9799
- `${dep.name}-${dep.dependencyType}`
9800
- ))
9801
- }
9802
- )
9803
- ]
9804
- }
9805
- ),
9806
- !selectedPackage && packages.length > 1 && /* @__PURE__ */ jsx(
11733
+ )
11734
+ ] }) })
11735
+ ] })
11736
+ },
11737
+ `${result.path}-${index}`
11738
+ );
11739
+ }) })
11740
+ }
11741
+ ),
11742
+ searchQuery && searchResults.length > 0 && /* @__PURE__ */ jsx(
11743
+ "div",
11744
+ {
11745
+ style: {
11746
+ padding: "8px 12px",
11747
+ borderTop: `1px solid ${theme2.colors.border}`,
11748
+ fontSize: theme2.fontSizes[0],
11749
+ color: theme2.colors.textSecondary,
11750
+ backgroundColor: theme2.colors.backgroundSecondary || theme2.colors.background
11751
+ },
11752
+ children: /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
11753
+ /* @__PURE__ */ jsxs("span", { children: [
11754
+ "Found ",
11755
+ searchResults.length,
11756
+ " result",
11757
+ searchResults.length !== 1 ? "s" : "",
11758
+ ' for "',
11759
+ searchQuery,
11760
+ '"'
11761
+ ] }),
11762
+ directoryFilters.length > 0 && /* @__PURE__ */ jsxs(
11763
+ "span",
11764
+ {
11765
+ style: {
11766
+ padding: "2px 6px",
11767
+ borderRadius: "4px",
11768
+ backgroundColor: `${theme2.colors.primary}20`,
11769
+ color: theme2.colors.textSecondary
11770
+ },
11771
+ children: [
11772
+ directoryFilters.length,
11773
+ " filter",
11774
+ directoryFilters.length !== 1 ? "s" : ""
11775
+ ]
11776
+ }
11777
+ )
11778
+ ] })
11779
+ }
11780
+ )
11781
+ ] });
11782
+ };
11783
+ const SearchPanelPreview = () => {
11784
+ const { theme: theme2 } = useTheme();
11785
+ return /* @__PURE__ */ jsxs(
11786
+ "div",
11787
+ {
11788
+ style: {
11789
+ padding: "12px",
11790
+ fontSize: "12px",
11791
+ color: theme2.colors.text,
11792
+ display: "flex",
11793
+ flexDirection: "column",
11794
+ gap: "6px"
11795
+ },
11796
+ children: [
11797
+ /* @__PURE__ */ jsx(
9807
11798
  "div",
9808
11799
  {
9809
11800
  style: {
9810
- flex: 1,
9811
- display: "flex",
9812
- alignItems: "center",
9813
- justifyContent: "center",
11801
+ padding: "6px 8px",
11802
+ borderRadius: "4px",
11803
+ backgroundColor: theme2.colors.backgroundSecondary,
11804
+ border: `1px solid ${theme2.colors.border}`,
9814
11805
  color: theme2.colors.textSecondary,
9815
- fontSize: `${theme2.fontSizes[1]}px`
11806
+ fontSize: "11px"
9816
11807
  },
9817
- children: "Select a package to view its dependencies"
11808
+ children: "Search files..."
9818
11809
  }
9819
11810
  ),
9820
- /* @__PURE__ */ jsx(
9821
- DependencyInfoModal,
9822
- {
9823
- isOpen: showInfoModal,
9824
- onClose: () => setShowInfoModal(false)
9825
- }
9826
- )
11811
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", opacity: 0.7 }, children: [
11812
+ /* @__PURE__ */ jsx(FileText, { size: 12 }),
11813
+ /* @__PURE__ */ jsx("span", { children: "index.tsx" })
11814
+ ] }),
11815
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", opacity: 0.7 }, children: [
11816
+ /* @__PURE__ */ jsx(FileText, { size: 12 }),
11817
+ /* @__PURE__ */ jsx("span", { children: "utils.ts" })
11818
+ ] })
9827
11819
  ]
9828
11820
  }
9829
11821
  );
9830
11822
  };
9831
- const DependenciesPanel = (props) => {
9832
- return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
11823
+ const SearchPanel = ({ context }) => {
11824
+ var _a;
11825
+ const fileTreeSlice = context.getSlice("fileTree");
11826
+ const fileTree = (fileTreeSlice == null ? void 0 : fileTreeSlice.data) ?? null;
11827
+ const isLoading = (fileTreeSlice == null ? void 0 : fileTreeSlice.loading) || false;
11828
+ const rootPath = context.currentScope.type === "repository" ? (_a = context.currentScope.repository) == null ? void 0 : _a.path : void 0;
11829
+ return /* @__PURE__ */ jsx(
11830
+ SearchPanelContent,
11831
+ {
11832
+ fileTree,
11833
+ baseDirectory: rootPath,
11834
+ isLoading
11835
+ }
11836
+ );
9833
11837
  };
9834
11838
  const panels = [
9835
11839
  {
@@ -9894,6 +11898,27 @@ const panels = [
9894
11898
  onUnmount: async (_context) => {
9895
11899
  console.log("Dependencies Panel unmounting");
9896
11900
  }
11901
+ },
11902
+ {
11903
+ metadata: {
11904
+ id: "industry-theme.search",
11905
+ name: "Search",
11906
+ icon: "Search",
11907
+ version: "0.1.0",
11908
+ author: "Industry Theme",
11909
+ description: "Search files in the repository by filename",
11910
+ slices: ["fileTree"]
11911
+ },
11912
+ component: SearchPanel,
11913
+ onMount: async (context) => {
11914
+ console.log("Search Panel mounted");
11915
+ if (context.hasSlice("fileTree") && !context.isSliceLoading("fileTree")) {
11916
+ await context.refresh("repository", "fileTree");
11917
+ }
11918
+ },
11919
+ onUnmount: async (_context) => {
11920
+ console.log("Search Panel unmounting");
11921
+ }
9897
11922
  }
9898
11923
  ];
9899
11924
  const onPackageLoad = async () => {
@@ -9910,6 +11935,9 @@ export {
9910
11935
  PackageCompositionPanel,
9911
11936
  PackageCompositionPanelContent,
9912
11937
  PackageCompositionPanelPreview,
11938
+ SearchPanel,
11939
+ SearchPanelContent,
11940
+ SearchPanelPreview,
9913
11941
  onPackageLoad,
9914
11942
  onPackageUnload,
9915
11943
  panels