@industry-theme/alexandria-panels 0.1.3 → 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.
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/mocks/panelContext.d.ts +24 -0
- package/dist/mocks/panelContext.d.ts.map +1 -1
- package/dist/panels/DependenciesPanel/components/DependencyRow.d.ts.map +1 -1
- package/dist/panels/LocalProjectsPanel/LocalProjectCard.d.ts.map +1 -1
- package/dist/panels/LocalProjectsPanel/types.d.ts +0 -2
- package/dist/panels/LocalProjectsPanel/types.d.ts.map +1 -1
- package/dist/panels/WorkspaceRepositoriesPanel/index.d.ts.map +1 -1
- package/dist/panels/WorkspacesListPanel/WorkspaceCard.d.ts +7 -0
- package/dist/panels/WorkspacesListPanel/WorkspaceCard.d.ts.map +1 -0
- package/dist/panels/WorkspacesListPanel/WorkspacesListPanel.stories.d.ts +46 -0
- package/dist/panels/WorkspacesListPanel/WorkspacesListPanel.stories.d.ts.map +1 -0
- package/dist/panels/WorkspacesListPanel/index.d.ts +35 -0
- package/dist/panels/WorkspacesListPanel/index.d.ts.map +1 -0
- package/dist/panels/WorkspacesListPanel/tools.d.ts +36 -0
- package/dist/panels/WorkspacesListPanel/tools.d.ts.map +1 -0
- package/dist/panels/WorkspacesListPanel/types.d.ts +151 -0
- package/dist/panels/WorkspacesListPanel/types.d.ts.map +1 -0
- package/dist/panels.bundle.js +1248 -301
- package/dist/panels.bundle.js.map +1 -1
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools.bundle.js +135 -6
- package/package.json +3 -2
- package/dist/panels.bundle.css +0 -86
package/dist/panels.bundle.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
"use strict";
|
|
3
|
+
try {
|
|
4
|
+
if (typeof document != "undefined") {
|
|
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__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
|
+
document.head.appendChild(elementStyle);
|
|
8
|
+
}
|
|
9
|
+
} catch (e) {
|
|
10
|
+
console.error("vite-plugin-css-injected-by-js", e);
|
|
11
|
+
}
|
|
12
|
+
})();
|
|
1
13
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
14
|
import React2, { createContext, useState, useEffect, useContext, forwardRef, createElement, useMemo, useCallback } from "react";
|
|
3
15
|
var terminalTheme = {
|
|
@@ -320,7 +332,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
320
332
|
* This source code is licensed under the ISC license.
|
|
321
333
|
* See the LICENSE file in the root directory of this source tree.
|
|
322
334
|
*/
|
|
323
|
-
const __iconNode$
|
|
335
|
+
const __iconNode$l = [
|
|
324
336
|
[
|
|
325
337
|
"path",
|
|
326
338
|
{
|
|
@@ -352,14 +364,14 @@ const __iconNode$j = [
|
|
|
352
364
|
["path", { d: "m12 8 4.74-2.85", key: "3rx089" }],
|
|
353
365
|
["path", { d: "M12 13.5V8", key: "1io7kd" }]
|
|
354
366
|
];
|
|
355
|
-
const Boxes = createLucideIcon("boxes", __iconNode$
|
|
367
|
+
const Boxes = createLucideIcon("boxes", __iconNode$l);
|
|
356
368
|
/**
|
|
357
369
|
* @license lucide-react v0.552.0 - ISC
|
|
358
370
|
*
|
|
359
371
|
* This source code is licensed under the ISC license.
|
|
360
372
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
373
|
*/
|
|
362
|
-
const __iconNode$
|
|
374
|
+
const __iconNode$k = [
|
|
363
375
|
["path", { d: "M10 12h4", key: "a56b0p" }],
|
|
364
376
|
["path", { d: "M10 8h4", key: "1sr2af" }],
|
|
365
377
|
["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
|
|
@@ -372,71 +384,83 @@ const __iconNode$i = [
|
|
|
372
384
|
],
|
|
373
385
|
["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
|
|
374
386
|
];
|
|
375
|
-
const Building2 = createLucideIcon("building-2", __iconNode$
|
|
387
|
+
const Building2 = createLucideIcon("building-2", __iconNode$k);
|
|
376
388
|
/**
|
|
377
389
|
* @license lucide-react v0.552.0 - ISC
|
|
378
390
|
*
|
|
379
391
|
* This source code is licensed under the ISC license.
|
|
380
392
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
393
|
*/
|
|
382
|
-
const __iconNode$
|
|
383
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
394
|
+
const __iconNode$j = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
395
|
+
const Check = createLucideIcon("check", __iconNode$j);
|
|
384
396
|
/**
|
|
385
397
|
* @license lucide-react v0.552.0 - ISC
|
|
386
398
|
*
|
|
387
399
|
* This source code is licensed under the ISC license.
|
|
388
400
|
* See the LICENSE file in the root directory of this source tree.
|
|
389
401
|
*/
|
|
390
|
-
const __iconNode$
|
|
402
|
+
const __iconNode$i = [
|
|
391
403
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
392
404
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
393
405
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
394
406
|
];
|
|
395
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
407
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$i);
|
|
396
408
|
/**
|
|
397
409
|
* @license lucide-react v0.552.0 - ISC
|
|
398
410
|
*
|
|
399
411
|
* This source code is licensed under the ISC license.
|
|
400
412
|
* See the LICENSE file in the root directory of this source tree.
|
|
401
413
|
*/
|
|
402
|
-
const __iconNode$
|
|
414
|
+
const __iconNode$h = [
|
|
403
415
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
404
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" }]
|
|
405
417
|
];
|
|
406
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
418
|
+
const Copy = createLucideIcon("copy", __iconNode$h);
|
|
407
419
|
/**
|
|
408
420
|
* @license lucide-react v0.552.0 - ISC
|
|
409
421
|
*
|
|
410
422
|
* This source code is licensed under the ISC license.
|
|
411
423
|
* See the LICENSE file in the root directory of this source tree.
|
|
412
424
|
*/
|
|
413
|
-
const __iconNode$
|
|
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 = [
|
|
414
438
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
415
439
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
416
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" }]
|
|
417
441
|
];
|
|
418
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
442
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$f);
|
|
419
443
|
/**
|
|
420
444
|
* @license lucide-react v0.552.0 - ISC
|
|
421
445
|
*
|
|
422
446
|
* This source code is licensed under the ISC license.
|
|
423
447
|
* See the LICENSE file in the root directory of this source tree.
|
|
424
448
|
*/
|
|
425
|
-
const __iconNode$
|
|
449
|
+
const __iconNode$e = [
|
|
426
450
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
427
451
|
["path", { d: "M3 7V5a2 2 0 0 1 2-2h2", key: "aa7l1z" }],
|
|
428
452
|
["path", { d: "M17 3h2a2 2 0 0 1 2 2v2", key: "4qcy5o" }],
|
|
429
453
|
["path", { d: "M21 17v2a2 2 0 0 1-2 2h-2", key: "6vwrx8" }],
|
|
430
454
|
["path", { d: "M7 21H5a2 2 0 0 1-2-2v-2", key: "ioqczr" }]
|
|
431
455
|
];
|
|
432
|
-
const Focus = createLucideIcon("focus", __iconNode$
|
|
456
|
+
const Focus = createLucideIcon("focus", __iconNode$e);
|
|
433
457
|
/**
|
|
434
458
|
* @license lucide-react v0.552.0 - ISC
|
|
435
459
|
*
|
|
436
460
|
* This source code is licensed under the ISC license.
|
|
437
461
|
* See the LICENSE file in the root directory of this source tree.
|
|
438
462
|
*/
|
|
439
|
-
const __iconNode$
|
|
463
|
+
const __iconNode$d = [
|
|
440
464
|
[
|
|
441
465
|
"path",
|
|
442
466
|
{
|
|
@@ -448,14 +472,14 @@ const __iconNode$c = [
|
|
|
448
472
|
["path", { d: "M18 19c-2.8 0-5-2.2-5-5v8", key: "pkpw2h" }],
|
|
449
473
|
["circle", { cx: "20", cy: "19", r: "2", key: "1obnsp" }]
|
|
450
474
|
];
|
|
451
|
-
const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$
|
|
475
|
+
const FolderGit2 = createLucideIcon("folder-git-2", __iconNode$d);
|
|
452
476
|
/**
|
|
453
477
|
* @license lucide-react v0.552.0 - ISC
|
|
454
478
|
*
|
|
455
479
|
* This source code is licensed under the ISC license.
|
|
456
480
|
* See the LICENSE file in the root directory of this source tree.
|
|
457
481
|
*/
|
|
458
|
-
const __iconNode$
|
|
482
|
+
const __iconNode$c = [
|
|
459
483
|
[
|
|
460
484
|
"path",
|
|
461
485
|
{
|
|
@@ -464,14 +488,14 @@ const __iconNode$b = [
|
|
|
464
488
|
}
|
|
465
489
|
]
|
|
466
490
|
];
|
|
467
|
-
const FolderOpen = createLucideIcon("folder-open", __iconNode$
|
|
491
|
+
const FolderOpen = createLucideIcon("folder-open", __iconNode$c);
|
|
468
492
|
/**
|
|
469
493
|
* @license lucide-react v0.552.0 - ISC
|
|
470
494
|
*
|
|
471
495
|
* This source code is licensed under the ISC license.
|
|
472
496
|
* See the LICENSE file in the root directory of this source tree.
|
|
473
497
|
*/
|
|
474
|
-
const __iconNode$
|
|
498
|
+
const __iconNode$b = [
|
|
475
499
|
[
|
|
476
500
|
"path",
|
|
477
501
|
{
|
|
@@ -480,14 +504,14 @@ const __iconNode$a = [
|
|
|
480
504
|
}
|
|
481
505
|
]
|
|
482
506
|
];
|
|
483
|
-
const Folder = createLucideIcon("folder", __iconNode$
|
|
507
|
+
const Folder = createLucideIcon("folder", __iconNode$b);
|
|
484
508
|
/**
|
|
485
509
|
* @license lucide-react v0.552.0 - ISC
|
|
486
510
|
*
|
|
487
511
|
* This source code is licensed under the ISC license.
|
|
488
512
|
* See the LICENSE file in the root directory of this source tree.
|
|
489
513
|
*/
|
|
490
|
-
const __iconNode$
|
|
514
|
+
const __iconNode$a = [
|
|
491
515
|
["path", { d: "M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8", key: "5wwlr5" }],
|
|
492
516
|
[
|
|
493
517
|
"path",
|
|
@@ -497,7 +521,37 @@ const __iconNode$9 = [
|
|
|
497
521
|
}
|
|
498
522
|
]
|
|
499
523
|
];
|
|
500
|
-
const House = createLucideIcon("house", __iconNode$
|
|
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);
|
|
501
555
|
/**
|
|
502
556
|
* @license lucide-react v0.552.0 - ISC
|
|
503
557
|
*
|
|
@@ -549,10 +603,9 @@ const __iconNode$5 = [
|
|
|
549
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",
|
|
550
604
|
key: "1a8usu"
|
|
551
605
|
}
|
|
552
|
-
]
|
|
553
|
-
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
606
|
+
]
|
|
554
607
|
];
|
|
555
|
-
const
|
|
608
|
+
const Pen = createLucideIcon("pen", __iconNode$5);
|
|
556
609
|
/**
|
|
557
610
|
* @license lucide-react v0.552.0 - ISC
|
|
558
611
|
*
|
|
@@ -596,17 +649,13 @@ const Search = createLucideIcon("search", __iconNode$2);
|
|
|
596
649
|
* See the LICENSE file in the root directory of this source tree.
|
|
597
650
|
*/
|
|
598
651
|
const __iconNode$1 = [
|
|
599
|
-
[
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
],
|
|
606
|
-
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
607
|
-
["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" }]
|
|
608
657
|
];
|
|
609
|
-
const
|
|
658
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$1);
|
|
610
659
|
/**
|
|
611
660
|
* @license lucide-react v0.552.0 - ISC
|
|
612
661
|
*
|
|
@@ -705,9 +754,7 @@ const LocalProjectCard = ({
|
|
|
705
754
|
isLoading = false,
|
|
706
755
|
windowState = "closed",
|
|
707
756
|
compact: _compact = false,
|
|
708
|
-
|
|
709
|
-
isInWorkspaceDirectory,
|
|
710
|
-
workspacePath
|
|
757
|
+
isInWorkspaceDirectory
|
|
711
758
|
}) => {
|
|
712
759
|
var _a, _b, _c, _d;
|
|
713
760
|
const { theme: theme2 } = useTheme();
|
|
@@ -719,6 +766,9 @@ const LocalProjectCard = ({
|
|
|
719
766
|
const handleCardClick = () => {
|
|
720
767
|
onSelect == null ? void 0 : onSelect(entry);
|
|
721
768
|
};
|
|
769
|
+
const handleDoubleClick = () => {
|
|
770
|
+
onOpen == null ? void 0 : onOpen(entry);
|
|
771
|
+
};
|
|
722
772
|
const handleOpenClick = (e) => {
|
|
723
773
|
e.stopPropagation();
|
|
724
774
|
onOpen == null ? void 0 : onOpen(entry);
|
|
@@ -749,15 +799,6 @@ const LocalProjectCard = ({
|
|
|
749
799
|
setIsMoving(false);
|
|
750
800
|
}
|
|
751
801
|
};
|
|
752
|
-
const displayPath = useMemo(() => {
|
|
753
|
-
if (actionMode === "workspace" && isInWorkspaceDirectory && workspacePath) {
|
|
754
|
-
if (entry.path.startsWith(workspacePath)) {
|
|
755
|
-
const relativePath = entry.path.slice(workspacePath.length);
|
|
756
|
-
return relativePath.startsWith("/") ? relativePath.slice(1) : relativePath;
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
return entry.path;
|
|
760
|
-
}, [actionMode, isInWorkspaceDirectory, workspacePath, entry.path]);
|
|
761
802
|
const handleCopyPath = async (e) => {
|
|
762
803
|
e.stopPropagation();
|
|
763
804
|
try {
|
|
@@ -802,9 +843,37 @@ const LocalProjectCard = ({
|
|
|
802
843
|
}
|
|
803
844
|
);
|
|
804
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
|
+
);
|
|
805
874
|
if (actionMode === "workspace") {
|
|
806
875
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
807
|
-
|
|
876
|
+
isInWorkspaceDirectory === false && onMoveToWorkspace && /* @__PURE__ */ jsxs(
|
|
808
877
|
"button",
|
|
809
878
|
{
|
|
810
879
|
type: "button",
|
|
@@ -834,6 +903,7 @@ const LocalProjectCard = ({
|
|
|
834
903
|
]
|
|
835
904
|
}
|
|
836
905
|
),
|
|
906
|
+
copyPathButton,
|
|
837
907
|
/* @__PURE__ */ jsxs(
|
|
838
908
|
"button",
|
|
839
909
|
{
|
|
@@ -862,7 +932,7 @@ const LocalProjectCard = ({
|
|
|
862
932
|
]
|
|
863
933
|
}
|
|
864
934
|
),
|
|
865
|
-
|
|
935
|
+
onRemoveFromWorkspace && /* @__PURE__ */ jsxs(
|
|
866
936
|
"button",
|
|
867
937
|
{
|
|
868
938
|
type: "button",
|
|
@@ -897,6 +967,7 @@ const LocalProjectCard = ({
|
|
|
897
967
|
] });
|
|
898
968
|
}
|
|
899
969
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
970
|
+
copyPathButton,
|
|
900
971
|
/* @__PURE__ */ jsxs(
|
|
901
972
|
"button",
|
|
902
973
|
{
|
|
@@ -975,6 +1046,7 @@ const LocalProjectCard = ({
|
|
|
975
1046
|
fontFamily: theme2.fonts.body
|
|
976
1047
|
},
|
|
977
1048
|
onClick: handleCardClick,
|
|
1049
|
+
onDoubleClick: handleDoubleClick,
|
|
978
1050
|
children: [
|
|
979
1051
|
/* @__PURE__ */ jsxs("div", { className: "local-project-card__content", children: [
|
|
980
1052
|
/* @__PURE__ */ jsx(
|
|
@@ -1013,30 +1085,6 @@ const LocalProjectCard = ({
|
|
|
1013
1085
|
children: entry.name
|
|
1014
1086
|
}
|
|
1015
1087
|
),
|
|
1016
|
-
/* @__PURE__ */ jsxs(
|
|
1017
|
-
"div",
|
|
1018
|
-
{
|
|
1019
|
-
className: "local-project-card__path",
|
|
1020
|
-
onClick: handleCopyPath,
|
|
1021
|
-
style: {
|
|
1022
|
-
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1023
|
-
fontFamily: theme2.fonts.monospace,
|
|
1024
|
-
color: copiedPath ? theme2.colors.success || "#10b981" : theme2.colors.textTertiary || theme2.colors.textSecondary,
|
|
1025
|
-
overflow: "hidden",
|
|
1026
|
-
textOverflow: "ellipsis",
|
|
1027
|
-
whiteSpace: "nowrap",
|
|
1028
|
-
cursor: "pointer",
|
|
1029
|
-
alignItems: "center",
|
|
1030
|
-
gap: "4px",
|
|
1031
|
-
transition: "color 0.15s ease"
|
|
1032
|
-
},
|
|
1033
|
-
title: copiedPath ? "Copied!" : `Click to copy: ${entry.path}`,
|
|
1034
|
-
children: [
|
|
1035
|
-
copiedPath ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 }),
|
|
1036
|
-
displayPath
|
|
1037
|
-
]
|
|
1038
|
-
}
|
|
1039
|
-
),
|
|
1040
1088
|
((_d = entry.github) == null ? void 0 : _d.description) && /* @__PURE__ */ jsx(
|
|
1041
1089
|
"div",
|
|
1042
1090
|
{
|
|
@@ -1068,10 +1116,10 @@ const LocalProjectCard = ({
|
|
|
1068
1116
|
}
|
|
1069
1117
|
);
|
|
1070
1118
|
};
|
|
1071
|
-
const PANEL_ID$
|
|
1072
|
-
const createPanelEvent$
|
|
1119
|
+
const PANEL_ID$6 = "industry-theme.local-projects";
|
|
1120
|
+
const createPanelEvent$2 = (type, payload) => ({
|
|
1073
1121
|
type,
|
|
1074
|
-
source: PANEL_ID$
|
|
1122
|
+
source: PANEL_ID$6,
|
|
1075
1123
|
timestamp: Date.now(),
|
|
1076
1124
|
payload
|
|
1077
1125
|
});
|
|
@@ -1107,7 +1155,7 @@ const LocalProjectsPanelContent = ({
|
|
|
1107
1155
|
try {
|
|
1108
1156
|
await panelActions.openRepository(entry);
|
|
1109
1157
|
setWindowStates((prev) => new Map(prev).set(entry.path, "ready"));
|
|
1110
|
-
events.emit(createPanelEvent$
|
|
1158
|
+
events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-opened`, { entry }));
|
|
1111
1159
|
} catch (error) {
|
|
1112
1160
|
console.error("Error opening repository:", error);
|
|
1113
1161
|
setWindowStates((prev) => new Map(prev).set(entry.path, "closed"));
|
|
@@ -1118,14 +1166,14 @@ const LocalProjectsPanelContent = ({
|
|
|
1118
1166
|
useEffect(() => {
|
|
1119
1167
|
const unsubscribers = [
|
|
1120
1168
|
// Filter event from tools
|
|
1121
|
-
events.on(`${PANEL_ID$
|
|
1169
|
+
events.on(`${PANEL_ID$6}:filter`, (event) => {
|
|
1122
1170
|
var _a2;
|
|
1123
1171
|
if (((_a2 = event.payload) == null ? void 0 : _a2.filter) !== void 0) {
|
|
1124
1172
|
setFilter(event.payload.filter);
|
|
1125
1173
|
}
|
|
1126
1174
|
}),
|
|
1127
1175
|
// Select repository event from tools
|
|
1128
|
-
events.on(`${PANEL_ID$
|
|
1176
|
+
events.on(`${PANEL_ID$6}:select-repository`, (event) => {
|
|
1129
1177
|
var _a2;
|
|
1130
1178
|
const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
|
|
1131
1179
|
if (identifier) {
|
|
@@ -1134,12 +1182,12 @@ const LocalProjectsPanelContent = ({
|
|
|
1134
1182
|
);
|
|
1135
1183
|
if (entry) {
|
|
1136
1184
|
setSelectedEntry(entry);
|
|
1137
|
-
events.emit(createPanelEvent$
|
|
1185
|
+
events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-selected`, { entry }));
|
|
1138
1186
|
}
|
|
1139
1187
|
}
|
|
1140
1188
|
}),
|
|
1141
1189
|
// Open repository event from tools
|
|
1142
|
-
events.on(`${PANEL_ID$
|
|
1190
|
+
events.on(`${PANEL_ID$6}:open-repository`, (event) => {
|
|
1143
1191
|
var _a2;
|
|
1144
1192
|
const identifier = (_a2 = event.payload) == null ? void 0 : _a2.identifier;
|
|
1145
1193
|
if (identifier) {
|
|
@@ -1187,7 +1235,7 @@ const LocalProjectsPanelContent = ({
|
|
|
1187
1235
|
};
|
|
1188
1236
|
const handleSelectRepository = (entry) => {
|
|
1189
1237
|
setSelectedEntry(entry);
|
|
1190
|
-
events.emit(createPanelEvent$
|
|
1238
|
+
events.emit(createPanelEvent$2(`${PANEL_ID$6}:repository-selected`, { entry }));
|
|
1191
1239
|
};
|
|
1192
1240
|
const normalizedFilter = filter.trim().toLowerCase();
|
|
1193
1241
|
const filteredAndSortedRepositories = useMemo(() => {
|
|
@@ -1448,10 +1496,10 @@ const LocalProjectsPanelPreview = () => {
|
|
|
1448
1496
|
}
|
|
1449
1497
|
);
|
|
1450
1498
|
};
|
|
1451
|
-
const PANEL_ID$
|
|
1452
|
-
const createPanelEvent = (type, payload) => ({
|
|
1499
|
+
const PANEL_ID$5 = "industry-theme.workspace-repositories";
|
|
1500
|
+
const createPanelEvent$1 = (type, payload) => ({
|
|
1453
1501
|
type,
|
|
1454
|
-
source: PANEL_ID$
|
|
1502
|
+
source: PANEL_ID$5,
|
|
1455
1503
|
timestamp: Date.now(),
|
|
1456
1504
|
payload
|
|
1457
1505
|
});
|
|
@@ -1461,10 +1509,11 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1461
1509
|
events
|
|
1462
1510
|
}) => {
|
|
1463
1511
|
const { theme: theme2 } = useTheme();
|
|
1464
|
-
const [isEditMode, setIsEditMode] = React2.useState(false);
|
|
1465
1512
|
const [repositoryLocations, setRepositoryLocations] = React2.useState(
|
|
1466
1513
|
/* @__PURE__ */ new Map()
|
|
1467
1514
|
);
|
|
1515
|
+
const [copiedPath, setCopiedPath] = useState(false);
|
|
1516
|
+
const [isPathHovered, setIsPathHovered] = useState(false);
|
|
1468
1517
|
const panelActions = actions;
|
|
1469
1518
|
const workspaceSlice = context.getSlice("workspace");
|
|
1470
1519
|
const repositoriesSlice = context.getSlice("workspaceRepositories");
|
|
@@ -1513,7 +1562,7 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1513
1562
|
(repository) => {
|
|
1514
1563
|
var _a;
|
|
1515
1564
|
events.emit(
|
|
1516
|
-
createPanelEvent("repository:selected", {
|
|
1565
|
+
createPanelEvent$1("repository:selected", {
|
|
1517
1566
|
repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
|
|
1518
1567
|
repository,
|
|
1519
1568
|
repositoryPath: repository.path
|
|
@@ -1526,7 +1575,7 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1526
1575
|
(repository) => {
|
|
1527
1576
|
var _a;
|
|
1528
1577
|
events.emit(
|
|
1529
|
-
createPanelEvent("repository:opened", {
|
|
1578
|
+
createPanelEvent$1("repository:opened", {
|
|
1530
1579
|
repositoryId: ((_a = repository.github) == null ? void 0 : _a.id) || repository.name,
|
|
1531
1580
|
repository
|
|
1532
1581
|
})
|
|
@@ -1567,7 +1616,7 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1567
1616
|
);
|
|
1568
1617
|
useEffect(() => {
|
|
1569
1618
|
const unsubscribers = [
|
|
1570
|
-
events.on(`${PANEL_ID$
|
|
1619
|
+
events.on(`${PANEL_ID$5}:select-repository`, (event) => {
|
|
1571
1620
|
var _a;
|
|
1572
1621
|
const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
|
|
1573
1622
|
if (path) {
|
|
@@ -1577,7 +1626,7 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1577
1626
|
}
|
|
1578
1627
|
}
|
|
1579
1628
|
}),
|
|
1580
|
-
events.on(`${PANEL_ID$
|
|
1629
|
+
events.on(`${PANEL_ID$5}:open-repository`, (event) => {
|
|
1581
1630
|
var _a;
|
|
1582
1631
|
const path = (_a = event.payload) == null ? void 0 : _a.repositoryPath;
|
|
1583
1632
|
if (path) {
|
|
@@ -1707,9 +1756,6 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1707
1756
|
}
|
|
1708
1757
|
) });
|
|
1709
1758
|
}
|
|
1710
|
-
const handleToggleEditMode = () => {
|
|
1711
|
-
setIsEditMode(!isEditMode);
|
|
1712
|
-
};
|
|
1713
1759
|
return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
|
|
1714
1760
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1715
1761
|
/* @__PURE__ */ jsxs(
|
|
@@ -1723,99 +1769,66 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1723
1769
|
marginBottom: "4px"
|
|
1724
1770
|
},
|
|
1725
1771
|
children: [
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
"
|
|
1772
|
+
/* @__PURE__ */ jsx(
|
|
1773
|
+
"h3",
|
|
1728
1774
|
{
|
|
1729
1775
|
style: {
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1776
|
+
margin: 0,
|
|
1777
|
+
fontSize: `${theme2.fontSizes[2]}px`,
|
|
1778
|
+
fontWeight: theme2.fontWeights.semibold,
|
|
1779
|
+
color: theme2.colors.text,
|
|
1780
|
+
fontFamily: theme2.fonts.body
|
|
1733
1781
|
},
|
|
1734
|
-
children:
|
|
1735
|
-
/* @__PURE__ */ jsx(
|
|
1736
|
-
"h3",
|
|
1737
|
-
{
|
|
1738
|
-
style: {
|
|
1739
|
-
margin: 0,
|
|
1740
|
-
fontSize: `${theme2.fontSizes[2]}px`,
|
|
1741
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
1742
|
-
color: theme2.colors.text,
|
|
1743
|
-
fontFamily: theme2.fonts.body
|
|
1744
|
-
},
|
|
1745
|
-
children: workspace.name
|
|
1746
|
-
}
|
|
1747
|
-
),
|
|
1748
|
-
/* @__PURE__ */ jsx(
|
|
1749
|
-
"button",
|
|
1750
|
-
{
|
|
1751
|
-
type: "button",
|
|
1752
|
-
onClick: handleToggleEditMode,
|
|
1753
|
-
title: isEditMode ? "Exit edit mode" : "Edit workspace",
|
|
1754
|
-
style: {
|
|
1755
|
-
display: "inline-flex",
|
|
1756
|
-
alignItems: "center",
|
|
1757
|
-
justifyContent: "center",
|
|
1758
|
-
width: "24px",
|
|
1759
|
-
height: "24px",
|
|
1760
|
-
padding: 0,
|
|
1761
|
-
borderRadius: "4px",
|
|
1762
|
-
border: "none",
|
|
1763
|
-
backgroundColor: isEditMode ? theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary : "transparent",
|
|
1764
|
-
color: isEditMode ? theme2.colors.primary : theme2.colors.textSecondary,
|
|
1765
|
-
cursor: "pointer",
|
|
1766
|
-
transition: "all 0.15s ease"
|
|
1767
|
-
},
|
|
1768
|
-
onMouseEnter: (event) => {
|
|
1769
|
-
if (!isEditMode) {
|
|
1770
|
-
event.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary || theme2.colors.backgroundSecondary;
|
|
1771
|
-
event.currentTarget.style.color = theme2.colors.text;
|
|
1772
|
-
}
|
|
1773
|
-
},
|
|
1774
|
-
onMouseLeave: (event) => {
|
|
1775
|
-
if (!isEditMode) {
|
|
1776
|
-
event.currentTarget.style.backgroundColor = "transparent";
|
|
1777
|
-
event.currentTarget.style.color = theme2.colors.textSecondary;
|
|
1778
|
-
}
|
|
1779
|
-
},
|
|
1780
|
-
children: /* @__PURE__ */ jsx(Pencil, { size: 14 })
|
|
1781
|
-
}
|
|
1782
|
-
)
|
|
1783
|
-
]
|
|
1782
|
+
children: workspace.name
|
|
1784
1783
|
}
|
|
1785
1784
|
),
|
|
1786
1785
|
workspace.suggestedClonePath && /* @__PURE__ */ jsxs(
|
|
1787
|
-
"
|
|
1786
|
+
"button",
|
|
1788
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}`,
|
|
1789
1801
|
style: {
|
|
1790
1802
|
display: "flex",
|
|
1791
1803
|
alignItems: "center",
|
|
1792
1804
|
gap: "6px",
|
|
1793
|
-
|
|
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"
|
|
1794
1815
|
},
|
|
1795
1816
|
children: [
|
|
1796
|
-
/* @__PURE__ */ jsx(
|
|
1797
|
-
House,
|
|
1798
|
-
{
|
|
1799
|
-
size: 14,
|
|
1800
|
-
style: {
|
|
1801
|
-
color: theme2.colors.textSecondary,
|
|
1802
|
-
flexShrink: 0
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
),
|
|
1817
|
+
copiedPath ? /* @__PURE__ */ jsx(Check, { size: 14, style: { flexShrink: 0 } }) : /* @__PURE__ */ jsx(House, { size: 14, style: { flexShrink: 0 } }),
|
|
1806
1818
|
/* @__PURE__ */ jsx(
|
|
1807
1819
|
"span",
|
|
1808
1820
|
{
|
|
1809
1821
|
style: {
|
|
1810
1822
|
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1811
|
-
color: theme2.colors.textSecondary,
|
|
1812
1823
|
fontFamily: theme2.fonts.monospace,
|
|
1813
1824
|
whiteSpace: "nowrap",
|
|
1814
1825
|
overflow: "hidden",
|
|
1815
|
-
textOverflow: "ellipsis"
|
|
1826
|
+
textOverflow: "ellipsis",
|
|
1827
|
+
opacity: isPathHovered || copiedPath ? 1 : 0,
|
|
1828
|
+
width: isPathHovered || copiedPath ? "auto" : 0,
|
|
1829
|
+
transition: "opacity 0.15s ease"
|
|
1816
1830
|
},
|
|
1817
|
-
|
|
1818
|
-
children: workspace.suggestedClonePath
|
|
1831
|
+
children: copiedPath ? "Copied!" : workspace.suggestedClonePath
|
|
1819
1832
|
}
|
|
1820
1833
|
)
|
|
1821
1834
|
]
|
|
@@ -1860,53 +1873,20 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1860
1873
|
}
|
|
1861
1874
|
),
|
|
1862
1875
|
repositoriesInWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
"
|
|
1876
|
+
/* @__PURE__ */ jsx(
|
|
1877
|
+
"h4",
|
|
1865
1878
|
{
|
|
1866
1879
|
style: {
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
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"
|
|
1871
1888
|
},
|
|
1872
|
-
children:
|
|
1873
|
-
/* @__PURE__ */ jsx(
|
|
1874
|
-
House,
|
|
1875
|
-
{
|
|
1876
|
-
size: 14,
|
|
1877
|
-
style: {
|
|
1878
|
-
color: theme2.colors.success || "#10b981",
|
|
1879
|
-
flexShrink: 0
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
),
|
|
1883
|
-
/* @__PURE__ */ jsx(
|
|
1884
|
-
"h4",
|
|
1885
|
-
{
|
|
1886
|
-
style: {
|
|
1887
|
-
margin: 0,
|
|
1888
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1889
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
1890
|
-
color: theme2.colors.textSecondary,
|
|
1891
|
-
fontFamily: theme2.fonts.body,
|
|
1892
|
-
textTransform: "uppercase",
|
|
1893
|
-
letterSpacing: "0.5px"
|
|
1894
|
-
},
|
|
1895
|
-
children: "In Workspace Directory"
|
|
1896
|
-
}
|
|
1897
|
-
),
|
|
1898
|
-
/* @__PURE__ */ jsx(
|
|
1899
|
-
"span",
|
|
1900
|
-
{
|
|
1901
|
-
style: {
|
|
1902
|
-
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1903
|
-
color: theme2.colors.textTertiary || theme2.colors.textSecondary,
|
|
1904
|
-
fontWeight: theme2.fontWeights.medium
|
|
1905
|
-
},
|
|
1906
|
-
children: repositoriesInWorkspace.length
|
|
1907
|
-
}
|
|
1908
|
-
)
|
|
1909
|
-
]
|
|
1889
|
+
children: "In Workspace Directory"
|
|
1910
1890
|
}
|
|
1911
1891
|
),
|
|
1912
1892
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesInWorkspace.map((repository) => /* @__PURE__ */ jsx(
|
|
@@ -1914,7 +1894,6 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1914
1894
|
{
|
|
1915
1895
|
entry: repository,
|
|
1916
1896
|
actionMode: "workspace",
|
|
1917
|
-
isEditMode,
|
|
1918
1897
|
isInWorkspaceDirectory: true,
|
|
1919
1898
|
workspacePath: workspace.suggestedClonePath,
|
|
1920
1899
|
onSelect: handleSelectRepository,
|
|
@@ -1926,53 +1905,20 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1926
1905
|
)) })
|
|
1927
1906
|
] }),
|
|
1928
1907
|
repositoriesOutsideWorkspace.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "8px" }, children: [
|
|
1929
|
-
/* @__PURE__ */
|
|
1930
|
-
"
|
|
1908
|
+
/* @__PURE__ */ jsx(
|
|
1909
|
+
"h4",
|
|
1931
1910
|
{
|
|
1932
1911
|
style: {
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
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"
|
|
1937
1920
|
},
|
|
1938
|
-
children:
|
|
1939
|
-
/* @__PURE__ */ jsx(
|
|
1940
|
-
TriangleAlert,
|
|
1941
|
-
{
|
|
1942
|
-
size: 14,
|
|
1943
|
-
style: {
|
|
1944
|
-
color: theme2.colors.warning || "#f59e0b",
|
|
1945
|
-
flexShrink: 0
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
),
|
|
1949
|
-
/* @__PURE__ */ jsx(
|
|
1950
|
-
"h4",
|
|
1951
|
-
{
|
|
1952
|
-
style: {
|
|
1953
|
-
margin: 0,
|
|
1954
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1955
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
1956
|
-
color: theme2.colors.textSecondary,
|
|
1957
|
-
fontFamily: theme2.fonts.body,
|
|
1958
|
-
textTransform: "uppercase",
|
|
1959
|
-
letterSpacing: "0.5px"
|
|
1960
|
-
},
|
|
1961
|
-
children: "Outside Workspace Directory"
|
|
1962
|
-
}
|
|
1963
|
-
),
|
|
1964
|
-
/* @__PURE__ */ jsx(
|
|
1965
|
-
"span",
|
|
1966
|
-
{
|
|
1967
|
-
style: {
|
|
1968
|
-
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1969
|
-
color: theme2.colors.textTertiary || theme2.colors.textSecondary,
|
|
1970
|
-
fontWeight: theme2.fontWeights.medium
|
|
1971
|
-
},
|
|
1972
|
-
children: repositoriesOutsideWorkspace.length
|
|
1973
|
-
}
|
|
1974
|
-
)
|
|
1975
|
-
]
|
|
1921
|
+
children: "Outside Workspace Directory"
|
|
1976
1922
|
}
|
|
1977
1923
|
),
|
|
1978
1924
|
/* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: repositoriesOutsideWorkspace.map((repository) => /* @__PURE__ */ jsx(
|
|
@@ -1980,7 +1926,6 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1980
1926
|
{
|
|
1981
1927
|
entry: repository,
|
|
1982
1928
|
actionMode: "workspace",
|
|
1983
|
-
isEditMode,
|
|
1984
1929
|
isInWorkspaceDirectory: false,
|
|
1985
1930
|
workspacePath: workspace.suggestedClonePath,
|
|
1986
1931
|
onSelect: handleSelectRepository,
|
|
@@ -1999,32 +1944,840 @@ const WorkspaceRepositoriesPanelContent = ({
|
|
|
1999
1944
|
const WorkspaceRepositoriesPanel = (props) => {
|
|
2000
1945
|
return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(WorkspaceRepositoriesPanelContent, { ...props }) });
|
|
2001
1946
|
};
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2004
|
-
|
|
1947
|
+
const WorkspaceCard = ({
|
|
1948
|
+
workspace,
|
|
1949
|
+
isSelected = false,
|
|
1950
|
+
isDefault = false,
|
|
1951
|
+
onClick,
|
|
1952
|
+
onOpen,
|
|
1953
|
+
onDelete,
|
|
1954
|
+
onUpdateName,
|
|
1955
|
+
themeColor
|
|
2005
1956
|
}) => {
|
|
2006
1957
|
const { theme: theme2 } = useTheme();
|
|
2007
|
-
|
|
2008
|
-
|
|
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(
|
|
2009
2060
|
"div",
|
|
2010
2061
|
{
|
|
2011
|
-
style:
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
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: {
|
|
2028
2781
|
backgroundColor: theme2.colors.background,
|
|
2029
2782
|
borderRadius: `${theme2.radii[3]}px`,
|
|
2030
2783
|
maxWidth: "600px",
|
|
@@ -2261,6 +3014,8 @@ const InfoItem = ({ badge, title, description, theme: theme2 }) => /* @__PURE__
|
|
|
2261
3014
|
);
|
|
2262
3015
|
const DependencyRow = ({ dependency }) => {
|
|
2263
3016
|
const { theme: theme2 } = useTheme();
|
|
3017
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
3018
|
+
const [copied, setCopied] = useState(false);
|
|
2264
3019
|
const getDependencyTypeBadgeStyle = (type) => {
|
|
2265
3020
|
const baseStyle = {
|
|
2266
3021
|
padding: `${theme2.space[1]}px ${theme2.space[2]}px`,
|
|
@@ -2297,6 +3052,31 @@ const DependencyRow = ({ dependency }) => {
|
|
|
2297
3052
|
};
|
|
2298
3053
|
}
|
|
2299
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
|
+
};
|
|
2300
3080
|
return /* @__PURE__ */ jsxs(
|
|
2301
3081
|
"div",
|
|
2302
3082
|
{
|
|
@@ -2311,6 +3091,8 @@ const DependencyRow = ({ dependency }) => {
|
|
|
2311
3091
|
border: `1px solid ${theme2.colors.border}`,
|
|
2312
3092
|
transition: "all 0.2s"
|
|
2313
3093
|
},
|
|
3094
|
+
onMouseEnter: () => setIsHovered(true),
|
|
3095
|
+
onMouseLeave: () => setIsHovered(false),
|
|
2314
3096
|
children: [
|
|
2315
3097
|
/* @__PURE__ */ jsxs(
|
|
2316
3098
|
"div",
|
|
@@ -2336,6 +3118,22 @@ const DependencyRow = ({ dependency }) => {
|
|
|
2336
3118
|
},
|
|
2337
3119
|
children: dependency.name
|
|
2338
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
|
+
}
|
|
2339
3137
|
)
|
|
2340
3138
|
]
|
|
2341
3139
|
}
|
|
@@ -2346,27 +3144,23 @@ const DependencyRow = ({ dependency }) => {
|
|
|
2346
3144
|
style: {
|
|
2347
3145
|
display: "flex",
|
|
2348
3146
|
alignItems: "center",
|
|
2349
|
-
gap: "
|
|
3147
|
+
gap: "4px"
|
|
2350
3148
|
},
|
|
2351
3149
|
children: [
|
|
2352
|
-
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version }),
|
|
2353
3150
|
/* @__PURE__ */ jsx(
|
|
2354
|
-
"
|
|
3151
|
+
"button",
|
|
2355
3152
|
{
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
rel: "noopener noreferrer",
|
|
3153
|
+
type: "button",
|
|
3154
|
+
onClick: handleCopy,
|
|
2359
3155
|
style: {
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
display: "flex",
|
|
2363
|
-
alignItems: "center",
|
|
2364
|
-
transition: "background-color 0.2s"
|
|
3156
|
+
...actionButtonStyle,
|
|
3157
|
+
color: copied ? theme2.colors.success || "#10b981" : theme2.colors.textSecondary
|
|
2365
3158
|
},
|
|
2366
|
-
title: "
|
|
2367
|
-
children: /* @__PURE__ */ jsx(
|
|
3159
|
+
title: copied ? "Copied!" : `Copy ${dependency.name}@${dependency.version}`,
|
|
3160
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 12 }) : /* @__PURE__ */ jsx(Copy, { size: 12 })
|
|
2368
3161
|
}
|
|
2369
|
-
)
|
|
3162
|
+
),
|
|
3163
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary }, children: dependency.version })
|
|
2370
3164
|
]
|
|
2371
3165
|
}
|
|
2372
3166
|
)
|
|
@@ -2879,7 +3673,7 @@ const DependenciesPanelContent = ({
|
|
|
2879
3673
|
const DependenciesPanel = (props) => {
|
|
2880
3674
|
return /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(DependenciesPanelContent, { ...props }) });
|
|
2881
3675
|
};
|
|
2882
|
-
const PANEL_ID$
|
|
3676
|
+
const PANEL_ID$3 = "industry-theme.local-projects";
|
|
2883
3677
|
const filterProjectsTool = {
|
|
2884
3678
|
name: "filter_projects",
|
|
2885
3679
|
description: "Filter the local projects list by name, owner, or path",
|
|
@@ -2903,7 +3697,7 @@ const filterProjectsTool = {
|
|
|
2903
3697
|
tags: ["filter", "search", "projects"],
|
|
2904
3698
|
tool_call_template: {
|
|
2905
3699
|
call_template_type: "panel_event",
|
|
2906
|
-
event_type: `${PANEL_ID$
|
|
3700
|
+
event_type: `${PANEL_ID$3}:filter`
|
|
2907
3701
|
}
|
|
2908
3702
|
};
|
|
2909
3703
|
const selectProjectTool = {
|
|
@@ -2929,7 +3723,7 @@ const selectProjectTool = {
|
|
|
2929
3723
|
tags: ["select", "project", "navigation"],
|
|
2930
3724
|
tool_call_template: {
|
|
2931
3725
|
call_template_type: "panel_event",
|
|
2932
|
-
event_type: `${PANEL_ID$
|
|
3726
|
+
event_type: `${PANEL_ID$3}:select-repository`
|
|
2933
3727
|
}
|
|
2934
3728
|
};
|
|
2935
3729
|
const openProjectTool = {
|
|
@@ -2955,7 +3749,7 @@ const openProjectTool = {
|
|
|
2955
3749
|
tags: ["open", "project", "workspace"],
|
|
2956
3750
|
tool_call_template: {
|
|
2957
3751
|
call_template_type: "panel_event",
|
|
2958
|
-
event_type: `${PANEL_ID$
|
|
3752
|
+
event_type: `${PANEL_ID$3}:open-repository`
|
|
2959
3753
|
}
|
|
2960
3754
|
};
|
|
2961
3755
|
const localProjectsPanelTools = [
|
|
@@ -2964,12 +3758,12 @@ const localProjectsPanelTools = [
|
|
|
2964
3758
|
openProjectTool
|
|
2965
3759
|
];
|
|
2966
3760
|
const localProjectsPanelToolsMetadata = {
|
|
2967
|
-
id: PANEL_ID$
|
|
3761
|
+
id: PANEL_ID$3,
|
|
2968
3762
|
name: "Local Projects Panel",
|
|
2969
3763
|
description: "Tools for browsing and managing local Alexandria repositories",
|
|
2970
3764
|
tools: localProjectsPanelTools
|
|
2971
3765
|
};
|
|
2972
|
-
const PANEL_ID$
|
|
3766
|
+
const PANEL_ID$2 = "industry-theme.workspace-repositories";
|
|
2973
3767
|
const selectRepositoryTool = {
|
|
2974
3768
|
name: "select_workspace_repository",
|
|
2975
3769
|
description: "Selects a repository in the workspace panel",
|
|
@@ -2993,7 +3787,7 @@ const selectRepositoryTool = {
|
|
|
2993
3787
|
tags: ["workspace", "repository", "select"],
|
|
2994
3788
|
tool_call_template: {
|
|
2995
3789
|
call_template_type: "panel_event",
|
|
2996
|
-
event_type: `${PANEL_ID$
|
|
3790
|
+
event_type: `${PANEL_ID$2}:select-repository`
|
|
2997
3791
|
}
|
|
2998
3792
|
};
|
|
2999
3793
|
const refreshWorkspaceTool = {
|
|
@@ -3018,7 +3812,7 @@ const refreshWorkspaceTool = {
|
|
|
3018
3812
|
tags: ["workspace", "refresh"],
|
|
3019
3813
|
tool_call_template: {
|
|
3020
3814
|
call_template_type: "panel_event",
|
|
3021
|
-
event_type: `${PANEL_ID$
|
|
3815
|
+
event_type: `${PANEL_ID$2}:refresh-workspace`
|
|
3022
3816
|
}
|
|
3023
3817
|
};
|
|
3024
3818
|
const openRepositoryTool = {
|
|
@@ -3044,7 +3838,7 @@ const openRepositoryTool = {
|
|
|
3044
3838
|
tags: ["workspace", "repository", "open"],
|
|
3045
3839
|
tool_call_template: {
|
|
3046
3840
|
call_template_type: "panel_event",
|
|
3047
|
-
event_type: `${PANEL_ID$
|
|
3841
|
+
event_type: `${PANEL_ID$2}:open-repository`
|
|
3048
3842
|
}
|
|
3049
3843
|
};
|
|
3050
3844
|
const workspaceRepositoriesPanelTools = [
|
|
@@ -3053,11 +3847,133 @@ const workspaceRepositoriesPanelTools = [
|
|
|
3053
3847
|
openRepositoryTool
|
|
3054
3848
|
];
|
|
3055
3849
|
const workspaceRepositoriesPanelToolsMetadata = {
|
|
3056
|
-
id: PANEL_ID$
|
|
3850
|
+
id: PANEL_ID$2,
|
|
3057
3851
|
name: "Workspace Repositories Panel",
|
|
3058
3852
|
description: "Tools provided by the workspace repositories panel",
|
|
3059
3853
|
tools: workspaceRepositoriesPanelTools
|
|
3060
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
|
+
};
|
|
3061
3977
|
const PANEL_ID = "principal-ade.dependencies-panel";
|
|
3062
3978
|
const filterDependenciesTool = {
|
|
3063
3979
|
name: "filter_dependencies",
|
|
@@ -3192,6 +4108,28 @@ const panels = [
|
|
|
3192
4108
|
console.log("Workspace Repositories Panel unmounting");
|
|
3193
4109
|
}
|
|
3194
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
|
+
},
|
|
3195
4133
|
{
|
|
3196
4134
|
metadata: {
|
|
3197
4135
|
id: "principal-ade.dependencies-panel",
|
|
@@ -3224,24 +4162,33 @@ export {
|
|
|
3224
4162
|
LocalProjectsPanel,
|
|
3225
4163
|
LocalProjectsPanelPreview,
|
|
3226
4164
|
RepositoryAvatar,
|
|
4165
|
+
WorkspaceCard,
|
|
3227
4166
|
WorkspaceRepositoriesPanel,
|
|
4167
|
+
WorkspacesListPanel,
|
|
4168
|
+
WorkspacesListPanelPreview,
|
|
4169
|
+
createWorkspaceTool,
|
|
3228
4170
|
dependenciesPanelTools,
|
|
3229
4171
|
dependenciesPanelToolsMetadata,
|
|
3230
4172
|
filterDependenciesTool,
|
|
3231
4173
|
filterProjectsTool,
|
|
4174
|
+
filterWorkspacesTool,
|
|
3232
4175
|
localProjectsPanelTools,
|
|
3233
4176
|
localProjectsPanelToolsMetadata,
|
|
3234
4177
|
onPackageLoad,
|
|
3235
4178
|
onPackageUnload,
|
|
3236
4179
|
openProjectTool,
|
|
3237
4180
|
openRepositoryTool,
|
|
4181
|
+
openWorkspaceTool,
|
|
3238
4182
|
panels,
|
|
3239
4183
|
refreshWorkspaceTool,
|
|
3240
4184
|
selectDependencyTypeTool,
|
|
3241
4185
|
selectPackageTool,
|
|
3242
4186
|
selectProjectTool,
|
|
3243
4187
|
selectRepositoryTool,
|
|
4188
|
+
selectWorkspaceTool,
|
|
3244
4189
|
workspaceRepositoriesPanelTools,
|
|
3245
|
-
workspaceRepositoriesPanelToolsMetadata
|
|
4190
|
+
workspaceRepositoriesPanelToolsMetadata,
|
|
4191
|
+
workspacesListPanelTools,
|
|
4192
|
+
workspacesListPanelToolsMetadata
|
|
3246
4193
|
};
|
|
3247
4194
|
//# sourceMappingURL=panels.bundle.js.map
|