@industry-theme/alexandria-panels 0.1.4 → 0.1.5

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.
@@ -3,7 +3,7 @@
3
3
  try {
4
4
  if (typeof document != "undefined") {
5
5
  var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("/* Container query for responsive LocalProjectCard */\n.local-projects-panel {\n container-type: inline-size;\n container-name: local-projects;\n height: 100%;\n}\n\n.local-project-card {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n}\n\n.local-project-card__content {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n min-width: 0;\n}\n\n.local-project-card__info {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.local-project-card__path,\n.local-project-card__meta {\n display: flex;\n}\n\n.local-project-card__actions {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n align-items: center;\n}\n\n.local-project-card__actions--stacked {\n display: none;\n}\n\n/* Compact mode when container is 400px or less */\n@container local-projects (max-width: 400px) {\n .local-projects-panel {\n padding: 8px !important;\n gap: 8px !important;\n }\n\n .local-projects-list {\n gap: 12px !important;\n }\n\n .local-project-card {\n flex-direction: column;\n align-items: stretch;\n gap: 6px;\n padding: 0 !important;\n }\n\n .local-project-card__content {\n gap: 8px;\n }\n\n .local-project-card__path,\n .local-project-card__meta {\n display: none;\n }\n\n .local-project-card__actions {\n display: none;\n }\n\n .local-project-card__actions--stacked {\n display: flex;\n gap: 4px;\n }\n\n .local-project-card__actions--stacked button {\n flex: 1;\n }\n}"));
6
+ elementStyle.appendChild(document.createTextNode("/* Container query for responsive LocalProjectCard */\n.local-projects-panel {\n container-type: inline-size;\n container-name: local-projects;\n height: 100%;\n}\n\n.local-project-card {\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 12px;\n}\n\n.local-project-card__content {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n min-width: 0;\n}\n\n.local-project-card__info {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.local-project-card__meta {\n display: flex;\n}\n\n.local-project-card__actions {\n display: flex;\n gap: 4px;\n flex-shrink: 0;\n align-items: center;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n.local-project-card:hover .local-project-card__actions {\n opacity: 1;\n}\n\n.local-project-card__actions--stacked {\n display: none;\n}\n\n/* Compact mode when container is 400px or less */\n@container local-projects (max-width: 400px) {\n .local-projects-panel {\n padding: 8px !important;\n gap: 8px !important;\n }\n\n .local-projects-list {\n gap: 12px !important;\n }\n\n .local-project-card {\n flex-direction: column;\n align-items: stretch;\n gap: 6px;\n padding: 0 !important;\n }\n\n .local-project-card__content {\n gap: 8px;\n }\n\n .local-project-card__meta {\n display: none;\n }\n\n .local-project-card__actions {\n display: none;\n }\n\n .local-project-card__actions--stacked {\n display: flex;\n gap: 4px;\n }\n\n .local-project-card__actions--stacked button {\n flex: 1;\n }\n}"));
7
7
  document.head.appendChild(elementStyle);
8
8
  }
