@industry-theme/alexandria-panels 0.1.33 → 0.1.34
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/LocalProjectsPanel/LocalProjectsPanel.stories.d.ts +4 -0
- package/dist/panels/LocalProjectsPanel/LocalProjectsPanel.stories.d.ts.map +1 -1
- package/dist/panels/LocalProjectsPanel/index.d.ts.map +1 -1
- package/dist/panels/WorkspaceCollectionPanel/WorkspaceCollectionPanel.stories.d.ts +1 -0
- package/dist/panels/WorkspaceCollectionPanel/WorkspaceCollectionPanel.stories.d.ts.map +1 -1
- package/dist/panels/WorkspaceCollectionPanel/index.d.ts.map +1 -1
- package/dist/panels/WorkspacesListPanel/WorkspacesListPanel.stories.d.ts +4 -0
- package/dist/panels/WorkspacesListPanel/WorkspacesListPanel.stories.d.ts.map +1 -1
- package/dist/panels/WorkspacesListPanel/index.d.ts.map +1 -1
- package/dist/panels.bundle.js +378 -36
- package/dist/panels.bundle.js.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -1206,13 +1206,14 @@ const LocalProjectsPanelContent = ({
|
|
|
1206
1206
|
const [windowStates, setWindowStates] = useState(/* @__PURE__ */ new Map());
|
|
1207
1207
|
const [sortByOrg, setSortByOrg] = useState(false);
|
|
1208
1208
|
const handleToggleSearch = useCallback(() => {
|
|
1209
|
+
if (defaultShowSearch) return;
|
|
1209
1210
|
setShowSearch((prev) => {
|
|
1210
1211
|
if (prev) {
|
|
1211
1212
|
setFilter("");
|
|
1212
1213
|
}
|
|
1213
1214
|
return !prev;
|
|
1214
1215
|
});
|
|
1215
|
-
}, []);
|
|
1216
|
+
}, [defaultShowSearch]);
|
|
1216
1217
|
const handleClearFilter = useCallback(() => {
|
|
1217
1218
|
setFilter("");
|
|
1218
1219
|
}, []);
|
|
@@ -1455,20 +1456,171 @@ const LocalProjectsPanelContent = ({
|
|
|
1455
1456
|
) });
|
|
1456
1457
|
}
|
|
1457
1458
|
return /* @__PURE__ */ jsxs("div", { className: "local-projects-panel", style: contentContainerStyle, children: [
|
|
1458
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ jsx(
|
|
1459
1460
|
"div",
|
|
1460
1461
|
{
|
|
1461
1462
|
style: {
|
|
1462
1463
|
position: "relative",
|
|
1463
1464
|
height: "40px",
|
|
1464
1465
|
minHeight: "40px",
|
|
1465
|
-
padding: "0 16px",
|
|
1466
|
+
padding: defaultShowSearch && showSearch ? "0 16px 0 8px" : "0 16px",
|
|
1466
1467
|
borderBottom: `1px solid ${theme.colors.border}`,
|
|
1467
1468
|
display: "flex",
|
|
1468
1469
|
alignItems: "center",
|
|
1469
1470
|
boxSizing: "border-box"
|
|
1470
1471
|
},
|
|
1471
|
-
children:
|
|
1472
|
+
children: defaultShowSearch && showSearch ? /* @__PURE__ */ jsxs(
|
|
1473
|
+
"div",
|
|
1474
|
+
{
|
|
1475
|
+
style: {
|
|
1476
|
+
display: "flex",
|
|
1477
|
+
alignItems: "center",
|
|
1478
|
+
gap: "8px",
|
|
1479
|
+
width: "100%"
|
|
1480
|
+
},
|
|
1481
|
+
children: [
|
|
1482
|
+
/* @__PURE__ */ jsxs("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
1483
|
+
/* @__PURE__ */ jsx(
|
|
1484
|
+
Search,
|
|
1485
|
+
{
|
|
1486
|
+
size: 16,
|
|
1487
|
+
color: theme.colors.textSecondary,
|
|
1488
|
+
style: {
|
|
1489
|
+
position: "absolute",
|
|
1490
|
+
left: "10px",
|
|
1491
|
+
pointerEvents: "none"
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
),
|
|
1495
|
+
/* @__PURE__ */ jsx(
|
|
1496
|
+
"input",
|
|
1497
|
+
{
|
|
1498
|
+
type: "text",
|
|
1499
|
+
className: "search-input",
|
|
1500
|
+
placeholder: "Filter local projects...",
|
|
1501
|
+
value: filter,
|
|
1502
|
+
onChange: (e) => setFilter(e.target.value),
|
|
1503
|
+
autoFocus: true,
|
|
1504
|
+
style: {
|
|
1505
|
+
width: "100%",
|
|
1506
|
+
padding: "6px 32px 6px 32px",
|
|
1507
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
1508
|
+
color: theme.colors.text,
|
|
1509
|
+
backgroundColor: theme.colors.background,
|
|
1510
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1511
|
+
borderRadius: "4px",
|
|
1512
|
+
outline: "none",
|
|
1513
|
+
fontFamily: theme.fonts.body,
|
|
1514
|
+
transition: "border-color 0.2s ease",
|
|
1515
|
+
["--theme-primary"]: theme.colors.primary
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
),
|
|
1519
|
+
filter && /* @__PURE__ */ jsx(
|
|
1520
|
+
"button",
|
|
1521
|
+
{
|
|
1522
|
+
className: "clear-filter-button",
|
|
1523
|
+
onClick: handleClearFilter,
|
|
1524
|
+
style: {
|
|
1525
|
+
position: "absolute",
|
|
1526
|
+
right: "8px",
|
|
1527
|
+
background: "none",
|
|
1528
|
+
border: "none",
|
|
1529
|
+
cursor: "pointer",
|
|
1530
|
+
padding: "4px",
|
|
1531
|
+
display: "flex",
|
|
1532
|
+
alignItems: "center",
|
|
1533
|
+
justifyContent: "center",
|
|
1534
|
+
color: theme.colors.textSecondary,
|
|
1535
|
+
["--theme-text"]: theme.colors.text
|
|
1536
|
+
},
|
|
1537
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
1538
|
+
}
|
|
1539
|
+
)
|
|
1540
|
+
] }),
|
|
1541
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1542
|
+
/* @__PURE__ */ jsx(
|
|
1543
|
+
"button",
|
|
1544
|
+
{
|
|
1545
|
+
onClick: () => setSortByOrg(!sortByOrg),
|
|
1546
|
+
title: sortByOrg ? "Sort by: Last opened, then organization" : "Sort by: Last opened, then name",
|
|
1547
|
+
style: {
|
|
1548
|
+
padding: "4px 8px",
|
|
1549
|
+
height: "30px",
|
|
1550
|
+
borderRadius: "4px",
|
|
1551
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1552
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
1553
|
+
color: sortByOrg ? theme.colors.primary : theme.colors.textSecondary,
|
|
1554
|
+
cursor: "pointer",
|
|
1555
|
+
display: "flex",
|
|
1556
|
+
alignItems: "center",
|
|
1557
|
+
justifyContent: "center",
|
|
1558
|
+
transition: "all 0.15s",
|
|
1559
|
+
flexShrink: 0
|
|
1560
|
+
},
|
|
1561
|
+
children: sortByOrg ? /* @__PURE__ */ jsx(Building2, { size: 16 }) : /* @__PURE__ */ jsx(FolderGit2, { size: 16 })
|
|
1562
|
+
}
|
|
1563
|
+
),
|
|
1564
|
+
/* @__PURE__ */ jsx(
|
|
1565
|
+
"button",
|
|
1566
|
+
{
|
|
1567
|
+
onClick: handleScanForRepos,
|
|
1568
|
+
disabled: isScanning,
|
|
1569
|
+
title: "Scan for repositories",
|
|
1570
|
+
style: {
|
|
1571
|
+
padding: "4px 8px",
|
|
1572
|
+
height: "30px",
|
|
1573
|
+
borderRadius: "4px",
|
|
1574
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1575
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
1576
|
+
color: theme.colors.textSecondary,
|
|
1577
|
+
cursor: isScanning ? "default" : "pointer",
|
|
1578
|
+
display: "flex",
|
|
1579
|
+
alignItems: "center",
|
|
1580
|
+
justifyContent: "center",
|
|
1581
|
+
opacity: isScanning ? 0.6 : 1,
|
|
1582
|
+
transition: "all 0.2s",
|
|
1583
|
+
flexShrink: 0
|
|
1584
|
+
},
|
|
1585
|
+
children: /* @__PURE__ */ jsx(
|
|
1586
|
+
RefreshCw,
|
|
1587
|
+
{
|
|
1588
|
+
size: 16,
|
|
1589
|
+
style: {
|
|
1590
|
+
animation: isScanning ? "spin 1s linear infinite" : "none"
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
)
|
|
1594
|
+
}
|
|
1595
|
+
),
|
|
1596
|
+
panelActions.selectDirectory && /* @__PURE__ */ jsx(
|
|
1597
|
+
"button",
|
|
1598
|
+
{
|
|
1599
|
+
onClick: handleAddProject,
|
|
1600
|
+
disabled: isAdding,
|
|
1601
|
+
title: "Add existing project",
|
|
1602
|
+
style: {
|
|
1603
|
+
padding: "4px 8px",
|
|
1604
|
+
height: "30px",
|
|
1605
|
+
borderRadius: "4px",
|
|
1606
|
+
border: "none",
|
|
1607
|
+
backgroundColor: theme.colors.primary,
|
|
1608
|
+
color: theme.colors.background,
|
|
1609
|
+
cursor: isAdding ? "default" : "pointer",
|
|
1610
|
+
display: "flex",
|
|
1611
|
+
alignItems: "center",
|
|
1612
|
+
justifyContent: "center",
|
|
1613
|
+
opacity: isAdding ? 0.6 : 1,
|
|
1614
|
+
transition: "opacity 0.2s",
|
|
1615
|
+
flexShrink: 0
|
|
1616
|
+
},
|
|
1617
|
+
children: /* @__PURE__ */ jsx(Plus, { size: 16 })
|
|
1618
|
+
}
|
|
1619
|
+
)
|
|
1620
|
+
] })
|
|
1621
|
+
]
|
|
1622
|
+
}
|
|
1623
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1472
1624
|
/* @__PURE__ */ jsxs(
|
|
1473
1625
|
"div",
|
|
1474
1626
|
{
|
|
@@ -1536,10 +1688,11 @@ const LocalProjectsPanelContent = ({
|
|
|
1536
1688
|
onClick: () => setSortByOrg(!sortByOrg),
|
|
1537
1689
|
title: sortByOrg ? "Sort by: Last opened, then organization" : "Sort by: Last opened, then name",
|
|
1538
1690
|
style: {
|
|
1539
|
-
padding: "4px",
|
|
1691
|
+
padding: "4px 8px",
|
|
1692
|
+
height: "30px",
|
|
1540
1693
|
borderRadius: "4px",
|
|
1541
|
-
border: `1px solid ${
|
|
1542
|
-
backgroundColor:
|
|
1694
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1695
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
1543
1696
|
color: sortByOrg ? theme.colors.primary : theme.colors.textSecondary,
|
|
1544
1697
|
cursor: "pointer",
|
|
1545
1698
|
display: "flex",
|
|
@@ -1558,7 +1711,8 @@ const LocalProjectsPanelContent = ({
|
|
|
1558
1711
|
disabled: isScanning,
|
|
1559
1712
|
title: "Scan for repositories",
|
|
1560
1713
|
style: {
|
|
1561
|
-
padding: "4px",
|
|
1714
|
+
padding: "4px 8px",
|
|
1715
|
+
height: "30px",
|
|
1562
1716
|
borderRadius: "4px",
|
|
1563
1717
|
border: `1px solid ${theme.colors.border}`,
|
|
1564
1718
|
backgroundColor: theme.colors.backgroundSecondary,
|
|
@@ -1589,7 +1743,8 @@ const LocalProjectsPanelContent = ({
|
|
|
1589
1743
|
disabled: isAdding,
|
|
1590
1744
|
title: "Add existing project",
|
|
1591
1745
|
style: {
|
|
1592
|
-
padding: "4px",
|
|
1746
|
+
padding: "4px 8px",
|
|
1747
|
+
height: "30px",
|
|
1593
1748
|
borderRadius: "4px",
|
|
1594
1749
|
border: "none",
|
|
1595
1750
|
backgroundColor: theme.colors.primary,
|
|
@@ -1609,7 +1764,7 @@ const LocalProjectsPanelContent = ({
|
|
|
1609
1764
|
]
|
|
1610
1765
|
}
|
|
1611
1766
|
),
|
|
1612
|
-
showSearch && /* @__PURE__ */ jsxs(
|
|
1767
|
+
showSearch && !defaultShowSearch && /* @__PURE__ */ jsxs(
|
|
1613
1768
|
"div",
|
|
1614
1769
|
{
|
|
1615
1770
|
className: "search-overlay",
|
|
@@ -1707,7 +1862,7 @@ const LocalProjectsPanelContent = ({
|
|
|
1707
1862
|
]
|
|
1708
1863
|
}
|
|
1709
1864
|
)
|
|
1710
|
-
]
|
|
1865
|
+
] })
|
|
1711
1866
|
}
|
|
1712
1867
|
),
|
|
1713
1868
|
/* @__PURE__ */ jsxs(
|
|
@@ -2675,6 +2830,15 @@ const WorkspacesListPanelContent = ({
|
|
|
2675
2830
|
const [workspaceRepositories, setWorkspaceRepositories] = useState(
|
|
2676
2831
|
/* @__PURE__ */ new Map()
|
|
2677
2832
|
);
|
|
2833
|
+
const handleToggleSearch = useCallback(() => {
|
|
2834
|
+
if (defaultShowSearch) return;
|
|
2835
|
+
setShowSearchBox((prev) => {
|
|
2836
|
+
if (prev) {
|
|
2837
|
+
setSearchQuery("");
|
|
2838
|
+
}
|
|
2839
|
+
return !prev;
|
|
2840
|
+
});
|
|
2841
|
+
}, [defaultShowSearch]);
|
|
2678
2842
|
const panelActions = actions;
|
|
2679
2843
|
const workspacesSlice = context.getSlice("workspaces");
|
|
2680
2844
|
const workspaces = useMemo(
|
|
@@ -2899,20 +3063,109 @@ const WorkspacesListPanelContent = ({
|
|
|
2899
3063
|
) });
|
|
2900
3064
|
}
|
|
2901
3065
|
return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
|
|
2902
|
-
/* @__PURE__ */
|
|
3066
|
+
/* @__PURE__ */ jsx(
|
|
2903
3067
|
"div",
|
|
2904
3068
|
{
|
|
2905
3069
|
style: {
|
|
2906
3070
|
position: "relative",
|
|
2907
3071
|
height: "40px",
|
|
2908
3072
|
minHeight: "40px",
|
|
2909
|
-
padding: "0 16px",
|
|
3073
|
+
padding: defaultShowSearch && showSearchBox ? "0 16px 0 8px" : "0 16px",
|
|
2910
3074
|
borderBottom: `1px solid ${theme.colors.border}`,
|
|
2911
3075
|
display: "flex",
|
|
2912
3076
|
alignItems: "center",
|
|
2913
3077
|
boxSizing: "border-box"
|
|
2914
3078
|
},
|
|
2915
|
-
children:
|
|
3079
|
+
children: defaultShowSearch && showSearchBox ? /* @__PURE__ */ jsxs(
|
|
3080
|
+
"div",
|
|
3081
|
+
{
|
|
3082
|
+
style: {
|
|
3083
|
+
display: "flex",
|
|
3084
|
+
alignItems: "center",
|
|
3085
|
+
gap: "8px",
|
|
3086
|
+
width: "100%"
|
|
3087
|
+
},
|
|
3088
|
+
children: [
|
|
3089
|
+
/* @__PURE__ */ jsxs("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
3090
|
+
/* @__PURE__ */ jsx(
|
|
3091
|
+
Search,
|
|
3092
|
+
{
|
|
3093
|
+
size: 16,
|
|
3094
|
+
color: theme.colors.textSecondary,
|
|
3095
|
+
style: {
|
|
3096
|
+
position: "absolute",
|
|
3097
|
+
left: "10px",
|
|
3098
|
+
pointerEvents: "none"
|
|
3099
|
+
}
|
|
3100
|
+
}
|
|
3101
|
+
),
|
|
3102
|
+
/* @__PURE__ */ jsx(
|
|
3103
|
+
"input",
|
|
3104
|
+
{
|
|
3105
|
+
type: "text",
|
|
3106
|
+
placeholder: "Filter workspaces...",
|
|
3107
|
+
value: searchQuery,
|
|
3108
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
3109
|
+
autoFocus: true,
|
|
3110
|
+
style: {
|
|
3111
|
+
width: "100%",
|
|
3112
|
+
padding: "6px 32px 6px 32px",
|
|
3113
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
3114
|
+
color: theme.colors.text,
|
|
3115
|
+
backgroundColor: theme.colors.background,
|
|
3116
|
+
border: `1px solid ${theme.colors.border}`,
|
|
3117
|
+
borderRadius: "4px",
|
|
3118
|
+
outline: "none",
|
|
3119
|
+
fontFamily: theme.fonts.body,
|
|
3120
|
+
transition: "border-color 0.2s ease",
|
|
3121
|
+
["--theme-primary"]: theme.colors.primary
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
),
|
|
3125
|
+
searchQuery && /* @__PURE__ */ jsx(
|
|
3126
|
+
"button",
|
|
3127
|
+
{
|
|
3128
|
+
onClick: () => setSearchQuery(""),
|
|
3129
|
+
style: {
|
|
3130
|
+
position: "absolute",
|
|
3131
|
+
right: "8px",
|
|
3132
|
+
background: "none",
|
|
3133
|
+
border: "none",
|
|
3134
|
+
cursor: "pointer",
|
|
3135
|
+
padding: "4px",
|
|
3136
|
+
display: "flex",
|
|
3137
|
+
alignItems: "center",
|
|
3138
|
+
justifyContent: "center",
|
|
3139
|
+
color: theme.colors.textSecondary
|
|
3140
|
+
},
|
|
3141
|
+
title: "Clear search",
|
|
3142
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
3143
|
+
}
|
|
3144
|
+
)
|
|
3145
|
+
] }),
|
|
3146
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsx(
|
|
3147
|
+
"button",
|
|
3148
|
+
{
|
|
3149
|
+
onClick: handleCreateWorkspace,
|
|
3150
|
+
style: {
|
|
3151
|
+
padding: "4px 8px",
|
|
3152
|
+
height: "30px",
|
|
3153
|
+
borderRadius: "4px",
|
|
3154
|
+
border: "none",
|
|
3155
|
+
backgroundColor: theme.colors.primary,
|
|
3156
|
+
color: theme.colors.background,
|
|
3157
|
+
cursor: "pointer",
|
|
3158
|
+
display: "flex",
|
|
3159
|
+
alignItems: "center",
|
|
3160
|
+
justifyContent: "center"
|
|
3161
|
+
},
|
|
3162
|
+
title: "Create new workspace",
|
|
3163
|
+
children: /* @__PURE__ */ jsx(Plus, { size: 16 })
|
|
3164
|
+
}
|
|
3165
|
+
) })
|
|
3166
|
+
]
|
|
3167
|
+
}
|
|
3168
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2916
3169
|
/* @__PURE__ */ jsxs(
|
|
2917
3170
|
"div",
|
|
2918
3171
|
{
|
|
@@ -2956,18 +3209,14 @@ const WorkspacesListPanelContent = ({
|
|
|
2956
3209
|
/* @__PURE__ */ jsx(
|
|
2957
3210
|
"button",
|
|
2958
3211
|
{
|
|
2959
|
-
onClick:
|
|
2960
|
-
setShowSearchBox(!showSearchBox);
|
|
2961
|
-
if (showSearchBox) {
|
|
2962
|
-
setSearchQuery("");
|
|
2963
|
-
}
|
|
2964
|
-
},
|
|
3212
|
+
onClick: handleToggleSearch,
|
|
2965
3213
|
style: {
|
|
2966
3214
|
background: showSearchBox ? theme.colors.backgroundSecondary : "none",
|
|
2967
3215
|
border: `1px solid ${showSearchBox ? theme.colors.border : "transparent"}`,
|
|
2968
3216
|
borderRadius: "4px",
|
|
2969
3217
|
cursor: "pointer",
|
|
2970
|
-
padding: "4px",
|
|
3218
|
+
padding: "4px 8px",
|
|
3219
|
+
height: "30px",
|
|
2971
3220
|
display: "flex",
|
|
2972
3221
|
alignItems: "center",
|
|
2973
3222
|
justifyContent: "center",
|
|
@@ -2982,7 +3231,8 @@ const WorkspacesListPanelContent = ({
|
|
|
2982
3231
|
{
|
|
2983
3232
|
onClick: handleCreateWorkspace,
|
|
2984
3233
|
style: {
|
|
2985
|
-
padding: "4px",
|
|
3234
|
+
padding: "4px 8px",
|
|
3235
|
+
height: "30px",
|
|
2986
3236
|
borderRadius: "4px",
|
|
2987
3237
|
border: "none",
|
|
2988
3238
|
backgroundColor: theme.colors.primary,
|
|
@@ -3000,7 +3250,7 @@ const WorkspacesListPanelContent = ({
|
|
|
3000
3250
|
]
|
|
3001
3251
|
}
|
|
3002
3252
|
),
|
|
3003
|
-
showSearchBox && /* @__PURE__ */ jsxs(
|
|
3253
|
+
showSearchBox && !defaultShowSearch && /* @__PURE__ */ jsxs(
|
|
3004
3254
|
"div",
|
|
3005
3255
|
{
|
|
3006
3256
|
style: {
|
|
@@ -3074,10 +3324,7 @@ const WorkspacesListPanelContent = ({
|
|
|
3074
3324
|
/* @__PURE__ */ jsx(
|
|
3075
3325
|
"button",
|
|
3076
3326
|
{
|
|
3077
|
-
onClick:
|
|
3078
|
-
setShowSearchBox(false);
|
|
3079
|
-
setSearchQuery("");
|
|
3080
|
-
},
|
|
3327
|
+
onClick: handleToggleSearch,
|
|
3081
3328
|
style: {
|
|
3082
3329
|
background: "none",
|
|
3083
3330
|
border: "none",
|
|
@@ -3096,7 +3343,7 @@ const WorkspacesListPanelContent = ({
|
|
|
3096
3343
|
]
|
|
3097
3344
|
}
|
|
3098
3345
|
)
|
|
3099
|
-
]
|
|
3346
|
+
] })
|
|
3100
3347
|
}
|
|
3101
3348
|
),
|
|
3102
3349
|
/* @__PURE__ */ jsxs(
|
|
@@ -3444,13 +3691,14 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3444
3691
|
const [filter, setFilter] = useState("");
|
|
3445
3692
|
const [showSearch, setShowSearch] = useState(defaultShowSearch);
|
|
3446
3693
|
const handleToggleSearch = useCallback(() => {
|
|
3694
|
+
if (defaultShowSearch) return;
|
|
3447
3695
|
setShowSearch((prev) => {
|
|
3448
3696
|
if (prev) {
|
|
3449
3697
|
setFilter("");
|
|
3450
3698
|
}
|
|
3451
3699
|
return !prev;
|
|
3452
3700
|
});
|
|
3453
|
-
}, []);
|
|
3701
|
+
}, [defaultShowSearch]);
|
|
3454
3702
|
const handleClearFilter = useCallback(() => {
|
|
3455
3703
|
setFilter("");
|
|
3456
3704
|
}, []);
|
|
@@ -3730,20 +3978,112 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3730
3978
|
) });
|
|
3731
3979
|
}
|
|
3732
3980
|
return /* @__PURE__ */ jsxs("div", { style: contentContainerStyle, children: [
|
|
3733
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ jsx(
|
|
3734
3982
|
"div",
|
|
3735
3983
|
{
|
|
3736
3984
|
style: {
|
|
3737
3985
|
position: "relative",
|
|
3738
3986
|
height: "40px",
|
|
3739
3987
|
minHeight: "40px",
|
|
3740
|
-
padding: "0 16px",
|
|
3988
|
+
padding: defaultShowSearch && showSearch ? "0 16px 0 8px" : "0 16px",
|
|
3741
3989
|
borderBottom: `1px solid ${theme.colors.border}`,
|
|
3742
3990
|
display: "flex",
|
|
3743
3991
|
alignItems: "center",
|
|
3744
3992
|
boxSizing: "border-box"
|
|
3745
3993
|
},
|
|
3746
|
-
children:
|
|
3994
|
+
children: defaultShowSearch && showSearch && repositories.length > 0 ? /* @__PURE__ */ jsxs(
|
|
3995
|
+
"div",
|
|
3996
|
+
{
|
|
3997
|
+
style: {
|
|
3998
|
+
display: "flex",
|
|
3999
|
+
alignItems: "center",
|
|
4000
|
+
gap: "8px",
|
|
4001
|
+
width: "100%"
|
|
4002
|
+
},
|
|
4003
|
+
children: [
|
|
4004
|
+
/* @__PURE__ */ jsxs("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
4005
|
+
/* @__PURE__ */ jsx(
|
|
4006
|
+
Search,
|
|
4007
|
+
{
|
|
4008
|
+
size: 16,
|
|
4009
|
+
color: theme.colors.textSecondary,
|
|
4010
|
+
style: {
|
|
4011
|
+
position: "absolute",
|
|
4012
|
+
left: "10px",
|
|
4013
|
+
pointerEvents: "none"
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
),
|
|
4017
|
+
/* @__PURE__ */ jsx(
|
|
4018
|
+
"input",
|
|
4019
|
+
{
|
|
4020
|
+
type: "text",
|
|
4021
|
+
className: "search-input",
|
|
4022
|
+
placeholder: "Filter repositories...",
|
|
4023
|
+
value: filter,
|
|
4024
|
+
onChange: (e) => setFilter(e.target.value),
|
|
4025
|
+
autoFocus: true,
|
|
4026
|
+
style: {
|
|
4027
|
+
width: "100%",
|
|
4028
|
+
padding: "6px 32px 6px 32px",
|
|
4029
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
4030
|
+
color: theme.colors.text,
|
|
4031
|
+
backgroundColor: theme.colors.background,
|
|
4032
|
+
border: `1px solid ${theme.colors.border}`,
|
|
4033
|
+
borderRadius: "4px",
|
|
4034
|
+
outline: "none",
|
|
4035
|
+
fontFamily: theme.fonts.body,
|
|
4036
|
+
transition: "border-color 0.2s ease",
|
|
4037
|
+
["--theme-primary"]: theme.colors.primary
|
|
4038
|
+
}
|
|
4039
|
+
}
|
|
4040
|
+
),
|
|
4041
|
+
filter && /* @__PURE__ */ jsx(
|
|
4042
|
+
"button",
|
|
4043
|
+
{
|
|
4044
|
+
className: "clear-filter-button",
|
|
4045
|
+
onClick: handleClearFilter,
|
|
4046
|
+
style: {
|
|
4047
|
+
position: "absolute",
|
|
4048
|
+
right: "8px",
|
|
4049
|
+
background: "none",
|
|
4050
|
+
border: "none",
|
|
4051
|
+
cursor: "pointer",
|
|
4052
|
+
padding: "4px",
|
|
4053
|
+
display: "flex",
|
|
4054
|
+
alignItems: "center",
|
|
4055
|
+
justifyContent: "center",
|
|
4056
|
+
color: theme.colors.textSecondary,
|
|
4057
|
+
["--theme-text"]: theme.colors.text
|
|
4058
|
+
},
|
|
4059
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
4060
|
+
}
|
|
4061
|
+
)
|
|
4062
|
+
] }),
|
|
4063
|
+
/* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: /* @__PURE__ */ jsx(
|
|
4064
|
+
"button",
|
|
4065
|
+
{
|
|
4066
|
+
onClick: toggleSort,
|
|
4067
|
+
style: {
|
|
4068
|
+
padding: "4px 10px",
|
|
4069
|
+
height: "30px",
|
|
4070
|
+
borderRadius: "4px",
|
|
4071
|
+
border: `1px solid ${theme.colors.border}`,
|
|
4072
|
+
background: theme.colors.backgroundSecondary,
|
|
4073
|
+
color: theme.colors.text,
|
|
4074
|
+
fontSize: `${theme.fontSizes[1]}px`,
|
|
4075
|
+
fontFamily: theme.fonts.body,
|
|
4076
|
+
cursor: "pointer",
|
|
4077
|
+
display: "flex",
|
|
4078
|
+
alignItems: "center",
|
|
4079
|
+
gap: "4px"
|
|
4080
|
+
},
|
|
4081
|
+
children: sortField === "name" ? "A-Z" : "Recent"
|
|
4082
|
+
}
|
|
4083
|
+
) })
|
|
4084
|
+
]
|
|
4085
|
+
}
|
|
4086
|
+
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3747
4087
|
/* @__PURE__ */ jsxs(
|
|
3748
4088
|
"div",
|
|
3749
4089
|
{
|
|
@@ -3794,7 +4134,8 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3794
4134
|
border: `1px solid ${showSearch ? theme.colors.border : "transparent"}`,
|
|
3795
4135
|
borderRadius: "4px",
|
|
3796
4136
|
cursor: "pointer",
|
|
3797
|
-
padding: "4px",
|
|
4137
|
+
padding: "4px 8px",
|
|
4138
|
+
height: "30px",
|
|
3798
4139
|
display: "flex",
|
|
3799
4140
|
alignItems: "center",
|
|
3800
4141
|
justifyContent: "center",
|
|
@@ -3811,9 +4152,10 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3811
4152
|
onClick: toggleSort,
|
|
3812
4153
|
style: {
|
|
3813
4154
|
padding: "4px 10px",
|
|
4155
|
+
height: "30px",
|
|
3814
4156
|
borderRadius: "4px",
|
|
3815
4157
|
border: `1px solid ${theme.colors.border}`,
|
|
3816
|
-
background: theme.colors.
|
|
4158
|
+
background: theme.colors.backgroundSecondary,
|
|
3817
4159
|
color: theme.colors.text,
|
|
3818
4160
|
fontSize: `${theme.fontSizes[1]}px`,
|
|
3819
4161
|
fontFamily: theme.fonts.body,
|
|
@@ -3829,7 +4171,7 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3829
4171
|
]
|
|
3830
4172
|
}
|
|
3831
4173
|
),
|
|
3832
|
-
showSearch && /* @__PURE__ */ jsxs(
|
|
4174
|
+
showSearch && !defaultShowSearch && /* @__PURE__ */ jsxs(
|
|
3833
4175
|
"div",
|
|
3834
4176
|
{
|
|
3835
4177
|
className: "search-overlay",
|
|
@@ -3927,7 +4269,7 @@ const WorkspaceCollectionPanelContent = ({
|
|
|
3927
4269
|
]
|
|
3928
4270
|
}
|
|
3929
4271
|
)
|
|
3930
|
-
]
|
|
4272
|
+
] })
|
|
3931
4273
|
}
|
|
3932
4274
|
),
|
|
3933
4275
|
error && /* @__PURE__ */ jsx(
|