@industry-theme/github-panels 0.1.40 → 0.1.41
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/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/shared/GitHubRepositoryCard.d.ts +46 -0
- package/dist/components/shared/GitHubRepositoryCard.d.ts.map +1 -0
- package/dist/components/shared/RepositoryAvatar.d.ts +24 -0
- package/dist/components/shared/RepositoryAvatar.d.ts.map +1 -0
- package/dist/components/shared/index.d.ts +5 -0
- package/dist/components/shared/index.d.ts.map +1 -0
- package/dist/panels/GitHubIssueDetailPanel.d.ts +3 -4
- package/dist/panels/GitHubIssueDetailPanel.d.ts.map +1 -1
- package/dist/panels/GitHubSearchPanel.d.ts +3 -2
- package/dist/panels/GitHubSearchPanel.d.ts.map +1 -1
- package/dist/panels.bundle.js +873 -623
- package/dist/panels.bundle.js.map +1 -1
- package/dist/types/github.d.ts +44 -0
- package/dist/types/github.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -130,18 +130,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
130
130
|
* This source code is licensed under the ISC license.
|
|
131
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
132
132
|
*/
|
|
133
|
-
const __iconNode$
|
|
134
|
-
["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
|
|
135
|
-
["path", { d: "M19 12H5", key: "x3x0zl" }]
|
|
136
|
-
];
|
|
137
|
-
const ArrowLeft = createLucideIcon("arrow-left", __iconNode$u);
|
|
138
|
-
/**
|
|
139
|
-
* @license lucide-react v0.552.0 - ISC
|
|
140
|
-
*
|
|
141
|
-
* This source code is licensed under the ISC license.
|
|
142
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
-
*/
|
|
144
|
-
const __iconNode$t = [
|
|
133
|
+
const __iconNode$w = [
|
|
145
134
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
146
135
|
[
|
|
147
136
|
"path",
|
|
@@ -151,14 +140,14 @@ const __iconNode$t = [
|
|
|
151
140
|
}
|
|
152
141
|
]
|
|
153
142
|
];
|
|
154
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
143
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$w);
|
|
155
144
|
/**
|
|
156
145
|
* @license lucide-react v0.552.0 - ISC
|
|
157
146
|
*
|
|
158
147
|
* This source code is licensed under the ISC license.
|
|
159
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
160
149
|
*/
|
|
161
|
-
const __iconNode$
|
|
150
|
+
const __iconNode$v = [
|
|
162
151
|
["path", { d: "M10 12h4", key: "a56b0p" }],
|
|
163
152
|
["path", { d: "M10 8h4", key: "1sr2af" }],
|
|
164
153
|
["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
|
|
@@ -171,74 +160,86 @@ const __iconNode$s = [
|
|
|
171
160
|
],
|
|
172
161
|
["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
|
|
173
162
|
];
|
|
174
|
-
const Building2 = createLucideIcon("building-2", __iconNode$
|
|
163
|
+
const Building2 = createLucideIcon("building-2", __iconNode$v);
|
|
175
164
|
/**
|
|
176
165
|
* @license lucide-react v0.552.0 - ISC
|
|
177
166
|
*
|
|
178
167
|
* This source code is licensed under the ISC license.
|
|
179
168
|
* See the LICENSE file in the root directory of this source tree.
|
|
180
169
|
*/
|
|
181
|
-
const __iconNode$
|
|
170
|
+
const __iconNode$u = [
|
|
182
171
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
183
172
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
184
173
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
185
174
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
186
175
|
];
|
|
187
|
-
const Calendar = createLucideIcon("calendar", __iconNode$
|
|
176
|
+
const Calendar = createLucideIcon("calendar", __iconNode$u);
|
|
188
177
|
/**
|
|
189
178
|
* @license lucide-react v0.552.0 - ISC
|
|
190
179
|
*
|
|
191
180
|
* This source code is licensed under the ISC license.
|
|
192
181
|
* See the LICENSE file in the root directory of this source tree.
|
|
193
182
|
*/
|
|
194
|
-
const __iconNode$
|
|
195
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
183
|
+
const __iconNode$t = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
184
|
+
const Check = createLucideIcon("check", __iconNode$t);
|
|
196
185
|
/**
|
|
197
186
|
* @license lucide-react v0.552.0 - ISC
|
|
198
187
|
*
|
|
199
188
|
* This source code is licensed under the ISC license.
|
|
200
189
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
190
|
*/
|
|
202
|
-
const __iconNode$
|
|
203
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
191
|
+
const __iconNode$s = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
192
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$s);
|
|
204
193
|
/**
|
|
205
194
|
* @license lucide-react v0.552.0 - ISC
|
|
206
195
|
*
|
|
207
196
|
* This source code is licensed under the ISC license.
|
|
208
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
209
198
|
*/
|
|
210
|
-
const __iconNode$
|
|
211
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
199
|
+
const __iconNode$r = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
200
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$r);
|
|
212
201
|
/**
|
|
213
202
|
* @license lucide-react v0.552.0 - ISC
|
|
214
203
|
*
|
|
215
204
|
* This source code is licensed under the ISC license.
|
|
216
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
217
206
|
*/
|
|
218
|
-
const __iconNode$
|
|
207
|
+
const __iconNode$q = [
|
|
219
208
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
220
209
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
221
210
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
222
211
|
];
|
|
223
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
212
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$q);
|
|
224
213
|
/**
|
|
225
214
|
* @license lucide-react v0.552.0 - ISC
|
|
226
215
|
*
|
|
227
216
|
* This source code is licensed under the ISC license.
|
|
228
217
|
* See the LICENSE file in the root directory of this source tree.
|
|
229
218
|
*/
|
|
230
|
-
const __iconNode$
|
|
219
|
+
const __iconNode$p = [
|
|
231
220
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
232
221
|
["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" }]
|
|
233
222
|
];
|
|
234
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
223
|
+
const Copy = createLucideIcon("copy", __iconNode$p);
|
|
235
224
|
/**
|
|
236
225
|
* @license lucide-react v0.552.0 - ISC
|
|
237
226
|
*
|
|
238
227
|
* This source code is licensed under the ISC license.
|
|
239
228
|
* See the LICENSE file in the root directory of this source tree.
|
|
240
229
|
*/
|
|
241
|
-
const __iconNode$
|
|
230
|
+
const __iconNode$o = [
|
|
231
|
+
["path", { d: "M12 15V3", key: "m9g1x1" }],
|
|
232
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
233
|
+
["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
|
|
234
|
+
];
|
|
235
|
+
const Download = createLucideIcon("download", __iconNode$o);
|
|
236
|
+
/**
|
|
237
|
+
* @license lucide-react v0.552.0 - ISC
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the ISC license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/
|
|
242
|
+
const __iconNode$n = [
|
|
242
243
|
["path", { d: "m15 15 6 6", key: "1s409w" }],
|
|
243
244
|
["path", { d: "m15 9 6-6", key: "ko1vev" }],
|
|
244
245
|
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
|
|
@@ -248,26 +249,26 @@ const __iconNode$l = [
|
|
|
248
249
|
["path", { d: "M3 8V3h5", key: "1ln10m" }],
|
|
249
250
|
["path", { d: "M9 9 3 3", key: "v551iv" }]
|
|
250
251
|
];
|
|
251
|
-
const Expand = createLucideIcon("expand", __iconNode$
|
|
252
|
+
const Expand = createLucideIcon("expand", __iconNode$n);
|
|
252
253
|
/**
|
|
253
254
|
* @license lucide-react v0.552.0 - ISC
|
|
254
255
|
*
|
|
255
256
|
* This source code is licensed under the ISC license.
|
|
256
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
257
258
|
*/
|
|
258
|
-
const __iconNode$
|
|
259
|
+
const __iconNode$m = [
|
|
259
260
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
260
261
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
261
262
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
262
263
|
];
|
|
263
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
264
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$m);
|
|
264
265
|
/**
|
|
265
266
|
* @license lucide-react v0.552.0 - ISC
|
|
266
267
|
*
|
|
267
268
|
* This source code is licensed under the ISC license.
|
|
268
269
|
* See the LICENSE file in the root directory of this source tree.
|
|
269
270
|
*/
|
|
270
|
-
const __iconNode$
|
|
271
|
+
const __iconNode$l = [
|
|
271
272
|
[
|
|
272
273
|
"path",
|
|
273
274
|
{
|
|
@@ -280,7 +281,41 @@ const __iconNode$j = [
|
|
|
280
281
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
281
282
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
282
283
|
];
|
|
283
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
284
|
+
const FileText = createLucideIcon("file-text", __iconNode$l);
|
|
285
|
+
/**
|
|
286
|
+
* @license lucide-react v0.552.0 - ISC
|
|
287
|
+
*
|
|
288
|
+
* This source code is licensed under the ISC license.
|
|
289
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
+
*/
|
|
291
|
+
const __iconNode$k = [
|
|
292
|
+
[
|
|
293
|
+
"path",
|
|
294
|
+
{
|
|
295
|
+
d: "m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",
|
|
296
|
+
key: "usdka0"
|
|
297
|
+
}
|
|
298
|
+
]
|
|
299
|
+
];
|
|
300
|
+
const FolderOpen = createLucideIcon("folder-open", __iconNode$k);
|
|
301
|
+
/**
|
|
302
|
+
* @license lucide-react v0.552.0 - ISC
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the ISC license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/
|
|
307
|
+
const __iconNode$j = [
|
|
308
|
+
["path", { d: "M12 10v6", key: "1bos4e" }],
|
|
309
|
+
["path", { d: "M9 13h6", key: "1uhe8q" }],
|
|
310
|
+
[
|
|
311
|
+
"path",
|
|
312
|
+
{
|
|
313
|
+
d: "M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",
|
|
314
|
+
key: "1kt360"
|
|
315
|
+
}
|
|
316
|
+
]
|
|
317
|
+
];
|
|
318
|
+
const FolderPlus = createLucideIcon("folder-plus", __iconNode$j);
|
|
284
319
|
/**
|
|
285
320
|
* @license lucide-react v0.552.0 - ISC
|
|
286
321
|
*
|
|
@@ -533,7 +568,7 @@ const __iconNode = [
|
|
|
533
568
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
534
569
|
];
|
|
535
570
|
const X = createLucideIcon("x", __iconNode);
|
|
536
|
-
function getLanguageColor(language2) {
|
|
571
|
+
function getLanguageColor$1(language2) {
|
|
537
572
|
const colors = {
|
|
538
573
|
TypeScript: "#3178c6",
|
|
539
574
|
JavaScript: "#f7df1e",
|
|
@@ -688,7 +723,7 @@ const GitHubProjectCard = ({
|
|
|
688
723
|
width: "8px",
|
|
689
724
|
height: "8px",
|
|
690
725
|
borderRadius: "50%",
|
|
691
|
-
backgroundColor: getLanguageColor(repository.language)
|
|
726
|
+
backgroundColor: getLanguageColor$1(repository.language)
|
|
692
727
|
}
|
|
693
728
|
}
|
|
694
729
|
),
|
|
@@ -1243,7 +1278,439 @@ const GitHubProjectsPanelMetadata = {
|
|
|
1243
1278
|
slices: ["github-repositories"],
|
|
1244
1279
|
surfaces: ["sidebar", "panel"]
|
|
1245
1280
|
};
|
|
1246
|
-
const
|
|
1281
|
+
const RepositoryAvatar = ({
|
|
1282
|
+
owner,
|
|
1283
|
+
customAvatarUrl,
|
|
1284
|
+
size = 32,
|
|
1285
|
+
fallbackIcon
|
|
1286
|
+
}) => {
|
|
1287
|
+
const { theme: theme2 } = useTheme();
|
|
1288
|
+
const borderRadius = `${Math.min(8, size / 4)}px`;
|
|
1289
|
+
const avatarUrl = customAvatarUrl || (owner ? `https://github.com/${owner}.png` : null);
|
|
1290
|
+
const getContent2 = () => {
|
|
1291
|
+
if (avatarUrl) {
|
|
1292
|
+
return /* @__PURE__ */ jsx(
|
|
1293
|
+
"img",
|
|
1294
|
+
{
|
|
1295
|
+
src: avatarUrl,
|
|
1296
|
+
alt: owner || "Repository",
|
|
1297
|
+
style: {
|
|
1298
|
+
width: "100%",
|
|
1299
|
+
height: "100%",
|
|
1300
|
+
objectFit: "cover"
|
|
1301
|
+
},
|
|
1302
|
+
onError: (e) => {
|
|
1303
|
+
e.currentTarget.style.display = "none";
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
}
|
|
1308
|
+
if (fallbackIcon) {
|
|
1309
|
+
return fallbackIcon;
|
|
1310
|
+
}
|
|
1311
|
+
return null;
|
|
1312
|
+
};
|
|
1313
|
+
return /* @__PURE__ */ jsx(
|
|
1314
|
+
"div",
|
|
1315
|
+
{
|
|
1316
|
+
style: {
|
|
1317
|
+
width: `${size}px`,
|
|
1318
|
+
height: `${size}px`,
|
|
1319
|
+
borderRadius,
|
|
1320
|
+
backgroundColor: theme2.colors.backgroundTertiary,
|
|
1321
|
+
display: "flex",
|
|
1322
|
+
alignItems: "center",
|
|
1323
|
+
justifyContent: "center",
|
|
1324
|
+
overflow: "hidden",
|
|
1325
|
+
flexShrink: 0
|
|
1326
|
+
},
|
|
1327
|
+
children: getContent2()
|
|
1328
|
+
}
|
|
1329
|
+
);
|
|
1330
|
+
};
|
|
1331
|
+
const GitHubRepositoryCard = ({
|
|
1332
|
+
repository,
|
|
1333
|
+
localRepo,
|
|
1334
|
+
onClone,
|
|
1335
|
+
onOpen,
|
|
1336
|
+
isLoading = false,
|
|
1337
|
+
isSelected = false,
|
|
1338
|
+
onSelect,
|
|
1339
|
+
onAddToCollection,
|
|
1340
|
+
isInCollection = false,
|
|
1341
|
+
collectionName
|
|
1342
|
+
}) => {
|
|
1343
|
+
const { theme: theme2 } = useTheme();
|
|
1344
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
1345
|
+
const isCloned = Boolean(localRepo);
|
|
1346
|
+
const handleClone = useCallback(
|
|
1347
|
+
(e) => {
|
|
1348
|
+
e.stopPropagation();
|
|
1349
|
+
if (onClone && !isLoading) {
|
|
1350
|
+
onClone(repository);
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
[onClone, repository, isLoading]
|
|
1354
|
+
);
|
|
1355
|
+
const handleOpen = useCallback(
|
|
1356
|
+
(e) => {
|
|
1357
|
+
e.stopPropagation();
|
|
1358
|
+
if (onOpen && localRepo && !isLoading) {
|
|
1359
|
+
onOpen(localRepo.path);
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
[onOpen, localRepo, isLoading]
|
|
1363
|
+
);
|
|
1364
|
+
const handleClick = useCallback(() => {
|
|
1365
|
+
if (onSelect) {
|
|
1366
|
+
onSelect(repository);
|
|
1367
|
+
}
|
|
1368
|
+
}, [onSelect, repository]);
|
|
1369
|
+
const handleOpenOnGitHub = useCallback(
|
|
1370
|
+
(e) => {
|
|
1371
|
+
e.stopPropagation();
|
|
1372
|
+
window.open(repository.html_url, "_blank", "noopener,noreferrer");
|
|
1373
|
+
},
|
|
1374
|
+
[repository.html_url]
|
|
1375
|
+
);
|
|
1376
|
+
const handleAddToCollection = useCallback(
|
|
1377
|
+
(e) => {
|
|
1378
|
+
e.stopPropagation();
|
|
1379
|
+
if (onAddToCollection && !isLoading && !isInCollection) {
|
|
1380
|
+
onAddToCollection(repository);
|
|
1381
|
+
}
|
|
1382
|
+
},
|
|
1383
|
+
[onAddToCollection, repository, isLoading, isInCollection]
|
|
1384
|
+
);
|
|
1385
|
+
const getRelativeTime = (dateString) => {
|
|
1386
|
+
const date = new Date(dateString);
|
|
1387
|
+
const now = /* @__PURE__ */ new Date();
|
|
1388
|
+
const diffMs = now.getTime() - date.getTime();
|
|
1389
|
+
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
1390
|
+
if (diffDays === 0) return "today";
|
|
1391
|
+
if (diffDays === 1) return "yesterday";
|
|
1392
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
1393
|
+
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
1394
|
+
if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`;
|
|
1395
|
+
return `${Math.floor(diffDays / 365)} years ago`;
|
|
1396
|
+
};
|
|
1397
|
+
return /* @__PURE__ */ jsxs(
|
|
1398
|
+
"div",
|
|
1399
|
+
{
|
|
1400
|
+
onClick: handleClick,
|
|
1401
|
+
onMouseEnter: () => setIsHovered(true),
|
|
1402
|
+
onMouseLeave: () => setIsHovered(false),
|
|
1403
|
+
style: {
|
|
1404
|
+
display: "flex",
|
|
1405
|
+
alignItems: "flex-start",
|
|
1406
|
+
gap: "12px",
|
|
1407
|
+
padding: "12px",
|
|
1408
|
+
borderRadius: "8px",
|
|
1409
|
+
backgroundColor: isSelected ? `${theme2.colors.primary}15` : isHovered ? theme2.colors.backgroundTertiary : "transparent",
|
|
1410
|
+
border: `1px solid ${isSelected ? theme2.colors.primary : "transparent"}`,
|
|
1411
|
+
cursor: onSelect ? "pointer" : "default",
|
|
1412
|
+
transition: "background-color 0.15s, border-color 0.15s"
|
|
1413
|
+
},
|
|
1414
|
+
children: [
|
|
1415
|
+
/* @__PURE__ */ jsx(
|
|
1416
|
+
RepositoryAvatar,
|
|
1417
|
+
{
|
|
1418
|
+
owner: repository.owner.login,
|
|
1419
|
+
customAvatarUrl: repository.owner.avatar_url,
|
|
1420
|
+
size: 40
|
|
1421
|
+
}
|
|
1422
|
+
),
|
|
1423
|
+
/* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
1424
|
+
/* @__PURE__ */ jsxs(
|
|
1425
|
+
"div",
|
|
1426
|
+
{
|
|
1427
|
+
style: {
|
|
1428
|
+
display: "flex",
|
|
1429
|
+
alignItems: "center",
|
|
1430
|
+
gap: "8px",
|
|
1431
|
+
marginBottom: "4px"
|
|
1432
|
+
},
|
|
1433
|
+
children: [
|
|
1434
|
+
/* @__PURE__ */ jsx(
|
|
1435
|
+
"span",
|
|
1436
|
+
{
|
|
1437
|
+
style: {
|
|
1438
|
+
fontSize: `${theme2.fontSizes[2]}px`,
|
|
1439
|
+
fontWeight: theme2.fontWeights.semibold,
|
|
1440
|
+
fontFamily: theme2.fonts.body,
|
|
1441
|
+
color: isCloned ? "#10b981" : theme2.colors.text,
|
|
1442
|
+
overflow: "hidden",
|
|
1443
|
+
textOverflow: "ellipsis",
|
|
1444
|
+
whiteSpace: "nowrap"
|
|
1445
|
+
},
|
|
1446
|
+
title: repository.full_name,
|
|
1447
|
+
children: repository.name
|
|
1448
|
+
}
|
|
1449
|
+
),
|
|
1450
|
+
repository.private && /* @__PURE__ */ jsx("span", { title: "Private repository", children: /* @__PURE__ */ jsx(
|
|
1451
|
+
Lock,
|
|
1452
|
+
{
|
|
1453
|
+
size: 12,
|
|
1454
|
+
style: { color: theme2.colors.textSecondary, flexShrink: 0 }
|
|
1455
|
+
}
|
|
1456
|
+
) }),
|
|
1457
|
+
repository.fork && /* @__PURE__ */ jsx("span", { title: "Forked repository", children: /* @__PURE__ */ jsx(
|
|
1458
|
+
GitFork,
|
|
1459
|
+
{
|
|
1460
|
+
size: 12,
|
|
1461
|
+
style: { color: theme2.colors.textSecondary, flexShrink: 0 }
|
|
1462
|
+
}
|
|
1463
|
+
) })
|
|
1464
|
+
]
|
|
1465
|
+
}
|
|
1466
|
+
),
|
|
1467
|
+
/* @__PURE__ */ jsx(
|
|
1468
|
+
"div",
|
|
1469
|
+
{
|
|
1470
|
+
style: {
|
|
1471
|
+
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1472
|
+
fontFamily: theme2.fonts.body,
|
|
1473
|
+
color: theme2.colors.textSecondary,
|
|
1474
|
+
marginBottom: "4px"
|
|
1475
|
+
},
|
|
1476
|
+
children: repository.owner.login
|
|
1477
|
+
}
|
|
1478
|
+
),
|
|
1479
|
+
repository.description && /* @__PURE__ */ jsx(
|
|
1480
|
+
"div",
|
|
1481
|
+
{
|
|
1482
|
+
style: {
|
|
1483
|
+
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1484
|
+
fontFamily: theme2.fonts.body,
|
|
1485
|
+
color: theme2.colors.textSecondary,
|
|
1486
|
+
lineHeight: theme2.lineHeights.body,
|
|
1487
|
+
overflow: "hidden",
|
|
1488
|
+
textOverflow: "ellipsis",
|
|
1489
|
+
display: "-webkit-box",
|
|
1490
|
+
WebkitLineClamp: 2,
|
|
1491
|
+
WebkitBoxOrient: "vertical",
|
|
1492
|
+
marginBottom: "8px"
|
|
1493
|
+
},
|
|
1494
|
+
children: repository.description
|
|
1495
|
+
}
|
|
1496
|
+
),
|
|
1497
|
+
/* @__PURE__ */ jsxs(
|
|
1498
|
+
"div",
|
|
1499
|
+
{
|
|
1500
|
+
style: {
|
|
1501
|
+
display: "flex",
|
|
1502
|
+
alignItems: "center",
|
|
1503
|
+
gap: "12px",
|
|
1504
|
+
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1505
|
+
fontFamily: theme2.fonts.body,
|
|
1506
|
+
color: theme2.colors.textSecondary
|
|
1507
|
+
},
|
|
1508
|
+
children: [
|
|
1509
|
+
repository.language && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1510
|
+
/* @__PURE__ */ jsx(
|
|
1511
|
+
"span",
|
|
1512
|
+
{
|
|
1513
|
+
style: {
|
|
1514
|
+
width: "8px",
|
|
1515
|
+
height: "8px",
|
|
1516
|
+
borderRadius: "50%",
|
|
1517
|
+
backgroundColor: getLanguageColor(repository.language)
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
),
|
|
1521
|
+
repository.language
|
|
1522
|
+
] }),
|
|
1523
|
+
repository.stargazers_count !== void 0 && repository.stargazers_count > 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1524
|
+
/* @__PURE__ */ jsx(Star, { size: 12 }),
|
|
1525
|
+
formatNumber(repository.stargazers_count)
|
|
1526
|
+
] }),
|
|
1527
|
+
repository.license && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1528
|
+
/* @__PURE__ */ jsx(Scale, { size: 12 }),
|
|
1529
|
+
repository.license
|
|
1530
|
+
] }),
|
|
1531
|
+
(repository.pushed_at || repository.updated_at) && /* @__PURE__ */ jsxs("span", { children: [
|
|
1532
|
+
"Updated ",
|
|
1533
|
+
getRelativeTime(repository.pushed_at || repository.updated_at)
|
|
1534
|
+
] })
|
|
1535
|
+
]
|
|
1536
|
+
}
|
|
1537
|
+
)
|
|
1538
|
+
] }),
|
|
1539
|
+
/* @__PURE__ */ jsxs(
|
|
1540
|
+
"div",
|
|
1541
|
+
{
|
|
1542
|
+
style: {
|
|
1543
|
+
display: "flex",
|
|
1544
|
+
alignItems: "center",
|
|
1545
|
+
gap: "8px",
|
|
1546
|
+
flexShrink: 0
|
|
1547
|
+
},
|
|
1548
|
+
children: [
|
|
1549
|
+
/* @__PURE__ */ jsx(
|
|
1550
|
+
"button",
|
|
1551
|
+
{
|
|
1552
|
+
type: "button",
|
|
1553
|
+
onClick: handleOpenOnGitHub,
|
|
1554
|
+
style: {
|
|
1555
|
+
display: "flex",
|
|
1556
|
+
alignItems: "center",
|
|
1557
|
+
justifyContent: "center",
|
|
1558
|
+
width: "32px",
|
|
1559
|
+
height: "32px",
|
|
1560
|
+
borderRadius: "6px",
|
|
1561
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
1562
|
+
backgroundColor: "transparent",
|
|
1563
|
+
color: theme2.colors.textSecondary,
|
|
1564
|
+
cursor: "pointer",
|
|
1565
|
+
transition: "background-color 0.15s, color 0.15s"
|
|
1566
|
+
},
|
|
1567
|
+
title: "Open on GitHub",
|
|
1568
|
+
onMouseEnter: (e) => {
|
|
1569
|
+
e.currentTarget.style.backgroundColor = theme2.colors.backgroundTertiary;
|
|
1570
|
+
e.currentTarget.style.color = theme2.colors.text;
|
|
1571
|
+
},
|
|
1572
|
+
onMouseLeave: (e) => {
|
|
1573
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
1574
|
+
e.currentTarget.style.color = theme2.colors.textSecondary;
|
|
1575
|
+
},
|
|
1576
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { size: 16 })
|
|
1577
|
+
}
|
|
1578
|
+
),
|
|
1579
|
+
onAddToCollection && /* @__PURE__ */ jsxs(
|
|
1580
|
+
"button",
|
|
1581
|
+
{
|
|
1582
|
+
type: "button",
|
|
1583
|
+
onClick: handleAddToCollection,
|
|
1584
|
+
disabled: isLoading || isInCollection,
|
|
1585
|
+
style: {
|
|
1586
|
+
display: "flex",
|
|
1587
|
+
alignItems: "center",
|
|
1588
|
+
gap: "6px",
|
|
1589
|
+
padding: "6px 12px",
|
|
1590
|
+
borderRadius: "6px",
|
|
1591
|
+
border: "none",
|
|
1592
|
+
backgroundColor: isInCollection ? "#10b981" : theme2.colors.secondary,
|
|
1593
|
+
color: isInCollection ? "#ffffff" : theme2.colors.text,
|
|
1594
|
+
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1595
|
+
fontWeight: theme2.fontWeights.medium,
|
|
1596
|
+
fontFamily: theme2.fonts.body,
|
|
1597
|
+
cursor: isLoading || isInCollection ? "not-allowed" : "pointer",
|
|
1598
|
+
opacity: isLoading ? 0.6 : 1,
|
|
1599
|
+
transition: "opacity 0.15s, background-color 0.15s"
|
|
1600
|
+
},
|
|
1601
|
+
title: isInCollection ? `Already in ${collectionName || "collection"}` : `Add to ${collectionName || "collection"}`,
|
|
1602
|
+
children: [
|
|
1603
|
+
isInCollection ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(FolderPlus, { size: 14 }),
|
|
1604
|
+
isInCollection ? "Added" : "Add"
|
|
1605
|
+
]
|
|
1606
|
+
}
|
|
1607
|
+
),
|
|
1608
|
+
isCloned && onOpen && /* @__PURE__ */ jsxs(
|
|
1609
|
+
"button",
|
|
1610
|
+
{
|
|
1611
|
+
type: "button",
|
|
1612
|
+
onClick: handleOpen,
|
|
1613
|
+
disabled: isLoading,
|
|
1614
|
+
style: {
|
|
1615
|
+
display: "flex",
|
|
1616
|
+
alignItems: "center",
|
|
1617
|
+
gap: "6px",
|
|
1618
|
+
padding: "6px 12px",
|
|
1619
|
+
borderRadius: "6px",
|
|
1620
|
+
border: "none",
|
|
1621
|
+
backgroundColor: "#10b981",
|
|
1622
|
+
color: "#ffffff",
|
|
1623
|
+
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1624
|
+
fontWeight: theme2.fontWeights.medium,
|
|
1625
|
+
fontFamily: theme2.fonts.body,
|
|
1626
|
+
cursor: isLoading ? "not-allowed" : "pointer",
|
|
1627
|
+
opacity: isLoading ? 0.6 : 1,
|
|
1628
|
+
transition: "opacity 0.15s"
|
|
1629
|
+
},
|
|
1630
|
+
title: "Open in workspace",
|
|
1631
|
+
children: [
|
|
1632
|
+
/* @__PURE__ */ jsx(FolderOpen, { size: 14 }),
|
|
1633
|
+
"Open"
|
|
1634
|
+
]
|
|
1635
|
+
}
|
|
1636
|
+
),
|
|
1637
|
+
!isCloned && onClone && /* @__PURE__ */ jsxs(
|
|
1638
|
+
"button",
|
|
1639
|
+
{
|
|
1640
|
+
type: "button",
|
|
1641
|
+
onClick: handleClone,
|
|
1642
|
+
disabled: isLoading,
|
|
1643
|
+
style: {
|
|
1644
|
+
display: "flex",
|
|
1645
|
+
alignItems: "center",
|
|
1646
|
+
gap: "6px",
|
|
1647
|
+
padding: "6px 12px",
|
|
1648
|
+
borderRadius: "6px",
|
|
1649
|
+
border: "none",
|
|
1650
|
+
backgroundColor: theme2.colors.primary,
|
|
1651
|
+
color: theme2.colors.background,
|
|
1652
|
+
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1653
|
+
fontWeight: theme2.fontWeights.medium,
|
|
1654
|
+
fontFamily: theme2.fonts.body,
|
|
1655
|
+
cursor: isLoading ? "not-allowed" : "pointer",
|
|
1656
|
+
opacity: isLoading ? 0.6 : 1,
|
|
1657
|
+
transition: "opacity 0.15s"
|
|
1658
|
+
},
|
|
1659
|
+
title: "Clone repository",
|
|
1660
|
+
children: [
|
|
1661
|
+
/* @__PURE__ */ jsx(Download, { size: 14 }),
|
|
1662
|
+
"Clone"
|
|
1663
|
+
]
|
|
1664
|
+
}
|
|
1665
|
+
)
|
|
1666
|
+
]
|
|
1667
|
+
}
|
|
1668
|
+
)
|
|
1669
|
+
]
|
|
1670
|
+
}
|
|
1671
|
+
);
|
|
1672
|
+
};
|
|
1673
|
+
function getLanguageColor(language2) {
|
|
1674
|
+
const colors = {
|
|
1675
|
+
TypeScript: "#3178c6",
|
|
1676
|
+
JavaScript: "#f7df1e",
|
|
1677
|
+
Python: "#3572A5",
|
|
1678
|
+
Rust: "#dea584",
|
|
1679
|
+
Go: "#00ADD8",
|
|
1680
|
+
Java: "#b07219",
|
|
1681
|
+
Ruby: "#701516",
|
|
1682
|
+
PHP: "#4F5D95",
|
|
1683
|
+
"C++": "#f34b7d",
|
|
1684
|
+
C: "#555555",
|
|
1685
|
+
"C#": "#178600",
|
|
1686
|
+
Swift: "#F05138",
|
|
1687
|
+
Kotlin: "#A97BFF",
|
|
1688
|
+
Shell: "#89e051",
|
|
1689
|
+
HTML: "#e34c26",
|
|
1690
|
+
CSS: "#563d7c",
|
|
1691
|
+
Vue: "#41b883",
|
|
1692
|
+
Svelte: "#ff3e00"
|
|
1693
|
+
};
|
|
1694
|
+
return colors[language2] || "#8b949e";
|
|
1695
|
+
}
|
|
1696
|
+
function formatNumber(num) {
|
|
1697
|
+
if (num >= 1e6) {
|
|
1698
|
+
return `${(num / 1e6).toFixed(1)}M`;
|
|
1699
|
+
}
|
|
1700
|
+
if (num >= 1e3) {
|
|
1701
|
+
return `${(num / 1e3).toFixed(1)}K`;
|
|
1702
|
+
}
|
|
1703
|
+
return num.toString();
|
|
1704
|
+
}
|
|
1705
|
+
const PANEL_ID = "github-search-panel";
|
|
1706
|
+
const createPanelEvent = (type, payload) => ({
|
|
1707
|
+
type,
|
|
1708
|
+
source: PANEL_ID,
|
|
1709
|
+
timestamp: Date.now(),
|
|
1710
|
+
payload
|
|
1711
|
+
});
|
|
1712
|
+
const GitHubSearchPanelContent = ({ context, actions, events }) => {
|
|
1713
|
+
var _a, _b;
|
|
1247
1714
|
const { theme: theme2 } = useTheme();
|
|
1248
1715
|
const [searchQuery, setSearchQuery] = useState("");
|
|
1249
1716
|
const [results, setResults] = useState([]);
|
|
@@ -1253,9 +1720,24 @@ const GitHubSearchPanelContent = ({ events }) => {
|
|
|
1253
1720
|
const [selectedRepoId, setSelectedRepoId] = useState(null);
|
|
1254
1721
|
const searchTimeoutRef = useRef(null);
|
|
1255
1722
|
const inputRef = useRef(null);
|
|
1723
|
+
const workspaceSlice = context.getSlice("workspace");
|
|
1724
|
+
const workspaceReposSlice = context.getSlice("workspaceRepositories");
|
|
1725
|
+
const currentWorkspace = (_a = workspaceSlice == null ? void 0 : workspaceSlice.data) == null ? void 0 : _a.workspace;
|
|
1726
|
+
const collectionName = currentWorkspace == null ? void 0 : currentWorkspace.name;
|
|
1727
|
+
const collectionRepos = useMemo(
|
|
1728
|
+
() => {
|
|
1729
|
+
var _a2;
|
|
1730
|
+
return ((_a2 = workspaceReposSlice == null ? void 0 : workspaceReposSlice.data) == null ? void 0 : _a2.repositories) || [];
|
|
1731
|
+
},
|
|
1732
|
+
[(_b = workspaceReposSlice == null ? void 0 : workspaceReposSlice.data) == null ? void 0 : _b.repositories]
|
|
1733
|
+
);
|
|
1734
|
+
const collectionRepoSet = useMemo(() => {
|
|
1735
|
+
return new Set(collectionRepos.map((r2) => r2.full_name));
|
|
1736
|
+
}, [collectionRepos]);
|
|
1737
|
+
const panelActions = actions;
|
|
1256
1738
|
useEffect(() => {
|
|
1257
|
-
var
|
|
1258
|
-
(
|
|
1739
|
+
var _a2;
|
|
1740
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1259
1741
|
}, []);
|
|
1260
1742
|
const performSearch = useCallback(async (query) => {
|
|
1261
1743
|
if (!query.trim()) {
|
|
@@ -1302,19 +1784,32 @@ const GitHubSearchPanelContent = ({ events }) => {
|
|
|
1302
1784
|
}
|
|
1303
1785
|
performSearch(searchQuery);
|
|
1304
1786
|
};
|
|
1305
|
-
const handleSelectRepository = (repo) => {
|
|
1787
|
+
const handleSelectRepository = useCallback((repo) => {
|
|
1306
1788
|
setSelectedRepoId(repo.id);
|
|
1307
1789
|
events.emit({
|
|
1308
1790
|
type: "repository:preview",
|
|
1309
|
-
source:
|
|
1791
|
+
source: PANEL_ID,
|
|
1310
1792
|
timestamp: Date.now(),
|
|
1311
1793
|
payload: {
|
|
1312
1794
|
repository: repo,
|
|
1313
1795
|
source: "search"
|
|
1314
1796
|
}
|
|
1315
1797
|
});
|
|
1316
|
-
};
|
|
1317
|
-
const
|
|
1798
|
+
}, [events]);
|
|
1799
|
+
const handleAddToCollection = useCallback(
|
|
1800
|
+
async (repo) => {
|
|
1801
|
+
if (panelActions.addToCollection) {
|
|
1802
|
+
await panelActions.addToCollection(repo);
|
|
1803
|
+
events.emit(
|
|
1804
|
+
createPanelEvent(`${PANEL_ID}:repository-added-to-collection`, {
|
|
1805
|
+
repository: repo
|
|
1806
|
+
})
|
|
1807
|
+
);
|
|
1808
|
+
}
|
|
1809
|
+
},
|
|
1810
|
+
[panelActions, events]
|
|
1811
|
+
);
|
|
1812
|
+
const formatNumber2 = (num) => {
|
|
1318
1813
|
if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
|
|
1319
1814
|
if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
|
|
1320
1815
|
return num.toString();
|
|
@@ -1332,89 +1827,110 @@ const GitHubSearchPanelContent = ({ events }) => {
|
|
|
1332
1827
|
},
|
|
1333
1828
|
children: [
|
|
1334
1829
|
/* @__PURE__ */ jsxs(
|
|
1335
|
-
"
|
|
1830
|
+
"form",
|
|
1336
1831
|
{
|
|
1832
|
+
onSubmit: handleSubmit,
|
|
1337
1833
|
style: {
|
|
1338
|
-
|
|
1834
|
+
height: "40px",
|
|
1835
|
+
minHeight: "40px",
|
|
1836
|
+
padding: "0 16px",
|
|
1339
1837
|
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
1340
|
-
display: "flex",
|
|
1341
|
-
alignItems: "center",
|
|
1342
|
-
gap: "12px"
|
|
1343
|
-
},
|
|
1344
|
-
children: [
|
|
1345
|
-
/* @__PURE__ */ jsx(Github, { size: 20, color: theme2.colors.primary }),
|
|
1346
|
-
/* @__PURE__ */ jsx(
|
|
1347
|
-
"h2",
|
|
1348
|
-
{
|
|
1349
|
-
style: {
|
|
1350
|
-
margin: 0,
|
|
1351
|
-
fontSize: `${theme2.fontSizes[3]}px`,
|
|
1352
|
-
fontWeight: theme2.fontWeights.semibold
|
|
1353
|
-
},
|
|
1354
|
-
children: "Search GitHub"
|
|
1355
|
-
}
|
|
1356
|
-
)
|
|
1357
|
-
]
|
|
1358
|
-
}
|
|
1359
|
-
),
|
|
1360
|
-
/* @__PURE__ */ jsx("form", { onSubmit: handleSubmit, style: { padding: "12px 16px" }, children: /* @__PURE__ */ jsxs(
|
|
1361
|
-
"div",
|
|
1362
|
-
{
|
|
1363
|
-
style: {
|
|
1364
1838
|
display: "flex",
|
|
1365
1839
|
alignItems: "center",
|
|
1366
1840
|
gap: "8px",
|
|
1367
|
-
|
|
1368
|
-
borderRadius: "6px",
|
|
1369
|
-
backgroundColor: theme2.colors.backgroundSecondary,
|
|
1370
|
-
border: `1px solid ${theme2.colors.border}`
|
|
1841
|
+
boxSizing: "border-box"
|
|
1371
1842
|
},
|
|
1372
1843
|
children: [
|
|
1373
|
-
/* @__PURE__ */ jsx(
|
|
1374
|
-
/* @__PURE__ */
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
background: "none",
|
|
1386
|
-
outline: "none",
|
|
1387
|
-
fontSize: `${theme2.fontSizes[2]}px`,
|
|
1388
|
-
color: theme2.colors.text
|
|
1844
|
+
/* @__PURE__ */ jsx(Github, { size: 18, color: theme2.colors.primary, style: { flexShrink: 0 } }),
|
|
1845
|
+
/* @__PURE__ */ jsxs("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center" }, children: [
|
|
1846
|
+
/* @__PURE__ */ jsx(
|
|
1847
|
+
Search,
|
|
1848
|
+
{
|
|
1849
|
+
size: 16,
|
|
1850
|
+
color: theme2.colors.textSecondary,
|
|
1851
|
+
style: {
|
|
1852
|
+
position: "absolute",
|
|
1853
|
+
left: "10px",
|
|
1854
|
+
pointerEvents: "none"
|
|
1855
|
+
}
|
|
1389
1856
|
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1857
|
+
),
|
|
1858
|
+
/* @__PURE__ */ jsx(
|
|
1859
|
+
"input",
|
|
1860
|
+
{
|
|
1861
|
+
ref: inputRef,
|
|
1862
|
+
type: "text",
|
|
1863
|
+
placeholder: "Search GitHub repositories...",
|
|
1864
|
+
value: searchQuery,
|
|
1865
|
+
onChange: handleSearchChange,
|
|
1866
|
+
style: {
|
|
1867
|
+
width: "100%",
|
|
1868
|
+
padding: "6px 32px 6px 32px",
|
|
1869
|
+
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1870
|
+
color: theme2.colors.text,
|
|
1871
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
1872
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
1873
|
+
borderRadius: "4px",
|
|
1874
|
+
outline: "none",
|
|
1875
|
+
fontFamily: theme2.fonts.body
|
|
1876
|
+
}
|
|
1402
1877
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1878
|
+
),
|
|
1879
|
+
searchQuery && !isLoading && /* @__PURE__ */ jsx(
|
|
1880
|
+
"button",
|
|
1881
|
+
{
|
|
1882
|
+
type: "button",
|
|
1883
|
+
onClick: () => {
|
|
1884
|
+
var _a2;
|
|
1885
|
+
setSearchQuery("");
|
|
1886
|
+
setResults([]);
|
|
1887
|
+
setTotalCount(0);
|
|
1888
|
+
(_a2 = inputRef.current) == null ? void 0 : _a2.focus();
|
|
1889
|
+
},
|
|
1890
|
+
style: {
|
|
1891
|
+
position: "absolute",
|
|
1892
|
+
right: "8px",
|
|
1893
|
+
background: "none",
|
|
1894
|
+
border: "none",
|
|
1895
|
+
cursor: "pointer",
|
|
1896
|
+
padding: "4px",
|
|
1897
|
+
display: "flex",
|
|
1898
|
+
alignItems: "center",
|
|
1899
|
+
justifyContent: "center",
|
|
1900
|
+
color: theme2.colors.textSecondary
|
|
1901
|
+
},
|
|
1902
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
1903
|
+
}
|
|
1904
|
+
),
|
|
1905
|
+
isLoading && /* @__PURE__ */ jsx(
|
|
1906
|
+
"div",
|
|
1907
|
+
{
|
|
1908
|
+
style: {
|
|
1909
|
+
position: "absolute",
|
|
1910
|
+
right: "10px",
|
|
1911
|
+
width: 14,
|
|
1912
|
+
height: 14,
|
|
1913
|
+
border: `2px solid ${theme2.colors.border}`,
|
|
1914
|
+
borderTopColor: theme2.colors.primary,
|
|
1915
|
+
borderRadius: "50%",
|
|
1916
|
+
animation: "spin 1s linear infinite"
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
)
|
|
1920
|
+
] })
|
|
1405
1921
|
]
|
|
1406
1922
|
}
|
|
1407
|
-
)
|
|
1923
|
+
),
|
|
1408
1924
|
totalCount > 0 && !isLoading && /* @__PURE__ */ jsxs(
|
|
1409
1925
|
"div",
|
|
1410
1926
|
{
|
|
1411
1927
|
style: {
|
|
1412
|
-
padding: "
|
|
1928
|
+
padding: "8px 16px",
|
|
1413
1929
|
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1414
1930
|
color: theme2.colors.textSecondary
|
|
1415
1931
|
},
|
|
1416
1932
|
children: [
|
|
1417
|
-
|
|
1933
|
+
formatNumber2(totalCount),
|
|
1418
1934
|
" repositories found"
|
|
1419
1935
|
]
|
|
1420
1936
|
}
|
|
@@ -1471,134 +1987,18 @@ const GitHubSearchPanelContent = ({ events }) => {
|
|
|
1471
1987
|
]
|
|
1472
1988
|
}
|
|
1473
1989
|
),
|
|
1474
|
-
results.map((repo) =>
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
border: selectedRepoId === repo.id ? `2px solid ${theme2.colors.primary}` : `1px solid ${theme2.colors.border}`,
|
|
1487
|
-
backgroundColor: selectedRepoId === repo.id ? `${theme2.colors.primary}10` : theme2.colors.surface,
|
|
1488
|
-
cursor: "pointer",
|
|
1489
|
-
textAlign: "left",
|
|
1490
|
-
display: "flex",
|
|
1491
|
-
flexDirection: "column",
|
|
1492
|
-
gap: "8px"
|
|
1493
|
-
},
|
|
1494
|
-
children: [
|
|
1495
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1496
|
-
((_a = repo.owner) == null ? void 0 : _a.avatar_url) && /* @__PURE__ */ jsx(
|
|
1497
|
-
"img",
|
|
1498
|
-
{
|
|
1499
|
-
src: repo.owner.avatar_url,
|
|
1500
|
-
alt: repo.owner.login,
|
|
1501
|
-
style: { width: 20, height: 20, borderRadius: 4 }
|
|
1502
|
-
}
|
|
1503
|
-
),
|
|
1504
|
-
/* @__PURE__ */ jsx(
|
|
1505
|
-
"span",
|
|
1506
|
-
{
|
|
1507
|
-
style: {
|
|
1508
|
-
fontSize: `${theme2.fontSizes[2]}px`,
|
|
1509
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
1510
|
-
color: theme2.colors.primary
|
|
1511
|
-
},
|
|
1512
|
-
children: repo.full_name
|
|
1513
|
-
}
|
|
1514
|
-
),
|
|
1515
|
-
repo.private && /* @__PURE__ */ jsx(
|
|
1516
|
-
"span",
|
|
1517
|
-
{
|
|
1518
|
-
style: {
|
|
1519
|
-
fontSize: `${theme2.fontSizes[0]}px`,
|
|
1520
|
-
padding: "2px 6px",
|
|
1521
|
-
borderRadius: "4px",
|
|
1522
|
-
backgroundColor: theme2.colors.backgroundTertiary,
|
|
1523
|
-
color: theme2.colors.textSecondary
|
|
1524
|
-
},
|
|
1525
|
-
children: "Private"
|
|
1526
|
-
}
|
|
1527
|
-
)
|
|
1528
|
-
] }),
|
|
1529
|
-
repo.description && /* @__PURE__ */ jsx(
|
|
1530
|
-
"p",
|
|
1531
|
-
{
|
|
1532
|
-
style: {
|
|
1533
|
-
margin: 0,
|
|
1534
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1535
|
-
color: theme2.colors.textSecondary,
|
|
1536
|
-
overflow: "hidden",
|
|
1537
|
-
textOverflow: "ellipsis",
|
|
1538
|
-
display: "-webkit-box",
|
|
1539
|
-
WebkitLineClamp: 2,
|
|
1540
|
-
WebkitBoxOrient: "vertical"
|
|
1541
|
-
},
|
|
1542
|
-
children: repo.description
|
|
1543
|
-
}
|
|
1544
|
-
),
|
|
1545
|
-
/* @__PURE__ */ jsxs(
|
|
1546
|
-
"div",
|
|
1547
|
-
{
|
|
1548
|
-
style: {
|
|
1549
|
-
display: "flex",
|
|
1550
|
-
alignItems: "center",
|
|
1551
|
-
gap: "16px",
|
|
1552
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
1553
|
-
color: theme2.colors.textSecondary
|
|
1554
|
-
},
|
|
1555
|
-
children: [
|
|
1556
|
-
repo.language && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1557
|
-
/* @__PURE__ */ jsx(
|
|
1558
|
-
"span",
|
|
1559
|
-
{
|
|
1560
|
-
style: {
|
|
1561
|
-
width: 10,
|
|
1562
|
-
height: 10,
|
|
1563
|
-
borderRadius: "50%",
|
|
1564
|
-
backgroundColor: theme2.colors.info
|
|
1565
|
-
}
|
|
1566
|
-
}
|
|
1567
|
-
),
|
|
1568
|
-
repo.language
|
|
1569
|
-
] }),
|
|
1570
|
-
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1571
|
-
/* @__PURE__ */ jsx(Star, { size: 14 }),
|
|
1572
|
-
formatNumber(repo.stargazers_count || 0)
|
|
1573
|
-
] }),
|
|
1574
|
-
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
1575
|
-
/* @__PURE__ */ jsx(GitFork, { size: 14 }),
|
|
1576
|
-
formatNumber(repo.forks_count || 0)
|
|
1577
|
-
] }),
|
|
1578
|
-
/* @__PURE__ */ jsx(
|
|
1579
|
-
"a",
|
|
1580
|
-
{
|
|
1581
|
-
href: repo.html_url,
|
|
1582
|
-
target: "_blank",
|
|
1583
|
-
rel: "noopener noreferrer",
|
|
1584
|
-
onClick: (e) => e.stopPropagation(),
|
|
1585
|
-
style: {
|
|
1586
|
-
marginLeft: "auto",
|
|
1587
|
-
color: theme2.colors.textSecondary,
|
|
1588
|
-
display: "flex",
|
|
1589
|
-
alignItems: "center"
|
|
1590
|
-
},
|
|
1591
|
-
children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
1592
|
-
}
|
|
1593
|
-
)
|
|
1594
|
-
]
|
|
1595
|
-
}
|
|
1596
|
-
)
|
|
1597
|
-
]
|
|
1598
|
-
},
|
|
1599
|
-
repo.id
|
|
1600
|
-
);
|
|
1601
|
-
})
|
|
1990
|
+
results.map((repo) => /* @__PURE__ */ jsx(
|
|
1991
|
+
GitHubRepositoryCard,
|
|
1992
|
+
{
|
|
1993
|
+
repository: repo,
|
|
1994
|
+
onSelect: handleSelectRepository,
|
|
1995
|
+
isSelected: selectedRepoId === repo.id,
|
|
1996
|
+
onAddToCollection: currentWorkspace ? handleAddToCollection : void 0,
|
|
1997
|
+
isInCollection: collectionRepoSet.has(repo.full_name),
|
|
1998
|
+
collectionName
|
|
1999
|
+
},
|
|
2000
|
+
repo.id
|
|
2001
|
+
))
|
|
1602
2002
|
]
|
|
1603
2003
|
}
|
|
1604
2004
|
),
|
|
@@ -1620,7 +2020,7 @@ const GitHubSearchPanelMetadata = {
|
|
|
1620
2020
|
description: "Search for repositories on GitHub",
|
|
1621
2021
|
icon: "search",
|
|
1622
2022
|
version: "0.1.0",
|
|
1623
|
-
slices: [],
|
|
2023
|
+
slices: ["workspace", "workspaceRepositories"],
|
|
1624
2024
|
surfaces: ["panel"]
|
|
1625
2025
|
};
|
|
1626
2026
|
const formatDate$1 = (dateString) => {
|
|
@@ -46045,55 +46445,15 @@ const formatDate = (dateString) => {
|
|
|
46045
46445
|
const now = /* @__PURE__ */ new Date();
|
|
46046
46446
|
const diffMs = now.getTime() - date.getTime();
|
|
46047
46447
|
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
46048
|
-
if (diffDays === 0) return "
|
|
46049
|
-
if (diffDays === 1) return "
|
|
46448
|
+
if (diffDays === 0) return "today";
|
|
46449
|
+
if (diffDays === 1) return "yesterday";
|
|
46050
46450
|
if (diffDays < 7) return `${diffDays} days ago`;
|
|
46051
|
-
|
|
46052
|
-
if (diffDays <
|
|
46053
|
-
|
|
46054
|
-
}
|
|
46055
|
-
const
|
|
46056
|
-
|
|
46057
|
-
const isOpen = state === "open";
|
|
46058
|
-
return /* @__PURE__ */ jsx(
|
|
46059
|
-
"span",
|
|
46060
|
-
{
|
|
46061
|
-
style: {
|
|
46062
|
-
display: "inline-flex",
|
|
46063
|
-
alignItems: "center",
|
|
46064
|
-
padding: "4px 12px",
|
|
46065
|
-
borderRadius: "12px",
|
|
46066
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
46067
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
46068
|
-
backgroundColor: isOpen ? "#22c55e22" : "#6b728022",
|
|
46069
|
-
color: isOpen ? "#22c55e" : "#6b7280",
|
|
46070
|
-
textTransform: "uppercase"
|
|
46071
|
-
},
|
|
46072
|
-
children: state
|
|
46073
|
-
}
|
|
46074
|
-
);
|
|
46075
|
-
};
|
|
46076
|
-
const MetadataRow = ({ icon, label, value }) => {
|
|
46077
|
-
const { theme: theme2 } = useTheme();
|
|
46078
|
-
return /* @__PURE__ */ jsxs(
|
|
46079
|
-
"div",
|
|
46080
|
-
{
|
|
46081
|
-
style: {
|
|
46082
|
-
display: "flex",
|
|
46083
|
-
alignItems: "center",
|
|
46084
|
-
gap: "8px",
|
|
46085
|
-
fontSize: `${theme2.fontSizes[1]}px`
|
|
46086
|
-
},
|
|
46087
|
-
children: [
|
|
46088
|
-
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.textSecondary, display: "flex", alignItems: "center" }, children: icon }),
|
|
46089
|
-
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.textSecondary }, children: [
|
|
46090
|
-
label,
|
|
46091
|
-
":"
|
|
46092
|
-
] }),
|
|
46093
|
-
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.text }, children: value })
|
|
46094
|
-
]
|
|
46095
|
-
}
|
|
46096
|
-
);
|
|
46451
|
+
const weeks = Math.floor(diffDays / 7);
|
|
46452
|
+
if (diffDays < 30) return `${weeks} ${weeks === 1 ? "week" : "weeks"} ago`;
|
|
46453
|
+
const months = Math.floor(diffDays / 30);
|
|
46454
|
+
if (diffDays < 365) return `${months} ${months === 1 ? "month" : "months"} ago`;
|
|
46455
|
+
const years = Math.floor(diffDays / 365);
|
|
46456
|
+
return `${years} ${years === 1 ? "year" : "years"} ago`;
|
|
46097
46457
|
};
|
|
46098
46458
|
const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
46099
46459
|
const { theme: theme2 } = useTheme();
|
|
@@ -46127,32 +46487,40 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
46127
46487
|
});
|
|
46128
46488
|
}
|
|
46129
46489
|
};
|
|
46490
|
+
const containerStyle = {
|
|
46491
|
+
display: "flex",
|
|
46492
|
+
flexDirection: "column",
|
|
46493
|
+
height: "100%",
|
|
46494
|
+
backgroundColor: theme2.colors.background,
|
|
46495
|
+
overflow: "hidden"
|
|
46496
|
+
};
|
|
46130
46497
|
if (!selectedIssue) {
|
|
46131
|
-
return /* @__PURE__ */ jsxs(
|
|
46498
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
|
|
46132
46499
|
"div",
|
|
46133
46500
|
{
|
|
46134
46501
|
style: {
|
|
46135
|
-
|
|
46502
|
+
flex: 1,
|
|
46136
46503
|
display: "flex",
|
|
46137
46504
|
flexDirection: "column",
|
|
46138
46505
|
alignItems: "center",
|
|
46139
46506
|
justifyContent: "center",
|
|
46507
|
+
gap: "16px",
|
|
46140
46508
|
padding: "24px",
|
|
46141
|
-
|
|
46142
|
-
color: theme2.colors.textSecondary,
|
|
46143
|
-
gap: "16px"
|
|
46509
|
+
textAlign: "center"
|
|
46144
46510
|
},
|
|
46145
46511
|
children: [
|
|
46146
|
-
/* @__PURE__ */ jsx(Github, { size: 48, color: theme2.colors.
|
|
46147
|
-
/* @__PURE__ */ jsxs("div", {
|
|
46512
|
+
/* @__PURE__ */ jsx(Github, { size: 48, style: { color: theme2.colors.textMuted } }),
|
|
46513
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
46148
46514
|
/* @__PURE__ */ jsx(
|
|
46149
46515
|
"h3",
|
|
46150
46516
|
{
|
|
46151
46517
|
style: {
|
|
46152
|
-
margin:
|
|
46153
|
-
|
|
46154
|
-
|
|
46155
|
-
|
|
46518
|
+
margin: 0,
|
|
46519
|
+
marginBottom: "8px",
|
|
46520
|
+
fontFamily: theme2.fonts.heading,
|
|
46521
|
+
fontSize: theme2.fontSizes[3],
|
|
46522
|
+
fontWeight: 600,
|
|
46523
|
+
color: theme2.colors.text
|
|
46156
46524
|
},
|
|
46157
46525
|
children: "No Issue Selected"
|
|
46158
46526
|
}
|
|
@@ -46162,347 +46530,229 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
46162
46530
|
{
|
|
46163
46531
|
style: {
|
|
46164
46532
|
margin: 0,
|
|
46165
|
-
|
|
46166
|
-
|
|
46533
|
+
fontFamily: theme2.fonts.body,
|
|
46534
|
+
fontSize: theme2.fontSizes[1],
|
|
46535
|
+
color: theme2.colors.textSecondary,
|
|
46536
|
+
lineHeight: 1.5
|
|
46167
46537
|
},
|
|
46168
|
-
children: "Click on an issue in the Issues panel to view its details"
|
|
46538
|
+
children: "Click on an issue in the Issues panel to view its details."
|
|
46169
46539
|
}
|
|
46170
46540
|
)
|
|
46171
46541
|
] })
|
|
46172
46542
|
]
|
|
46173
46543
|
}
|
|
46174
|
-
);
|
|
46544
|
+
) });
|
|
46175
46545
|
}
|
|
46176
|
-
|
|
46177
|
-
|
|
46178
|
-
|
|
46179
|
-
|
|
46180
|
-
|
|
46181
|
-
|
|
46182
|
-
|
|
46183
|
-
|
|
46184
|
-
|
|
46185
|
-
|
|
46186
|
-
|
|
46187
|
-
|
|
46188
|
-
|
|
46189
|
-
|
|
46190
|
-
"
|
|
46546
|
+
const isOpen = selectedIssue.state === "open";
|
|
46547
|
+
const statusColor = isOpen ? theme2.colors.success || "#22c55e" : theme2.colors.error || "#ef4444";
|
|
46548
|
+
const statusBg = `${statusColor}20`;
|
|
46549
|
+
const statusLabel = isOpen ? "Open" : "Closed";
|
|
46550
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
46551
|
+
/* @__PURE__ */ jsxs(
|
|
46552
|
+
"div",
|
|
46553
|
+
{
|
|
46554
|
+
style: {
|
|
46555
|
+
height: "40px",
|
|
46556
|
+
minHeight: "40px",
|
|
46557
|
+
padding: "0 12px",
|
|
46558
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
46559
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
46560
|
+
display: "flex",
|
|
46561
|
+
alignItems: "center",
|
|
46562
|
+
gap: "12px",
|
|
46563
|
+
boxSizing: "border-box"
|
|
46564
|
+
},
|
|
46565
|
+
children: [
|
|
46566
|
+
/* @__PURE__ */ jsxs(
|
|
46567
|
+
"span",
|
|
46568
|
+
{
|
|
46569
|
+
style: {
|
|
46570
|
+
fontFamily: theme2.fonts.monospace,
|
|
46571
|
+
fontSize: theme2.fontSizes[0],
|
|
46572
|
+
color: theme2.colors.textSecondary
|
|
46573
|
+
},
|
|
46574
|
+
children: [
|
|
46575
|
+
"#",
|
|
46576
|
+
selectedIssue.number
|
|
46577
|
+
]
|
|
46578
|
+
}
|
|
46579
|
+
),
|
|
46580
|
+
/* @__PURE__ */ jsx(
|
|
46581
|
+
"span",
|
|
46582
|
+
{
|
|
46583
|
+
style: {
|
|
46584
|
+
display: "inline-flex",
|
|
46585
|
+
alignItems: "center",
|
|
46586
|
+
gap: "6px",
|
|
46587
|
+
padding: "4px 10px",
|
|
46588
|
+
borderRadius: "999px",
|
|
46589
|
+
backgroundColor: statusBg,
|
|
46590
|
+
color: statusColor,
|
|
46591
|
+
fontFamily: theme2.fonts.heading,
|
|
46592
|
+
fontSize: theme2.fontSizes[0],
|
|
46593
|
+
fontWeight: 600,
|
|
46594
|
+
textTransform: "uppercase"
|
|
46595
|
+
},
|
|
46596
|
+
children: statusLabel
|
|
46597
|
+
}
|
|
46598
|
+
),
|
|
46599
|
+
/* @__PURE__ */ jsxs(
|
|
46600
|
+
"span",
|
|
46601
|
+
{
|
|
46602
|
+
style: {
|
|
46603
|
+
color: theme2.colors.textSecondary,
|
|
46604
|
+
fontSize: theme2.fontSizes[0],
|
|
46605
|
+
fontFamily: theme2.fonts.body
|
|
46606
|
+
},
|
|
46607
|
+
children: [
|
|
46608
|
+
"by ",
|
|
46609
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: selectedIssue.user.login }),
|
|
46610
|
+
" ",
|
|
46611
|
+
formatDate(selectedIssue.created_at)
|
|
46612
|
+
]
|
|
46613
|
+
}
|
|
46614
|
+
),
|
|
46615
|
+
selectedIssue.comments > 0 && /* @__PURE__ */ jsxs(
|
|
46616
|
+
"span",
|
|
46617
|
+
{
|
|
46618
|
+
style: {
|
|
46619
|
+
display: "inline-flex",
|
|
46620
|
+
alignItems: "center",
|
|
46621
|
+
gap: "4px",
|
|
46622
|
+
color: theme2.colors.textSecondary,
|
|
46623
|
+
fontSize: theme2.fontSizes[0]
|
|
46624
|
+
},
|
|
46625
|
+
children: [
|
|
46626
|
+
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
46627
|
+
selectedIssue.comments
|
|
46628
|
+
]
|
|
46629
|
+
}
|
|
46630
|
+
),
|
|
46631
|
+
selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
|
|
46632
|
+
"span",
|
|
46633
|
+
{
|
|
46634
|
+
style: {
|
|
46635
|
+
display: "inline-flex",
|
|
46636
|
+
alignItems: "center",
|
|
46637
|
+
gap: "4px",
|
|
46638
|
+
color: theme2.colors.textSecondary,
|
|
46639
|
+
fontSize: theme2.fontSizes[0],
|
|
46640
|
+
fontFamily: theme2.fonts.body
|
|
46641
|
+
},
|
|
46642
|
+
children: [
|
|
46643
|
+
"assigned to",
|
|
46644
|
+
" ",
|
|
46645
|
+
selectedIssue.assignees.map((assignee, index2) => /* @__PURE__ */ jsxs("span", { children: [
|
|
46646
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: assignee.login }),
|
|
46647
|
+
index2 < selectedIssue.assignees.length - 1 && ", "
|
|
46648
|
+
] }, assignee.login))
|
|
46649
|
+
]
|
|
46650
|
+
}
|
|
46651
|
+
),
|
|
46652
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
46653
|
+
/* @__PURE__ */ jsx(
|
|
46654
|
+
"a",
|
|
46655
|
+
{
|
|
46656
|
+
href: selectedIssue.html_url,
|
|
46657
|
+
target: "_blank",
|
|
46658
|
+
rel: "noopener noreferrer",
|
|
46659
|
+
title: "View on GitHub",
|
|
46660
|
+
style: {
|
|
46661
|
+
display: "inline-flex",
|
|
46662
|
+
alignItems: "center",
|
|
46663
|
+
justifyContent: "center",
|
|
46664
|
+
width: "28px",
|
|
46665
|
+
height: "28px",
|
|
46666
|
+
padding: 0,
|
|
46667
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
46668
|
+
borderRadius: "6px",
|
|
46669
|
+
backgroundColor: theme2.colors.background,
|
|
46670
|
+
color: theme2.colors.textSecondary,
|
|
46671
|
+
textDecoration: "none"
|
|
46672
|
+
},
|
|
46673
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
46674
|
+
}
|
|
46675
|
+
),
|
|
46676
|
+
/* @__PURE__ */ jsx(
|
|
46677
|
+
"button",
|
|
46678
|
+
{
|
|
46679
|
+
type: "button",
|
|
46680
|
+
onClick: handleBack,
|
|
46681
|
+
title: "Close",
|
|
46682
|
+
style: {
|
|
46683
|
+
display: "inline-flex",
|
|
46684
|
+
alignItems: "center",
|
|
46685
|
+
justifyContent: "center",
|
|
46686
|
+
width: "28px",
|
|
46687
|
+
height: "28px",
|
|
46688
|
+
padding: 0,
|
|
46689
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
46690
|
+
borderRadius: "6px",
|
|
46691
|
+
backgroundColor: theme2.colors.background,
|
|
46692
|
+
color: theme2.colors.textSecondary,
|
|
46693
|
+
cursor: "pointer"
|
|
46694
|
+
},
|
|
46695
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
46696
|
+
}
|
|
46697
|
+
)
|
|
46698
|
+
]
|
|
46699
|
+
}
|
|
46700
|
+
),
|
|
46701
|
+
/* @__PURE__ */ jsx(
|
|
46702
|
+
"div",
|
|
46703
|
+
{
|
|
46704
|
+
style: {
|
|
46705
|
+
padding: "16px",
|
|
46706
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
46707
|
+
},
|
|
46708
|
+
children: /* @__PURE__ */ jsx(
|
|
46709
|
+
"h1",
|
|
46191
46710
|
{
|
|
46192
46711
|
style: {
|
|
46193
|
-
|
|
46194
|
-
|
|
46195
|
-
|
|
46196
|
-
|
|
46712
|
+
margin: 0,
|
|
46713
|
+
fontFamily: theme2.fonts.heading,
|
|
46714
|
+
fontSize: theme2.fontSizes[4] || 20,
|
|
46715
|
+
fontWeight: 600,
|
|
46716
|
+
color: theme2.colors.text,
|
|
46717
|
+
lineHeight: 1.3
|
|
46197
46718
|
},
|
|
46198
|
-
children:
|
|
46199
|
-
/* @__PURE__ */ jsxs(
|
|
46200
|
-
"div",
|
|
46201
|
-
{
|
|
46202
|
-
style: {
|
|
46203
|
-
display: "flex",
|
|
46204
|
-
alignItems: "center",
|
|
46205
|
-
gap: "12px",
|
|
46206
|
-
marginBottom: "12px"
|
|
46207
|
-
},
|
|
46208
|
-
children: [
|
|
46209
|
-
/* @__PURE__ */ jsx(
|
|
46210
|
-
"button",
|
|
46211
|
-
{
|
|
46212
|
-
type: "button",
|
|
46213
|
-
onClick: handleBack,
|
|
46214
|
-
style: {
|
|
46215
|
-
display: "flex",
|
|
46216
|
-
alignItems: "center",
|
|
46217
|
-
justifyContent: "center",
|
|
46218
|
-
width: "32px",
|
|
46219
|
-
height: "32px",
|
|
46220
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
46221
|
-
borderRadius: "6px",
|
|
46222
|
-
background: theme2.colors.surface,
|
|
46223
|
-
cursor: "pointer",
|
|
46224
|
-
color: theme2.colors.textSecondary
|
|
46225
|
-
},
|
|
46226
|
-
title: "Back",
|
|
46227
|
-
children: /* @__PURE__ */ jsx(ArrowLeft, { size: 16 })
|
|
46228
|
-
}
|
|
46229
|
-
),
|
|
46230
|
-
/* @__PURE__ */ jsxs(
|
|
46231
|
-
"span",
|
|
46232
|
-
{
|
|
46233
|
-
style: {
|
|
46234
|
-
fontFamily: theme2.fonts.monospace || "monospace",
|
|
46235
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
46236
|
-
color: theme2.colors.textSecondary
|
|
46237
|
-
},
|
|
46238
|
-
children: [
|
|
46239
|
-
"#",
|
|
46240
|
-
selectedIssue.number
|
|
46241
|
-
]
|
|
46242
|
-
}
|
|
46243
|
-
),
|
|
46244
|
-
/* @__PURE__ */ jsx(StatusBadge, { state: selectedIssue.state }),
|
|
46245
|
-
owner && repo && /* @__PURE__ */ jsxs(
|
|
46246
|
-
"span",
|
|
46247
|
-
{
|
|
46248
|
-
style: {
|
|
46249
|
-
fontSize: `${theme2.fontSizes[0]}px`,
|
|
46250
|
-
color: theme2.colors.textSecondary,
|
|
46251
|
-
marginLeft: "auto"
|
|
46252
|
-
},
|
|
46253
|
-
children: [
|
|
46254
|
-
owner,
|
|
46255
|
-
"/",
|
|
46256
|
-
repo
|
|
46257
|
-
]
|
|
46258
|
-
}
|
|
46259
|
-
)
|
|
46260
|
-
]
|
|
46261
|
-
}
|
|
46262
|
-
),
|
|
46263
|
-
/* @__PURE__ */ jsx(
|
|
46264
|
-
"h1",
|
|
46265
|
-
{
|
|
46266
|
-
style: {
|
|
46267
|
-
margin: "0 0 16px 0",
|
|
46268
|
-
fontSize: `${theme2.fontSizes[5]}px`,
|
|
46269
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
46270
|
-
color: theme2.colors.text,
|
|
46271
|
-
lineHeight: 1.3
|
|
46272
|
-
},
|
|
46273
|
-
children: selectedIssue.title
|
|
46274
|
-
}
|
|
46275
|
-
),
|
|
46276
|
-
/* @__PURE__ */ jsxs(
|
|
46277
|
-
"div",
|
|
46278
|
-
{
|
|
46279
|
-
style: {
|
|
46280
|
-
display: "grid",
|
|
46281
|
-
gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))",
|
|
46282
|
-
gap: "12px"
|
|
46283
|
-
},
|
|
46284
|
-
children: [
|
|
46285
|
-
/* @__PURE__ */ jsx(
|
|
46286
|
-
MetadataRow,
|
|
46287
|
-
{
|
|
46288
|
-
icon: /* @__PURE__ */ jsx(User, { size: 14 }),
|
|
46289
|
-
label: "Author",
|
|
46290
|
-
value: /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "6px" }, children: [
|
|
46291
|
-
/* @__PURE__ */ jsx(
|
|
46292
|
-
"img",
|
|
46293
|
-
{
|
|
46294
|
-
src: selectedIssue.user.avatar_url,
|
|
46295
|
-
alt: selectedIssue.user.login,
|
|
46296
|
-
style: {
|
|
46297
|
-
width: "16px",
|
|
46298
|
-
height: "16px",
|
|
46299
|
-
borderRadius: "50%"
|
|
46300
|
-
}
|
|
46301
|
-
}
|
|
46302
|
-
),
|
|
46303
|
-
selectedIssue.user.login
|
|
46304
|
-
] })
|
|
46305
|
-
}
|
|
46306
|
-
),
|
|
46307
|
-
/* @__PURE__ */ jsx(
|
|
46308
|
-
MetadataRow,
|
|
46309
|
-
{
|
|
46310
|
-
icon: /* @__PURE__ */ jsx(Calendar, { size: 14 }),
|
|
46311
|
-
label: "Created",
|
|
46312
|
-
value: formatDate(selectedIssue.created_at)
|
|
46313
|
-
}
|
|
46314
|
-
),
|
|
46315
|
-
selectedIssue.comments > 0 && /* @__PURE__ */ jsx(
|
|
46316
|
-
MetadataRow,
|
|
46317
|
-
{
|
|
46318
|
-
icon: /* @__PURE__ */ jsx(MessageSquare, { size: 14 }),
|
|
46319
|
-
label: "Comments",
|
|
46320
|
-
value: `${selectedIssue.comments} ${selectedIssue.comments === 1 ? "comment" : "comments"}`
|
|
46321
|
-
}
|
|
46322
|
-
)
|
|
46323
|
-
]
|
|
46324
|
-
}
|
|
46325
|
-
),
|
|
46326
|
-
selectedIssue.labels.length > 0 && /* @__PURE__ */ jsxs(
|
|
46327
|
-
"div",
|
|
46328
|
-
{
|
|
46329
|
-
style: {
|
|
46330
|
-
display: "flex",
|
|
46331
|
-
alignItems: "center",
|
|
46332
|
-
gap: "8px",
|
|
46333
|
-
marginTop: "12px",
|
|
46334
|
-
flexWrap: "wrap"
|
|
46335
|
-
},
|
|
46336
|
-
children: [
|
|
46337
|
-
/* @__PURE__ */ jsx(Tag, { size: 14, color: theme2.colors.textSecondary }),
|
|
46338
|
-
selectedIssue.labels.map((label) => /* @__PURE__ */ jsx(
|
|
46339
|
-
"span",
|
|
46340
|
-
{
|
|
46341
|
-
style: {
|
|
46342
|
-
display: "inline-flex",
|
|
46343
|
-
alignItems: "center",
|
|
46344
|
-
gap: "6px",
|
|
46345
|
-
padding: "4px 12px",
|
|
46346
|
-
borderRadius: "16px",
|
|
46347
|
-
backgroundColor: `#${label.color}22`,
|
|
46348
|
-
color: `#${label.color}`,
|
|
46349
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
46350
|
-
fontWeight: theme2.fontWeights.medium
|
|
46351
|
-
},
|
|
46352
|
-
children: label.name
|
|
46353
|
-
},
|
|
46354
|
-
label.id
|
|
46355
|
-
))
|
|
46356
|
-
]
|
|
46357
|
-
}
|
|
46358
|
-
)
|
|
46359
|
-
]
|
|
46719
|
+
children: selectedIssue.title
|
|
46360
46720
|
}
|
|
46361
|
-
)
|
|
46362
|
-
|
|
46363
|
-
|
|
46721
|
+
)
|
|
46722
|
+
}
|
|
46723
|
+
),
|
|
46724
|
+
/* @__PURE__ */ jsx(
|
|
46725
|
+
"div",
|
|
46726
|
+
{
|
|
46727
|
+
style: {
|
|
46728
|
+
flex: 1,
|
|
46729
|
+
overflow: "auto"
|
|
46730
|
+
},
|
|
46731
|
+
children: selectedIssue.body ? /* @__PURE__ */ jsx(
|
|
46732
|
+
DocumentView,
|
|
46364
46733
|
{
|
|
46365
|
-
|
|
46366
|
-
|
|
46367
|
-
|
|
46368
|
-
|
|
46369
|
-
flexDirection: "column"
|
|
46370
|
-
},
|
|
46371
|
-
children: [
|
|
46372
|
-
selectedIssue.body ? /* @__PURE__ */ jsx(
|
|
46373
|
-
DocumentView,
|
|
46374
|
-
{
|
|
46375
|
-
content: selectedIssue.body,
|
|
46376
|
-
theme: theme2,
|
|
46377
|
-
maxWidth: "100%",
|
|
46378
|
-
transparentBackground: true
|
|
46379
|
-
}
|
|
46380
|
-
) : /* @__PURE__ */ jsx(
|
|
46381
|
-
"div",
|
|
46382
|
-
{
|
|
46383
|
-
style: {
|
|
46384
|
-
flex: 1,
|
|
46385
|
-
display: "flex",
|
|
46386
|
-
alignItems: "center",
|
|
46387
|
-
justifyContent: "center",
|
|
46388
|
-
color: theme2.colors.textSecondary,
|
|
46389
|
-
fontStyle: "italic",
|
|
46390
|
-
padding: "40px"
|
|
46391
|
-
},
|
|
46392
|
-
children: "No description provided"
|
|
46393
|
-
}
|
|
46394
|
-
),
|
|
46395
|
-
selectedIssue.assignees && selectedIssue.assignees.length > 0 && /* @__PURE__ */ jsxs(
|
|
46396
|
-
"div",
|
|
46397
|
-
{
|
|
46398
|
-
style: {
|
|
46399
|
-
marginTop: "20px",
|
|
46400
|
-
padding: "16px",
|
|
46401
|
-
backgroundColor: theme2.colors.backgroundSecondary,
|
|
46402
|
-
borderRadius: "8px",
|
|
46403
|
-
border: `1px solid ${theme2.colors.border}`
|
|
46404
|
-
},
|
|
46405
|
-
children: [
|
|
46406
|
-
/* @__PURE__ */ jsx(
|
|
46407
|
-
"h3",
|
|
46408
|
-
{
|
|
46409
|
-
style: {
|
|
46410
|
-
color: theme2.colors.text,
|
|
46411
|
-
fontSize: `${theme2.fontSizes[2]}px`,
|
|
46412
|
-
fontWeight: theme2.fontWeights.semibold,
|
|
46413
|
-
marginTop: 0,
|
|
46414
|
-
marginBottom: "12px"
|
|
46415
|
-
},
|
|
46416
|
-
children: "Assignees"
|
|
46417
|
-
}
|
|
46418
|
-
),
|
|
46419
|
-
/* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "12px", flexWrap: "wrap" }, children: selectedIssue.assignees.map((assignee) => /* @__PURE__ */ jsxs(
|
|
46420
|
-
"div",
|
|
46421
|
-
{
|
|
46422
|
-
style: {
|
|
46423
|
-
display: "flex",
|
|
46424
|
-
alignItems: "center",
|
|
46425
|
-
gap: "8px",
|
|
46426
|
-
padding: "6px 12px",
|
|
46427
|
-
backgroundColor: theme2.colors.surface,
|
|
46428
|
-
borderRadius: "20px",
|
|
46429
|
-
border: `1px solid ${theme2.colors.border}`
|
|
46430
|
-
},
|
|
46431
|
-
children: [
|
|
46432
|
-
/* @__PURE__ */ jsx(
|
|
46433
|
-
"img",
|
|
46434
|
-
{
|
|
46435
|
-
src: assignee.avatar_url,
|
|
46436
|
-
alt: assignee.login,
|
|
46437
|
-
style: {
|
|
46438
|
-
width: "20px",
|
|
46439
|
-
height: "20px",
|
|
46440
|
-
borderRadius: "50%"
|
|
46441
|
-
}
|
|
46442
|
-
}
|
|
46443
|
-
),
|
|
46444
|
-
/* @__PURE__ */ jsx(
|
|
46445
|
-
"span",
|
|
46446
|
-
{
|
|
46447
|
-
style: {
|
|
46448
|
-
fontSize: `${theme2.fontSizes[1]}px`,
|
|
46449
|
-
color: theme2.colors.text
|
|
46450
|
-
},
|
|
46451
|
-
children: assignee.login
|
|
46452
|
-
}
|
|
46453
|
-
)
|
|
46454
|
-
]
|
|
46455
|
-
},
|
|
46456
|
-
assignee.login
|
|
46457
|
-
)) })
|
|
46458
|
-
]
|
|
46459
|
-
}
|
|
46460
|
-
)
|
|
46461
|
-
]
|
|
46734
|
+
content: selectedIssue.body,
|
|
46735
|
+
theme: theme2,
|
|
46736
|
+
maxWidth: "100%",
|
|
46737
|
+
transparentBackground: true
|
|
46462
46738
|
}
|
|
46463
|
-
)
|
|
46464
|
-
/* @__PURE__ */ jsx(
|
|
46739
|
+
) : /* @__PURE__ */ jsx(
|
|
46465
46740
|
"div",
|
|
46466
46741
|
{
|
|
46467
46742
|
style: {
|
|
46468
|
-
|
|
46469
|
-
|
|
46470
|
-
|
|
46471
|
-
|
|
46472
|
-
|
|
46473
|
-
|
|
46474
|
-
gap: "12px"
|
|
46743
|
+
padding: "40px",
|
|
46744
|
+
textAlign: "center",
|
|
46745
|
+
color: theme2.colors.textMuted,
|
|
46746
|
+
fontFamily: theme2.fonts.body,
|
|
46747
|
+
fontSize: theme2.fontSizes[1],
|
|
46748
|
+
fontStyle: "italic"
|
|
46475
46749
|
},
|
|
46476
|
-
children:
|
|
46477
|
-
"a",
|
|
46478
|
-
{
|
|
46479
|
-
href: selectedIssue.html_url,
|
|
46480
|
-
target: "_blank",
|
|
46481
|
-
rel: "noopener noreferrer",
|
|
46482
|
-
style: {
|
|
46483
|
-
display: "flex",
|
|
46484
|
-
alignItems: "center",
|
|
46485
|
-
gap: "6px",
|
|
46486
|
-
padding: "8px 16px",
|
|
46487
|
-
borderRadius: "6px",
|
|
46488
|
-
border: "none",
|
|
46489
|
-
backgroundColor: theme2.colors.primary,
|
|
46490
|
-
color: theme2.colors.background,
|
|
46491
|
-
fontSize: `${theme2.fontSizes[2]}px`,
|
|
46492
|
-
fontWeight: theme2.fontWeights.medium,
|
|
46493
|
-
textDecoration: "none"
|
|
46494
|
-
},
|
|
46495
|
-
children: [
|
|
46496
|
-
/* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
|
|
46497
|
-
"View on GitHub"
|
|
46498
|
-
]
|
|
46499
|
-
}
|
|
46500
|
-
)
|
|
46750
|
+
children: "No description provided."
|
|
46501
46751
|
}
|
|
46502
46752
|
)
|
|
46503
|
-
|
|
46504
|
-
|
|
46505
|
-
);
|
|
46753
|
+
}
|
|
46754
|
+
)
|
|
46755
|
+
] });
|
|
46506
46756
|
};
|
|
46507
46757
|
const GitHubIssueDetailPanel = (props) => {
|
|
46508
46758
|
return /* @__PURE__ */ jsx(GitHubIssueDetailPanelContent, { ...props });
|
|
@@ -46644,7 +46894,7 @@ const OwnerRepositoriesPanelContent = ({
|
|
|
46644
46894
|
}
|
|
46645
46895
|
});
|
|
46646
46896
|
};
|
|
46647
|
-
const
|
|
46897
|
+
const formatNumber2 = (num) => {
|
|
46648
46898
|
if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
|
|
46649
46899
|
if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
|
|
46650
46900
|
return num.toString();
|
|
@@ -47111,11 +47361,11 @@ const OwnerRepositoriesPanelContent = ({
|
|
|
47111
47361
|
] }),
|
|
47112
47362
|
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47113
47363
|
/* @__PURE__ */ jsx(Star, { size: 14 }),
|
|
47114
|
-
|
|
47364
|
+
formatNumber2(repo.stargazers_count || 0)
|
|
47115
47365
|
] }),
|
|
47116
47366
|
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47117
47367
|
/* @__PURE__ */ jsx(GitFork, { size: 14 }),
|
|
47118
|
-
|
|
47368
|
+
formatNumber2(repo.forks_count || 0)
|
|
47119
47369
|
] }),
|
|
47120
47370
|
repo.updated_at && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47121
47371
|
/* @__PURE__ */ jsx(Calendar, { size: 14 }),
|
|
@@ -47299,7 +47549,7 @@ const RecentRepositoriesPanelContent = ({
|
|
|
47299
47549
|
if (diffDays < 30) return `${Math.floor(diffDays / 7)}w ago`;
|
|
47300
47550
|
return `${Math.floor(diffDays / 30)}mo ago`;
|
|
47301
47551
|
};
|
|
47302
|
-
const
|
|
47552
|
+
const formatNumber2 = (num) => {
|
|
47303
47553
|
if (num >= 1e6) return `${(num / 1e6).toFixed(1)}M`;
|
|
47304
47554
|
if (num >= 1e3) return `${(num / 1e3).toFixed(1)}K`;
|
|
47305
47555
|
return num.toString();
|
|
@@ -47674,11 +47924,11 @@ const RecentRepositoriesPanelContent = ({
|
|
|
47674
47924
|
] }),
|
|
47675
47925
|
item.stargazers_count !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47676
47926
|
/* @__PURE__ */ jsx(Star, { size: 14 }),
|
|
47677
|
-
|
|
47927
|
+
formatNumber2(item.stargazers_count)
|
|
47678
47928
|
] }),
|
|
47679
47929
|
item.forks_count !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47680
47930
|
/* @__PURE__ */ jsx(GitFork, { size: 14 }),
|
|
47681
|
-
|
|
47931
|
+
formatNumber2(item.forks_count)
|
|
47682
47932
|
] }),
|
|
47683
47933
|
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47684
47934
|
/* @__PURE__ */ jsx(Calendar, { size: 14 }),
|
|
@@ -47825,12 +48075,12 @@ const RecentRepositoriesPanelContent = ({
|
|
|
47825
48075
|
children: [
|
|
47826
48076
|
item.public_repos !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47827
48077
|
/* @__PURE__ */ jsx(BookOpen, { size: 14 }),
|
|
47828
|
-
|
|
48078
|
+
formatNumber2(item.public_repos),
|
|
47829
48079
|
" repos"
|
|
47830
48080
|
] }),
|
|
47831
48081
|
item.followers !== void 0 && /* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|
|
47832
48082
|
/* @__PURE__ */ jsx(User, { size: 14 }),
|
|
47833
|
-
|
|
48083
|
+
formatNumber2(item.followers),
|
|
47834
48084
|
" followers"
|
|
47835
48085
|
] }),
|
|
47836
48086
|
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [
|