9
9
  } catch (e) {
@@ -332,7 +332,7 @@ const createLucideIcon = (iconName, iconNode) => {
332
332
  * This source code is licensed under the ISC license.
333
333
  * See the LICENSE file in the root directory of this source tree.
334
334
  */
335
- const __iconNode$j = [
335
+ const __iconNode$l = [
336
336
  [
337
337
  "path",
338
338
  {
@@ -364,14 +364,14 @@ const __iconNode$j = [
364
364
  ["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
365
365
  ["path", { d: "M12 13.5V8", key: "1io7kd" }]
366
366
  ];
367
- const Boxes = createLucideIcon("boxes", __iconNode$j);
367
+ const Boxes = createLucideIcon("boxes", __iconNode$l);
368
368
  /**
369
369
  * @license lucide-react v0.552.0 - ISC
370
370
  *
371
371
  * This source code is licensed under the ISC license.
372
372
  * See the LICENSE file in the root directory of this source tree.
373
373
  */
374
- const __iconNode$i = [
374
+ const __iconNode$k = [
375
375
  ["path", { d: "M10 12h4", key: "a56b0p" }],
376
376
  ["path", { d: "M10 8h4", key: "1sr2af" }],
377
377
  ["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
@@ -384,71 +384,83 @@ const __iconNode$i = [
384
384
  ],
385
385
  ["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
386
386
  ];
387
- const Building2 = createLucideIcon("building-2", __iconNode$i);
387
+ const Building2 = createLucideIcon("building-2", __iconNode$k);
388
388
  /**
389
389
  * @license lucide-react v0.552.0 - ISC
390
390
  *
391
391
  * This source code is licensed under the ISC license.
392
392
  * See the LICENSE file in the root directory of this source tree.
393
393
  */
394
- const __iconNode$h = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
395
- const Check = createLucideIcon("check", __iconNode$h);
394
+ const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
395
+ const Check = createLucideIcon("check", __iconNode$j);
396
396
  /**
397
397
  * @license lucide-react v0.552.0 - ISC
398
398
  *
399
399
  * This source code is licensed under the ISC license.
400
400
  * See the LICENSE file in the root directory of this source tree.
401
401
  */
402
- const __iconNode$g = [
402
+ const __iconNode$i = [
403
403
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
404
404
  ["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
405
405
  ["path", { d: "M12 17h.01", key: "p32p05" }]
406
406
  ];
407
- const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$g);
407
+ const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$i);
408
408
  /**
409
409
  * @license lucide-react v0.552.0 - ISC
410
410
  *
411
411
  * This source code is licensed under the ISC license.
412
412
  * See the LICENSE file in the root directory of this source tree.
413
413
  */
414
- const __iconNode$f = [
414
+ const __iconNode$h = [
415
415
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
416
416
  ["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" }]
417
417
  ];
418
- const Copy = createLucideIcon("copy", __iconNode$f);
418
+ const Copy = createLucideIcon("copy", __iconNode$h);
419
419
  /**
420
420
  * @license lucide-react v0.552.0 - ISC
421
421
  *
422
422
  * This source code is licensed under the ISC license.
423
423
  * See the LICENSE file in the root directory of this source tree.
424
424
  */
425
- const __iconNode$e = [
425
+ const __iconNode$g = [
426
+ ["path", { d: "M10 12h.01", key: "1kxr2c" }],
427
+ ["path", { d: "M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14", key: "36qu9e" }],
428
+ ["path", { d: "M2 20h20", key: "owomy5" }]
429
+ ];
430
+ const DoorClosed = createLucideIcon("door-closed", __iconNode$g);
431
+ /**
432
+ * @license lucide-react v0.552.0 - ISC
433
+ *
434
+ * This source code is licensed under the ISC license.
435
+ * See the LICENSE file in the root directory of this source tree.
436
+ */
437
+ const __iconNode$f = [
426
438
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
427
439
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
428
440
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
429
441
  ];
430
- const ExternalLink = createLucideIcon("external-link", __iconNode$e);
442
+ const ExternalLink = createLucideIcon("external-link", __iconNode$f);
431
443
  /**
432
444
  * @license lucide-react v0.552.0 - ISC
433
445
  *
434
446
  * This source code is licensed under the ISC license.
435
447
  * See the LICENSE file in the root directory of this source tree.
436
448
  */
437
- const __iconNode$d = [
449
+ const __iconNode$e = [
438
450
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
439
451
  ["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
440
452
  ["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
441
453
  ["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
442
454
  ["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
443
455
  ];
444
- const Focus = createLucideIcon("focus", __iconNode$d);
456
+ const Focus = createLucideIcon("focus", __iconNode$e);
445
457
  /**
446
458
  * @license lucide-react v0.552.0 - ISC
447
459
  *
448
460
  * This source code is licensed under the ISC license.
449
461
  * See the LICENSE file in the root directory of this source tree.
450
462
  */
451
- const __iconNode$c = [
463
+ const __iconNode$d = [
452
464
  [
453
465
  "path",
454
466
  {
@@ -460,14 +472,14 @@ const __iconNode$c = [
460
472
  ["path", { d: "M18 19c-2.8 0-5-2.2-5-5v8", key: "pkpw2h" }],
461
473
  ["circle", { cx: "20", cy: "19", r: "2", key: "1obnsp" }]
462
474
  ];
463
- const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$c);
475
+ const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$d);
464
476
  /**
465
477
  * @license lucide-react v0.552.0 - ISC
466
478
  *
467
479
  * This source code is licensed under the ISC license.
468
480
  * See the LICENSE file in the root directory of this source tree.
469
481
  */
470
- const __iconNode$b = [
482
+ const __iconNode$c = [
471
483
  [
472
484
  "path",
473
485
  {
@@ -476,14 +488,14 @@ const __iconNode$b = [
476
488
  }
477
489
  ]
478
490
  ];
479
- const FolderOpen = createLucideIcon("folder-open", __iconNode$b);
491
+ const FolderOpen = createLucideIcon("folder-open", __iconNode$c);
480
492
  /**
481
493
  * @license lucide-react v0.552.0 - ISC
482
494
  *
483
495
  * This source code is licensed under the ISC license.
484
496
  * See the LICENSE file in the root directory of this source tree.
485
497
  */
486
- const __iconNode$a = [
498
+ const __iconNode$b = [
487
499
  [
488
500
  "path",
489
501
  {
@@ -492,14 +504,14 @@ const __iconNode$a = [
492
504
  }
493
505
  ]
494
506
  ];
495
- const Folder = createLucideIcon("folder", __iconNode$a);
507
+ const Folder = createLucideIcon("folder", __iconNode$b);
496
508
  /**
497
509
  * @license lucide-react v0.552.0 - ISC
498
510
  *
499
511
  * This source code is licensed under the ISC license.
500
512
  * See the LICENSE file in the root directory of this source tree.
501
513
  */
502
- const __iconNode$9 = [
514
+ const __iconNode$a = [
503
515
  ["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
504
516
  [
505
517
  "path",
@@ -509,7 +521,37 @@ const __iconNode$9 = [
509
521
  }
510
522
  ]
511
523
  ];
512
- const House = createLucideIcon("house", __iconNode$9);
524
+ const House = createLucideIcon("house", __iconNode$a);
525
+ /**
526
+ * @license lucide-react v0.552.0 - ISC
527
+ *
528
+ * This source code is licensed under the ISC license.
529
+ * See the LICENSE file in the root directory of this source tree.
530
+ */
531
+ const __iconNode$9 = [
532
+ [
533
+ "path",
534
+ {
535
+ 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",
536
+ key: "zw3jo"
537
+ }
538
+ ],
539
+ [
540
+ "path",
541
+ {
542
+ 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",
543
+ key: "1wduqc"
544
+ }
545
+ ],
546
+ [
547
+ "path",
548
+ {
549
+ 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",
550
+ key: "kqbvx6"
551
+ }
552
+ ]
553
+ ];
554
+ const Layers = createLucideIcon("layers", __iconNode$9);
513
555
  /**
514
556
  * @license lucide-react v0.552.0 - ISC
515
557
  *
@@ -561,10 +603,9 @@ const __iconNode$5 = [
561
603
  d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
562
604
  key: "1a8usu"
563
605
  }
564
- ],
565
- ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
606
+ ]
566
607
  ];
567
- const Pencil = createLucideIcon("pencil", __iconNode$5);
608
+ const Pen = createLucideIcon("pen", __iconNode$5);
568
609
  /**
569
610
  * @license lucide-react v0.552.0 - ISC
570
611
  *
@@ -608,17 +649,13 @@ const Search = createLucideIcon("search", __iconNode$2);
608
649
  * See the LICENSE file in the root directory of this source tree.
609
650
  */
610
651
  const __iconNode$1 = [
611
- [
612
- "path",
613
- {
614
- d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
615
- key: "wmoenq"
616
- }
617
- ],
618
- ["path", { d: "M12 9v4", key: "juzpu7" }],
619
- ["path", { d: "M12 17h.01", key: "p32p05" }]
652
+ ["path", { d: "M10 11v6", key: "nco0om" }],
653
+ ["path", { d: "M14 11v6", key: "outv1u" }],
654
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
655
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
656
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
620
657
  ];
621
- const TriangleAlert = createLucideIcon("triangle-alert", __iconNode$1);
658
+ const Trash2 = createLucideIcon("trash-2", __iconNode$1);
622
659
  /**
623
660
  * @license lucide-react v0.552.0 - ISC
624
661
  *
@@ -717,9 +754,7 @@ const LocalProjectCard = ({
717
754
  isLoading = false,
718
755
  windowState = "closed",
719
756
  compact: _compact = false,
720
- isEditMode = false,
721
- isInWorkspaceDirectory,
722
- workspacePath
757
+ isInWorkspaceDirectory
723
758
  }) => {
724
759
  var _a, _b, _c, _d;
725
760
  const { theme: theme2 } = useTheme();
@@ -731,6 +766,9 @@ const LocalProjectCard = ({
731
766
  const handleCardClick = () => {
732
767
  onSelect == null ? void 0 : onSelect(entry);
733
768
  };
769
+ const handleDoubleClick = () => {
770
+ onOpen == null ? void 0 : onOpen(entry);
771
+ };
734
772
  const handleOpenClick = (e) => {
735
773
  e.stopPropagation();
736
774
  onOpen == null ? void 0 : onOpen(entry);
@@ -761,15 +799,6 @@ const LocalProjectCard = ({
761
799
  setIsMoving(false);
762
800
  }
763
801
  };
764
- const displayPath = useMemo(() => {
765
- if (actionMode === "workspace" && isInWorkspaceDirectory && workspacePath) {
766
- if (entry.path.startsWith(workspacePath)) {
767
- const relativePath = entry.path.slice(workspacePath.length);
768
- return relativePath.startsWith("/") ? relativePath.slice(1) : relativePath;
769
- }
770
- }
771
- return entry.path;
772
- }, [actionMode, isInWorkspaceDirectory, workspacePath, entry.path]);
773
802
  const handleCopyPath = async (e) => {
774
803
  e.stopPropagation();
775
804
  try {
@@ -814,9 +843,37 @@ const LocalProjectCard = ({
814
843
  }
815
844
  );
816
845
  }
846
+ const copyPathButton = /* @__PURE__ */ jsxs(
847
+ "button",
848
+ {
849
+ type: "button",
850
+ onClick: handleCopyPath,
851
+ title: copiedPath ? "Copied!" : `Copy path: ${entry.path}`,
852
+ style: {
853
+ flex: buttonFlex,
854
+ display: "inline-flex",
855
+ alignItems: "center",
856
+ justifyContent: "center",
857
+ padding: "6px 10px",
858
+ gap: "4px",
859
+ borderRadius: "4px",
860
+ border: `1px solid ${copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.border}`,
861
+ backgroundColor: copiedPath ? `${theme2.colors.success || "#10b981"}15` : theme2.colors.backgroundTertiary,
862
+ color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textSecondary,
863
+ fontSize: `${theme2.fontSizes[0]}px`,
864
+ fontWeight: theme2.fontWeights.medium,
865
+ cursor: "pointer",
866
+ transition: "all 0.15s ease"
867
+ },
868
+ children: [
869
+ copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
870
+ copiedPath ? "Copied" : "Path"
871
+ ]
872
+ }
873
+ );
817
874
  if (actionMode === "workspace") {
818
875
  return /* @__PURE__ */ jsxs(Fragment, { children: [
819
- isEditMode && isInWorkspaceDirectory === false && onMoveToWorkspace && /* @__PURE__ */ jsxs(
876
+ isInWorkspaceDirectory === false && onMoveToWorkspace && /* @__PURE__ */ jsxs(
820
877
  "button",
821
878
  {
822
879
  type: "button",
@@ -846,6 +903,7 @@ const LocalProjectCard = ({
846
903
  ]
847
904
  }
848
905
  ),
906
+ copyPathButton,
849
907
  /* @__PURE__ */ jsxs(
850
908
  "button",
851
909
  {
@@ -874,7 +932,7 @@ const LocalProjectCard = ({
874
932
  ]
875
933
  }
876
934
  ),
877
- isEditMode && onRemoveFromWorkspace && /* @__PURE__ */ jsxs(
935
+ onRemoveFromWorkspace && /* @__PURE__ */ jsxs(
878
936
  "button",
879
937
  {
880
938
  type: "button",
@@ -909,6 +967,7 @@ const LocalProjectCard = ({
909
967
  ] });
910
968
  }
911
969
  return /* @__PURE__ */ jsxs(Fragment, { children: [
970
+ copyPathButton,
912
971
  /* @__PURE__ */ jsxs(
913
972
  "button",
914
973
  {
@@ -987,6 +1046,7 @@ const LocalProjectCard = ({
987
1046
  fontFamily: theme2.fonts.body
988
1047
  },
989
1048
  onClick: handleCardClick,
1049
+ onDoubleClick: handleDoubleClick,
990
1050
  children: [
991
1051
  /* @__PURE__ */ jsxs("div", { className: "local-project-card__content", children: [
992
1052
  /* @__PURE__ */ jsx(
@@ -1025,30 +1085,6 @@ const LocalProjectCard = ({
1025
1085
  children: entry.name
1026
1086
  }
1027
1087
  ),
1028
- /* @__PURE__ */ jsxs(
1029
- "div",
1030
- {
1031
- className: "local-project-card__path",
1032
- onClick: handleCopyPath,
1033
- style: {
1034
- fontSize: `${theme2.fontSizes[0]}px`,
1035
- fontFamily: theme2.fonts.monospace,
1036
- color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textTertiary || theme2.colors.textSecondary,
1037
- overflow: "hidden",
1038
- textOverflow: "ellipsis",
1039
- whiteSpace: "nowrap",
1040
- cursor: "pointer",
1041
- alignItems: "center",
1042
- gap: "4px",
1043
- transition: "color 0.15s ease"
1044
- },
1045
- title: copiedPath ? "Copied!" : `Click to copy: ${entry.path}`,
1046
- children: [
1047
- copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
1048
- displayPath
1049
- ]
1050
- }
1051
- ),
1052
1088
  ((_d = entry.github) == null ? void 0 : _d.description) && /* @__PURE__ */ jsx(
1053
1089
  "div",
1054
1090
  {
@@ -1080,10 +1116,10 @@ const LocalProjectCard = ({
1080
1116
  }
1081
1117
  );
1082
1118
  };
1083
- const PANEL_ID$4 = "industry-theme.local-projects";
1084
- const createPanelEvent$1 = (type, payload) => ({
1119
+ const PANEL_ID$6 = "industry-theme.local-projects";
1120
+ const createPanelEvent$2 = (type, payload) => ({
1085
1121
  type,
1086
- source: PANEL_ID$4,
1122
+ source: PANEL_ID$6,
1087
1123
  timestamp: Date.now(),
1088
1124
  payload
1089
1125
  });
@@ -1119,7 +1155,7 @@ const LocalProjectsPanelContent = ({
1119
1155
  try {
1120
1156
  await panelActions.openRepository(entry);
1121
1157
  setWindowStates((prev) => new Map(prev).set(entry.path, "ready"));
1122
- events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-opened`, { entry }));
1158
+ events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-opened`, { entry }));
1123
1159
  } catch (error) {
1124
1160
  console.error("Error opening repository:", error);
1125
1161
  setWindowStates((prev) => new Map(prev).set(entry.path, "closed"));
@@ -1130,14 +1166,14 @@ const LocalProjectsPanelContent = ({
1130
1166
  useEffect(() => {
1131
1167
  const unsubscribers = [
1132
1168
  // Filter event from tools
1133
- events.on(`${PANEL_ID$4}:filter`, (event) => {
1169
+ events.on(`${PANEL_ID$6}:filter`, (event) => {
1134
1170
  var _a2;
1135
1171
  if (((_a2 = event.payload) == null ? void 0 : _a2.filter) !== void 0) {
1136
1172
  setFilter(event.payload.filter);
1137
1173
  }
1138
1174
  }),
1139
1175
  // Select repository event from tools
1140
- events.on(`${PANEL_ID$4}:select-repository`, (event) => {
1176
+ events.on(`${PANEL_ID$6}:select-repository`, (event) => {
1141
1177
  var _a2;
1142
1178
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
1143
1179
  if (identifier) {
@@ -1146,12 +1182,12 @@ const LocalProjectsPanelContent = ({
1146
1182
  );
1147
1183
  if (entry) {
1148
1184
  setSelectedEntry(entry);
1149
- events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-selected`, { entry }));
1185
+ events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-selected`, { entry }));
1150
1186
  }
1151
1187
  }
1152
1188
  }),
1153
1189
  // Open repository event from tools
1154
- events.on(`${PANEL_ID$4}:open-repository`, (event) => {
1190
+ events.on(`${PANEL_ID$6}:open-repository`, (event) => {
1155
1191
  var _a2;
1156
1192
  const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
1157
1193
  if (identifier) {
@@ -1199,7 +1235,7 @@ const LocalProjectsPanelContent = ({
1199
1235
  };
1200
1236
  const handleSelectRepository = (entry) => {
1201
1237
  setSelectedEntry(entry);
1202
- events.emit(createPanelEvent$1(`${PANEL_ID$4}:repository-selected`, { entry }));
1238
+ events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-selected`, { entry }));
1203
1239
  };
1204
1240
  const normalizedFilter = filter.trim().toLowerCase();
1205
1241
  const filteredAndSortedRepositories = useMemo(() => {
@@ -1460,10 +1496,10 @@ const LocalProjectsPanelPreview = () => {
1460
1496
  }
1461
1497
  );
1462
1498
  };
1463
- const PANEL_ID$3 = "industry-theme.workspace-repositories";
1464
- const createPanelEvent = (type, payload) => ({
1499
+ const PANEL_ID$5 = "industry-theme.workspace-repositories";
1500
+ const createPanelEvent$1 = (type, payload) => ({
1465
1501
  type,
1466
- source: PANEL_ID$3,
1502
+ source: PANEL_ID$5,
1467
1503
  timestamp: Date.now(),
1468
1504
  payload
1469
1505
  });
@@ -1473,10 +1509,11 @@ const WorkspaceRepositoriesPanelContent = ({
1473
1509
  events
1474
1510
  }) => {
1475
1511
  const { theme: theme2 } = useTheme();
1476
- const [isEditMode, setIsEditMode] = React2.useState(false);
1477
1512
  const [repositoryLocations, setRepositoryLocations] = React2.useState(
1478
1513
  /* @__PURE__ */ new Map()
1479
1514
  );
1515
+ const [copiedPath, setCopiedPath] = useState(false);
1516
+ const [isPathHovered, setIsPathHovered] = useState(false);
1480
1517
  const panelActions = actions;
1481
1518
  const workspaceSlice = context.getSlice("workspace");
1482
1519
  const repositoriesSlice = context.getSlice("workspaceRepositories");
@@ -1525,7 +1562,7 @@ const WorkspaceRepositoriesPanelContent = ({
1525
1562
  (repository) => {
1526
1563
  var _a;
1527
1564
  events.emit(
1528
- createPanelEvent("repository:selected", {
1565
+ createPanelEvent$1("repository:selected", {
1529
1566
  repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
1530
1567
  repository,
1531
1568
  repositoryPath: repository.path
@@ -1538,7 +1575,7 @@ const WorkspaceRepositoriesPanelContent = ({
1538
1575
  (repository) => {
1539
1576
  var _a;
1540
1577
  events.emit(
1541
- createPanelEvent("repository:opened", {
1578
+ createPanelEvent$1("repository:opened", {
1542
1579
  repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
1543
1580
  repository
1544
1581
  })
@@ -1579,7 +1616,7 @@ const WorkspaceRepositoriesPanelContent = ({
1579
1616
  );
1580
1617
  useEffect(() => {
1581
1618
  const unsubscribers = [
1582
- events.on(`${PANEL_ID$3}:select-repository`, (event) => {
1619
+ events.on(`${PANEL_ID$5}:select-repository`, (event) => {
1583
1620
  var _a;
1584
1621
  const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1585
1622
  if (path) {
@@ -1589,7 +1626,7 @@ const WorkspaceRepositoriesPanelContent = ({
1589
1626
  }
1590
1627
  }
1591
1628
  }),
1592
- events.on(`${PANEL_ID$3}:open-repository`, (event) => {
1629
+ events.on(`${PANEL_ID$5}:open-repository`, (event) => {
1593
1630
  var _a;
1594
1631
  const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
1595
1632
  if (path) {
@@ -1719,9 +1756,6 @@ const WorkspaceRepositoriesPanelContent = ({
1719
1756
  }
1720
1757
  ) });
1721
1758
  }
1722
- const handleToggleEditMode = () => {
1723
- setIsEditMode(!isEditMode);
1724
- };
1725
1759
  return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
1726
1760
  /* @__PURE__ */ jsxs("div", { children: [
1727
1761
  /* @__PURE__ */ jsxs(
@@ -1735,99 +1769,66 @@ const WorkspaceRepositoriesPanelContent = ({
1735
1769
  marginBottom: "4px"
1736
1770
  },
1737
1771
  children: [
1738
- /* @__PURE__ */ jsxs(
1739
- "div",
1772
+ /* @__PURE__ */ jsx(
1773
+ "h3",
1740
1774
  {
1741
1775
  style: {
1742
- display: "flex",
1743
- alignItems: "center",
1744
- gap: "8px"
1776
+ margin: 0,
1777
+ fontSize: `${theme2.fontSizes[2]}px`,
1778
+ fontWeight: theme2.fontWeights.semibold,
1779
+ color: theme2.colors.text,
1780
+ fontFamily: theme2.fonts.body
1745
1781
  },
1746
- children: [
1747
- /* @__PURE__ */ jsx(
1748
- "h3",
1749
- {
1750
- style: {
1751
- margin: 0,
1752
- fontSize: `${theme2.fontSizes[2]}px`,
1753
- fontWeight: theme2.fontWeights.semibold,
1754
- color: theme2.colors.text,
1755
- fontFamily: theme2.fonts.body
1756
- },
1757
- children: workspace.name
1758
- }
1759
- ),
1760
- /* @__PURE__ */ jsx(
1761
- "button",
1762
- {
1763
- type: "button",
1764
- onClick: handleToggleEditMode,
1765
- title: isEditMode ? "Exit edit mode" : "Edit workspace",
1766
- style: {
1767
- display: "inline-flex",
1768
- alignItems: "center",
1769
- justifyContent: "center",
1770
- width: "24px",
1771
- height: "24px",
1772
- padding: 0,
1773
- borderRadius: "4px",
1774
- border: "none",
1775
- backgroundColor: isEditMode ? theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary : "transparent",
1776
- color: isEditMode ? theme2.colors.primary : theme2.colors.textSecondary,
1777
- cursor: "pointer",
1778
- transition: "all 0.15s ease"
1779
- },
1780
- onMouseEnter: (event) => {
1781
- if (!isEditMode) {
1782
- event.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary;
1783
- event.currentTarget.style.color = theme2.colors.text;
1784
- }
1785
- },
1786
- onMouseLeave: (event) => {
1787
- if (!isEditMode) {
1788
- event.currentTarget.style.backgroundColor = "transparent";
1789
- event.currentTarget.style.color = theme2.colors.textSecondary;
1790
- }
1791
- },
1792
- children: /* @__PURE__ */ jsx(Pencil, { size: 14 })
1793
- }
1794
- )
1795
- ]
1782
+ children: workspace.name
1796
1783
  }
1797
1784
  ),
1798
1785
  workspace.suggestedClonePath && /* @__PURE__ */ jsxs(
1799
- "div",
1786
+ "button",
1800
1787
  {
1788
+ type: "button",
1789
+ onClick: async () => {
1790
+ try {
1791
+ await navigator.clipboard.writeText(workspace.suggestedClonePath);
1792
+ setCopiedPath(true);
1793
+ setTimeout(() => setCopiedPath(false), 2e3);
1794
+ } catch (err) {
1795
+ console.error("Failed to copy path:", err);
1796
+ }
1797
+ },
1798
+ onMouseEnter: () => setIsPathHovered(true),
1799
+ onMouseLeave: () => setIsPathHovered(false),
1800
+ title: copiedPath ? "Copied!" : `Click to copy: ${workspace.suggestedClonePath}`,
1801
1801
  style: {
1802
1802
  display: "flex",
1803
1803
  alignItems: "center",
1804
1804
  gap: "6px",
1805
- minWidth: 0
1805
+ padding: "4px 8px",
1806
+ borderRadius: "4px",
1807
+ border: `1px solid ${copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.border}`,
1808
+ backgroundColor: copiedPath ? `${theme2.colors.success || "#10b981"}15` : theme2.colors.backgroundTertiary,
1809
+ color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textSecondary,
1810
+ cursor: "pointer",
1811
+ transition: "all 0.15s ease",
1812
+ minWidth: 0,
1813
+ maxWidth: isPathHovered || copiedPath ? "200px" : "32px",
1814
+ overflow: "hidden"
1806
1815
  },
1807
1816
  children: [
1808
- /* @__PURE__ */ jsx(
1809
- House,
1810
- {
1811
- size: 14,
1812
- style: {
1813
- color: theme2.colors.textSecondary,
1814
- flexShrink: 0
1815
- }
1816
- }
1817
- ),
1817
+ copiedPath ? /* @__PURE__ */ jsx(Check, { size: 14, style: { flexShrink: 0 } }) : /* @__PURE__ */ jsx(House, { size: 14, style: { flexShrink: 0 } }),
1818
1818
  /* @__PURE__ */ jsx(
1819
1819
  "span",
1820
1820
  {
1821
1821
  style: {
1822
1822
  fontSize: `${theme2.fontSizes[0]}px`,
1823
- color: theme2.colors.textSecondary,
1824
1823
  fontFamily: theme2.fonts.monospace,
1825
1824
  whiteSpace: "nowrap",
1826
1825
  overflow: "hidden",
1827
- textOverflow: "ellipsis"
1826
+ textOverflow: "ellipsis",
1827
+ opacity: isPathHovered || copiedPath ? 1 : 0,
1828
+ width: isPathHovered || copiedPath ? "auto" : 0,
1829
+ transition: "opacity 0.15s ease"
1828
1830
  },
1829
- title: workspace.suggestedClonePath,
1830
- children: workspace.suggestedClonePath
1831
+ children: copiedPath ? "Copied!" : workspace.suggestedClonePath
1831
1832
  }
1832
1833
  )
1833
1834
  ]
@@ -1872,53 +1873,20 @@ const WorkspaceRepositoriesPanelContent = ({
1872
1873
  }
1873
1874
  ),
1874
1875
  repositoriesInWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
1875
- /* @__PURE__ */ jsxs(
1876
- "div",
1876
+ /* @__PURE__ */ jsx(
1877
+ "h4",
1877
1878
  {
1878
1879
  style: {
1879
- display: "flex",
1880
- alignItems: "center",
1881
- gap: "6px",
1882
- paddingBottom: "4px"
1880
+ margin: 0,
1881
+ paddingBottom: "4px",
1882
+ fontSize: `${theme2.fontSizes[1]}px`,
1883
+ fontWeight: theme2.fontWeights.semibold,
1884
+ color: theme2.colors.textSecondary,
1885
+ fontFamily: theme2.fonts.body,
1886
+ textTransform: "uppercase",
1887
+ letterSpacing: "0.5px"
1883
1888
  },
1884
- children: [
1885
- /* @__PURE__ */ jsx(
1886
- House,
1887
- {
1888
- size: 14,
1889
- style: {
1890
- color: theme2.colors.success || "#10b981",
1891
- flexShrink: 0
1892
- }
1893
- }
1894
- ),
1895
- /* @__PURE__ */ jsx(
1896
- "h4",
1897
- {
1898
- style: {
1899
- margin: 0,
1900
- fontSize: `${theme2.fontSizes[1]}px`,
1901
- fontWeight: theme2.fontWeights.semibold,
1902
- color: theme2.colors.textSecondary,
1903
- fontFamily: theme2.fonts.body,
1904
- textTransform: "uppercase",
1905
- letterSpacing: "0.5px"
1906
- },
1907
- children: "In Workspace Directory"
1908
- }
1909
- ),
1910
- /* @__PURE__ */ jsx(
1911
- "span",
1912
- {
1913
- style: {
1914
- fontSize: `${theme2.fontSizes[0]}px`,
1915
- color: theme2.colors.textTertiary || theme2.colors.textSecondary,
1916
- fontWeight: theme2.fontWeights.medium
1917
- },
1918
- children: repositoriesInWorkspace.length
1919
- }
1920
- )
1921
- ]
1889
+ children: "In Workspace Directory"
1922
1890
  }
1923
1891
  ),
1924
1892
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesInWorkspace.map((repository) => /* @__PURE__ */ jsx(
@@ -1926,7 +1894,6 @@ const WorkspaceRepositoriesPanelContent = ({
1926
1894
  {
1927
1895
  entry: repository,
1928
1896
  actionMode: "workspace",
1929
- isEditMode,
1930
1897
  isInWorkspaceDirectory: true,
1931
1898
  workspacePath: workspace.suggestedClonePath,
1932
1899
  onSelect: handleSelectRepository,
@@ -1938,53 +1905,20 @@ const WorkspaceRepositoriesPanelContent = ({
1938
1905
  )) })
1939
1906
  ] }),
1940
1907
  repositoriesOutsideWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
1941
- /* @__PURE__ */ jsxs(
1942
- "div",
1908
+ /* @__PURE__ */ jsx(
1909
+ "h4",
1943
1910
  {
1944
1911
  style: {
1945
- display: "flex",
1946
- alignItems: "center",
1947
- gap: "6px",
1948
- paddingBottom: "4px"
1912
+ margin: 0,
1913
+ paddingBottom: "4px",
1914
+ fontSize: `${theme2.fontSizes[1]}px`,
1915
+ fontWeight: theme2.fontWeights.semibold,
1916
+ color: theme2.colors.textSecondary,
1917
+ fontFamily: theme2.fonts.body,
1918
+ textTransform: "uppercase",
1919
+ letterSpacing: "0.5px"
1949
1920
  },
1950
- children: [
1951
- /* @__PURE__ */ jsx(
1952
- TriangleAlert,
1953
- {
1954
- size: 14,
1955
- style: {
1956
- color: theme2.colors.warning || "#f59e0b",
1957
- flexShrink: 0
1958
- }
1959
- }
1960
- ),
1961
- /* @__PURE__ */ jsx(
1962
- "h4",
1963
- {
1964
- style: {
1965
- margin: 0,
1966
- fontSize: `${theme2.fontSizes[1]}px`,
1967
- fontWeight: theme2.fontWeights.semibold,
1968
- color: theme2.colors.textSecondary,
1969
- fontFamily: theme2.fonts.body,
1970
- textTransform: "uppercase",
1971
- letterSpacing: "0.5px"
1972
- },
1973
- children: "Outside Workspace Directory"
1974
- }
1975
- ),
1976
- /* @__PURE__ */ jsx(
1977
- "span",
1978
- {
1979
- style: {
1980
- fontSize: `${theme2.fontSizes[0]}px`,
1981
- color: theme2.colors.textTertiary || theme2.colors.textSecondary,
1982
- fontWeight: theme2.fontWeights.medium
1983
- },
1984
- children: repositoriesOutsideWorkspace.length
1985
- }
1986
- )
1987
- ]
1921
+ children: "Outside Workspace Directory"
1988
1922
  }
1989
1923
  ),
1990
1924
  /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesOutsideWorkspace.map((repository) => /* @__PURE__ */ jsx(
@@ -1992,7 +1926,6 @@ const WorkspaceRepositoriesPanelContent = ({
1992
1926
  {
1993
1927
  entry: repository,
1994
1928
  actionMode: "workspace",
1995
- isEditMode,
1996
1929
  isInWorkspaceDirectory: false,
1997
1930
  workspacePath: workspace.suggestedClonePath,
1998
1931
  onSelect: handleSelectRepository,
@@ -2011,34 +1944,842 @@ const WorkspaceRepositoriesPanelContent = ({
2011
1944
  const WorkspaceRepositoriesPanel = (props) => {
2012
1945
  return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WorkspaceRepositoriesPanelContent, { ...props }) });
2013
1946
  };
2014
- const DependencyInfoModal = ({
2015
- isOpen,
2016
- onClose
1947
+ const WorkspaceCard = ({
1948
+ workspace,
1949
+ isSelected = false,
1950
+ isDefault = false,
1951
+ onClick,
1952
+ onOpen,
1953
+ onDelete,
1954
+ onUpdateName,
1955
+ themeColor
2017
1956
  }) => {
2018
1957
  const { theme: theme2 } = useTheme();
2019
- if (!isOpen) return null;
2020
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
1958
+ const [isHovered, setIsHovered] = useState(false);
1959
+ const [isEditing, setIsEditing] = useState(false);
1960
+ const [editedName, setEditedName] = useState(workspace.name);
1961
+ const [isSaving, setIsSaving] = useState(false);
1962
+ const iconColor = themeColor || theme2.colors.primary;
1963
+ const handleStartEdit = (e) => {
1964
+ e.stopPropagation();
1965
+ setIsEditing(true);
1966
+ setEditedName(workspace.name);
1967
+ };
1968
+ const handleSave = async (e) => {
1969
+ if (e) e.stopPropagation();
1970
+ const trimmedName = editedName.trim();
1971
+ if (!trimmedName || trimmedName === workspace.name) {
1972
+ setIsEditing(false);
1973
+ setEditedName(workspace.name);
1974
+ return;
1975
+ }
1976
+ if (!onUpdateName) {
1977
+ setIsEditing(false);
1978
+ return;
1979
+ }
1980
+ try {
1981
+ setIsSaving(true);
1982
+ await onUpdateName(workspace.id, trimmedName);
1983
+ setIsEditing(false);
1984
+ } catch (error) {
1985
+ console.error("Failed to update workspace name:", error);
1986
+ setEditedName(workspace.name);
1987
+ } finally {
1988
+ setIsSaving(false);
1989
+ }
1990
+ };
1991
+ const handleCancel = (e) => {
1992
+ if (e) e.stopPropagation();
1993
+ setIsEditing(false);
1994
+ setEditedName(workspace.name);
1995
+ };
1996
+ const handleKeyDown = (e) => {
1997
+ if (e.key === "Enter") {
1998
+ e.preventDefault();
1999
+ handleSave();
2000
+ } else if (e.key === "Escape") {
2001
+ e.preventDefault();
2002
+ handleCancel();
2003
+ }
2004
+ };
2005
+ const handleClick = () => {
2006
+ if (!isEditing) {
2007
+ onClick == null ? void 0 : onClick(workspace);
2008
+ }
2009
+ };
2010
+ const handleDoubleClick = () => {
2011
+ if (!isEditing) {
2012
+ onOpen == null ? void 0 : onOpen(workspace);
2013
+ }
2014
+ };
2015
+ const handleOpenClick = (e) => {
2016
+ e.stopPropagation();
2017
+ onOpen == null ? void 0 : onOpen(workspace);
2018
+ };
2019
+ const handleDeleteClick = (e) => {
2020
+ e.stopPropagation();
2021
+ onDelete == null ? void 0 : onDelete(workspace);
2022
+ };
2023
+ const cardStyle = {
2024
+ display: "flex",
2025
+ flexDirection: "row",
2026
+ gap: "8px",
2027
+ padding: "12px",
2028
+ borderRadius: "6px",
2029
+ backgroundColor: isSelected ? theme2.colors.backgroundTertiary : isHovered ? theme2.colors.backgroundTertiary : "transparent",
2030
+ border: `1px solid ${isSelected ? theme2.colors.primary || theme2.colors.border : isHovered ? theme2.colors.border : "transparent"}`,
2031
+ cursor: isEditing ? "default" : "pointer",
2032
+ transition: "all 0.15s ease"
2033
+ };
2034
+ const headerStyle = {
2035
+ display: "flex",
2036
+ alignItems: "center",
2037
+ gap: "8px",
2038
+ color: theme2.colors.text,
2039
+ fontSize: `${theme2.fontSizes[2]}px`,
2040
+ fontWeight: theme2.fontWeights.semibold,
2041
+ fontFamily: theme2.fonts.body
2042
+ };
2043
+ const actionButtonStyle = {
2044
+ display: "flex",
2045
+ alignItems: "center",
2046
+ justifyContent: "center",
2047
+ width: "24px",
2048
+ height: "24px",
2049
+ padding: 0,
2050
+ border: "none",
2051
+ borderRadius: "4px",
2052
+ backgroundColor: "transparent",
2053
+ color: theme2.colors.textSecondary,
2054
+ cursor: "pointer",
2055
+ opacity: isHovered ? 1 : 0,
2056
+ pointerEvents: isHovered ? "auto" : "none",
2057
+ transition: "all 0.15s ease"
2058
+ };
2059
+ return /* @__PURE__ */ jsxs(
2021
2060
  "div",
2022
2061
  {
2023
- style: {
2024
- position: "fixed",
2025
- top: 0,
2026
- left: 0,
2027
- right: 0,
2028
- bottom: 0,
2029
- backgroundColor: theme2.colors.muted,
2030
- zIndex: theme2.zIndices[4],
2031
- display: "flex",
2032
- alignItems: "center",
2033
- justifyContent: "center"
2034
- },
2035
- onClick: onClose,
2036
- children: /* @__PURE__ */ jsxs(
2037
- "div",
2038
- {
2039
- style: {
2040
- backgroundColor: theme2.colors.background,
2041
- borderRadius: `${theme2.radii[3]}px`,
2062
+ style: cardStyle,
2063
+ onClick: handleClick,
2064
+ onDoubleClick: handleDoubleClick,
2065
+ onMouseEnter: () => setIsHovered(true),
2066
+ onMouseLeave: () => setIsHovered(false),
2067
+ children: [
2068
+ /* @__PURE__ */ jsx(
2069
+ "div",
2070
+ {
2071
+ style: {
2072
+ display: "flex",
2073
+ alignItems: "center",
2074
+ justifyContent: "center",
2075
+ width: "40px",
2076
+ height: "40px",
2077
+ borderRadius: "6px",
2078
+ backgroundColor: `color-mix(in srgb, ${iconColor} 12%, transparent)`,
2079
+ color: iconColor,
2080
+ flexShrink: 0,
2081
+ marginTop: "2px"
2082
+ },
2083
+ children: workspace.icon ? /* @__PURE__ */ jsx("span", { style: { fontSize: `${theme2.fontSizes[3]}px` }, children: workspace.icon }) : /* @__PURE__ */ jsx(DoorClosed, { size: 24 })
2084
+ }
2085
+ ),
2086
+ /* @__PURE__ */ jsxs(
2087
+ "div",
2088
+ {
2089
+ style: {
2090
+ flex: 1,
2091
+ display: "flex",
2092
+ flexDirection: "column",
2093
+ gap: "4px",
2094
+ minWidth: 0
2095
+ },
2096
+ children: [
2097
+ /* @__PURE__ */ jsx("div", { style: headerStyle, children: isEditing ? /* @__PURE__ */ jsxs(Fragment, { children: [
2098
+ /* @__PURE__ */ jsx(
2099
+ "input",
2100
+ {
2101
+ type: "text",
2102
+ value: editedName,
2103
+ onChange: (e) => setEditedName(e.target.value),
2104
+ onKeyDown: handleKeyDown,
2105
+ onClick: (e) => e.stopPropagation(),
2106
+ autoFocus: true,
2107
+ disabled: isSaving,
2108
+ style: {
2109
+ flex: 1,
2110
+ padding: "4px 8px",
2111
+ borderRadius: "4px",
2112
+ border: `1px solid ${theme2.colors.border}`,
2113
+ backgroundColor: theme2.colors.background,
2114
+ color: theme2.colors.text,
2115
+ fontSize: `${theme2.fontSizes[2]}px`,
2116
+ fontWeight: theme2.fontWeights.semibold,
2117
+ fontFamily: theme2.fonts.body,
2118
+ outline: "none"
2119
+ }
2120
+ }
2121
+ ),
2122
+ /* @__PURE__ */ jsx(
2123
+ "button",
2124
+ {
2125
+ onClick: handleSave,
2126
+ disabled: isSaving,
2127
+ title: "Save (Enter)",
2128
+ style: {
2129
+ display: "flex",
2130
+ alignItems: "center",
2131
+ justifyContent: "center",
2132
+ width: "24px",
2133
+ height: "24px",
2134
+ padding: 0,
2135
+ border: "none",
2136
+ borderRadius: "4px",
2137
+ backgroundColor: theme2.colors.success,
2138
+ color: theme2.colors.background,
2139
+ cursor: isSaving ? "not-allowed" : "pointer",
2140
+ opacity: isSaving ? 0.6 : 1,
2141
+ transition: "opacity 0.15s ease"
2142
+ },
2143
+ children: /* @__PURE__ */ jsx(Check, { size: 16 })
2144
+ }
2145
+ ),
2146
+ /* @__PURE__ */ jsx(
2147
+ "button",
2148
+ {
2149
+ onClick: handleCancel,
2150
+ disabled: isSaving,
2151
+ title: "Cancel (Esc)",
2152
+ style: {
2153
+ display: "flex",
2154
+ alignItems: "center",
2155
+ justifyContent: "center",
2156
+ width: "24px",
2157
+ height: "24px",
2158
+ padding: 0,
2159
+ border: "none",
2160
+ borderRadius: "4px",
2161
+ backgroundColor: theme2.colors.backgroundTertiary,
2162
+ color: theme2.colors.text,
2163
+ cursor: isSaving ? "not-allowed" : "pointer",
2164
+ opacity: isSaving ? 0.6 : 1,
2165
+ transition: "opacity 0.15s ease"
2166
+ },
2167
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
2168
+ }
2169
+ )
2170
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2171
+ /* @__PURE__ */ jsx(
2172
+ "span",
2173
+ {
2174
+ style: {
2175
+ flex: 1,
2176
+ whiteSpace: "nowrap",
2177
+ overflow: "hidden",
2178
+ textOverflow: "ellipsis"
2179
+ },
2180
+ children: workspace.name
2181
+ }
2182
+ ),
2183
+ onOpen && /* @__PURE__ */ jsx(
2184
+ "button",
2185
+ {
2186
+ onClick: handleOpenClick,
2187
+ title: "Open workspace",
2188
+ style: actionButtonStyle,
2189
+ onMouseEnter: (e) => {
2190
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary;
2191
+ e.currentTarget.style.color = theme2.colors.text;
2192
+ },
2193
+ onMouseLeave: (e) => {
2194
+ e.currentTarget.style.backgroundColor = "transparent";
2195
+ e.currentTarget.style.color = theme2.colors.textSecondary;
2196
+ },
2197
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
2198
+ }
2199
+ ),
2200
+ onUpdateName && /* @__PURE__ */ jsx(
2201
+ "button",
2202
+ {
2203
+ onClick: handleStartEdit,
2204
+ title: "Edit workspace name",
2205
+ style: actionButtonStyle,
2206
+ onMouseEnter: (e) => {
2207
+ e.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary;
2208
+ e.currentTarget.style.color = theme2.colors.text;
2209
+ },
2210
+ onMouseLeave: (e) => {
2211
+ e.currentTarget.style.backgroundColor = "transparent";
2212
+ e.currentTarget.style.color = theme2.colors.textSecondary;
2213
+ },
2214
+ children: /* @__PURE__ */ jsx(Pen, { size: 16 })
2215
+ }
2216
+ ),
2217
+ onDelete && /* @__PURE__ */ jsx(
2218
+ "button",
2219
+ {
2220
+ onClick: handleDeleteClick,
2221
+ title: "Delete workspace",
2222
+ style: actionButtonStyle,
2223
+ onMouseEnter: (e) => {
2224
+ e.currentTarget.style.backgroundColor = `${theme2.colors.error}15`;
2225
+ e.currentTarget.style.color = theme2.colors.error;
2226
+ },
2227
+ onMouseLeave: (e) => {
2228
+ e.currentTarget.style.backgroundColor = "transparent";
2229
+ e.currentTarget.style.color = theme2.colors.textSecondary;
2230
+ },
2231
+ children: /* @__PURE__ */ jsx(Trash2, { size: 16 })
2232
+ }
2233
+ ),
2234
+ isDefault && /* @__PURE__ */ jsx(
2235
+ "span",
2236
+ {
2237
+ style: {
2238
+ fontSize: `${theme2.fontSizes[1]}px`,
2239
+ color: theme2.colors.textSecondary,
2240
+ fontWeight: 400,
2241
+ flexShrink: 0
2242
+ },
2243
+ children: "Default"
2244
+ }
2245
+ )
2246
+ ] }) }),
2247
+ workspace.description && !isEditing && /* @__PURE__ */ jsx(
2248
+ "div",
2249
+ {
2250
+ style: {
2251
+ fontSize: `${theme2.fontSizes[1]}px`,
2252
+ color: theme2.colors.textSecondary,
2253
+ fontFamily: theme2.fonts.body,
2254
+ lineHeight: 1.4,
2255
+ whiteSpace: "nowrap",
2256
+ overflow: "hidden",
2257
+ textOverflow: "ellipsis"
2258
+ },
2259
+ title: workspace.description,
2260
+ children: workspace.description
2261
+ }
2262
+ )
2263
+ ]
2264
+ }
2265
+ )
2266
+ ]
2267
+ }
2268
+ );
2269
+ };
2270
+ const PANEL_ID$4 = "industry-theme.workspaces-list";
2271
+ const createPanelEvent = (type, payload) => ({
2272
+ type,
2273
+ source: PANEL_ID$4,
2274
+ timestamp: Date.now(),
2275
+ payload
2276
+ });
2277
+ const WorkspacesListPanelContent = ({
2278
+ context,
2279
+ actions,
2280
+ events
2281
+ }) => {
2282
+ var _a, _b;
2283
+ const { theme: theme2 } = useTheme();
2284
+ const [searchQuery, setSearchQuery] = useState("");
2285
+ const [showSearchBox, setShowSearchBox] = useState(false);
2286
+ const [selectedWorkspaceId, setSelectedWorkspaceId] = useState(null);
2287
+ const [workspaceRepositories, setWorkspaceRepositories] = useState(
2288
+ /* @__PURE__ */ new Map()
2289
+ );
2290
+ const [isCreating, setIsCreating] = useState(false);
2291
+ const panelActions = actions;
2292
+ const workspacesSlice = context.getSlice("workspaces");
2293
+ const workspaces = useMemo(
2294
+ () => {
2295
+ var _a2;
2296
+ return ((_a2 = workspacesSlice == null ? void 0 : workspacesSlice.data) == null ? void 0 : _a2.workspaces) || [];
2297
+ },
2298
+ [(_a = workspacesSlice == null ? void 0 : workspacesSlice.data) == null ? void 0 : _a.workspaces]
2299
+ );
2300
+ const defaultWorkspaceId = ((_b = workspacesSlice == null ? void 0 : workspacesSlice.data) == null ? void 0 : _b.defaultWorkspaceId) ?? null;
2301
+ const loading = (workspacesSlice == null ? void 0 : workspacesSlice.loading) ?? false;
2302
+ useEffect(() => {
2303
+ const loadRepositories = async () => {
2304
+ if (!panelActions.getWorkspaceRepositories || workspaces.length === 0) {
2305
+ return;
2306
+ }
2307
+ const repoMap = /* @__PURE__ */ new Map();
2308
+ await Promise.all(
2309
+ workspaces.map(async (workspace) => {
2310
+ try {
2311
+ const repos = await panelActions.getWorkspaceRepositories(workspace.id);
2312
+ repoMap.set(workspace.id, repos.map((r) => r.name));
2313
+ } catch (error) {
2314
+ console.error(`Failed to load repos for workspace ${workspace.id}:`, error);
2315
+ repoMap.set(workspace.id, []);
2316
+ }
2317
+ })
2318
+ );
2319
+ setWorkspaceRepositories(repoMap);
2320
+ };
2321
+ loadRepositories();
2322
+ }, [workspaces, panelActions]);
2323
+ const sortedWorkspaces = useMemo(() => {
2324
+ let filtered = workspaces;
2325
+ if (searchQuery.trim()) {
2326
+ const query = searchQuery.toLowerCase().trim();
2327
+ filtered = workspaces.filter((workspace) => {
2328
+ var _a2;
2329
+ if (workspace.name.toLowerCase().includes(query)) {
2330
+ return true;
2331
+ }
2332
+ if ((_a2 = workspace.description) == null ? void 0 : _a2.toLowerCase().includes(query)) {
2333
+ return true;
2334
+ }
2335
+ const repos = workspaceRepositories.get(workspace.id) || [];
2336
+ return repos.some((repoName) => repoName.toLowerCase().includes(query));
2337
+ });
2338
+ }
2339
+ return [...filtered].sort((a, b) => {
2340
+ if (a.id === defaultWorkspaceId) return -1;
2341
+ if (b.id === defaultWorkspaceId) return 1;
2342
+ return a.name.toLowerCase().localeCompare(b.name.toLowerCase());
2343
+ });
2344
+ }, [workspaces, defaultWorkspaceId, searchQuery, workspaceRepositories]);
2345
+ const handleWorkspaceSelect = useCallback(
2346
+ (workspace) => {
2347
+ setSelectedWorkspaceId(workspace.id);
2348
+ events.emit(
2349
+ createPanelEvent(`${PANEL_ID$4}:workspace:selected`, {
2350
+ workspaceId: workspace.id,
2351
+ workspace
2352
+ })
2353
+ );
2354
+ },
2355
+ [events]
2356
+ );
2357
+ const handleOpenWorkspace = useCallback(
2358
+ async (workspace) => {
2359
+ if (!panelActions.openWorkspace) {
2360
+ console.warn("Open workspace action not available");
2361
+ return;
2362
+ }
2363
+ try {
2364
+ await panelActions.openWorkspace(workspace.id);
2365
+ events.emit(
2366
+ createPanelEvent(`${PANEL_ID$4}:workspace:opened`, {
2367
+ workspaceId: workspace.id,
2368
+ workspace
2369
+ })
2370
+ );
2371
+ } catch (error) {
2372
+ console.error("Failed to open workspace:", error);
2373
+ }
2374
+ },
2375
+ [panelActions, events]
2376
+ );
2377
+ const handleDeleteWorkspace = useCallback(
2378
+ async (workspace) => {
2379
+ if (!panelActions.deleteWorkspace) {
2380
+ console.warn("Delete workspace action not available");
2381
+ return;
2382
+ }
2383
+ const confirmed = window.confirm(
2384
+ `Are you sure you want to delete "${workspace.name}"? This action cannot be undone.`
2385
+ );
2386
+ if (!confirmed) return;
2387
+ try {
2388
+ await panelActions.deleteWorkspace(workspace.id);
2389
+ events.emit(
2390
+ createPanelEvent(`${PANEL_ID$4}:workspace:deleted`, {
2391
+ workspaceId: workspace.id
2392
+ })
2393
+ );
2394
+ await context.refresh("workspace", "workspaces");
2395
+ } catch (error) {
2396
+ console.error("Failed to delete workspace:", error);
2397
+ }
2398
+ },
2399
+ [panelActions, events, context]
2400
+ );
2401
+ const handleUpdateWorkspaceName = useCallback(
2402
+ async (workspaceId, newName) => {
2403
+ if (!panelActions.updateWorkspace) {
2404
+ console.warn("Update workspace action not available");
2405
+ return;
2406
+ }
2407
+ await panelActions.updateWorkspace(workspaceId, { name: newName });
2408
+ await context.refresh("workspace", "workspaces");
2409
+ },
2410
+ [panelActions, context]
2411
+ );
2412
+ const handleCreateWorkspace = useCallback(async () => {
2413
+ if (!panelActions.createWorkspace) {
2414
+ console.warn("Create workspace action not available");
2415
+ return;
2416
+ }
2417
+ const name = window.prompt("Enter workspace name:");
2418
+ if (!(name == null ? void 0 : name.trim())) return;
2419
+ try {
2420
+ setIsCreating(true);
2421
+ const workspace = await panelActions.createWorkspace(name.trim());
2422
+ events.emit(
2423
+ createPanelEvent(`${PANEL_ID$4}:workspace:created`, {
2424
+ workspaceId: workspace.id,
2425
+ workspace
2426
+ })
2427
+ );
2428
+ await context.refresh("workspace", "workspaces");
2429
+ } catch (error) {
2430
+ console.error("Failed to create workspace:", error);
2431
+ } finally {
2432
+ setIsCreating(false);
2433
+ }
2434
+ }, [panelActions, events, context]);
2435
+ useEffect(() => {
2436
+ const unsubscribers = [
2437
+ // Select workspace event from tools
2438
+ events.on(`${PANEL_ID$4}:select-workspace`, (event) => {
2439
+ var _a2;
2440
+ const workspaceId = (_a2 = event.payload) == null ? void 0 : _a2.workspaceId;
2441
+ if (workspaceId) {
2442
+ const workspace = workspaces.find((w) => w.id === workspaceId);
2443
+ if (workspace) {
2444
+ handleWorkspaceSelect(workspace);
2445
+ }
2446
+ }
2447
+ }),
2448
+ // Open workspace event from tools
2449
+ events.on(`${PANEL_ID$4}:open-workspace`, (event) => {
2450
+ var _a2;
2451
+ const workspaceId = (_a2 = event.payload) == null ? void 0 : _a2.workspaceId;
2452
+ if (workspaceId) {
2453
+ const workspace = workspaces.find((w) => w.id === workspaceId);
2454
+ if (workspace) {
2455
+ handleOpenWorkspace(workspace);
2456
+ }
2457
+ }
2458
+ }),
2459
+ // Create workspace event from tools
2460
+ events.on(
2461
+ `${PANEL_ID$4}:create-workspace`,
2462
+ async (event) => {
2463
+ const { name, description } = event.payload || {};
2464
+ if (name && panelActions.createWorkspace) {
2465
+ try {
2466
+ const workspace = await panelActions.createWorkspace(name, { description });
2467
+ events.emit(
2468
+ createPanelEvent(`${PANEL_ID$4}:workspace:created`, {
2469
+ workspaceId: workspace.id,
2470
+ workspace
2471
+ })
2472
+ );
2473
+ await context.refresh("workspace", "workspaces");
2474
+ } catch (error) {
2475
+ console.error("Failed to create workspace:", error);
2476
+ }
2477
+ }
2478
+ }
2479
+ )
2480
+ ];
2481
+ return () => unsubscribers.forEach((unsub) => unsub());
2482
+ }, [events, workspaces, handleWorkspaceSelect, handleOpenWorkspace, panelActions, context]);
2483
+ const baseContainerStyle = {
2484
+ display: "flex",
2485
+ flexDirection: "column",
2486
+ height: "100%",
2487
+ backgroundColor: theme2.colors.backgroundSecondary
2488
+ };
2489
+ const contentContainerStyle = {
2490
+ ...baseContainerStyle,
2491
+ padding: "16px",
2492
+ gap: "12px"
2493
+ };
2494
+ if (loading) {
2495
+ return /* @__PURE__ */ jsx("div", { style: baseContainerStyle, children: /* @__PURE__ */ jsx(
2496
+ "div",
2497
+ {
2498
+ style: {
2499
+ flex: 1,
2500
+ display: "flex",
2501
+ alignItems: "center",
2502
+ justifyContent: "center",
2503
+ padding: "32px",
2504
+ textAlign: "center"
2505
+ },
2506
+ children: /* @__PURE__ */ jsx(
2507
+ "div",
2508
+ {
2509
+ style: {
2510
+ display: "flex",
2511
+ flexDirection: "column",
2512
+ alignItems: "center",
2513
+ gap: "16px",
2514
+ maxWidth: "360px"
2515
+ },
2516
+ children: /* @__PURE__ */ jsx(
2517
+ "h3",
2518
+ {
2519
+ style: {
2520
+ margin: 0,
2521
+ color: theme2.colors.text,
2522
+ fontSize: `${theme2.fontSizes[3]}px`,
2523
+ fontWeight: theme2.fontWeights.semibold,
2524
+ fontFamily: theme2.fonts.body
2525
+ },
2526
+ children: "Loading workspaces..."
2527
+ }
2528
+ )
2529
+ }
2530
+ )
2531
+ }
2532
+ ) });
2533
+ }
2534
+ return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
2535
+ /* @__PURE__ */ jsxs(
2536
+ "div",
2537
+ {
2538
+ style: {
2539
+ display: "flex",
2540
+ alignItems: "center",
2541
+ justifyContent: "space-between",
2542
+ gap: "8px"
2543
+ },
2544
+ children: [
2545
+ /* @__PURE__ */ jsx(
2546
+ "h3",
2547
+ {
2548
+ style: {
2549
+ margin: 0,
2550
+ fontSize: `${theme2.fontSizes[2]}px`,
2551
+ fontWeight: theme2.fontWeights.semibold,
2552
+ color: theme2.colors.text,
2553
+ fontFamily: theme2.fonts.body
2554
+ },
2555
+ children: "Workspaces"
2556
+ }
2557
+ ),
2558
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
2559
+ /* @__PURE__ */ jsx(
2560
+ "button",
2561
+ {
2562
+ onClick: () => {
2563
+ setShowSearchBox(!showSearchBox);
2564
+ if (showSearchBox) {
2565
+ setSearchQuery("");
2566
+ }
2567
+ },
2568
+ style: {
2569
+ display: "flex",
2570
+ alignItems: "center",
2571
+ justifyContent: "center",
2572
+ width: "28px",
2573
+ height: "28px",
2574
+ borderRadius: "6px",
2575
+ border: `1px solid ${theme2.colors.border}`,
2576
+ backgroundColor: showSearchBox ? theme2.colors.primary : theme2.colors.backgroundTertiary,
2577
+ color: showSearchBox ? theme2.colors.background : theme2.colors.text,
2578
+ cursor: "pointer",
2579
+ transition: "all 0.15s ease"
2580
+ },
2581
+ title: "Search workspaces",
2582
+ children: /* @__PURE__ */ jsx(Search, { size: 16 })
2583
+ }
2584
+ ),
2585
+ panelActions.createWorkspace && /* @__PURE__ */ jsx(
2586
+ "button",
2587
+ {
2588
+ onClick: handleCreateWorkspace,
2589
+ disabled: isCreating,
2590
+ style: {
2591
+ display: "flex",
2592
+ alignItems: "center",
2593
+ justifyContent: "center",
2594
+ width: "28px",
2595
+ height: "28px",
2596
+ borderRadius: "6px",
2597
+ border: `1px solid ${theme2.colors.border}`,
2598
+ backgroundColor: theme2.colors.primary,
2599
+ color: theme2.colors.background,
2600
+ cursor: isCreating ? "not-allowed" : "pointer",
2601
+ opacity: isCreating ? 0.6 : 1,
2602
+ transition: "all 0.15s ease"
2603
+ },
2604
+ title: "Create new workspace",
2605
+ children: /* @__PURE__ */ jsx(Plus, { size: 16 })
2606
+ }
2607
+ )
2608
+ ] })
2609
+ ]
2610
+ }
2611
+ ),
2612
+ showSearchBox && /* @__PURE__ */ jsxs(
2613
+ "div",
2614
+ {
2615
+ style: {
2616
+ display: "flex",
2617
+ alignItems: "center",
2618
+ gap: "8px"
2619
+ },
2620
+ children: [
2621
+ /* @__PURE__ */ jsx(
2622
+ "input",
2623
+ {
2624
+ type: "text",
2625
+ value: searchQuery,
2626
+ onChange: (e) => setSearchQuery(e.target.value),
2627
+ placeholder: "Search by workspace or repository name...",
2628
+ autoFocus: true,
2629
+ style: {
2630
+ flex: 1,
2631
+ padding: "8px 12px",
2632
+ borderRadius: "6px",
2633
+ border: `1px solid ${theme2.colors.border}`,
2634
+ backgroundColor: theme2.colors.background,
2635
+ color: theme2.colors.text,
2636
+ fontSize: `${theme2.fontSizes[1]}px`,
2637
+ fontFamily: theme2.fonts.body,
2638
+ outline: "none"
2639
+ }
2640
+ }
2641
+ ),
2642
+ searchQuery && /* @__PURE__ */ jsx(
2643
+ "button",
2644
+ {
2645
+ onClick: () => setSearchQuery(""),
2646
+ style: {
2647
+ display: "flex",
2648
+ alignItems: "center",
2649
+ justifyContent: "center",
2650
+ width: "28px",
2651
+ height: "28px",
2652
+ borderRadius: "6px",
2653
+ border: `1px solid ${theme2.colors.border}`,
2654
+ backgroundColor: theme2.colors.backgroundTertiary,
2655
+ color: theme2.colors.text,
2656
+ cursor: "pointer",
2657
+ transition: "all 0.15s ease"
2658
+ },
2659
+ title: "Clear search",
2660
+ children: /* @__PURE__ */ jsx(X, { size: 16 })
2661
+ }
2662
+ )
2663
+ ]
2664
+ }
2665
+ ),
2666
+ /* @__PURE__ */ jsxs(
2667
+ "div",
2668
+ {
2669
+ style: {
2670
+ flex: 1,
2671
+ overflowY: "auto",
2672
+ display: "flex",
2673
+ flexDirection: "column",
2674
+ gap: "4px"
2675
+ },
2676
+ children: [
2677
+ sortedWorkspaces.map((workspace) => /* @__PURE__ */ jsx(
2678
+ WorkspaceCard,
2679
+ {
2680
+ workspace,
2681
+ isSelected: workspace.id === selectedWorkspaceId,
2682
+ isDefault: workspace.id === defaultWorkspaceId,
2683
+ onClick: handleWorkspaceSelect,
2684
+ onOpen: panelActions.openWorkspace ? handleOpenWorkspace : void 0,
2685
+ onDelete: panelActions.deleteWorkspace ? handleDeleteWorkspace : void 0,
2686
+ onUpdateName: panelActions.updateWorkspace ? handleUpdateWorkspaceName : void 0
2687
+ },
2688
+ workspace.id
2689
+ )),
2690
+ sortedWorkspaces.length === 0 && !loading && /* @__PURE__ */ jsx(
2691
+ "div",
2692
+ {
2693
+ style: {
2694
+ padding: "32px",
2695
+ textAlign: "center",
2696
+ color: theme2.colors.textSecondary
2697
+ },
2698
+ children: /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: searchQuery.trim() ? `No workspaces found matching "${searchQuery}"` : "No workspaces found." })
2699
+ }
2700
+ )
2701
+ ]
2702
+ }
2703
+ )
2704
+ ] });
2705
+ };
2706
+ const WorkspacesListPanel = (props) => {
2707
+ return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WorkspacesListPanelContent, { ...props }) });
2708
+ };
2709
+ const WorkspacesListPanelPreview = () => {
2710
+ const { theme: theme2 } = useTheme();
2711
+ return /* @__PURE__ */ jsxs(
2712
+ "div",
2713
+ {
2714
+ style: {
2715
+ padding: "12px",
2716
+ fontSize: `${theme2.fontSizes[0]}px`,
2717
+ fontFamily: theme2.fonts.body,
2718
+ color: theme2.colors.text,
2719
+ display: "flex",
2720
+ flexDirection: "column",
2721
+ gap: "8px"
2722
+ },
2723
+ children: [
2724
+ /* @__PURE__ */ jsxs(
2725
+ "div",
2726
+ {
2727
+ style: {
2728
+ display: "flex",
2729
+ alignItems: "center",
2730
+ gap: "6px",
2731
+ fontWeight: theme2.fontWeights.semibold
2732
+ },
2733
+ children: [
2734
+ /* @__PURE__ */ jsx(Layers, { size: 16, style: { color: theme2.colors.primary } }),
2735
+ /* @__PURE__ */ jsx("span", { children: "Workspaces" })
2736
+ ]
2737
+ }
2738
+ ),
2739
+ /* @__PURE__ */ jsx(
2740
+ "div",
2741
+ {
2742
+ style: {
2743
+ fontSize: `${theme2.fontSizes[0]}px`,
2744
+ fontFamily: theme2.fonts.body,
2745
+ color: theme2.colors.textSecondary,
2746
+ marginTop: "4px"
2747
+ },
2748
+ children: "Browse and manage your workspaces"
2749
+ }
2750
+ )
2751
+ ]
2752
+ }
2753
+ );
2754
+ };
2755
+ const DependencyInfoModal = ({
2756
+ isOpen,
2757
+ onClose
2758
+ }) => {
2759
+ const { theme: theme2 } = useTheme();
2760
+ if (!isOpen) return null;
2761
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2762
+ "div",
2763
+ {
2764
+ style: {
2765
+ position: "fixed",
2766
+ top: 0,
2767
+ left: 0,
2768
+ right: 0,
2769
+ bottom: 0,
2770
+ backgroundColor: theme2.colors.muted,
2771
+ zIndex: theme2.zIndices[4],
2772
+ display: "flex",
2773
+ alignItems: "center",
2774
+ justifyContent: "center"
2775
+ },
2776
+ onClick: onClose,
2777
+ children: /* @__PURE__ */ jsxs(
2778
+ "div",
2779
+ {
2780
+ style: {
2781
+ backgroundColor: theme2.colors.background,
2782
+ borderRadius: `${theme2.radii[3]}px`,
2042
2783
  maxWidth: "600px",
2043
2784
  maxHeight: "80vh",
2044
2785
  width: "90%",
@@ -2273,6 +3014,8 @@ const InfoItem = ({ badge, title, description, theme: theme2 }) => /* @__PURE__
2273
3014
  );
2274
3015
  const DependencyRow = ({ dependency }) => {
2275
3016
  const { theme: theme2 } = useTheme();
3017
+ const [isHovered, setIsHovered] = useState(false);
3018
+ const [copied, setCopied] = useState(false);
2276
3019
  const getDependencyTypeBadgeStyle = (type) => {
2277
3020
  const baseStyle = {
2278
3021
  padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
@@ -2309,6 +3052,31 @@ const DependencyRow = ({ dependency }) => {
2309
3052
  };
2310
3053
  }
2311
3054
  };
3055
+ const handleCopy = async (e) => {
3056
+ e.preventDefault();
3057
+ e.stopPropagation();
3058
+ try {
3059
+ const copyText = `${dependency.name}@${dependency.version}`;
3060
+ await navigator.clipboard.writeText(copyText);
3061
+ setCopied(true);
3062
+ setTimeout(() => setCopied(false), 2e3);
3063
+ } catch (err) {
3064
+ console.error("Failed to copy:", err);
3065
+ }
3066
+ };
3067
+ const actionButtonStyle = {
3068
+ padding: `${theme2.space[1]}px`,
3069
+ borderRadius: `${theme2.radii[1]}px`,
3070
+ display: "flex",
3071
+ alignItems: "center",
3072
+ justifyContent: "center",
3073
+ border: "none",
3074
+ backgroundColor: "transparent",
3075
+ cursor: "pointer",
3076
+ transition: "all 0.15s ease",
3077
+ opacity: isHovered ? 1 : 0,
3078
+ pointerEvents: isHovered ? "auto" : "none"
3079
+ };
2312
3080
  return /* @__PURE__ */ jsxs(
2313
3081
  "div",
2314
3082
  {
@@ -2323,6 +3091,8 @@ const DependencyRow = ({ dependency }) => {
2323
3091
  border: `1px solid ${theme2.colors.border}`,
2324
3092
  transition: "all 0.2s"
2325
3093
  },
3094
+ onMouseEnter: () => setIsHovered(true),
3095
+ onMouseLeave: () => setIsHovered(false),
2326
3096
  children: [
2327
3097
  /* @__PURE__ */ jsxs(
2328
3098
  "div",
@@ -2348,6 +3118,22 @@ const DependencyRow = ({ dependency }) => {
2348
3118
  },
2349
3119
  children: dependency.name
2350
3120
  }
3121
+ ),
3122
+ /* @__PURE__ */ jsx(
3123
+ "a",
3124
+ {
3125
+ href: `https://www.npmjs.com/package/${dependency.name}`,
3126
+ target: "_blank",
3127
+ rel: "noopener noreferrer",
3128
+ style: {
3129
+ ...actionButtonStyle,
3130
+ color: theme2.colors.textSecondary,
3131
+ textDecoration: "none",
3132
+ flexShrink: 0
3133
+ },
3134
+ title: "View on npm",
3135
+ children: /* @__PURE__ */ jsx(ExternalLink, { size: 12 })
3136
+ }
2351
3137
  )
2352
3138
  ]
2353
3139
  }
@@ -2358,27 +3144,23 @@ const DependencyRow = ({ dependency }) => {
2358
3144
  style: {
2359
3145
  display: "flex",
2360
3146
  alignItems: "center",
2361
- gap: "8px"
3147
+ gap: "4px"
2362
3148
  },
2363
3149
  children: [
2364
- /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version }),
2365
3150
  /* @__PURE__ */ jsx(
2366
- "a",
3151
+ "button",
2367
3152
  {
2368
- href: `https://www.npmjs.com/package/${dependency.name}`,
2369
- target: "_blank",
2370
- rel: "noopener noreferrer",
3153
+ type: "button",
3154
+ onClick: handleCopy,
2371
3155
  style: {
2372
- padding: `${theme2.space[1]}px`,
2373
- borderRadius: `${theme2.radii[1]}px`,
2374
- display: "flex",
2375
- alignItems: "center",
2376
- transition: "background-color 0.2s"
3156
+ ...actionButtonStyle,
3157
+ color: copied ? theme2.colors.success || "#10b981" : theme2.colors.textSecondary
2377
3158
  },
2378
- title: "View on npm",
2379
- children: /* @__PURE__ */ jsx(ExternalLink, { size: 12, color: theme2.colors.textSecondary })
3159
+ title: copied ? "Copied!" : `Copy ${dependency.name}@${dependency.version}`,
3160
+ children: copied ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 })
2380
3161
  }
2381
- )
3162
+ ),
3163
+ /* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version })
2382
3164
  ]
2383
3165
  }
2384
3166
  )
@@ -2891,7 +3673,7 @@ const DependenciesPanelContent = ({
2891
3673
  const DependenciesPanel = (props) => {
2892
3674
  return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
2893
3675
  };
2894
- const PANEL_ID$2 = "industry-theme.local-projects";
3676
+ const PANEL_ID$3 = "industry-theme.local-projects";
2895
3677
  const filterProjectsTool = {
2896
3678
  name: "filter_projects",
2897
3679
  description: "Filter the local projects list by name, owner, or path",
@@ -2915,7 +3697,7 @@ const filterProjectsTool = {
2915
3697
  tags: ["filter", "search", "projects"],
2916
3698
  tool_call_template: {
2917
3699
  call_template_type: "panel_event",
2918
- event_type: `${PANEL_ID$2}:filter`
3700
+ event_type: `${PANEL_ID$3}:filter`
2919
3701
  }
2920
3702
  };
2921
3703
  const selectProjectTool = {
@@ -2941,7 +3723,7 @@ const selectProjectTool = {
2941
3723
  tags: ["select", "project", "navigation"],
2942
3724
  tool_call_template: {
2943
3725
  call_template_type: "panel_event",
2944
- event_type: `${PANEL_ID$2}:select-repository`
3726
+ event_type: `${PANEL_ID$3}:select-repository`
2945
3727
  }
2946
3728
  };
2947
3729
  const openProjectTool = {
@@ -2967,7 +3749,7 @@ const openProjectTool = {
2967
3749
  tags: ["open", "project", "workspace"],
2968
3750
  tool_call_template: {
2969
3751
  call_template_type: "panel_event",
2970
- event_type: `${PANEL_ID$2}:open-repository`
3752
+ event_type: `${PANEL_ID$3}:open-repository`
2971
3753
  }
2972
3754
  };
2973
3755
  const localProjectsPanelTools = [
@@ -2976,12 +3758,12 @@ const localProjectsPanelTools = [
2976
3758
  openProjectTool
2977
3759
  ];
2978
3760
  const localProjectsPanelToolsMetadata = {
2979
- id: PANEL_ID$2,
3761
+ id: PANEL_ID$3,
2980
3762
  name: "Local Projects Panel",
2981
3763
  description: "Tools for browsing and managing local Alexandria repositories",
2982
3764
  tools: localProjectsPanelTools
2983
3765
  };
2984
- const PANEL_ID$1 = "industry-theme.workspace-repositories";
3766
+ const PANEL_ID$2 = "industry-theme.workspace-repositories";
2985
3767
  const selectRepositoryTool = {
2986
3768
  name: "select_workspace_repository",
2987
3769
  description: "Selects a repository in the workspace panel",
@@ -3005,7 +3787,7 @@ const selectRepositoryTool = {
3005
3787
  tags: ["workspace", "repository", "select"],
3006
3788
  tool_call_template: {
3007
3789
  call_template_type: "panel_event",
3008
- event_type: `${PANEL_ID$1}:select-repository`
3790
+ event_type: `${PANEL_ID$2}:select-repository`
3009
3791
  }
3010
3792
  };
3011
3793
  const refreshWorkspaceTool = {
@@ -3030,7 +3812,7 @@ const refreshWorkspaceTool = {
3030
3812
  tags: ["workspace", "refresh"],
3031
3813
  tool_call_template: {
3032
3814
  call_template_type: "panel_event",
3033
- event_type: `${PANEL_ID$1}:refresh-workspace`
3815
+ event_type: `${PANEL_ID$2}:refresh-workspace`
3034
3816
  }
3035
3817
  };
3036
3818
  const openRepositoryTool = {
@@ -3056,7 +3838,7 @@ const openRepositoryTool = {
3056
3838
  tags: ["workspace", "repository", "open"],
3057
3839
  tool_call_template: {
3058
3840
  call_template_type: "panel_event",
3059
- event_type: `${PANEL_ID$1}:open-repository`
3841
+ event_type: `${PANEL_ID$2}:open-repository`
3060
3842
  }
3061
3843
  };
3062
3844
  const workspaceRepositoriesPanelTools = [
@@ -3065,11 +3847,133 @@ const workspaceRepositoriesPanelTools = [
3065
3847
  openRepositoryTool
3066
3848
  ];
3067
3849
  const workspaceRepositoriesPanelToolsMetadata = {
3068
- id: PANEL_ID$1,
3850
+ id: PANEL_ID$2,
3069
3851
  name: "Workspace Repositories Panel",
3070
3852
  description: "Tools provided by the workspace repositories panel",
3071
3853
  tools: workspaceRepositoriesPanelTools
3072
3854
  };
3855
+ const PANEL_ID$1 = "industry-theme.workspaces-list";
3856
+ const filterWorkspacesTool = {
3857
+ name: "filter_workspaces",
3858
+ description: "Filter the workspaces list by workspace name, description, or repository names within workspaces",
3859
+ inputs: {
3860
+ type: "object",
3861
+ properties: {
3862
+ filter: {
3863
+ type: "string",
3864
+ description: "Search term to filter workspaces (matches workspace name, description, or repository names)"
3865
+ }
3866
+ },
3867
+ required: ["filter"]
3868
+ },
3869
+ outputs: {
3870
+ type: "object",
3871
+ properties: {
3872
+ success: { type: "boolean" },
3873
+ message: { type: "string" }
3874
+ }
3875
+ },
3876
+ tags: ["filter", "search", "workspaces"],
3877
+ tool_call_template: {
3878
+ call_template_type: "panel_event",
3879
+ event_type: `${PANEL_ID$1}:filter`
3880
+ }
3881
+ };
3882
+ const selectWorkspaceTool = {
3883
+ name: "select_workspace",
3884
+ description: "Select a workspace by its ID to view its details and repositories",
3885
+ inputs: {
3886
+ type: "object",
3887
+ properties: {
3888
+ workspaceId: {
3889
+ type: "string",
3890
+ description: "The workspace ID to select"
3891
+ }
3892
+ },
3893
+ required: ["workspaceId"]
3894
+ },
3895
+ outputs: {
3896
+ type: "object",
3897
+ properties: {
3898
+ success: { type: "boolean" },
3899
+ selectedWorkspace: { type: "string" }
3900
+ }
3901
+ },
3902
+ tags: ["select", "workspace", "navigation"],
3903
+ tool_call_template: {
3904
+ call_template_type: "panel_event",
3905
+ event_type: `${PANEL_ID$1}:select-workspace`
3906
+ }
3907
+ };
3908
+ const openWorkspaceTool = {
3909
+ name: "open_workspace",
3910
+ description: "Open a workspace in a dedicated window for full workspace management",
3911
+ inputs: {
3912
+ type: "object",
3913
+ properties: {
3914
+ workspaceId: {
3915
+ type: "string",
3916
+ description: "The workspace ID to open"
3917
+ }
3918
+ },
3919
+ required: ["workspaceId"]
3920
+ },
3921
+ outputs: {
3922
+ type: "object",
3923
+ properties: {
3924
+ success: { type: "boolean" },
3925
+ message: { type: "string" }
3926
+ }
3927
+ },
3928
+ tags: ["open", "workspace", "window"],
3929
+ tool_call_template: {
3930
+ call_template_type: "panel_event",
3931
+ event_type: `${PANEL_ID$1}:open-workspace`
3932
+ }
3933
+ };
3934
+ const createWorkspaceTool = {
3935
+ name: "create_workspace",
3936
+ description: "Create a new workspace with the specified name and optional description",
3937
+ inputs: {
3938
+ type: "object",
3939
+ properties: {
3940
+ name: {
3941
+ type: "string",
3942
+ description: "The name for the new workspace"
3943
+ },
3944
+ description: {
3945
+ type: "string",
3946
+ description: "Optional description for the workspace"
3947
+ }
3948
+ },
3949
+ required: ["name"]
3950
+ },
3951
+ outputs: {
3952
+ type: "object",
3953
+ properties: {
3954
+ success: { type: "boolean" },
3955
+ workspaceId: { type: "string" },
3956
+ message: { type: "string" }
3957
+ }
3958
+ },
3959
+ tags: ["create", "workspace", "new"],
3960
+ tool_call_template: {
3961
+ call_template_type: "panel_event",
3962
+ event_type: `${PANEL_ID$1}:create-workspace`
3963
+ }
3964
+ };
3965
+ const workspacesListPanelTools = [
3966
+ filterWorkspacesTool,
3967
+ selectWorkspaceTool,
3968
+ openWorkspaceTool,
3969
+ createWorkspaceTool
3970
+ ];
3971
+ const workspacesListPanelToolsMetadata = {
3972
+ id: PANEL_ID$1,
3973
+ name: "Workspaces List Panel",
3974
+ description: "Tools for browsing and managing workspaces",
3975
+ tools: workspacesListPanelTools
3976
+ };
3073
3977
  const PANEL_ID = "principal-ade.dependencies-panel";
3074
3978
  const filterDependenciesTool = {
3075
3979
  name: "filter_dependencies",
@@ -3204,6 +4108,28 @@ const panels = [
3204
4108
  console.log("Workspace Repositories Panel unmounting");
3205
4109
  }
3206
4110
  },
4111
+ {
4112
+ metadata: {
4113
+ id: "industry-theme.workspaces-list",
4114
+ name: "Workspaces",
4115
+ icon: "Layers",
4116
+ version: "0.1.0",
4117
+ author: "Industry Theme",
4118
+ description: "Browse and manage workspaces",
4119
+ slices: ["workspaces"],
4120
+ tools: workspacesListPanelTools
4121
+ },
4122
+ component: WorkspacesListPanel,
4123
+ onMount: async (context) => {
4124
+ console.log("Workspaces List Panel mounted");
4125
+ if (context.hasSlice("workspaces") && !context.isSliceLoading("workspaces")) {
4126
+ await context.refresh("workspace", "workspaces");
4127
+ }
4128
+ },
4129
+ onUnmount: async (_context) => {
4130
+ console.log("Workspaces List Panel unmounting");
4131
+ }
4132
+ },
3207
4133
  {
3208
4134
  metadata: {
3209
4135
  id: "principal-ade.dependencies-panel",
@@ -3236,24 +4162,33 @@ export {
3236
4162
  LocalProjectsPanel,
3237
4163
  LocalProjectsPanelPreview,
3238
4164
  RepositoryAvatar,
4165
+ WorkspaceCard,
3239
4166
  WorkspaceRepositoriesPanel,
4167
+ WorkspacesListPanel,
4168
+ WorkspacesListPanelPreview,
4169
+ createWorkspaceTool,
3240
4170
  dependenciesPanelTools,
3241
4171
  dependenciesPanelToolsMetadata,
3242
4172
  filterDependenciesTool,
3243
4173
  filterProjectsTool,
4174
+ filterWorkspacesTool,
3244
4175
  localProjectsPanelTools,
3245
4176
  localProjectsPanelToolsMetadata,
3246
4177
  onPackageLoad,
3247
4178
  onPackageUnload,
3248
4179
  openProjectTool,
3249
4180
  openRepositoryTool,
4181
+ openWorkspaceTool,
3250
4182
  panels,
3251
4183
  refreshWorkspaceTool,
3252
4184
  selectDependencyTypeTool,
3253
4185
  selectPackageTool,
3254
4186
  selectProjectTool,
3255
4187
  selectRepositoryTool,
4188
+ selectWorkspaceTool,
3256
4189
  workspaceRepositoriesPanelTools,
3257
- workspaceRepositoriesPanelToolsMetadata
4190
+ workspaceRepositoriesPanelToolsMetadata,
4191
+ workspacesListPanelTools,
4192
+ workspacesListPanelToolsMetadata
3258
4193
  };
3259
4194
  //# sourceMappingURL=panels.bundle.js.map