@industry-theme/alexandria-panels 0.1.17 → 0.1.19
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/panels/WorkspaceCollectionPanel/index.d.ts +9 -2
- package/dist/panels/WorkspaceCollectionPanel/index.d.ts.map +1 -1
- package/dist/panels/shared/github-types.d.ts +8 -0
- package/dist/panels/shared/github-types.d.ts.map +1 -1
- package/dist/panels.bundle.js +156 -219
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelComponentProps } from '../../types';
|
|
3
|
+
export interface WorkspaceCollectionPanelProps extends PanelComponentProps {
|
|
4
|
+
selectedRepository?: string;
|
|
5
|
+
}
|
|
3
6
|
/**
|
|
4
7
|
* WorkspaceCollectionPanel - Browser-based workspace repository management panel
|
|
5
8
|
*
|
|
9
|
+
* Props:
|
|
10
|
+
* - selectedRepository: Full name of the selected repo (e.g., "owner/repo")
|
|
11
|
+
*
|
|
6
12
|
* Features:
|
|
7
13
|
* - List all repositories in a workspace
|
|
8
|
-
* -
|
|
14
|
+
* - Toggle between name (A-Z) and recently updated sorting
|
|
15
|
+
* - Syncs selection with selectedRepository prop and repository:selected events
|
|
9
16
|
* - Navigate to repository pages
|
|
10
17
|
* - Remove repositories from workspace
|
|
11
18
|
*
|
|
@@ -18,7 +25,7 @@ import type { PanelComponentProps } from '../../types';
|
|
|
18
25
|
* - repository:navigate
|
|
19
26
|
* - repository:removed
|
|
20
27
|
*/
|
|
21
|
-
export declare const WorkspaceCollectionPanel: React.FC<
|
|
28
|
+
export declare const WorkspaceCollectionPanel: React.FC<WorkspaceCollectionPanelProps>;
|
|
22
29
|
/**
|
|
23
30
|
* Preview component for panel tabs/thumbnails
|
|
24
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panels/WorkspaceCollectionPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/panels/WorkspaceCollectionPanel/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAOzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAYvD,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAkrBD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAE5E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,EAAE,KAAK,CAAC,EAsCnD,CAAC;AAGF,YAAY,EACV,SAAS,EACT,wBAAwB,EACxB,0BAA0B,EAC1B,+BAA+B,EAC/B,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,SAAS,CAAC"}
|
|
@@ -24,6 +24,14 @@ export interface GitHubRepository {
|
|
|
24
24
|
stargazers_count?: number;
|
|
25
25
|
default_branch: string;
|
|
26
26
|
fork?: boolean;
|
|
27
|
+
/** Parent repository info (for forks) */
|
|
28
|
+
parent?: {
|
|
29
|
+
full_name: string;
|
|
30
|
+
owner: {
|
|
31
|
+
login: string;
|
|
32
|
+
avatar_url: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
27
35
|
/** License SPDX identifier (e.g., "MIT", "Apache-2.0") */
|
|
28
36
|
license?: string | null;
|
|
29
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-types.d.ts","sourceRoot":"","sources":["../../../src/panels/shared/github-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
|
1
|
+
{"version":3,"file":"github-types.d.ts","sourceRoot":"","sources":["../../../src/panels/shared/github-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE;QACL,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,MAAM,CAAC,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE;YACL,KAAK,EAAE,MAAM,CAAC;YACd,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;KACH,CAAC;IACF,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -134,17 +134,6 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
134
134
|
Component.displayName = toPascalCase(iconName);
|
|
135
135
|
return Component;
|
|
136
136
|
};
|
|
137
|
-
/**
|
|
138
|
-
* @license lucide-react v0.552.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/
|
|
143
|
-
const __iconNode$w = [
|
|
144
|
-
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
145
|
-
["path", { d: "m12 5 7 7-7 7", key: "xquz4c" }]
|
|
146
|
-
];
|
|
147
|
-
const ArrowRight = createLucideIcon("arrow-right", __iconNode$w);
|
|
148
137
|
/**
|
|
149
138
|
* @license lucide-react v0.552.0 - ISC
|
|
150
139
|
*
|
|
@@ -2731,15 +2720,11 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2731
2720
|
onSelect(repository);
|
|
2732
2721
|
}
|
|
2733
2722
|
}, [onSelect, repository]);
|
|
2734
|
-
const
|
|
2735
|
-
(
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
}
|
|
2740
|
-
},
|
|
2741
|
-
[onNavigate, repository]
|
|
2742
|
-
);
|
|
2723
|
+
const handleDoubleClick = useCallback(() => {
|
|
2724
|
+
if (onNavigate) {
|
|
2725
|
+
onNavigate(repository);
|
|
2726
|
+
}
|
|
2727
|
+
}, [onNavigate, repository]);
|
|
2743
2728
|
const handleRemove = useCallback(
|
|
2744
2729
|
(e) => {
|
|
2745
2730
|
e.stopPropagation();
|
|
@@ -2749,13 +2734,6 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2749
2734
|
},
|
|
2750
2735
|
[onRemove, repository]
|
|
2751
2736
|
);
|
|
2752
|
-
const handleOpenOnGitHub = useCallback(
|
|
2753
|
-
(e) => {
|
|
2754
|
-
e.stopPropagation();
|
|
2755
|
-
window.open(repository.html_url, "_blank", "noopener,noreferrer");
|
|
2756
|
-
},
|
|
2757
|
-
[repository.html_url]
|
|
2758
|
-
);
|
|
2759
2737
|
const getRelativeTime = (dateString) => {
|
|
2760
2738
|
const date = new Date(dateString);
|
|
2761
2739
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -2772,6 +2750,7 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2772
2750
|
"div",
|
|
2773
2751
|
{
|
|
2774
2752
|
onClick: handleClick,
|
|
2753
|
+
onDoubleClick: handleDoubleClick,
|
|
2775
2754
|
onMouseEnter: () => setIsHovered(true),
|
|
2776
2755
|
onMouseLeave: () => setIsHovered(false),
|
|
2777
2756
|
style: {
|
|
@@ -2789,8 +2768,8 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2789
2768
|
/* @__PURE__ */ jsx(
|
|
2790
2769
|
RepositoryAvatar,
|
|
2791
2770
|
{
|
|
2792
|
-
owner: repository.owner.login,
|
|
2793
|
-
customAvatarUrl: repository.owner.avatar_url,
|
|
2771
|
+
owner: repository.fork && repository.parent ? repository.parent.owner.login : repository.owner.login,
|
|
2772
|
+
customAvatarUrl: repository.fork && repository.parent ? repository.parent.owner.avatar_url : repository.owner.avatar_url,
|
|
2794
2773
|
size: 40
|
|
2795
2774
|
}
|
|
2796
2775
|
),
|
|
@@ -2831,7 +2810,11 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2831
2810
|
color: theme.colors.textSecondary,
|
|
2832
2811
|
marginBottom: "4px"
|
|
2833
2812
|
},
|
|
2834
|
-
children: repository.
|
|
2813
|
+
children: repository.fork && repository.parent ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2814
|
+
repository.parent.owner.login,
|
|
2815
|
+
/* @__PURE__ */ jsx("span", { style: { opacity: 0.7 }, children: " · forked by " }),
|
|
2816
|
+
repository.owner.login
|
|
2817
|
+
] }) : repository.owner.login
|
|
2835
2818
|
}
|
|
2836
2819
|
),
|
|
2837
2820
|
repository.description && /* @__PURE__ */ jsx(
|
|
@@ -2886,7 +2869,7 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2886
2869
|
}
|
|
2887
2870
|
)
|
|
2888
2871
|
] }),
|
|
2889
|
-
/* @__PURE__ */
|
|
2872
|
+
/* @__PURE__ */ jsx(
|
|
2890
2873
|
"div",
|
|
2891
2874
|
{
|
|
2892
2875
|
style: {
|
|
@@ -2897,97 +2880,38 @@ const WorkspaceCollectionRepositoryCard = ({
|
|
|
2897
2880
|
opacity: isHovered || isSelected ? 1 : 0,
|
|
2898
2881
|
transition: "opacity 0.15s"
|
|
2899
2882
|
},
|
|
2900
|
-
children:
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
),
|
|
2933
|
-
/* @__PURE__ */ jsx(
|
|
2934
|
-
"button",
|
|
2935
|
-
{
|
|
2936
|
-
type: "button",
|
|
2937
|
-
onClick: handleOpenOnGitHub,
|
|
2938
|
-
style: {
|
|
2939
|
-
display: "flex",
|
|
2940
|
-
alignItems: "center",
|
|
2941
|
-
justifyContent: "center",
|
|
2942
|
-
width: "32px",
|
|
2943
|
-
height: "32px",
|
|
2944
|
-
borderRadius: "6px",
|
|
2945
|
-
border: `1px solid ${theme.colors.border}`,
|
|
2946
|
-
backgroundColor: "transparent",
|
|
2947
|
-
color: theme.colors.textSecondary,
|
|
2948
|
-
cursor: "pointer",
|
|
2949
|
-
transition: "background-color 0.15s, color 0.15s"
|
|
2950
|
-
},
|
|
2951
|
-
title: "Open on GitHub",
|
|
2952
|
-
onMouseEnter: (e) => {
|
|
2953
|
-
e.currentTarget.style.backgroundColor = theme.colors.backgroundTertiary;
|
|
2954
|
-
e.currentTarget.style.color = theme.colors.text;
|
|
2955
|
-
},
|
|
2956
|
-
onMouseLeave: (e) => {
|
|
2957
|
-
e.currentTarget.style.backgroundColor = "transparent";
|
|
2958
|
-
e.currentTarget.style.color = theme.colors.textSecondary;
|
|
2959
|
-
},
|
|
2960
|
-
children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
|
|
2961
|
-
}
|
|
2962
|
-
),
|
|
2963
|
-
onNavigate && /* @__PURE__ */ jsxs(
|
|
2964
|
-
"button",
|
|
2965
|
-
{
|
|
2966
|
-
type: "button",
|
|
2967
|
-
onClick: handleNavigate,
|
|
2968
|
-
style: {
|
|
2969
|
-
display: "flex",
|
|
2970
|
-
alignItems: "center",
|
|
2971
|
-
gap: "6px",
|
|
2972
|
-
padding: "6px 12px",
|
|
2973
|
-
borderRadius: "6px",
|
|
2974
|
-
border: "none",
|
|
2975
|
-
backgroundColor: theme.colors.primary,
|
|
2976
|
-
color: theme.colors.background,
|
|
2977
|
-
fontSize: `${theme.fontSizes[1]}px`,
|
|
2978
|
-
fontWeight: theme.fontWeights.medium,
|
|
2979
|
-
fontFamily: theme.fonts.body,
|
|
2980
|
-
cursor: "pointer",
|
|
2981
|
-
transition: "opacity 0.15s"
|
|
2982
|
-
},
|
|
2983
|
-
title: "View repository",
|
|
2984
|
-
children: [
|
|
2985
|
-
/* @__PURE__ */ jsx(ArrowRight, { size: 14 }),
|
|
2986
|
-
"View"
|
|
2987
|
-
]
|
|
2988
|
-
}
|
|
2989
|
-
)
|
|
2990
|
-
]
|
|
2883
|
+
children: onRemove && /* @__PURE__ */ jsx(
|
|
2884
|
+
"button",
|
|
2885
|
+
{
|
|
2886
|
+
type: "button",
|
|
2887
|
+
onClick: handleRemove,
|
|
2888
|
+
style: {
|
|
2889
|
+
display: "flex",
|
|
2890
|
+
alignItems: "center",
|
|
2891
|
+
justifyContent: "center",
|
|
2892
|
+
width: "32px",
|
|
2893
|
+
height: "32px",
|
|
2894
|
+
borderRadius: "6px",
|
|
2895
|
+
border: `1px solid ${theme.colors.border}`,
|
|
2896
|
+
backgroundColor: "transparent",
|
|
2897
|
+
color: theme.colors.textSecondary,
|
|
2898
|
+
cursor: "pointer",
|
|
2899
|
+
transition: "background-color 0.15s, color 0.15s"
|
|
2900
|
+
},
|
|
2901
|
+
title: "Remove from workspace",
|
|
2902
|
+
onMouseEnter: (e) => {
|
|
2903
|
+
e.currentTarget.style.backgroundColor = `${theme.colors.error || "#ef4444"}20`;
|
|
2904
|
+
e.currentTarget.style.color = theme.colors.error || "#ef4444";
|
|
2905
|
+
e.currentTarget.style.borderColor = theme.colors.error || "#ef4444";
|
|
2906
|
+
},
|
|
2907
|
+
onMouseLeave: (e) => {
|
|
2908
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
2909
|
+
e.currentTarget.style.color = theme.colors.textSecondary;
|
|
2910
|
+
e.currentTarget.style.borderColor = theme.colors.border;
|
|
2911
|
+
},
|
|
2912
|
+
children: /* @__PURE__ */ jsx(Trash2, { size: 16 })
|
|
2913
|
+
}
|
|
2914
|
+
)
|
|
2991
2915
|
}
|
|
2992
2916
|
)
|
|
2993
2917
|
]
|
|
@@ -3020,12 +2944,13 @@ function getLanguageColor$1(language) {
|
|
|
3020
2944
|
const WorkspaceCollectionPanelContent = ({
|
|
3021
2945
|
context,
|
|
3022
2946
|
actions,
|
|
3023
|
-
events
|
|
2947
|
+
events,
|
|
2948
|
+
selectedRepository
|
|
3024
2949
|
}) => {
|
|
3025
2950
|
var _a, _b, _c, _d;
|
|
3026
2951
|
const { theme } = useTheme();
|
|
3027
|
-
const [filter, setFilter] = useState("");
|
|
3028
2952
|
const [selectedRepo, setSelectedRepo] = useState(null);
|
|
2953
|
+
const [sortField, setSortField] = useState("name");
|
|
3029
2954
|
const panelActions = actions;
|
|
3030
2955
|
const workspaceSlice = context.getSlice("workspace");
|
|
3031
2956
|
const repositoriesSlice = context.getSlice("workspaceRepositories");
|
|
@@ -3033,24 +2958,44 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3033
2958
|
const repositories = ((_b = repositoriesSlice == null ? void 0 : repositoriesSlice.data) == null ? void 0 : _b.repositories) ?? [];
|
|
3034
2959
|
const isLoading = (workspaceSlice == null ? void 0 : workspaceSlice.loading) || (repositoriesSlice == null ? void 0 : repositoriesSlice.loading) || false;
|
|
3035
2960
|
const error = ((_c = workspaceSlice == null ? void 0 : workspaceSlice.data) == null ? void 0 : _c.error) || ((_d = repositoriesSlice == null ? void 0 : repositoriesSlice.data) == null ? void 0 : _d.error);
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
const haystack = [
|
|
3043
|
-
repo.name,
|
|
3044
|
-
repo.full_name,
|
|
3045
|
-
((_a2 = repo.owner) == null ? void 0 : _a2.login) ?? "",
|
|
3046
|
-
repo.description ?? "",
|
|
3047
|
-
repo.language ?? ""
|
|
3048
|
-
].join(" ").toLowerCase();
|
|
3049
|
-
return haystack.includes(normalizedFilter);
|
|
3050
|
-
});
|
|
2961
|
+
useEffect(() => {
|
|
2962
|
+
if (selectedRepository && repositories.length > 0) {
|
|
2963
|
+
const repo = repositories.find((r) => r.full_name === selectedRepository);
|
|
2964
|
+
if (repo) {
|
|
2965
|
+
setSelectedRepo(repo);
|
|
2966
|
+
}
|
|
3051
2967
|
}
|
|
3052
|
-
|
|
3053
|
-
|
|
2968
|
+
}, [selectedRepository, repositories]);
|
|
2969
|
+
useEffect(() => {
|
|
2970
|
+
const unsubscribe = events.on("repository:selected", (event) => {
|
|
2971
|
+
var _a2;
|
|
2972
|
+
const payload = event.payload;
|
|
2973
|
+
if (((_a2 = payload == null ? void 0 : payload.repository) == null ? void 0 : _a2.full_name) && repositories.length > 0) {
|
|
2974
|
+
const repo = repositories.find((r) => {
|
|
2975
|
+
var _a3;
|
|
2976
|
+
return r.full_name === ((_a3 = payload.repository) == null ? void 0 : _a3.full_name);
|
|
2977
|
+
});
|
|
2978
|
+
if (repo) {
|
|
2979
|
+
setSelectedRepo(repo);
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
});
|
|
2983
|
+
return () => unsubscribe();
|
|
2984
|
+
}, [events, repositories]);
|
|
2985
|
+
const toggleSort = () => {
|
|
2986
|
+
setSortField(sortField === "name" ? "updated" : "name");
|
|
2987
|
+
};
|
|
2988
|
+
const sortedRepositories = useMemo(() => {
|
|
2989
|
+
return [...repositories].sort((a, b) => {
|
|
2990
|
+
if (sortField === "name") {
|
|
2991
|
+
return a.name.localeCompare(b.name);
|
|
2992
|
+
} else {
|
|
2993
|
+
const aTime = new Date(a.pushed_at || a.updated_at || 0).getTime();
|
|
2994
|
+
const bTime = new Date(b.pushed_at || b.updated_at || 0).getTime();
|
|
2995
|
+
return bTime - aTime;
|
|
2996
|
+
}
|
|
2997
|
+
});
|
|
2998
|
+
}, [repositories, sortField]);
|
|
3054
2999
|
const handleSelectRepository = useCallback(
|
|
3055
3000
|
(repository) => {
|
|
3056
3001
|
setSelectedRepo(repository);
|
|
@@ -3138,10 +3083,6 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3138
3083
|
void handleRemoveRepository(repository);
|
|
3139
3084
|
}
|
|
3140
3085
|
}
|
|
3141
|
-
}),
|
|
3142
|
-
events.on(`${PANEL_ID$a}:filter`, (event) => {
|
|
3143
|
-
var _a2;
|
|
3144
|
-
setFilter(((_a2 = event.payload) == null ? void 0 : _a2.filter) || "");
|
|
3145
3086
|
})
|
|
3146
3087
|
];
|
|
3147
3088
|
return () => unsubscribers.forEach((unsub) => unsub());
|
|
@@ -3153,9 +3094,7 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3153
3094
|
backgroundColor: theme.colors.backgroundSecondary
|
|
3154
3095
|
};
|
|
3155
3096
|
const contentContainerStyle = {
|
|
3156
|
-
...baseContainerStyle
|
|
3157
|
-
padding: "16px",
|
|
3158
|
-
gap: "12px"
|
|
3097
|
+
...baseContainerStyle
|
|
3159
3098
|
};
|
|
3160
3099
|
if (!workspace) {
|
|
3161
3100
|
return /* @__PURE__ */ jsx("div", { style: baseContainerStyle, children: /* @__PURE__ */ jsx(
|
|
@@ -3273,42 +3212,71 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3273
3212
|
) });
|
|
3274
3213
|
}
|
|
3275
3214
|
return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
{
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3215
|
+
/* @__PURE__ */ jsxs(
|
|
3216
|
+
"div",
|
|
3217
|
+
{
|
|
3218
|
+
style: {
|
|
3219
|
+
height: "40px",
|
|
3220
|
+
minHeight: "40px",
|
|
3221
|
+
padding: "0 16px",
|
|
3222
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
3223
|
+
display: "flex",
|
|
3224
|
+
alignItems: "center",
|
|
3225
|
+
gap: "8px"
|
|
3226
|
+
},
|
|
3227
|
+
children: [
|
|
3228
|
+
/* @__PURE__ */ jsx(Folder, { size: 18, color: theme.colors.primary }),
|
|
3229
|
+
/* @__PURE__ */ jsx(
|
|
3230
|
+
"span",
|
|
3231
|
+
{
|
|
3232
|
+
style: {
|
|
3233
|
+
fontSize: `${theme.fontSizes[2]}px`,
|
|
3234
|
+
fontWeight: theme.fontWeights.medium,
|
|
3235
|
+
color: theme.colors.text,
|
|
3236
|
+
fontFamily: theme.fonts.body
|
|
3237
|
+
},
|
|
3238
|
+
children: "Repositories"
|
|
3239
|
+
}
|
|
3240
|
+
),
|
|
3241
|
+
repositories.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3242
|
+
/* @__PURE__ */ jsx(
|
|
3243
|
+
"span",
|
|
3244
|
+
{
|
|
3245
|
+
style: {
|
|
3246
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
3247
|
+
color: theme.colors.textSecondary,
|
|
3248
|
+
padding: "2px 8px",
|
|
3249
|
+
borderRadius: "12px",
|
|
3250
|
+
backgroundColor: theme.colors.background
|
|
3251
|
+
},
|
|
3252
|
+
children: repositories.length
|
|
3253
|
+
}
|
|
3254
|
+
),
|
|
3255
|
+
/* @__PURE__ */ jsx(
|
|
3256
|
+
"button",
|
|
3257
|
+
{
|
|
3258
|
+
onClick: toggleSort,
|
|
3259
|
+
style: {
|
|
3260
|
+
marginLeft: "auto",
|
|
3261
|
+
padding: "4px 10px",
|
|
3262
|
+
borderRadius: "4px",
|
|
3263
|
+
border: `1px solid ${theme.colors.border}`,
|
|
3264
|
+
background: theme.colors.background,
|
|
3265
|
+
color: theme.colors.text,
|
|
3266
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
3267
|
+
fontFamily: theme.fonts.body,
|
|
3268
|
+
cursor: "pointer",
|
|
3269
|
+
display: "flex",
|
|
3270
|
+
alignItems: "center",
|
|
3271
|
+
gap: "4px"
|
|
3272
|
+
},
|
|
3273
|
+
children: sortField === "name" ? "A-Z" : "Recent"
|
|
3274
|
+
}
|
|
3275
|
+
)
|
|
3276
|
+
] })
|
|
3277
|
+
]
|
|
3278
|
+
}
|
|
3279
|
+
),
|
|
3312
3280
|
error && /* @__PURE__ */ jsx(
|
|
3313
3281
|
"div",
|
|
3314
3282
|
{
|
|
@@ -3317,6 +3285,7 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3317
3285
|
alignItems: "center",
|
|
3318
3286
|
gap: "8px",
|
|
3319
3287
|
padding: "10px 14px",
|
|
3288
|
+
margin: "8px 16px",
|
|
3320
3289
|
borderRadius: "6px",
|
|
3321
3290
|
backgroundColor: `${theme.colors.error || "#ef4444"}20`,
|
|
3322
3291
|
color: theme.colors.error || "#ef4444",
|
|
@@ -3326,28 +3295,6 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3326
3295
|
children: /* @__PURE__ */ jsx("span", { children: error })
|
|
3327
3296
|
}
|
|
3328
3297
|
),
|
|
3329
|
-
/* @__PURE__ */ jsxs(
|
|
3330
|
-
"div",
|
|
3331
|
-
{
|
|
3332
|
-
style: {
|
|
3333
|
-
fontSize: `${theme.fontSizes[0]}px`,
|
|
3334
|
-
fontFamily: theme.fonts.body,
|
|
3335
|
-
color: theme.colors.textSecondary,
|
|
3336
|
-
textTransform: "uppercase",
|
|
3337
|
-
letterSpacing: "0.5px"
|
|
3338
|
-
},
|
|
3339
|
-
children: [
|
|
3340
|
-
filteredRepositories.length,
|
|
3341
|
-
" ",
|
|
3342
|
-
filteredRepositories.length === 1 ? "repository" : "repositories",
|
|
3343
|
-
filter && repositories.length !== filteredRepositories.length && /* @__PURE__ */ jsxs("span", { children: [
|
|
3344
|
-
" (filtered from ",
|
|
3345
|
-
repositories.length,
|
|
3346
|
-
")"
|
|
3347
|
-
] })
|
|
3348
|
-
]
|
|
3349
|
-
}
|
|
3350
|
-
),
|
|
3351
3298
|
/* @__PURE__ */ jsxs(
|
|
3352
3299
|
"div",
|
|
3353
3300
|
{
|
|
@@ -3356,7 +3303,8 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3356
3303
|
overflowY: "auto",
|
|
3357
3304
|
display: "flex",
|
|
3358
3305
|
flexDirection: "column",
|
|
3359
|
-
gap: "4px"
|
|
3306
|
+
gap: "4px",
|
|
3307
|
+
padding: "8px"
|
|
3360
3308
|
},
|
|
3361
3309
|
children: [
|
|
3362
3310
|
repositories.length === 0 && !isLoading && /* @__PURE__ */ jsxs(
|
|
@@ -3389,18 +3337,7 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3389
3337
|
]
|
|
3390
3338
|
}
|
|
3391
3339
|
),
|
|
3392
|
-
|
|
3393
|
-
"div",
|
|
3394
|
-
{
|
|
3395
|
-
style: {
|
|
3396
|
-
padding: "32px",
|
|
3397
|
-
textAlign: "center",
|
|
3398
|
-
color: theme.colors.textSecondary
|
|
3399
|
-
},
|
|
3400
|
-
children: /* @__PURE__ */ jsx("p", { style: { margin: 0 }, children: "No repositories match your filter." })
|
|
3401
|
-
}
|
|
3402
|
-
),
|
|
3403
|
-
filteredRepositories.map((repository) => /* @__PURE__ */ jsx(
|
|
3340
|
+
sortedRepositories.map((repository) => /* @__PURE__ */ jsx(
|
|
3404
3341
|
WorkspaceCollectionRepositoryCard,
|
|
3405
3342
|
{
|
|
3406
3343
|
repository,
|