@industry-theme/git-panels 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/panels/GitCommitDetailPanel.d.ts +11 -0
- package/dist/panels/GitCommitDetailPanel.d.ts.map +1 -0
- package/dist/panels/GitCommitHistoryPanel.d.ts.map +1 -1
- package/dist/panels/GitPullRequestsPanel.d.ts.map +1 -1
- package/dist/panels.bundle.js +1627 -852
- package/dist/panels.bundle.js.map +1 -1
- package/dist/tools/index.d.ts +16 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools.bundle.js +61 -1
- package/dist/types/index.d.ts +52 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -107,70 +107,70 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
107
107
|
* This source code is licensed under the ISC license.
|
|
108
108
|
* See the LICENSE file in the root directory of this source tree.
|
|
109
109
|
*/
|
|
110
|
-
const __iconNode$
|
|
110
|
+
const __iconNode$m = [
|
|
111
111
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
112
112
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
113
113
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
114
114
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
115
115
|
];
|
|
116
|
-
const Calendar = createLucideIcon("calendar", __iconNode$
|
|
116
|
+
const Calendar = createLucideIcon("calendar", __iconNode$m);
|
|
117
117
|
/**
|
|
118
118
|
* @license lucide-react v0.552.0 - ISC
|
|
119
119
|
*
|
|
120
120
|
* This source code is licensed under the ISC license.
|
|
121
121
|
* See the LICENSE file in the root directory of this source tree.
|
|
122
122
|
*/
|
|
123
|
-
const __iconNode$
|
|
124
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
123
|
+
const __iconNode$l = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
124
|
+
const Check = createLucideIcon("check", __iconNode$l);
|
|
125
125
|
/**
|
|
126
126
|
* @license lucide-react v0.552.0 - ISC
|
|
127
127
|
*
|
|
128
128
|
* This source code is licensed under the ISC license.
|
|
129
129
|
* See the LICENSE file in the root directory of this source tree.
|
|
130
130
|
*/
|
|
131
|
-
const __iconNode$
|
|
132
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
131
|
+
const __iconNode$k = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
132
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$k);
|
|
133
133
|
/**
|
|
134
134
|
* @license lucide-react v0.552.0 - ISC
|
|
135
135
|
*
|
|
136
136
|
* This source code is licensed under the ISC license.
|
|
137
137
|
* See the LICENSE file in the root directory of this source tree.
|
|
138
138
|
*/
|
|
139
|
-
const __iconNode$
|
|
139
|
+
const __iconNode$j = [
|
|
140
140
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
141
141
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
142
142
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
143
143
|
];
|
|
144
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
144
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$j);
|
|
145
145
|
/**
|
|
146
146
|
* @license lucide-react v0.552.0 - ISC
|
|
147
147
|
*
|
|
148
148
|
* This source code is licensed under the ISC license.
|
|
149
149
|
* See the LICENSE file in the root directory of this source tree.
|
|
150
150
|
*/
|
|
151
|
-
const __iconNode$
|
|
151
|
+
const __iconNode$i = [
|
|
152
152
|
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
153
153
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
154
154
|
];
|
|
155
|
-
const Clock = createLucideIcon("clock", __iconNode$
|
|
155
|
+
const Clock = createLucideIcon("clock", __iconNode$i);
|
|
156
156
|
/**
|
|
157
157
|
* @license lucide-react v0.552.0 - ISC
|
|
158
158
|
*
|
|
159
159
|
* This source code is licensed under the ISC license.
|
|
160
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
161
|
*/
|
|
162
|
-
const __iconNode$
|
|
162
|
+
const __iconNode$h = [
|
|
163
163
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
164
164
|
["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" }]
|
|
165
165
|
];
|
|
166
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
166
|
+
const Copy = createLucideIcon("copy", __iconNode$h);
|
|
167
167
|
/**
|
|
168
168
|
* @license lucide-react v0.552.0 - ISC
|
|
169
169
|
*
|
|
170
170
|
* This source code is licensed under the ISC license.
|
|
171
171
|
* See the LICENSE file in the root directory of this source tree.
|
|
172
172
|
*/
|
|
173
|
-
const __iconNode$
|
|
173
|
+
const __iconNode$g = [
|
|
174
174
|
["path", { d: "m15 15 6 6", key: "1s409w" }],
|
|
175
175
|
["path", { d: "m15 9 6-6", key: "ko1vev" }],
|
|
176
176
|
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
|
|
@@ -180,26 +180,26 @@ const __iconNode$b = [
|
|
|
180
180
|
["path", { d: "M3 8V3h5", key: "1ln10m" }],
|
|
181
181
|
["path", { d: "M9 9 3 3", key: "v551iv" }]
|
|
182
182
|
];
|
|
183
|
-
const Expand = createLucideIcon("expand", __iconNode$
|
|
183
|
+
const Expand = createLucideIcon("expand", __iconNode$g);
|
|
184
184
|
/**
|
|
185
185
|
* @license lucide-react v0.552.0 - ISC
|
|
186
186
|
*
|
|
187
187
|
* This source code is licensed under the ISC license.
|
|
188
188
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
189
|
*/
|
|
190
|
-
const __iconNode$
|
|
190
|
+
const __iconNode$f = [
|
|
191
191
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
192
192
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
193
193
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
194
194
|
];
|
|
195
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
195
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$f);
|
|
196
196
|
/**
|
|
197
197
|
* @license lucide-react v0.552.0 - ISC
|
|
198
198
|
*
|
|
199
199
|
* This source code is licensed under the ISC license.
|
|
200
200
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
201
|
*/
|
|
202
|
-
const __iconNode$
|
|
202
|
+
const __iconNode$e = [
|
|
203
203
|
[
|
|
204
204
|
"path",
|
|
205
205
|
{
|
|
@@ -212,47 +212,70 @@ const __iconNode$9 = [
|
|
|
212
212
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
213
213
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
214
214
|
];
|
|
215
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
215
|
+
const FileText = createLucideIcon("file-text", __iconNode$e);
|
|
216
216
|
/**
|
|
217
217
|
* @license lucide-react v0.552.0 - ISC
|
|
218
218
|
*
|
|
219
219
|
* This source code is licensed under the ISC license.
|
|
220
220
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
221
|
*/
|
|
222
|
-
const __iconNode$
|
|
222
|
+
const __iconNode$d = [
|
|
223
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
224
|
+
["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
|
|
225
|
+
["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
|
|
226
|
+
];
|
|
227
|
+
const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$d);
|
|
228
|
+
/**
|
|
229
|
+
* @license lucide-react v0.552.0 - ISC
|
|
230
|
+
*
|
|
231
|
+
* This source code is licensed under the ISC license.
|
|
232
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
233
|
+
*/
|
|
234
|
+
const __iconNode$c = [
|
|
223
235
|
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
|
|
224
236
|
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
225
237
|
["path", { d: "M13 6h3a2 2 0 0 1 2 2v7", key: "1yeb86" }],
|
|
226
238
|
["line", { x1: "6", x2: "6", y1: "9", y2: "21", key: "rroup" }]
|
|
227
239
|
];
|
|
228
|
-
const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$
|
|
240
|
+
const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$c);
|
|
229
241
|
/**
|
|
230
242
|
* @license lucide-react v0.552.0 - ISC
|
|
231
243
|
*
|
|
232
244
|
* This source code is licensed under the ISC license.
|
|
233
245
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
246
|
*/
|
|
235
|
-
const __iconNode$
|
|
247
|
+
const __iconNode$b = [
|
|
236
248
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
237
249
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
238
250
|
["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
|
|
239
251
|
];
|
|
240
|
-
const History = createLucideIcon("history", __iconNode$
|
|
252
|
+
const History = createLucideIcon("history", __iconNode$b);
|
|
241
253
|
/**
|
|
242
254
|
* @license lucide-react v0.552.0 - ISC
|
|
243
255
|
*
|
|
244
256
|
* This source code is licensed under the ISC license.
|
|
245
257
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
258
|
*/
|
|
247
|
-
const __iconNode$
|
|
248
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
259
|
+
const __iconNode$a = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
260
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$a);
|
|
249
261
|
/**
|
|
250
262
|
* @license lucide-react v0.552.0 - ISC
|
|
251
263
|
*
|
|
252
264
|
* This source code is licensed under the ISC license.
|
|
253
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
254
266
|
*/
|
|
255
|
-
const __iconNode$
|
|
267
|
+
const __iconNode$9 = [
|
|
268
|
+
["path", { d: "m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7", key: "132q7q" }],
|
|
269
|
+
["rect", { x: "2", y: "4", width: "20", height: "16", rx: "2", key: "izxlao" }]
|
|
270
|
+
];
|
|
271
|
+
const Mail = createLucideIcon("mail", __iconNode$9);
|
|
272
|
+
/**
|
|
273
|
+
* @license lucide-react v0.552.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/
|
|
278
|
+
const __iconNode$8 = [
|
|
256
279
|
[
|
|
257
280
|
"path",
|
|
258
281
|
{
|
|
@@ -261,37 +284,45 @@ const __iconNode$5 = [
|
|
|
261
284
|
}
|
|
262
285
|
]
|
|
263
286
|
];
|
|
264
|
-
const MessageSquare = createLucideIcon("message-square", __iconNode$
|
|
287
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$8);
|
|
265
288
|
/**
|
|
266
289
|
* @license lucide-react v0.552.0 - ISC
|
|
267
290
|
*
|
|
268
291
|
* This source code is licensed under the ISC license.
|
|
269
292
|
* See the LICENSE file in the root directory of this source tree.
|
|
270
293
|
*/
|
|
271
|
-
const __iconNode$
|
|
294
|
+
const __iconNode$7 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
295
|
+
const Minus = createLucideIcon("minus", __iconNode$7);
|
|
296
|
+
/**
|
|
297
|
+
* @license lucide-react v0.552.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/
|
|
302
|
+
const __iconNode$6 = [
|
|
272
303
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
273
304
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
274
305
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
275
306
|
];
|
|
276
|
-
const Monitor = createLucideIcon("monitor", __iconNode$
|
|
307
|
+
const Monitor = createLucideIcon("monitor", __iconNode$6);
|
|
277
308
|
/**
|
|
278
309
|
* @license lucide-react v0.552.0 - ISC
|
|
279
310
|
*
|
|
280
311
|
* This source code is licensed under the ISC license.
|
|
281
312
|
* See the LICENSE file in the root directory of this source tree.
|
|
282
313
|
*/
|
|
283
|
-
const __iconNode$
|
|
314
|
+
const __iconNode$5 = [
|
|
284
315
|
["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
|
|
285
316
|
["path", { d: "M2 12H22", key: "1m8cig" }]
|
|
286
317
|
];
|
|
287
|
-
const MoveRight = createLucideIcon("move-right", __iconNode$
|
|
318
|
+
const MoveRight = createLucideIcon("move-right", __iconNode$5);
|
|
288
319
|
/**
|
|
289
320
|
* @license lucide-react v0.552.0 - ISC
|
|
290
321
|
*
|
|
291
322
|
* This source code is licensed under the ISC license.
|
|
292
323
|
* See the LICENSE file in the root directory of this source tree.
|
|
293
324
|
*/
|
|
294
|
-
const __iconNode$
|
|
325
|
+
const __iconNode$4 = [
|
|
295
326
|
[
|
|
296
327
|
"path",
|
|
297
328
|
{
|
|
@@ -300,20 +331,42 @@ const __iconNode$2 = [
|
|
|
300
331
|
}
|
|
301
332
|
]
|
|
302
333
|
];
|
|
303
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
334
|
+
const Play = createLucideIcon("play", __iconNode$4);
|
|
304
335
|
/**
|
|
305
336
|
* @license lucide-react v0.552.0 - ISC
|
|
306
337
|
*
|
|
307
338
|
* This source code is licensed under the ISC license.
|
|
308
339
|
* See the LICENSE file in the root directory of this source tree.
|
|
309
340
|
*/
|
|
310
|
-
const __iconNode$
|
|
341
|
+
const __iconNode$3 = [
|
|
342
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
343
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
344
|
+
];
|
|
345
|
+
const Plus = createLucideIcon("plus", __iconNode$3);
|
|
346
|
+
/**
|
|
347
|
+
* @license lucide-react v0.552.0 - ISC
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the ISC license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/
|
|
352
|
+
const __iconNode$2 = [
|
|
311
353
|
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
|
|
312
354
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
313
355
|
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
|
|
314
356
|
["path", { d: "M16 16h5v5", key: "ccwih5" }]
|
|
315
357
|
];
|
|
316
|
-
const RefreshCcw = createLucideIcon("refresh-ccw", __iconNode$
|
|
358
|
+
const RefreshCcw = createLucideIcon("refresh-ccw", __iconNode$2);
|
|
359
|
+
/**
|
|
360
|
+
* @license lucide-react v0.552.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/
|
|
365
|
+
const __iconNode$1 = [
|
|
366
|
+
["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
|
|
367
|
+
["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
|
|
368
|
+
];
|
|
369
|
+
const User = createLucideIcon("user", __iconNode$1);
|
|
317
370
|
/**
|
|
318
371
|
* @license lucide-react v0.552.0 - ISC
|
|
319
372
|
*
|
|
@@ -551,18 +604,34 @@ const GitCommitHistoryPanel = ({
|
|
|
551
604
|
children: "No commits found."
|
|
552
605
|
}
|
|
553
606
|
),
|
|
554
|
-
sortedCommits.map((commit) => /* @__PURE__ */ jsx(
|
|
607
|
+
sortedCommits.map((commit) => /* @__PURE__ */ jsx(
|
|
608
|
+
CommitCard,
|
|
609
|
+
{
|
|
610
|
+
commit,
|
|
611
|
+
theme: theme2,
|
|
612
|
+
onClick: () => {
|
|
613
|
+
events.emit({
|
|
614
|
+
type: "git-panels.commit:selected",
|
|
615
|
+
source: "git-panels.commit-history",
|
|
616
|
+
timestamp: Date.now(),
|
|
617
|
+
payload: { hash: commit.hash }
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
},
|
|
621
|
+
commit.hash
|
|
622
|
+
))
|
|
555
623
|
]
|
|
556
624
|
}
|
|
557
625
|
)
|
|
558
626
|
] });
|
|
559
627
|
};
|
|
560
|
-
const CommitCard = ({ commit, theme: theme2 }) => {
|
|
628
|
+
const CommitCard = ({ commit, theme: theme2, onClick }) => {
|
|
561
629
|
const firstLine = commit.message.split("\n")[0];
|
|
562
630
|
const relative = formatRelativeTime(commit.date);
|
|
563
631
|
return /* @__PURE__ */ jsxs(
|
|
564
632
|
"div",
|
|
565
633
|
{
|
|
634
|
+
onClick,
|
|
566
635
|
style: {
|
|
567
636
|
padding: "12px",
|
|
568
637
|
backgroundColor: theme2.colors.background,
|
|
@@ -570,7 +639,17 @@ const CommitCard = ({ commit, theme: theme2 }) => {
|
|
|
570
639
|
border: `1px solid ${theme2.colors.border}`,
|
|
571
640
|
display: "flex",
|
|
572
641
|
flexDirection: "column",
|
|
573
|
-
gap: "6px"
|
|
642
|
+
gap: "6px",
|
|
643
|
+
cursor: onClick ? "pointer" : "default",
|
|
644
|
+
transition: "border-color 0.15s ease"
|
|
645
|
+
},
|
|
646
|
+
onMouseEnter: (e) => {
|
|
647
|
+
if (onClick) {
|
|
648
|
+
e.currentTarget.style.borderColor = theme2.colors.primary;
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
onMouseLeave: (e) => {
|
|
652
|
+
e.currentTarget.style.borderColor = theme2.colors.border;
|
|
574
653
|
},
|
|
575
654
|
children: [
|
|
576
655
|
/* @__PURE__ */ jsx(
|
|
@@ -698,700 +777,176 @@ const GitCommitHistoryPanelPreview = () => {
|
|
|
698
777
|
}
|
|
699
778
|
);
|
|
700
779
|
};
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
try {
|
|
717
|
-
await context.refresh("repository", "pullRequests");
|
|
718
|
-
} catch (error) {
|
|
719
|
-
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
720
|
-
}
|
|
721
|
-
}),
|
|
722
|
-
// Tool: set filter
|
|
723
|
-
events.on("git-panels.pull-requests:set-filter", (event) => {
|
|
724
|
-
var _a2;
|
|
725
|
-
const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
|
|
726
|
-
if (newFilter && ["open", "closed"].includes(newFilter)) {
|
|
727
|
-
setFilter(newFilter);
|
|
728
|
-
}
|
|
729
|
-
})
|
|
730
|
-
];
|
|
731
|
-
return () => unsubscribers.forEach((unsub) => unsub());
|
|
732
|
-
}, [events, context]);
|
|
733
|
-
const filteredPullRequests = useMemo(() => {
|
|
734
|
-
return pullRequests.filter((pr) => pr.state === filter);
|
|
735
|
-
}, [filter, pullRequests]);
|
|
736
|
-
const counts = useMemo(() => {
|
|
737
|
-
const open = pullRequests.filter((pr) => pr.state === "open").length;
|
|
738
|
-
const closed = pullRequests.filter((pr) => pr.state === "closed").length;
|
|
739
|
-
return { open, closed };
|
|
740
|
-
}, [pullRequests]);
|
|
741
|
-
const handleRefresh = async () => {
|
|
742
|
-
try {
|
|
743
|
-
await context.refresh("repository", "pullRequests");
|
|
744
|
-
} catch (error) {
|
|
745
|
-
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
746
|
-
}
|
|
780
|
+
const VOID = -1;
|
|
781
|
+
const PRIMITIVE = 0;
|
|
782
|
+
const ARRAY = 1;
|
|
783
|
+
const OBJECT = 2;
|
|
784
|
+
const DATE = 3;
|
|
785
|
+
const REGEXP = 4;
|
|
786
|
+
const MAP = 5;
|
|
787
|
+
const SET = 6;
|
|
788
|
+
const ERROR = 7;
|
|
789
|
+
const BIGINT = 8;
|
|
790
|
+
const env = typeof self === "object" ? self : globalThis;
|
|
791
|
+
const deserializer = ($2, _) => {
|
|
792
|
+
const as = (out, index2) => {
|
|
793
|
+
$2.set(index2, out);
|
|
794
|
+
return out;
|
|
747
795
|
};
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
796
|
+
const unpair = (index2) => {
|
|
797
|
+
if ($2.has(index2))
|
|
798
|
+
return $2.get(index2);
|
|
799
|
+
const [type, value] = _[index2];
|
|
800
|
+
switch (type) {
|
|
801
|
+
case PRIMITIVE:
|
|
802
|
+
case VOID:
|
|
803
|
+
return as(value, index2);
|
|
804
|
+
case ARRAY: {
|
|
805
|
+
const arr = as([], index2);
|
|
806
|
+
for (const index3 of value)
|
|
807
|
+
arr.push(unpair(index3));
|
|
808
|
+
return arr;
|
|
809
|
+
}
|
|
810
|
+
case OBJECT: {
|
|
811
|
+
const object = as({}, index2);
|
|
812
|
+
for (const [key, index3] of value)
|
|
813
|
+
object[unpair(key)] = unpair(index3);
|
|
814
|
+
return object;
|
|
815
|
+
}
|
|
816
|
+
case DATE:
|
|
817
|
+
return as(new Date(value), index2);
|
|
818
|
+
case REGEXP: {
|
|
819
|
+
const { source: source2, flags } = value;
|
|
820
|
+
return as(new RegExp(source2, flags), index2);
|
|
821
|
+
}
|
|
822
|
+
case MAP: {
|
|
823
|
+
const map2 = as(/* @__PURE__ */ new Map(), index2);
|
|
824
|
+
for (const [key, index3] of value)
|
|
825
|
+
map2.set(unpair(key), unpair(index3));
|
|
826
|
+
return map2;
|
|
827
|
+
}
|
|
828
|
+
case SET: {
|
|
829
|
+
const set = as(/* @__PURE__ */ new Set(), index2);
|
|
830
|
+
for (const index3 of value)
|
|
831
|
+
set.add(unpair(index3));
|
|
832
|
+
return set;
|
|
833
|
+
}
|
|
834
|
+
case ERROR: {
|
|
835
|
+
const { name: name2, message } = value;
|
|
836
|
+
return as(new env[name2](message), index2);
|
|
837
|
+
}
|
|
838
|
+
case BIGINT:
|
|
839
|
+
return as(BigInt(value), index2);
|
|
840
|
+
case "BigInt":
|
|
841
|
+
return as(Object(BigInt(value)), index2);
|
|
842
|
+
case "ArrayBuffer":
|
|
843
|
+
return as(new Uint8Array(value).buffer, value);
|
|
844
|
+
case "DataView": {
|
|
845
|
+
const { buffer } = new Uint8Array(value);
|
|
846
|
+
return as(new DataView(buffer), value);
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return as(new env[type](value), index2);
|
|
755
850
|
};
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
851
|
+
return unpair;
|
|
852
|
+
};
|
|
853
|
+
const deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
854
|
+
const EMPTY = "";
|
|
855
|
+
const { toString: toString$2 } = {};
|
|
856
|
+
const { keys } = Object;
|
|
857
|
+
const typeOf = (value) => {
|
|
858
|
+
const type = typeof value;
|
|
859
|
+
if (type !== "object" || !value)
|
|
860
|
+
return [PRIMITIVE, type];
|
|
861
|
+
const asString = toString$2.call(value).slice(8, -1);
|
|
862
|
+
switch (asString) {
|
|
863
|
+
case "Array":
|
|
864
|
+
return [ARRAY, EMPTY];
|
|
865
|
+
case "Object":
|
|
866
|
+
return [OBJECT, EMPTY];
|
|
867
|
+
case "Date":
|
|
868
|
+
return [DATE, EMPTY];
|
|
869
|
+
case "RegExp":
|
|
870
|
+
return [REGEXP, EMPTY];
|
|
871
|
+
case "Map":
|
|
872
|
+
return [MAP, EMPTY];
|
|
873
|
+
case "Set":
|
|
874
|
+
return [SET, EMPTY];
|
|
875
|
+
case "DataView":
|
|
876
|
+
return [ARRAY, asString];
|
|
877
|
+
}
|
|
878
|
+
if (asString.includes("Array"))
|
|
879
|
+
return [ARRAY, asString];
|
|
880
|
+
if (asString.includes("Error"))
|
|
881
|
+
return [ERROR, asString];
|
|
882
|
+
return [OBJECT, asString];
|
|
883
|
+
};
|
|
884
|
+
const shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
885
|
+
const serializer = (strict, json2, $2, _) => {
|
|
886
|
+
const as = (out, value) => {
|
|
887
|
+
const index2 = _.push(out) - 1;
|
|
888
|
+
$2.set(value, index2);
|
|
889
|
+
return index2;
|
|
762
890
|
};
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
},
|
|
784
|
-
children: [
|
|
785
|
-
/* @__PURE__ */ jsx("div", { children: icon }),
|
|
786
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
787
|
-
/* @__PURE__ */ jsx(
|
|
788
|
-
"h3",
|
|
789
|
-
{
|
|
790
|
-
style: {
|
|
791
|
-
margin: 0,
|
|
792
|
-
marginBottom: "8px",
|
|
793
|
-
color: theme2.colors.text,
|
|
794
|
-
fontFamily: theme2.fonts.heading,
|
|
795
|
-
fontSize: theme2.fontSizes[2],
|
|
796
|
-
fontWeight: 600
|
|
797
|
-
},
|
|
798
|
-
children: title
|
|
799
|
-
}
|
|
800
|
-
),
|
|
801
|
-
description && /* @__PURE__ */ jsx(
|
|
802
|
-
"p",
|
|
803
|
-
{
|
|
804
|
-
style: {
|
|
805
|
-
margin: 0,
|
|
806
|
-
color: theme2.colors.textSecondary,
|
|
807
|
-
fontFamily: theme2.fonts.body,
|
|
808
|
-
fontSize: theme2.fontSizes[1],
|
|
809
|
-
lineHeight: 1.5
|
|
810
|
-
},
|
|
811
|
-
children: description
|
|
812
|
-
}
|
|
813
|
-
)
|
|
814
|
-
] })
|
|
815
|
-
]
|
|
891
|
+
const pair = (value) => {
|
|
892
|
+
if ($2.has(value))
|
|
893
|
+
return $2.get(value);
|
|
894
|
+
let [TYPE, type] = typeOf(value);
|
|
895
|
+
switch (TYPE) {
|
|
896
|
+
case PRIMITIVE: {
|
|
897
|
+
let entry = value;
|
|
898
|
+
switch (type) {
|
|
899
|
+
case "bigint":
|
|
900
|
+
TYPE = BIGINT;
|
|
901
|
+
entry = value.toString();
|
|
902
|
+
break;
|
|
903
|
+
case "function":
|
|
904
|
+
case "symbol":
|
|
905
|
+
if (strict)
|
|
906
|
+
throw new TypeError("unable to serialize " + type);
|
|
907
|
+
entry = null;
|
|
908
|
+
break;
|
|
909
|
+
case "undefined":
|
|
910
|
+
return as([VOID], value);
|
|
816
911
|
}
|
|
817
|
-
|
|
818
|
-
}
|
|
819
|
-
) });
|
|
820
|
-
if (isLoading && pullRequests.length === 0) {
|
|
821
|
-
return renderState(
|
|
822
|
-
/* @__PURE__ */ jsx(LoaderCircle, { size: 32, style: { color: theme2.colors.textSecondary }, className: "spin" }),
|
|
823
|
-
"Loading pull requests...",
|
|
824
|
-
"Fetching pull request data for this repository."
|
|
825
|
-
);
|
|
826
|
-
}
|
|
827
|
-
if (!context.currentScope.repository) {
|
|
828
|
-
return renderState(
|
|
829
|
-
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.textSecondary } }),
|
|
830
|
-
"No repository selected",
|
|
831
|
-
"Select a repository to view pull requests."
|
|
832
|
-
);
|
|
833
|
-
}
|
|
834
|
-
if (!hasPRs) {
|
|
835
|
-
return renderState(
|
|
836
|
-
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.warning || "#f59e0b" } }),
|
|
837
|
-
"Pull requests unavailable",
|
|
838
|
-
"Pull request data is not available for this repository."
|
|
839
|
-
);
|
|
840
|
-
}
|
|
841
|
-
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
842
|
-
/* @__PURE__ */ jsx("style", { children: `.hide-scrollbar::-webkit-scrollbar { display: none; }` }),
|
|
843
|
-
/* @__PURE__ */ jsxs(
|
|
844
|
-
"div",
|
|
845
|
-
{
|
|
846
|
-
style: {
|
|
847
|
-
height: "40px",
|
|
848
|
-
minHeight: "40px",
|
|
849
|
-
padding: "0 12px",
|
|
850
|
-
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
851
|
-
backgroundColor: theme2.colors.background,
|
|
852
|
-
display: "flex",
|
|
853
|
-
alignItems: "center",
|
|
854
|
-
justifyContent: "space-between",
|
|
855
|
-
boxSizing: "border-box"
|
|
856
|
-
},
|
|
857
|
-
children: [
|
|
858
|
-
/* @__PURE__ */ jsxs(
|
|
859
|
-
"div",
|
|
860
|
-
{
|
|
861
|
-
style: {
|
|
862
|
-
display: "flex",
|
|
863
|
-
alignItems: "center",
|
|
864
|
-
gap: "8px",
|
|
865
|
-
color: theme2.colors.textSecondary,
|
|
866
|
-
fontFamily: theme2.fonts.heading,
|
|
867
|
-
fontSize: theme2.fontSizes[0],
|
|
868
|
-
fontWeight: 600,
|
|
869
|
-
textTransform: "uppercase"
|
|
870
|
-
},
|
|
871
|
-
children: [
|
|
872
|
-
/* @__PURE__ */ jsx(GitPullRequest, { size: 14 }),
|
|
873
|
-
"Pull Requests"
|
|
874
|
-
]
|
|
875
|
-
}
|
|
876
|
-
),
|
|
877
|
-
/* @__PURE__ */ jsxs(
|
|
878
|
-
"button",
|
|
879
|
-
{
|
|
880
|
-
type: "button",
|
|
881
|
-
onClick: handleRefresh,
|
|
882
|
-
disabled: isLoading,
|
|
883
|
-
style: {
|
|
884
|
-
display: "inline-flex",
|
|
885
|
-
alignItems: "center",
|
|
886
|
-
gap: "6px",
|
|
887
|
-
padding: "4px 10px",
|
|
888
|
-
borderRadius: "4px",
|
|
889
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
890
|
-
backgroundColor: theme2.colors.background,
|
|
891
|
-
color: theme2.colors.text,
|
|
892
|
-
cursor: isLoading ? "default" : "pointer",
|
|
893
|
-
fontFamily: theme2.fonts.body,
|
|
894
|
-
fontSize: theme2.fontSizes[0],
|
|
895
|
-
fontWeight: 500,
|
|
896
|
-
opacity: isLoading ? 0.7 : 1
|
|
897
|
-
},
|
|
898
|
-
children: [
|
|
899
|
-
isLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "spin" }) : /* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
900
|
-
isLoading ? "Refreshing..." : "Refresh"
|
|
901
|
-
]
|
|
902
|
-
}
|
|
903
|
-
)
|
|
904
|
-
]
|
|
912
|
+
return as([TYPE, entry], value);
|
|
905
913
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
onClick: () => setFilter(value),
|
|
922
|
-
style: {
|
|
923
|
-
flex: 1,
|
|
924
|
-
display: "flex",
|
|
925
|
-
alignItems: "center",
|
|
926
|
-
justifyContent: "center",
|
|
927
|
-
gap: "6px",
|
|
928
|
-
padding: "8px 12px",
|
|
929
|
-
border: "none",
|
|
930
|
-
borderBottom: isActive ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
|
|
931
|
-
backgroundColor: "transparent",
|
|
932
|
-
color: isActive ? theme2.colors.text : theme2.colors.textSecondary,
|
|
933
|
-
fontFamily: theme2.fonts.body,
|
|
934
|
-
fontSize: theme2.fontSizes[1],
|
|
935
|
-
fontWeight: isActive ? 600 : 500,
|
|
936
|
-
cursor: "pointer",
|
|
937
|
-
marginBottom: "-1px"
|
|
938
|
-
},
|
|
939
|
-
children: [
|
|
940
|
-
label,
|
|
941
|
-
/* @__PURE__ */ jsxs("span", { style: { opacity: 0.7 }, children: [
|
|
942
|
-
"(",
|
|
943
|
-
counts[value],
|
|
944
|
-
")"
|
|
945
|
-
] })
|
|
946
|
-
]
|
|
947
|
-
},
|
|
948
|
-
value
|
|
949
|
-
);
|
|
950
|
-
})
|
|
914
|
+
case ARRAY: {
|
|
915
|
+
if (type) {
|
|
916
|
+
let spread = value;
|
|
917
|
+
if (type === "DataView") {
|
|
918
|
+
spread = new Uint8Array(value.buffer);
|
|
919
|
+
} else if (type === "ArrayBuffer") {
|
|
920
|
+
spread = new Uint8Array(value);
|
|
921
|
+
}
|
|
922
|
+
return as([type, [...spread]], value);
|
|
923
|
+
}
|
|
924
|
+
const arr = [];
|
|
925
|
+
const index2 = as([TYPE, arr], value);
|
|
926
|
+
for (const entry of value)
|
|
927
|
+
arr.push(pair(entry));
|
|
928
|
+
return index2;
|
|
951
929
|
}
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
scrollbarWidth: "none",
|
|
962
|
-
msOverflowStyle: "none"
|
|
963
|
-
},
|
|
964
|
-
className: "hide-scrollbar",
|
|
965
|
-
children: filteredPullRequests.length === 0 ? /* @__PURE__ */ jsxs(
|
|
966
|
-
"div",
|
|
967
|
-
{
|
|
968
|
-
style: {
|
|
969
|
-
marginTop: "48px",
|
|
970
|
-
textAlign: "center",
|
|
971
|
-
color: theme2.colors.textSecondary,
|
|
972
|
-
fontFamily: theme2.fonts.body
|
|
973
|
-
},
|
|
974
|
-
children: [
|
|
975
|
-
/* @__PURE__ */ jsx(GitPullRequest, { size: 32, style: { marginBottom: "12px" } }),
|
|
976
|
-
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No pull requests found" }),
|
|
977
|
-
/* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: [
|
|
978
|
-
"There are no ",
|
|
979
|
-
filter,
|
|
980
|
-
" pull requests to display."
|
|
981
|
-
] })
|
|
982
|
-
]
|
|
930
|
+
case OBJECT: {
|
|
931
|
+
if (type) {
|
|
932
|
+
switch (type) {
|
|
933
|
+
case "BigInt":
|
|
934
|
+
return as([type, value.toString()], value);
|
|
935
|
+
case "Boolean":
|
|
936
|
+
case "Number":
|
|
937
|
+
case "String":
|
|
938
|
+
return as([type, value.valueOf()], value);
|
|
983
939
|
}
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
return /* @__PURE__ */ jsxs(
|
|
995
|
-
"div",
|
|
996
|
-
{
|
|
997
|
-
onClick,
|
|
998
|
-
role: "button",
|
|
999
|
-
tabIndex: 0,
|
|
1000
|
-
onKeyDown: (e) => {
|
|
1001
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1002
|
-
e.preventDefault();
|
|
1003
|
-
onClick == null ? void 0 : onClick();
|
|
1004
|
-
}
|
|
1005
|
-
},
|
|
1006
|
-
style: {
|
|
1007
|
-
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
1008
|
-
padding: "12px 16px",
|
|
1009
|
-
backgroundColor: theme2.colors.backgroundSecondary,
|
|
1010
|
-
display: "flex",
|
|
1011
|
-
flexDirection: "column",
|
|
1012
|
-
gap: "8px",
|
|
1013
|
-
cursor: onClick ? "pointer" : "default",
|
|
1014
|
-
minWidth: 0
|
|
1015
|
-
},
|
|
1016
|
-
children: [
|
|
1017
|
-
/* @__PURE__ */ jsxs(
|
|
1018
|
-
"div",
|
|
1019
|
-
{
|
|
1020
|
-
style: {
|
|
1021
|
-
display: "flex",
|
|
1022
|
-
alignItems: "baseline",
|
|
1023
|
-
gap: "8px"
|
|
1024
|
-
},
|
|
1025
|
-
children: [
|
|
1026
|
-
/* @__PURE__ */ jsxs(
|
|
1027
|
-
"span",
|
|
1028
|
-
{
|
|
1029
|
-
style: {
|
|
1030
|
-
fontFamily: theme2.fonts.heading,
|
|
1031
|
-
fontSize: theme2.fontSizes[1],
|
|
1032
|
-
fontWeight: 600,
|
|
1033
|
-
color: theme2.colors.textSecondary,
|
|
1034
|
-
flexShrink: 0
|
|
1035
|
-
},
|
|
1036
|
-
children: [
|
|
1037
|
-
"#",
|
|
1038
|
-
pr.number
|
|
1039
|
-
]
|
|
1040
|
-
}
|
|
1041
|
-
),
|
|
1042
|
-
/* @__PURE__ */ jsx(
|
|
1043
|
-
"span",
|
|
1044
|
-
{
|
|
1045
|
-
style: {
|
|
1046
|
-
fontFamily: theme2.fonts.heading,
|
|
1047
|
-
fontSize: theme2.fontSizes[2],
|
|
1048
|
-
fontWeight: 600,
|
|
1049
|
-
color: theme2.colors.text,
|
|
1050
|
-
lineHeight: 1.3,
|
|
1051
|
-
wordBreak: "break-word"
|
|
1052
|
-
},
|
|
1053
|
-
children: pr.title
|
|
1054
|
-
}
|
|
1055
|
-
)
|
|
1056
|
-
]
|
|
1057
|
-
}
|
|
1058
|
-
),
|
|
1059
|
-
/* @__PURE__ */ jsxs(
|
|
1060
|
-
"div",
|
|
1061
|
-
{
|
|
1062
|
-
style: {
|
|
1063
|
-
display: "flex",
|
|
1064
|
-
alignItems: "center",
|
|
1065
|
-
gap: "8px 12px",
|
|
1066
|
-
flexWrap: "wrap",
|
|
1067
|
-
color: theme2.colors.textSecondary,
|
|
1068
|
-
fontFamily: theme2.fonts.body,
|
|
1069
|
-
fontSize: theme2.fontSizes[0]
|
|
1070
|
-
},
|
|
1071
|
-
children: [
|
|
1072
|
-
pr.draft && /* @__PURE__ */ jsx(
|
|
1073
|
-
"span",
|
|
1074
|
-
{
|
|
1075
|
-
style: {
|
|
1076
|
-
padding: "4px 10px",
|
|
1077
|
-
borderRadius: "999px",
|
|
1078
|
-
backgroundColor: theme2.colors.background,
|
|
1079
|
-
color: theme2.colors.textSecondary,
|
|
1080
|
-
fontFamily: theme2.fonts.heading,
|
|
1081
|
-
fontSize: theme2.fontSizes[0],
|
|
1082
|
-
fontWeight: 600,
|
|
1083
|
-
textTransform: "uppercase",
|
|
1084
|
-
letterSpacing: "0.02em"
|
|
1085
|
-
},
|
|
1086
|
-
children: "Draft"
|
|
1087
|
-
}
|
|
1088
|
-
),
|
|
1089
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
1090
|
-
"by ",
|
|
1091
|
-
((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"
|
|
1092
|
-
] }),
|
|
1093
|
-
/* @__PURE__ */ jsxs(
|
|
1094
|
-
"span",
|
|
1095
|
-
{
|
|
1096
|
-
style: {
|
|
1097
|
-
display: "inline-flex",
|
|
1098
|
-
alignItems: "center",
|
|
1099
|
-
gap: "4px"
|
|
1100
|
-
},
|
|
1101
|
-
children: [
|
|
1102
|
-
/* @__PURE__ */ jsx(Calendar, { size: 12 }),
|
|
1103
|
-
" ",
|
|
1104
|
-
formatDate(pr.created_at)
|
|
1105
|
-
]
|
|
1106
|
-
}
|
|
1107
|
-
),
|
|
1108
|
-
!isOpen && /* @__PURE__ */ jsxs(
|
|
1109
|
-
"span",
|
|
1110
|
-
{
|
|
1111
|
-
style: {
|
|
1112
|
-
display: "inline-flex",
|
|
1113
|
-
alignItems: "center",
|
|
1114
|
-
gap: "4px"
|
|
1115
|
-
},
|
|
1116
|
-
children: [
|
|
1117
|
-
isMerged ? "Merged" : "Closed",
|
|
1118
|
-
" ",
|
|
1119
|
-
formatDate(pr.merged_at || pr.updated_at)
|
|
1120
|
-
]
|
|
1121
|
-
}
|
|
1122
|
-
),
|
|
1123
|
-
totalComments > 0 && /* @__PURE__ */ jsxs(
|
|
1124
|
-
"span",
|
|
1125
|
-
{
|
|
1126
|
-
style: {
|
|
1127
|
-
display: "inline-flex",
|
|
1128
|
-
alignItems: "center",
|
|
1129
|
-
gap: "4px"
|
|
1130
|
-
},
|
|
1131
|
-
children: [
|
|
1132
|
-
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
1133
|
-
" ",
|
|
1134
|
-
totalComments
|
|
1135
|
-
]
|
|
1136
|
-
}
|
|
1137
|
-
)
|
|
1138
|
-
]
|
|
1139
|
-
}
|
|
1140
|
-
)
|
|
1141
|
-
]
|
|
1142
|
-
}
|
|
1143
|
-
);
|
|
1144
|
-
};
|
|
1145
|
-
const GitPullRequestsPanelPreview = () => {
|
|
1146
|
-
const { theme: theme2 } = useTheme();
|
|
1147
|
-
return /* @__PURE__ */ jsxs(
|
|
1148
|
-
"div",
|
|
1149
|
-
{
|
|
1150
|
-
style: {
|
|
1151
|
-
padding: "12px",
|
|
1152
|
-
fontFamily: theme2.fonts.body,
|
|
1153
|
-
fontSize: theme2.fontSizes[0],
|
|
1154
|
-
color: theme2.colors.text,
|
|
1155
|
-
display: "flex",
|
|
1156
|
-
flexDirection: "column",
|
|
1157
|
-
gap: "8px"
|
|
1158
|
-
},
|
|
1159
|
-
children: [
|
|
1160
|
-
/* @__PURE__ */ jsxs(
|
|
1161
|
-
"div",
|
|
1162
|
-
{
|
|
1163
|
-
style: {
|
|
1164
|
-
display: "flex",
|
|
1165
|
-
alignItems: "center",
|
|
1166
|
-
gap: "8px"
|
|
1167
|
-
},
|
|
1168
|
-
children: [
|
|
1169
|
-
/* @__PURE__ */ jsx(
|
|
1170
|
-
"span",
|
|
1171
|
-
{
|
|
1172
|
-
style: {
|
|
1173
|
-
display: "inline-flex",
|
|
1174
|
-
alignItems: "center",
|
|
1175
|
-
gap: "6px",
|
|
1176
|
-
padding: "2px 8px",
|
|
1177
|
-
borderRadius: "999px",
|
|
1178
|
-
backgroundColor: "#3b82f622",
|
|
1179
|
-
color: "#3b82f6",
|
|
1180
|
-
fontFamily: theme2.fonts.heading,
|
|
1181
|
-
fontSize: theme2.fontSizes[0],
|
|
1182
|
-
fontWeight: 600,
|
|
1183
|
-
textTransform: "uppercase"
|
|
1184
|
-
},
|
|
1185
|
-
children: "Review"
|
|
1186
|
-
}
|
|
1187
|
-
),
|
|
1188
|
-
/* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "#42 Refine panel layout system" })
|
|
1189
|
-
]
|
|
1190
|
-
}
|
|
1191
|
-
),
|
|
1192
|
-
/* @__PURE__ */ jsx(
|
|
1193
|
-
"div",
|
|
1194
|
-
{
|
|
1195
|
-
style: {
|
|
1196
|
-
paddingLeft: "4px",
|
|
1197
|
-
color: theme2.colors.textSecondary,
|
|
1198
|
-
fontSize: theme2.fontSizes[0],
|
|
1199
|
-
lineHeight: 1.4
|
|
1200
|
-
},
|
|
1201
|
-
children: "Adds preview registry and consolidates configurator metadata."
|
|
1202
|
-
}
|
|
1203
|
-
),
|
|
1204
|
-
/* @__PURE__ */ jsxs(
|
|
1205
|
-
"div",
|
|
1206
|
-
{
|
|
1207
|
-
style: {
|
|
1208
|
-
display: "flex",
|
|
1209
|
-
alignItems: "center",
|
|
1210
|
-
gap: "8px",
|
|
1211
|
-
color: theme2.colors.textSecondary,
|
|
1212
|
-
fontSize: theme2.fontSizes[0]
|
|
1213
|
-
},
|
|
1214
|
-
children: [
|
|
1215
|
-
/* @__PURE__ */ jsx("span", { children: "4 checks" }),
|
|
1216
|
-
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
1217
|
-
/* @__PURE__ */ jsx("span", { children: "1 reviewer" })
|
|
1218
|
-
]
|
|
1219
|
-
}
|
|
1220
|
-
)
|
|
1221
|
-
]
|
|
1222
|
-
}
|
|
1223
|
-
);
|
|
1224
|
-
};
|
|
1225
|
-
const VOID = -1;
|
|
1226
|
-
const PRIMITIVE = 0;
|
|
1227
|
-
const ARRAY = 1;
|
|
1228
|
-
const OBJECT = 2;
|
|
1229
|
-
const DATE = 3;
|
|
1230
|
-
const REGEXP = 4;
|
|
1231
|
-
const MAP = 5;
|
|
1232
|
-
const SET = 6;
|
|
1233
|
-
const ERROR = 7;
|
|
1234
|
-
const BIGINT = 8;
|
|
1235
|
-
const env = typeof self === "object" ? self : globalThis;
|
|
1236
|
-
const deserializer = ($2, _) => {
|
|
1237
|
-
const as = (out, index2) => {
|
|
1238
|
-
$2.set(index2, out);
|
|
1239
|
-
return out;
|
|
1240
|
-
};
|
|
1241
|
-
const unpair = (index2) => {
|
|
1242
|
-
if ($2.has(index2))
|
|
1243
|
-
return $2.get(index2);
|
|
1244
|
-
const [type, value] = _[index2];
|
|
1245
|
-
switch (type) {
|
|
1246
|
-
case PRIMITIVE:
|
|
1247
|
-
case VOID:
|
|
1248
|
-
return as(value, index2);
|
|
1249
|
-
case ARRAY: {
|
|
1250
|
-
const arr = as([], index2);
|
|
1251
|
-
for (const index3 of value)
|
|
1252
|
-
arr.push(unpair(index3));
|
|
1253
|
-
return arr;
|
|
1254
|
-
}
|
|
1255
|
-
case OBJECT: {
|
|
1256
|
-
const object = as({}, index2);
|
|
1257
|
-
for (const [key, index3] of value)
|
|
1258
|
-
object[unpair(key)] = unpair(index3);
|
|
1259
|
-
return object;
|
|
1260
|
-
}
|
|
1261
|
-
case DATE:
|
|
1262
|
-
return as(new Date(value), index2);
|
|
1263
|
-
case REGEXP: {
|
|
1264
|
-
const { source: source2, flags } = value;
|
|
1265
|
-
return as(new RegExp(source2, flags), index2);
|
|
1266
|
-
}
|
|
1267
|
-
case MAP: {
|
|
1268
|
-
const map2 = as(/* @__PURE__ */ new Map(), index2);
|
|
1269
|
-
for (const [key, index3] of value)
|
|
1270
|
-
map2.set(unpair(key), unpair(index3));
|
|
1271
|
-
return map2;
|
|
1272
|
-
}
|
|
1273
|
-
case SET: {
|
|
1274
|
-
const set = as(/* @__PURE__ */ new Set(), index2);
|
|
1275
|
-
for (const index3 of value)
|
|
1276
|
-
set.add(unpair(index3));
|
|
1277
|
-
return set;
|
|
1278
|
-
}
|
|
1279
|
-
case ERROR: {
|
|
1280
|
-
const { name: name2, message } = value;
|
|
1281
|
-
return as(new env[name2](message), index2);
|
|
1282
|
-
}
|
|
1283
|
-
case BIGINT:
|
|
1284
|
-
return as(BigInt(value), index2);
|
|
1285
|
-
case "BigInt":
|
|
1286
|
-
return as(Object(BigInt(value)), index2);
|
|
1287
|
-
case "ArrayBuffer":
|
|
1288
|
-
return as(new Uint8Array(value).buffer, value);
|
|
1289
|
-
case "DataView": {
|
|
1290
|
-
const { buffer } = new Uint8Array(value);
|
|
1291
|
-
return as(new DataView(buffer), value);
|
|
1292
|
-
}
|
|
1293
|
-
}
|
|
1294
|
-
return as(new env[type](value), index2);
|
|
1295
|
-
};
|
|
1296
|
-
return unpair;
|
|
1297
|
-
};
|
|
1298
|
-
const deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
1299
|
-
const EMPTY = "";
|
|
1300
|
-
const { toString: toString$2 } = {};
|
|
1301
|
-
const { keys } = Object;
|
|
1302
|
-
const typeOf = (value) => {
|
|
1303
|
-
const type = typeof value;
|
|
1304
|
-
if (type !== "object" || !value)
|
|
1305
|
-
return [PRIMITIVE, type];
|
|
1306
|
-
const asString = toString$2.call(value).slice(8, -1);
|
|
1307
|
-
switch (asString) {
|
|
1308
|
-
case "Array":
|
|
1309
|
-
return [ARRAY, EMPTY];
|
|
1310
|
-
case "Object":
|
|
1311
|
-
return [OBJECT, EMPTY];
|
|
1312
|
-
case "Date":
|
|
1313
|
-
return [DATE, EMPTY];
|
|
1314
|
-
case "RegExp":
|
|
1315
|
-
return [REGEXP, EMPTY];
|
|
1316
|
-
case "Map":
|
|
1317
|
-
return [MAP, EMPTY];
|
|
1318
|
-
case "Set":
|
|
1319
|
-
return [SET, EMPTY];
|
|
1320
|
-
case "DataView":
|
|
1321
|
-
return [ARRAY, asString];
|
|
1322
|
-
}
|
|
1323
|
-
if (asString.includes("Array"))
|
|
1324
|
-
return [ARRAY, asString];
|
|
1325
|
-
if (asString.includes("Error"))
|
|
1326
|
-
return [ERROR, asString];
|
|
1327
|
-
return [OBJECT, asString];
|
|
1328
|
-
};
|
|
1329
|
-
const shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
1330
|
-
const serializer = (strict, json2, $2, _) => {
|
|
1331
|
-
const as = (out, value) => {
|
|
1332
|
-
const index2 = _.push(out) - 1;
|
|
1333
|
-
$2.set(value, index2);
|
|
1334
|
-
return index2;
|
|
1335
|
-
};
|
|
1336
|
-
const pair = (value) => {
|
|
1337
|
-
if ($2.has(value))
|
|
1338
|
-
return $2.get(value);
|
|
1339
|
-
let [TYPE, type] = typeOf(value);
|
|
1340
|
-
switch (TYPE) {
|
|
1341
|
-
case PRIMITIVE: {
|
|
1342
|
-
let entry = value;
|
|
1343
|
-
switch (type) {
|
|
1344
|
-
case "bigint":
|
|
1345
|
-
TYPE = BIGINT;
|
|
1346
|
-
entry = value.toString();
|
|
1347
|
-
break;
|
|
1348
|
-
case "function":
|
|
1349
|
-
case "symbol":
|
|
1350
|
-
if (strict)
|
|
1351
|
-
throw new TypeError("unable to serialize " + type);
|
|
1352
|
-
entry = null;
|
|
1353
|
-
break;
|
|
1354
|
-
case "undefined":
|
|
1355
|
-
return as([VOID], value);
|
|
1356
|
-
}
|
|
1357
|
-
return as([TYPE, entry], value);
|
|
1358
|
-
}
|
|
1359
|
-
case ARRAY: {
|
|
1360
|
-
if (type) {
|
|
1361
|
-
let spread = value;
|
|
1362
|
-
if (type === "DataView") {
|
|
1363
|
-
spread = new Uint8Array(value.buffer);
|
|
1364
|
-
} else if (type === "ArrayBuffer") {
|
|
1365
|
-
spread = new Uint8Array(value);
|
|
1366
|
-
}
|
|
1367
|
-
return as([type, [...spread]], value);
|
|
1368
|
-
}
|
|
1369
|
-
const arr = [];
|
|
1370
|
-
const index2 = as([TYPE, arr], value);
|
|
1371
|
-
for (const entry of value)
|
|
1372
|
-
arr.push(pair(entry));
|
|
1373
|
-
return index2;
|
|
1374
|
-
}
|
|
1375
|
-
case OBJECT: {
|
|
1376
|
-
if (type) {
|
|
1377
|
-
switch (type) {
|
|
1378
|
-
case "BigInt":
|
|
1379
|
-
return as([type, value.toString()], value);
|
|
1380
|
-
case "Boolean":
|
|
1381
|
-
case "Number":
|
|
1382
|
-
case "String":
|
|
1383
|
-
return as([type, value.valueOf()], value);
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
if (json2 && "toJSON" in value)
|
|
1387
|
-
return pair(value.toJSON());
|
|
1388
|
-
const entries = [];
|
|
1389
|
-
const index2 = as([TYPE, entries], value);
|
|
1390
|
-
for (const key of keys(value)) {
|
|
1391
|
-
if (strict || !shouldSkip(typeOf(value[key])))
|
|
1392
|
-
entries.push([pair(key), pair(value[key])]);
|
|
1393
|
-
}
|
|
1394
|
-
return index2;
|
|
940
|
+
}
|
|
941
|
+
if (json2 && "toJSON" in value)
|
|
942
|
+
return pair(value.toJSON());
|
|
943
|
+
const entries = [];
|
|
944
|
+
const index2 = as([TYPE, entries], value);
|
|
945
|
+
for (const key of keys(value)) {
|
|
946
|
+
if (strict || !shouldSkip(typeOf(value[key])))
|
|
947
|
+
entries.push([pair(key), pair(value[key])]);
|
|
948
|
+
}
|
|
949
|
+
return index2;
|
|
1395
950
|
}
|
|
1396
951
|
case DATE:
|
|
1397
952
|
return as([TYPE, value.toISOString()], value);
|
|
@@ -45038,138 +44593,1282 @@ var DocumentView = ({
|
|
|
45038
44593
|
overflow: "auto",
|
|
45039
44594
|
backgroundColor
|
|
45040
44595
|
}
|
|
45041
|
-
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
45042
|
-
style: {
|
|
45043
|
-
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
45044
|
-
margin: "0 auto",
|
|
45045
|
-
height: "100%"
|
|
44596
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44597
|
+
style: {
|
|
44598
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44599
|
+
margin: "0 auto",
|
|
44600
|
+
height: "100%"
|
|
44601
|
+
}
|
|
44602
|
+
}, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44603
|
+
content: content2,
|
|
44604
|
+
slideIdPrefix,
|
|
44605
|
+
slideIndex: 0,
|
|
44606
|
+
isVisible: true,
|
|
44607
|
+
theme: theme2,
|
|
44608
|
+
onCheckboxChange,
|
|
44609
|
+
enableHtmlPopout,
|
|
44610
|
+
enableKeyboardScrolling,
|
|
44611
|
+
onLinkClick,
|
|
44612
|
+
handleRunBashCommand,
|
|
44613
|
+
fontSizeScale,
|
|
44614
|
+
handlePromptCopy,
|
|
44615
|
+
repositoryInfo,
|
|
44616
|
+
transparentBackground
|
|
44617
|
+
})));
|
|
44618
|
+
}
|
|
44619
|
+
if (!showSegmented) {
|
|
44620
|
+
const fullContent = content2.join(`
|
|
44621
|
+
|
|
44622
|
+
---
|
|
44623
|
+
|
|
44624
|
+
`);
|
|
44625
|
+
return /* @__PURE__ */ React2__default.createElement("div", {
|
|
44626
|
+
ref: containerRef,
|
|
44627
|
+
style: {
|
|
44628
|
+
height: "100%",
|
|
44629
|
+
overflow: "auto",
|
|
44630
|
+
backgroundColor
|
|
44631
|
+
}
|
|
44632
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44633
|
+
style: {
|
|
44634
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44635
|
+
margin: "0 auto",
|
|
44636
|
+
height: "100%"
|
|
44637
|
+
}
|
|
44638
|
+
}, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44639
|
+
content: fullContent,
|
|
44640
|
+
slideIdPrefix,
|
|
44641
|
+
slideIndex: 0,
|
|
44642
|
+
isVisible: true,
|
|
44643
|
+
theme: theme2,
|
|
44644
|
+
onCheckboxChange,
|
|
44645
|
+
enableHtmlPopout,
|
|
44646
|
+
enableKeyboardScrolling,
|
|
44647
|
+
onLinkClick,
|
|
44648
|
+
handleRunBashCommand,
|
|
44649
|
+
fontSizeScale,
|
|
44650
|
+
handlePromptCopy,
|
|
44651
|
+
repositoryInfo,
|
|
44652
|
+
transparentBackground
|
|
44653
|
+
})));
|
|
44654
|
+
}
|
|
44655
|
+
return /* @__PURE__ */ React2__default.createElement("div", {
|
|
44656
|
+
ref: containerRef,
|
|
44657
|
+
style: {
|
|
44658
|
+
height: "100%",
|
|
44659
|
+
overflow: "auto",
|
|
44660
|
+
backgroundColor
|
|
44661
|
+
}
|
|
44662
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44663
|
+
style: {
|
|
44664
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44665
|
+
margin: "0 auto"
|
|
44666
|
+
}
|
|
44667
|
+
}, content2.map((slideContent, index2) => /* @__PURE__ */ React2__default.createElement("div", {
|
|
44668
|
+
key: index2,
|
|
44669
|
+
ref: (el) => {
|
|
44670
|
+
if (el)
|
|
44671
|
+
sectionRefs.current[index2] = el;
|
|
44672
|
+
},
|
|
44673
|
+
style: {
|
|
44674
|
+
marginBottom: index2 < content2.length - 1 ? "48px" : "0",
|
|
44675
|
+
scrollMarginTop: "20px"
|
|
44676
|
+
}
|
|
44677
|
+
}, showSectionHeaders && /* @__PURE__ */ React2__default.createElement("div", {
|
|
44678
|
+
onClick: () => handleSectionClick(index2),
|
|
44679
|
+
style: {
|
|
44680
|
+
display: "flex",
|
|
44681
|
+
alignItems: "center",
|
|
44682
|
+
justifyContent: "space-between",
|
|
44683
|
+
marginBottom: "16px",
|
|
44684
|
+
paddingBottom: "8px",
|
|
44685
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
44686
|
+
opacity: 0.7,
|
|
44687
|
+
cursor: "pointer",
|
|
44688
|
+
transition: "opacity 0.2s ease"
|
|
44689
|
+
},
|
|
44690
|
+
onMouseOver: (e2) => {
|
|
44691
|
+
e2.currentTarget.style.opacity = "1";
|
|
44692
|
+
},
|
|
44693
|
+
onMouseOut: (e2) => {
|
|
44694
|
+
e2.currentTarget.style.opacity = "0.7";
|
|
44695
|
+
}
|
|
44696
|
+
}, /* @__PURE__ */ React2__default.createElement("span", {
|
|
44697
|
+
style: {
|
|
44698
|
+
fontSize: "11px",
|
|
44699
|
+
fontWeight: 600,
|
|
44700
|
+
color: theme2.colors.textSecondary,
|
|
44701
|
+
textTransform: "uppercase",
|
|
44702
|
+
letterSpacing: "0.5px"
|
|
44703
|
+
}
|
|
44704
|
+
}, "Section ", index2 + 1, " of ", content2.length)), /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44705
|
+
content: slideContent,
|
|
44706
|
+
slideIdPrefix: `${slideIdPrefix}-${index2}`,
|
|
44707
|
+
slideIndex: index2,
|
|
44708
|
+
isVisible: true,
|
|
44709
|
+
theme: theme2,
|
|
44710
|
+
onCheckboxChange,
|
|
44711
|
+
enableHtmlPopout,
|
|
44712
|
+
enableKeyboardScrolling,
|
|
44713
|
+
onLinkClick,
|
|
44714
|
+
handleRunBashCommand,
|
|
44715
|
+
fontSizeScale,
|
|
44716
|
+
handlePromptCopy,
|
|
44717
|
+
repositoryInfo,
|
|
44718
|
+
transparentBackground
|
|
44719
|
+
}), showSeparators && index2 < content2.length - 1 && /* @__PURE__ */ React2__default.createElement("div", {
|
|
44720
|
+
style: {
|
|
44721
|
+
marginTop: "32px",
|
|
44722
|
+
marginBottom: "32px",
|
|
44723
|
+
height: "1px",
|
|
44724
|
+
backgroundColor: theme2.colors.border,
|
|
44725
|
+
opacity: 0.3
|
|
44726
|
+
}
|
|
44727
|
+
})))));
|
|
44728
|
+
};
|
|
44729
|
+
const GitCommitDetailPanelContent = ({
|
|
44730
|
+
events
|
|
44731
|
+
}) => {
|
|
44732
|
+
const { theme: theme2 } = useTheme();
|
|
44733
|
+
const [selectedCommit, setSelectedCommit] = useState(null);
|
|
44734
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
44735
|
+
const [error, setError] = useState(null);
|
|
44736
|
+
useEffect(() => {
|
|
44737
|
+
if (!events) return;
|
|
44738
|
+
const unsubscribers = [
|
|
44739
|
+
// Host is loading commit details
|
|
44740
|
+
events.on(
|
|
44741
|
+
"git-panels.commit-detail:loading",
|
|
44742
|
+
(event) => {
|
|
44743
|
+
setIsLoading(true);
|
|
44744
|
+
setError(null);
|
|
44745
|
+
}
|
|
44746
|
+
),
|
|
44747
|
+
// Host loaded commit details
|
|
44748
|
+
events.on(
|
|
44749
|
+
"git-panels.commit-detail:loaded",
|
|
44750
|
+
(event) => {
|
|
44751
|
+
var _a;
|
|
44752
|
+
const commit = (_a = event.payload) == null ? void 0 : _a.commit;
|
|
44753
|
+
if (commit) {
|
|
44754
|
+
setSelectedCommit(commit);
|
|
44755
|
+
setIsLoading(false);
|
|
44756
|
+
setError(null);
|
|
44757
|
+
}
|
|
44758
|
+
}
|
|
44759
|
+
),
|
|
44760
|
+
// Host encountered error
|
|
44761
|
+
events.on(
|
|
44762
|
+
"git-panels.commit-detail:error",
|
|
44763
|
+
(event) => {
|
|
44764
|
+
var _a;
|
|
44765
|
+
setError(((_a = event.payload) == null ? void 0 : _a.error) || "Failed to load commit");
|
|
44766
|
+
setIsLoading(false);
|
|
44767
|
+
}
|
|
44768
|
+
)
|
|
44769
|
+
];
|
|
44770
|
+
return () => {
|
|
44771
|
+
unsubscribers.forEach((unsub) => unsub && unsub());
|
|
44772
|
+
};
|
|
44773
|
+
}, [events]);
|
|
44774
|
+
const handleClose = () => {
|
|
44775
|
+
setSelectedCommit(null);
|
|
44776
|
+
setError(null);
|
|
44777
|
+
if (events) {
|
|
44778
|
+
events.emit({
|
|
44779
|
+
type: "git-panels.commit:deselected",
|
|
44780
|
+
source: "git-panels.commit-detail",
|
|
44781
|
+
timestamp: Date.now(),
|
|
44782
|
+
payload: {}
|
|
44783
|
+
});
|
|
44784
|
+
}
|
|
44785
|
+
};
|
|
44786
|
+
const containerStyle = {
|
|
44787
|
+
display: "flex",
|
|
44788
|
+
flexDirection: "column",
|
|
44789
|
+
height: "100%",
|
|
44790
|
+
backgroundColor: theme2.colors.background,
|
|
44791
|
+
overflow: "hidden"
|
|
44792
|
+
};
|
|
44793
|
+
if (isLoading) {
|
|
44794
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
44795
|
+
/* @__PURE__ */ jsxs(
|
|
44796
|
+
"div",
|
|
44797
|
+
{
|
|
44798
|
+
style: {
|
|
44799
|
+
flex: 1,
|
|
44800
|
+
display: "flex",
|
|
44801
|
+
flexDirection: "column",
|
|
44802
|
+
alignItems: "center",
|
|
44803
|
+
justifyContent: "center",
|
|
44804
|
+
gap: "16px",
|
|
44805
|
+
padding: "24px",
|
|
44806
|
+
textAlign: "center"
|
|
44807
|
+
},
|
|
44808
|
+
children: [
|
|
44809
|
+
/* @__PURE__ */ jsx(
|
|
44810
|
+
LoaderCircle,
|
|
44811
|
+
{
|
|
44812
|
+
size: 32,
|
|
44813
|
+
style: {
|
|
44814
|
+
color: theme2.colors.primary,
|
|
44815
|
+
animation: "spin 1s linear infinite"
|
|
44816
|
+
}
|
|
44817
|
+
}
|
|
44818
|
+
),
|
|
44819
|
+
/* @__PURE__ */ jsx(
|
|
44820
|
+
"p",
|
|
44821
|
+
{
|
|
44822
|
+
style: {
|
|
44823
|
+
margin: 0,
|
|
44824
|
+
fontFamily: theme2.fonts.body,
|
|
44825
|
+
fontSize: theme2.fontSizes[1],
|
|
44826
|
+
color: theme2.colors.textSecondary
|
|
44827
|
+
},
|
|
44828
|
+
children: "Loading commit details..."
|
|
44829
|
+
}
|
|
44830
|
+
)
|
|
44831
|
+
]
|
|
44832
|
+
}
|
|
44833
|
+
),
|
|
44834
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` })
|
|
44835
|
+
] });
|
|
44836
|
+
}
|
|
44837
|
+
if (error) {
|
|
44838
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
|
|
44839
|
+
"div",
|
|
44840
|
+
{
|
|
44841
|
+
style: {
|
|
44842
|
+
flex: 1,
|
|
44843
|
+
display: "flex",
|
|
44844
|
+
flexDirection: "column",
|
|
44845
|
+
alignItems: "center",
|
|
44846
|
+
justifyContent: "center",
|
|
44847
|
+
gap: "16px",
|
|
44848
|
+
padding: "24px",
|
|
44849
|
+
textAlign: "center"
|
|
44850
|
+
},
|
|
44851
|
+
children: [
|
|
44852
|
+
/* @__PURE__ */ jsx(X, { size: 48, style: { color: theme2.colors.error || "#ef4444" } }),
|
|
44853
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
44854
|
+
/* @__PURE__ */ jsx(
|
|
44855
|
+
"h3",
|
|
44856
|
+
{
|
|
44857
|
+
style: {
|
|
44858
|
+
margin: 0,
|
|
44859
|
+
marginBottom: "8px",
|
|
44860
|
+
fontFamily: theme2.fonts.heading,
|
|
44861
|
+
fontSize: theme2.fontSizes[3],
|
|
44862
|
+
fontWeight: 600,
|
|
44863
|
+
color: theme2.colors.text
|
|
44864
|
+
},
|
|
44865
|
+
children: "Failed to Load Commit"
|
|
44866
|
+
}
|
|
44867
|
+
),
|
|
44868
|
+
/* @__PURE__ */ jsx(
|
|
44869
|
+
"p",
|
|
44870
|
+
{
|
|
44871
|
+
style: {
|
|
44872
|
+
margin: 0,
|
|
44873
|
+
fontFamily: theme2.fonts.body,
|
|
44874
|
+
fontSize: theme2.fontSizes[1],
|
|
44875
|
+
color: theme2.colors.textSecondary
|
|
44876
|
+
},
|
|
44877
|
+
children: error
|
|
44878
|
+
}
|
|
44879
|
+
)
|
|
44880
|
+
] })
|
|
44881
|
+
]
|
|
44882
|
+
}
|
|
44883
|
+
) });
|
|
44884
|
+
}
|
|
44885
|
+
if (!selectedCommit) {
|
|
44886
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
|
|
44887
|
+
"div",
|
|
44888
|
+
{
|
|
44889
|
+
style: {
|
|
44890
|
+
flex: 1,
|
|
44891
|
+
display: "flex",
|
|
44892
|
+
flexDirection: "column",
|
|
44893
|
+
alignItems: "center",
|
|
44894
|
+
justifyContent: "center",
|
|
44895
|
+
gap: "16px",
|
|
44896
|
+
padding: "24px",
|
|
44897
|
+
textAlign: "center"
|
|
44898
|
+
},
|
|
44899
|
+
children: [
|
|
44900
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 48, style: { color: theme2.colors.textMuted } }),
|
|
44901
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
44902
|
+
/* @__PURE__ */ jsx(
|
|
44903
|
+
"h3",
|
|
44904
|
+
{
|
|
44905
|
+
style: {
|
|
44906
|
+
margin: 0,
|
|
44907
|
+
marginBottom: "8px",
|
|
44908
|
+
fontFamily: theme2.fonts.heading,
|
|
44909
|
+
fontSize: theme2.fontSizes[3],
|
|
44910
|
+
fontWeight: 600,
|
|
44911
|
+
color: theme2.colors.text
|
|
44912
|
+
},
|
|
44913
|
+
children: "No Commit Selected"
|
|
44914
|
+
}
|
|
44915
|
+
),
|
|
44916
|
+
/* @__PURE__ */ jsx(
|
|
44917
|
+
"p",
|
|
44918
|
+
{
|
|
44919
|
+
style: {
|
|
44920
|
+
margin: 0,
|
|
44921
|
+
fontFamily: theme2.fonts.body,
|
|
44922
|
+
fontSize: theme2.fontSizes[1],
|
|
44923
|
+
color: theme2.colors.textSecondary,
|
|
44924
|
+
lineHeight: 1.5
|
|
44925
|
+
},
|
|
44926
|
+
children: "Click on a commit in the history to view its details."
|
|
44927
|
+
}
|
|
44928
|
+
)
|
|
44929
|
+
] })
|
|
44930
|
+
]
|
|
44931
|
+
}
|
|
44932
|
+
) });
|
|
44933
|
+
}
|
|
44934
|
+
const shortHash = selectedCommit.hash.substring(0, 8);
|
|
44935
|
+
const [firstLine, ...restLines] = selectedCommit.message.split("\n");
|
|
44936
|
+
const messageBody = restLines.join("\n").trim();
|
|
44937
|
+
const relative = formatRelativeTime(selectedCommit.date);
|
|
44938
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
44939
|
+
/* @__PURE__ */ jsxs(
|
|
44940
|
+
"div",
|
|
44941
|
+
{
|
|
44942
|
+
style: {
|
|
44943
|
+
height: "40px",
|
|
44944
|
+
minHeight: "40px",
|
|
44945
|
+
padding: "0 12px",
|
|
44946
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
44947
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
44948
|
+
display: "flex",
|
|
44949
|
+
alignItems: "center",
|
|
44950
|
+
gap: "12px",
|
|
44951
|
+
boxSizing: "border-box"
|
|
44952
|
+
},
|
|
44953
|
+
children: [
|
|
44954
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 14, style: { color: theme2.colors.primary } }),
|
|
44955
|
+
/* @__PURE__ */ jsx(
|
|
44956
|
+
"span",
|
|
44957
|
+
{
|
|
44958
|
+
style: {
|
|
44959
|
+
fontFamily: theme2.fonts.monospace,
|
|
44960
|
+
fontSize: theme2.fontSizes[1],
|
|
44961
|
+
color: theme2.colors.primary,
|
|
44962
|
+
backgroundColor: `${theme2.colors.primary}15`,
|
|
44963
|
+
padding: "2px 8px",
|
|
44964
|
+
borderRadius: "4px"
|
|
44965
|
+
},
|
|
44966
|
+
children: shortHash
|
|
44967
|
+
}
|
|
44968
|
+
),
|
|
44969
|
+
selectedCommit.stats && /* @__PURE__ */ jsxs(
|
|
44970
|
+
"span",
|
|
44971
|
+
{
|
|
44972
|
+
style: {
|
|
44973
|
+
display: "inline-flex",
|
|
44974
|
+
alignItems: "center",
|
|
44975
|
+
gap: "8px",
|
|
44976
|
+
fontSize: theme2.fontSizes[0]
|
|
44977
|
+
},
|
|
44978
|
+
children: [
|
|
44979
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.success || "#22c55e", display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
|
|
44980
|
+
/* @__PURE__ */ jsx(Plus, { size: 12 }),
|
|
44981
|
+
selectedCommit.stats.additions
|
|
44982
|
+
] }),
|
|
44983
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.error || "#ef4444", display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
|
|
44984
|
+
/* @__PURE__ */ jsx(Minus, { size: 12 }),
|
|
44985
|
+
selectedCommit.stats.deletions
|
|
44986
|
+
] })
|
|
44987
|
+
]
|
|
44988
|
+
}
|
|
44989
|
+
),
|
|
44990
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
44991
|
+
selectedCommit.htmlUrl && /* @__PURE__ */ jsx(
|
|
44992
|
+
"a",
|
|
44993
|
+
{
|
|
44994
|
+
href: selectedCommit.htmlUrl,
|
|
44995
|
+
target: "_blank",
|
|
44996
|
+
rel: "noreferrer",
|
|
44997
|
+
title: "View on GitHub",
|
|
44998
|
+
style: {
|
|
44999
|
+
display: "inline-flex",
|
|
45000
|
+
alignItems: "center",
|
|
45001
|
+
justifyContent: "center",
|
|
45002
|
+
width: "28px",
|
|
45003
|
+
height: "28px",
|
|
45004
|
+
padding: 0,
|
|
45005
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45006
|
+
borderRadius: "6px",
|
|
45007
|
+
backgroundColor: theme2.colors.background,
|
|
45008
|
+
color: theme2.colors.textSecondary,
|
|
45009
|
+
textDecoration: "none"
|
|
45010
|
+
},
|
|
45011
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
45012
|
+
}
|
|
45013
|
+
),
|
|
45014
|
+
/* @__PURE__ */ jsx(
|
|
45015
|
+
"button",
|
|
45016
|
+
{
|
|
45017
|
+
type: "button",
|
|
45018
|
+
onClick: handleClose,
|
|
45019
|
+
title: "Close",
|
|
45020
|
+
style: {
|
|
45021
|
+
display: "inline-flex",
|
|
45022
|
+
alignItems: "center",
|
|
45023
|
+
justifyContent: "center",
|
|
45024
|
+
width: "28px",
|
|
45025
|
+
height: "28px",
|
|
45026
|
+
padding: 0,
|
|
45027
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45028
|
+
borderRadius: "6px",
|
|
45029
|
+
backgroundColor: theme2.colors.background,
|
|
45030
|
+
color: theme2.colors.textSecondary,
|
|
45031
|
+
cursor: "pointer"
|
|
45032
|
+
},
|
|
45033
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
45034
|
+
}
|
|
45035
|
+
)
|
|
45036
|
+
]
|
|
45037
|
+
}
|
|
45038
|
+
),
|
|
45039
|
+
/* @__PURE__ */ jsxs(
|
|
45040
|
+
"div",
|
|
45041
|
+
{
|
|
45042
|
+
style: {
|
|
45043
|
+
flex: 1,
|
|
45044
|
+
overflow: "auto",
|
|
45045
|
+
padding: "16px"
|
|
45046
|
+
},
|
|
45047
|
+
children: [
|
|
45048
|
+
/* @__PURE__ */ jsx(
|
|
45049
|
+
"h1",
|
|
45050
|
+
{
|
|
45051
|
+
style: {
|
|
45052
|
+
margin: 0,
|
|
45053
|
+
marginBottom: "16px",
|
|
45054
|
+
fontFamily: theme2.fonts.heading,
|
|
45055
|
+
fontSize: theme2.fontSizes[4] || 20,
|
|
45056
|
+
fontWeight: 600,
|
|
45057
|
+
color: theme2.colors.text,
|
|
45058
|
+
lineHeight: 1.3
|
|
45059
|
+
},
|
|
45060
|
+
children: firstLine
|
|
45061
|
+
}
|
|
45062
|
+
),
|
|
45063
|
+
/* @__PURE__ */ jsxs(
|
|
45064
|
+
"div",
|
|
45065
|
+
{
|
|
45066
|
+
style: {
|
|
45067
|
+
display: "flex",
|
|
45068
|
+
flexDirection: "column",
|
|
45069
|
+
gap: "8px",
|
|
45070
|
+
padding: "12px",
|
|
45071
|
+
marginBottom: "16px",
|
|
45072
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
45073
|
+
borderRadius: "8px",
|
|
45074
|
+
border: `1px solid ${theme2.colors.border}`
|
|
45075
|
+
},
|
|
45076
|
+
children: [
|
|
45077
|
+
/* @__PURE__ */ jsxs(
|
|
45078
|
+
"div",
|
|
45079
|
+
{
|
|
45080
|
+
style: {
|
|
45081
|
+
display: "flex",
|
|
45082
|
+
alignItems: "center",
|
|
45083
|
+
gap: "8px",
|
|
45084
|
+
fontSize: theme2.fontSizes[1]
|
|
45085
|
+
},
|
|
45086
|
+
children: [
|
|
45087
|
+
/* @__PURE__ */ jsx(User, { size: 14, style: { color: theme2.colors.textSecondary } }),
|
|
45088
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.text }, children: selectedCommit.author }),
|
|
45089
|
+
selectedCommit.authorEmail && /* @__PURE__ */ jsxs(
|
|
45090
|
+
"span",
|
|
45091
|
+
{
|
|
45092
|
+
style: {
|
|
45093
|
+
display: "inline-flex",
|
|
45094
|
+
alignItems: "center",
|
|
45095
|
+
gap: "4px",
|
|
45096
|
+
color: theme2.colors.textSecondary,
|
|
45097
|
+
fontSize: theme2.fontSizes[0]
|
|
45098
|
+
},
|
|
45099
|
+
children: [
|
|
45100
|
+
/* @__PURE__ */ jsx(Mail, { size: 12 }),
|
|
45101
|
+
selectedCommit.authorEmail
|
|
45102
|
+
]
|
|
45103
|
+
}
|
|
45104
|
+
)
|
|
45105
|
+
]
|
|
45106
|
+
}
|
|
45107
|
+
),
|
|
45108
|
+
/* @__PURE__ */ jsxs(
|
|
45109
|
+
"div",
|
|
45110
|
+
{
|
|
45111
|
+
style: {
|
|
45112
|
+
display: "flex",
|
|
45113
|
+
alignItems: "center",
|
|
45114
|
+
gap: "8px",
|
|
45115
|
+
fontSize: theme2.fontSizes[1]
|
|
45116
|
+
},
|
|
45117
|
+
children: [
|
|
45118
|
+
/* @__PURE__ */ jsx(Clock, { size: 14, style: { color: theme2.colors.textSecondary } }),
|
|
45119
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.text }, children: formatDate(selectedCommit.date) }),
|
|
45120
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.textSecondary }, children: [
|
|
45121
|
+
"(",
|
|
45122
|
+
relative,
|
|
45123
|
+
")"
|
|
45124
|
+
] })
|
|
45125
|
+
]
|
|
45126
|
+
}
|
|
45127
|
+
),
|
|
45128
|
+
/* @__PURE__ */ jsxs(
|
|
45129
|
+
"div",
|
|
45130
|
+
{
|
|
45131
|
+
style: {
|
|
45132
|
+
display: "flex",
|
|
45133
|
+
alignItems: "center",
|
|
45134
|
+
gap: "8px",
|
|
45135
|
+
fontSize: theme2.fontSizes[1]
|
|
45136
|
+
},
|
|
45137
|
+
children: [
|
|
45138
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 14, style: { color: theme2.colors.textSecondary } }),
|
|
45139
|
+
/* @__PURE__ */ jsx(
|
|
45140
|
+
"code",
|
|
45141
|
+
{
|
|
45142
|
+
style: {
|
|
45143
|
+
fontFamily: theme2.fonts.monospace,
|
|
45144
|
+
fontSize: theme2.fontSizes[0],
|
|
45145
|
+
color: theme2.colors.text,
|
|
45146
|
+
backgroundColor: theme2.colors.background,
|
|
45147
|
+
padding: "2px 6px",
|
|
45148
|
+
borderRadius: "4px"
|
|
45149
|
+
},
|
|
45150
|
+
children: selectedCommit.hash
|
|
45151
|
+
}
|
|
45152
|
+
)
|
|
45153
|
+
]
|
|
45154
|
+
}
|
|
45155
|
+
)
|
|
45156
|
+
]
|
|
45157
|
+
}
|
|
45158
|
+
),
|
|
45159
|
+
messageBody && /* @__PURE__ */ jsx(
|
|
45160
|
+
"div",
|
|
45161
|
+
{
|
|
45162
|
+
style: {
|
|
45163
|
+
marginBottom: "16px",
|
|
45164
|
+
padding: "16px",
|
|
45165
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
45166
|
+
borderRadius: "8px",
|
|
45167
|
+
border: `1px solid ${theme2.colors.border}`
|
|
45168
|
+
},
|
|
45169
|
+
children: /* @__PURE__ */ jsx(
|
|
45170
|
+
DocumentView,
|
|
45171
|
+
{
|
|
45172
|
+
content: messageBody,
|
|
45173
|
+
theme: theme2,
|
|
45174
|
+
maxWidth: "100%",
|
|
45175
|
+
transparentBackground: true
|
|
45176
|
+
}
|
|
45177
|
+
)
|
|
45178
|
+
}
|
|
45179
|
+
),
|
|
45180
|
+
selectedCommit.files && selectedCommit.files.length > 0 && /* @__PURE__ */ jsxs("div", { children: [
|
|
45181
|
+
/* @__PURE__ */ jsxs(
|
|
45182
|
+
"h2",
|
|
45183
|
+
{
|
|
45184
|
+
style: {
|
|
45185
|
+
margin: 0,
|
|
45186
|
+
marginBottom: "12px",
|
|
45187
|
+
fontFamily: theme2.fonts.heading,
|
|
45188
|
+
fontSize: theme2.fontSizes[2],
|
|
45189
|
+
fontWeight: 600,
|
|
45190
|
+
color: theme2.colors.text,
|
|
45191
|
+
display: "flex",
|
|
45192
|
+
alignItems: "center",
|
|
45193
|
+
gap: "8px"
|
|
45194
|
+
},
|
|
45195
|
+
children: [
|
|
45196
|
+
/* @__PURE__ */ jsx(FileText, { size: 16 }),
|
|
45197
|
+
"Files Changed (",
|
|
45198
|
+
selectedCommit.files.length,
|
|
45199
|
+
")"
|
|
45200
|
+
]
|
|
45201
|
+
}
|
|
45202
|
+
),
|
|
45203
|
+
/* @__PURE__ */ jsx(
|
|
45204
|
+
"div",
|
|
45205
|
+
{
|
|
45206
|
+
style: {
|
|
45207
|
+
display: "flex",
|
|
45208
|
+
flexDirection: "column",
|
|
45209
|
+
gap: "4px"
|
|
45210
|
+
},
|
|
45211
|
+
children: selectedCommit.files.map((file) => /* @__PURE__ */ jsx(FileChangeRow, { file, theme: theme2 }, file.filename))
|
|
45212
|
+
}
|
|
45213
|
+
)
|
|
45214
|
+
] })
|
|
45215
|
+
]
|
|
45216
|
+
}
|
|
45217
|
+
)
|
|
45218
|
+
] });
|
|
45219
|
+
};
|
|
45220
|
+
const FileChangeRow = ({ file, theme: theme2 }) => {
|
|
45221
|
+
const statusColors = {
|
|
45222
|
+
added: theme2.colors.success || "#22c55e",
|
|
45223
|
+
removed: theme2.colors.error || "#ef4444",
|
|
45224
|
+
modified: theme2.colors.warning || "#f59e0b",
|
|
45225
|
+
renamed: theme2.colors.info || "#3b82f6"
|
|
45226
|
+
};
|
|
45227
|
+
const statusColor = statusColors[file.status] || theme2.colors.textSecondary;
|
|
45228
|
+
return /* @__PURE__ */ jsxs(
|
|
45229
|
+
"div",
|
|
45230
|
+
{
|
|
45231
|
+
style: {
|
|
45232
|
+
display: "flex",
|
|
45233
|
+
alignItems: "center",
|
|
45234
|
+
gap: "8px",
|
|
45235
|
+
padding: "8px 12px",
|
|
45236
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
45237
|
+
borderRadius: "6px",
|
|
45238
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45239
|
+
fontSize: theme2.fontSizes[1]
|
|
45240
|
+
},
|
|
45241
|
+
children: [
|
|
45242
|
+
/* @__PURE__ */ jsx(
|
|
45243
|
+
"span",
|
|
45244
|
+
{
|
|
45245
|
+
style: {
|
|
45246
|
+
width: "8px",
|
|
45247
|
+
height: "8px",
|
|
45248
|
+
borderRadius: "50%",
|
|
45249
|
+
backgroundColor: statusColor,
|
|
45250
|
+
flexShrink: 0
|
|
45251
|
+
},
|
|
45252
|
+
title: file.status
|
|
45253
|
+
}
|
|
45254
|
+
),
|
|
45255
|
+
/* @__PURE__ */ jsx(
|
|
45256
|
+
"span",
|
|
45257
|
+
{
|
|
45258
|
+
style: {
|
|
45259
|
+
flex: 1,
|
|
45260
|
+
fontFamily: theme2.fonts.monospace,
|
|
45261
|
+
fontSize: theme2.fontSizes[0],
|
|
45262
|
+
color: theme2.colors.text,
|
|
45263
|
+
overflow: "hidden",
|
|
45264
|
+
textOverflow: "ellipsis",
|
|
45265
|
+
whiteSpace: "nowrap"
|
|
45266
|
+
},
|
|
45267
|
+
title: file.filename,
|
|
45268
|
+
children: file.filename
|
|
45269
|
+
}
|
|
45270
|
+
),
|
|
45271
|
+
/* @__PURE__ */ jsxs(
|
|
45272
|
+
"span",
|
|
45273
|
+
{
|
|
45274
|
+
style: {
|
|
45275
|
+
display: "inline-flex",
|
|
45276
|
+
alignItems: "center",
|
|
45277
|
+
gap: "6px",
|
|
45278
|
+
fontSize: theme2.fontSizes[0],
|
|
45279
|
+
flexShrink: 0
|
|
45280
|
+
},
|
|
45281
|
+
children: [
|
|
45282
|
+
file.additions > 0 && /* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.success || "#22c55e" }, children: [
|
|
45283
|
+
"+",
|
|
45284
|
+
file.additions
|
|
45285
|
+
] }),
|
|
45286
|
+
file.deletions > 0 && /* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.error || "#ef4444" }, children: [
|
|
45287
|
+
"-",
|
|
45288
|
+
file.deletions
|
|
45289
|
+
] })
|
|
45290
|
+
]
|
|
45291
|
+
}
|
|
45292
|
+
)
|
|
45293
|
+
]
|
|
45294
|
+
}
|
|
45295
|
+
);
|
|
45296
|
+
};
|
|
45297
|
+
const GitCommitDetailPanel = GitCommitDetailPanelContent;
|
|
45298
|
+
const GitCommitDetailPanelPreview = () => {
|
|
45299
|
+
const { theme: theme2 } = useTheme();
|
|
45300
|
+
return /* @__PURE__ */ jsxs(
|
|
45301
|
+
"div",
|
|
45302
|
+
{
|
|
45303
|
+
style: {
|
|
45304
|
+
padding: "12px",
|
|
45305
|
+
fontFamily: theme2.fonts.body,
|
|
45306
|
+
fontSize: theme2.fontSizes[0],
|
|
45307
|
+
color: theme2.colors.text,
|
|
45308
|
+
display: "flex",
|
|
45309
|
+
flexDirection: "column",
|
|
45310
|
+
gap: "8px"
|
|
45311
|
+
},
|
|
45312
|
+
children: [
|
|
45313
|
+
/* @__PURE__ */ jsxs(
|
|
45314
|
+
"div",
|
|
45315
|
+
{
|
|
45316
|
+
style: {
|
|
45317
|
+
display: "flex",
|
|
45318
|
+
alignItems: "center",
|
|
45319
|
+
gap: "8px"
|
|
45320
|
+
},
|
|
45321
|
+
children: [
|
|
45322
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 12, style: { color: theme2.colors.primary } }),
|
|
45323
|
+
/* @__PURE__ */ jsx(
|
|
45324
|
+
"span",
|
|
45325
|
+
{
|
|
45326
|
+
style: {
|
|
45327
|
+
fontFamily: theme2.fonts.monospace,
|
|
45328
|
+
fontSize: theme2.fontSizes[0],
|
|
45329
|
+
color: theme2.colors.primary
|
|
45330
|
+
},
|
|
45331
|
+
children: "a1b2c3d4"
|
|
45332
|
+
}
|
|
45333
|
+
),
|
|
45334
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.success || "#22c55e", fontSize: "10px" }, children: "+42" }),
|
|
45335
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.error || "#ef4444", fontSize: "10px" }, children: "-15" })
|
|
45336
|
+
]
|
|
45337
|
+
}
|
|
45338
|
+
),
|
|
45339
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "feat: add commit detail panel" }),
|
|
45340
|
+
/* @__PURE__ */ jsx(
|
|
45341
|
+
"div",
|
|
45342
|
+
{
|
|
45343
|
+
style: {
|
|
45344
|
+
color: theme2.colors.textSecondary,
|
|
45345
|
+
fontSize: theme2.fontSizes[0],
|
|
45346
|
+
lineHeight: 1.4
|
|
45347
|
+
},
|
|
45348
|
+
children: "View commit message, stats, and files changed."
|
|
45349
|
+
}
|
|
45350
|
+
)
|
|
45351
|
+
]
|
|
45352
|
+
}
|
|
45353
|
+
);
|
|
45354
|
+
};
|
|
45355
|
+
const GitPullRequestsPanel = ({
|
|
45356
|
+
context,
|
|
45357
|
+
events
|
|
45358
|
+
}) => {
|
|
45359
|
+
var _a;
|
|
45360
|
+
const { theme: theme2 } = useTheme();
|
|
45361
|
+
const [filter, setFilter] = useState("open");
|
|
45362
|
+
const [selectedPrId, setSelectedPrId] = useState(null);
|
|
45363
|
+
const prSlice = context.getSlice("pullRequests");
|
|
45364
|
+
const hasPRs = context.hasSlice("pullRequests");
|
|
45365
|
+
const isLoading = context.isSliceLoading("pullRequests");
|
|
45366
|
+
const pullRequests = ((_a = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _a.pullRequests) ?? [];
|
|
45367
|
+
useEffect(() => {
|
|
45368
|
+
const unsubscribers = [
|
|
45369
|
+
// Tool: refresh pull requests
|
|
45370
|
+
events.on("git-panels.pull-requests:refresh", async () => {
|
|
45371
|
+
try {
|
|
45372
|
+
await context.refresh("repository", "pullRequests");
|
|
45373
|
+
} catch (error) {
|
|
45374
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
45375
|
+
}
|
|
45376
|
+
}),
|
|
45377
|
+
// Tool: set filter
|
|
45378
|
+
events.on("git-panels.pull-requests:set-filter", (event) => {
|
|
45379
|
+
var _a2;
|
|
45380
|
+
const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
|
|
45381
|
+
if (newFilter && ["open", "closed"].includes(newFilter)) {
|
|
45382
|
+
setFilter(newFilter);
|
|
45383
|
+
}
|
|
45384
|
+
})
|
|
45385
|
+
];
|
|
45386
|
+
return () => unsubscribers.forEach((unsub) => unsub());
|
|
45387
|
+
}, [events, context]);
|
|
45388
|
+
const filteredPullRequests = useMemo(() => {
|
|
45389
|
+
return pullRequests.filter((pr) => pr.state === filter);
|
|
45390
|
+
}, [filter, pullRequests]);
|
|
45391
|
+
const counts = useMemo(() => {
|
|
45392
|
+
const open = pullRequests.filter((pr) => pr.state === "open").length;
|
|
45393
|
+
const closed = pullRequests.filter((pr) => pr.state === "closed").length;
|
|
45394
|
+
return { open, closed };
|
|
45395
|
+
}, [pullRequests]);
|
|
45396
|
+
const handleRefresh = async () => {
|
|
45397
|
+
try {
|
|
45398
|
+
await context.refresh("repository", "pullRequests");
|
|
45399
|
+
} catch (error) {
|
|
45400
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
45401
|
+
}
|
|
45402
|
+
};
|
|
45403
|
+
const handlePRClick = (pr) => {
|
|
45404
|
+
setSelectedPrId(pr.id);
|
|
45405
|
+
events.emit({
|
|
45406
|
+
type: "git-panels.pull-request:selected",
|
|
45407
|
+
source: "git-panels.pull-requests",
|
|
45408
|
+
timestamp: Date.now(),
|
|
45409
|
+
payload: { pr }
|
|
45410
|
+
});
|
|
45411
|
+
};
|
|
45412
|
+
const containerStyle = {
|
|
45413
|
+
display: "flex",
|
|
45414
|
+
flexDirection: "column",
|
|
45415
|
+
height: "100%",
|
|
45416
|
+
backgroundColor: theme2.colors.background,
|
|
45417
|
+
overflow: "hidden"
|
|
45418
|
+
};
|
|
45419
|
+
const renderState = (icon, title, description) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
45420
|
+
"div",
|
|
45421
|
+
{
|
|
45422
|
+
style: {
|
|
45423
|
+
flex: 1,
|
|
45424
|
+
display: "flex",
|
|
45425
|
+
alignItems: "center",
|
|
45426
|
+
justifyContent: "center",
|
|
45427
|
+
padding: "24px"
|
|
45428
|
+
},
|
|
45429
|
+
children: /* @__PURE__ */ jsxs(
|
|
45430
|
+
"div",
|
|
45431
|
+
{
|
|
45432
|
+
style: {
|
|
45433
|
+
display: "flex",
|
|
45434
|
+
flexDirection: "column",
|
|
45435
|
+
alignItems: "center",
|
|
45436
|
+
gap: "16px",
|
|
45437
|
+
maxWidth: "360px",
|
|
45438
|
+
textAlign: "center"
|
|
45439
|
+
},
|
|
45440
|
+
children: [
|
|
45441
|
+
/* @__PURE__ */ jsx("div", { children: icon }),
|
|
45442
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
45443
|
+
/* @__PURE__ */ jsx(
|
|
45444
|
+
"h3",
|
|
45445
|
+
{
|
|
45446
|
+
style: {
|
|
45447
|
+
margin: 0,
|
|
45448
|
+
marginBottom: "8px",
|
|
45449
|
+
color: theme2.colors.text,
|
|
45450
|
+
fontFamily: theme2.fonts.heading,
|
|
45451
|
+
fontSize: theme2.fontSizes[2],
|
|
45452
|
+
fontWeight: 600
|
|
45453
|
+
},
|
|
45454
|
+
children: title
|
|
45455
|
+
}
|
|
45456
|
+
),
|
|
45457
|
+
description && /* @__PURE__ */ jsx(
|
|
45458
|
+
"p",
|
|
45459
|
+
{
|
|
45460
|
+
style: {
|
|
45461
|
+
margin: 0,
|
|
45462
|
+
color: theme2.colors.textSecondary,
|
|
45463
|
+
fontFamily: theme2.fonts.body,
|
|
45464
|
+
fontSize: theme2.fontSizes[1],
|
|
45465
|
+
lineHeight: 1.5
|
|
45466
|
+
},
|
|
45467
|
+
children: description
|
|
45468
|
+
}
|
|
45469
|
+
)
|
|
45470
|
+
] })
|
|
45471
|
+
]
|
|
45472
|
+
}
|
|
45473
|
+
)
|
|
45474
|
+
}
|
|
45475
|
+
) });
|
|
45476
|
+
if (isLoading && pullRequests.length === 0) {
|
|
45477
|
+
return renderState(
|
|
45478
|
+
/* @__PURE__ */ jsx(LoaderCircle, { size: 32, style: { color: theme2.colors.textSecondary }, className: "spin" }),
|
|
45479
|
+
"Loading pull requests...",
|
|
45480
|
+
"Fetching pull request data for this repository."
|
|
45481
|
+
);
|
|
45482
|
+
}
|
|
45483
|
+
if (!context.currentScope.repository) {
|
|
45484
|
+
return renderState(
|
|
45485
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.textSecondary } }),
|
|
45486
|
+
"No repository selected",
|
|
45487
|
+
"Select a repository to view pull requests."
|
|
45488
|
+
);
|
|
45489
|
+
}
|
|
45490
|
+
if (!hasPRs) {
|
|
45491
|
+
return renderState(
|
|
45492
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.warning || "#f59e0b" } }),
|
|
45493
|
+
"Pull requests unavailable",
|
|
45494
|
+
"Pull request data is not available for this repository."
|
|
45495
|
+
);
|
|
45496
|
+
}
|
|
45497
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
45498
|
+
/* @__PURE__ */ jsx("style", { children: `.hide-scrollbar::-webkit-scrollbar { display: none; }` }),
|
|
45499
|
+
/* @__PURE__ */ jsxs(
|
|
45500
|
+
"div",
|
|
45501
|
+
{
|
|
45502
|
+
style: {
|
|
45503
|
+
height: "40px",
|
|
45504
|
+
minHeight: "40px",
|
|
45505
|
+
padding: "0 12px",
|
|
45506
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
45507
|
+
backgroundColor: theme2.colors.background,
|
|
45508
|
+
display: "flex",
|
|
45509
|
+
alignItems: "center",
|
|
45510
|
+
justifyContent: "space-between",
|
|
45511
|
+
boxSizing: "border-box"
|
|
45512
|
+
},
|
|
45513
|
+
children: [
|
|
45514
|
+
/* @__PURE__ */ jsxs(
|
|
45515
|
+
"div",
|
|
45516
|
+
{
|
|
45517
|
+
style: {
|
|
45518
|
+
display: "flex",
|
|
45519
|
+
alignItems: "center",
|
|
45520
|
+
gap: "8px",
|
|
45521
|
+
color: theme2.colors.textSecondary,
|
|
45522
|
+
fontFamily: theme2.fonts.heading,
|
|
45523
|
+
fontSize: theme2.fontSizes[0],
|
|
45524
|
+
fontWeight: 600,
|
|
45525
|
+
textTransform: "uppercase"
|
|
45526
|
+
},
|
|
45527
|
+
children: [
|
|
45528
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 14 }),
|
|
45529
|
+
"Pull Requests"
|
|
45530
|
+
]
|
|
45531
|
+
}
|
|
45532
|
+
),
|
|
45533
|
+
/* @__PURE__ */ jsxs(
|
|
45534
|
+
"button",
|
|
45535
|
+
{
|
|
45536
|
+
type: "button",
|
|
45537
|
+
onClick: handleRefresh,
|
|
45538
|
+
disabled: isLoading,
|
|
45539
|
+
style: {
|
|
45540
|
+
display: "inline-flex",
|
|
45541
|
+
alignItems: "center",
|
|
45542
|
+
gap: "6px",
|
|
45543
|
+
padding: "4px 10px",
|
|
45544
|
+
borderRadius: "4px",
|
|
45545
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45546
|
+
backgroundColor: theme2.colors.background,
|
|
45547
|
+
color: theme2.colors.text,
|
|
45548
|
+
cursor: isLoading ? "default" : "pointer",
|
|
45549
|
+
fontFamily: theme2.fonts.body,
|
|
45550
|
+
fontSize: theme2.fontSizes[0],
|
|
45551
|
+
fontWeight: 500,
|
|
45552
|
+
opacity: isLoading ? 0.7 : 1
|
|
45553
|
+
},
|
|
45554
|
+
children: [
|
|
45555
|
+
isLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "spin" }) : /* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
45556
|
+
isLoading ? "Refreshing..." : "Refresh"
|
|
45557
|
+
]
|
|
45558
|
+
}
|
|
45559
|
+
)
|
|
45560
|
+
]
|
|
45561
|
+
}
|
|
45562
|
+
),
|
|
45563
|
+
/* @__PURE__ */ jsx(
|
|
45564
|
+
"div",
|
|
45565
|
+
{
|
|
45566
|
+
style: {
|
|
45567
|
+
display: "flex",
|
|
45568
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
45569
|
+
},
|
|
45570
|
+
children: ["open", "closed"].map((value) => {
|
|
45571
|
+
const isActive = filter === value;
|
|
45572
|
+
const label = value === "open" ? "Open" : "Closed";
|
|
45573
|
+
return /* @__PURE__ */ jsxs(
|
|
45574
|
+
"button",
|
|
45575
|
+
{
|
|
45576
|
+
type: "button",
|
|
45577
|
+
onClick: () => setFilter(value),
|
|
45578
|
+
style: {
|
|
45579
|
+
flex: 1,
|
|
45580
|
+
display: "flex",
|
|
45581
|
+
alignItems: "center",
|
|
45582
|
+
justifyContent: "center",
|
|
45583
|
+
gap: "6px",
|
|
45584
|
+
padding: "8px 12px",
|
|
45585
|
+
border: "none",
|
|
45586
|
+
borderBottom: isActive ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
|
|
45587
|
+
backgroundColor: "transparent",
|
|
45588
|
+
color: isActive ? theme2.colors.text : theme2.colors.textSecondary,
|
|
45589
|
+
fontFamily: theme2.fonts.body,
|
|
45590
|
+
fontSize: theme2.fontSizes[1],
|
|
45591
|
+
fontWeight: isActive ? 600 : 500,
|
|
45592
|
+
cursor: "pointer",
|
|
45593
|
+
marginBottom: "-1px"
|
|
45594
|
+
},
|
|
45595
|
+
children: [
|
|
45596
|
+
label,
|
|
45597
|
+
/* @__PURE__ */ jsxs("span", { style: { opacity: 0.7 }, children: [
|
|
45598
|
+
"(",
|
|
45599
|
+
counts[value],
|
|
45600
|
+
")"
|
|
45601
|
+
] })
|
|
45602
|
+
]
|
|
45603
|
+
},
|
|
45604
|
+
value
|
|
45605
|
+
);
|
|
45606
|
+
})
|
|
45046
45607
|
}
|
|
45047
|
-
|
|
45048
|
-
|
|
45049
|
-
|
|
45050
|
-
|
|
45051
|
-
|
|
45052
|
-
|
|
45053
|
-
|
|
45054
|
-
|
|
45055
|
-
|
|
45056
|
-
|
|
45057
|
-
|
|
45058
|
-
|
|
45059
|
-
|
|
45060
|
-
|
|
45061
|
-
|
|
45062
|
-
|
|
45063
|
-
|
|
45064
|
-
|
|
45065
|
-
|
|
45066
|
-
|
|
45067
|
-
|
|
45068
|
-
|
|
45069
|
-
|
|
45070
|
-
|
|
45071
|
-
|
|
45072
|
-
|
|
45073
|
-
|
|
45074
|
-
|
|
45075
|
-
|
|
45608
|
+
),
|
|
45609
|
+
/* @__PURE__ */ jsx(
|
|
45610
|
+
"div",
|
|
45611
|
+
{
|
|
45612
|
+
style: {
|
|
45613
|
+
flex: 1,
|
|
45614
|
+
overflowY: "auto",
|
|
45615
|
+
display: "flex",
|
|
45616
|
+
flexDirection: "column",
|
|
45617
|
+
scrollbarWidth: "none",
|
|
45618
|
+
msOverflowStyle: "none"
|
|
45619
|
+
},
|
|
45620
|
+
className: "hide-scrollbar",
|
|
45621
|
+
children: filteredPullRequests.length === 0 ? /* @__PURE__ */ jsxs(
|
|
45622
|
+
"div",
|
|
45623
|
+
{
|
|
45624
|
+
style: {
|
|
45625
|
+
marginTop: "48px",
|
|
45626
|
+
textAlign: "center",
|
|
45627
|
+
color: theme2.colors.textSecondary,
|
|
45628
|
+
fontFamily: theme2.fonts.body
|
|
45629
|
+
},
|
|
45630
|
+
children: [
|
|
45631
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 32, style: { marginBottom: "12px" } }),
|
|
45632
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No pull requests found" }),
|
|
45633
|
+
/* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: [
|
|
45634
|
+
"There are no ",
|
|
45635
|
+
filter,
|
|
45636
|
+
" pull requests to display."
|
|
45637
|
+
] })
|
|
45638
|
+
]
|
|
45639
|
+
}
|
|
45640
|
+
) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme: theme2, isSelected: selectedPrId === pr.id, onClick: () => handlePRClick(pr) }, pr.id))
|
|
45076
45641
|
}
|
|
45077
|
-
|
|
45642
|
+
)
|
|
45643
|
+
] });
|
|
45644
|
+
};
|
|
45645
|
+
const PullRequestCard = ({ pr, theme: theme2, isSelected, onClick }) => {
|
|
45646
|
+
var _a;
|
|
45647
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
45648
|
+
const isActive = isHovered || isSelected;
|
|
45649
|
+
const isMerged = pr.merged_at !== null;
|
|
45650
|
+
const isOpen = pr.state === "open";
|
|
45651
|
+
const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
|
|
45652
|
+
return /* @__PURE__ */ jsxs(
|
|
45653
|
+
"div",
|
|
45654
|
+
{
|
|
45655
|
+
onClick,
|
|
45656
|
+
role: "button",
|
|
45657
|
+
tabIndex: 0,
|
|
45658
|
+
onKeyDown: (e) => {
|
|
45659
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
45660
|
+
e.preventDefault();
|
|
45661
|
+
onClick == null ? void 0 : onClick();
|
|
45662
|
+
}
|
|
45663
|
+
},
|
|
45664
|
+
onMouseEnter: () => setIsHovered(true),
|
|
45665
|
+
onMouseLeave: () => setIsHovered(false),
|
|
45078
45666
|
style: {
|
|
45079
|
-
|
|
45080
|
-
|
|
45081
|
-
|
|
45082
|
-
|
|
45083
|
-
|
|
45084
|
-
|
|
45085
|
-
|
|
45086
|
-
|
|
45087
|
-
|
|
45088
|
-
|
|
45089
|
-
|
|
45090
|
-
|
|
45091
|
-
|
|
45092
|
-
|
|
45093
|
-
|
|
45094
|
-
|
|
45095
|
-
|
|
45096
|
-
|
|
45097
|
-
|
|
45098
|
-
|
|
45099
|
-
|
|
45100
|
-
|
|
45101
|
-
|
|
45102
|
-
|
|
45103
|
-
|
|
45104
|
-
|
|
45105
|
-
|
|
45106
|
-
|
|
45107
|
-
|
|
45108
|
-
|
|
45109
|
-
|
|
45110
|
-
|
|
45111
|
-
|
|
45112
|
-
|
|
45113
|
-
|
|
45114
|
-
|
|
45115
|
-
|
|
45116
|
-
|
|
45117
|
-
|
|
45118
|
-
|
|
45119
|
-
|
|
45120
|
-
|
|
45121
|
-
|
|
45122
|
-
|
|
45123
|
-
|
|
45124
|
-
|
|
45125
|
-
|
|
45126
|
-
|
|
45127
|
-
|
|
45128
|
-
|
|
45129
|
-
|
|
45130
|
-
|
|
45131
|
-
|
|
45132
|
-
|
|
45133
|
-
|
|
45134
|
-
|
|
45135
|
-
|
|
45136
|
-
|
|
45137
|
-
|
|
45138
|
-
|
|
45139
|
-
|
|
45140
|
-
|
|
45141
|
-
|
|
45142
|
-
|
|
45143
|
-
|
|
45144
|
-
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45667
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
45668
|
+
padding: "16px 16px",
|
|
45669
|
+
backgroundColor: isActive ? theme2.colors.background : theme2.colors.backgroundSecondary,
|
|
45670
|
+
display: "flex",
|
|
45671
|
+
flexDirection: "column",
|
|
45672
|
+
gap: "8px",
|
|
45673
|
+
cursor: onClick ? "pointer" : "default",
|
|
45674
|
+
minWidth: 0,
|
|
45675
|
+
transition: "background-color 0.15s ease"
|
|
45676
|
+
},
|
|
45677
|
+
children: [
|
|
45678
|
+
/* @__PURE__ */ jsx(
|
|
45679
|
+
"div",
|
|
45680
|
+
{
|
|
45681
|
+
style: {
|
|
45682
|
+
fontFamily: theme2.fonts.heading,
|
|
45683
|
+
fontSize: theme2.fontSizes[2],
|
|
45684
|
+
fontWeight: 600,
|
|
45685
|
+
color: isActive ? theme2.colors.primary : theme2.colors.text,
|
|
45686
|
+
lineHeight: 1.3,
|
|
45687
|
+
wordBreak: "break-word",
|
|
45688
|
+
transition: "color 0.15s ease"
|
|
45689
|
+
},
|
|
45690
|
+
children: pr.title
|
|
45691
|
+
}
|
|
45692
|
+
),
|
|
45693
|
+
/* @__PURE__ */ jsxs(
|
|
45694
|
+
"div",
|
|
45695
|
+
{
|
|
45696
|
+
style: {
|
|
45697
|
+
display: "flex",
|
|
45698
|
+
alignItems: "center",
|
|
45699
|
+
gap: "8px 12px",
|
|
45700
|
+
flexWrap: "wrap",
|
|
45701
|
+
color: theme2.colors.textSecondary,
|
|
45702
|
+
fontFamily: theme2.fonts.body,
|
|
45703
|
+
fontSize: theme2.fontSizes[0]
|
|
45704
|
+
},
|
|
45705
|
+
children: [
|
|
45706
|
+
pr.draft && /* @__PURE__ */ jsx(
|
|
45707
|
+
"span",
|
|
45708
|
+
{
|
|
45709
|
+
style: {
|
|
45710
|
+
padding: "4px 10px",
|
|
45711
|
+
borderRadius: "999px",
|
|
45712
|
+
backgroundColor: theme2.colors.background,
|
|
45713
|
+
color: theme2.colors.textSecondary,
|
|
45714
|
+
fontFamily: theme2.fonts.heading,
|
|
45715
|
+
fontSize: theme2.fontSizes[0],
|
|
45716
|
+
fontWeight: 600,
|
|
45717
|
+
textTransform: "uppercase",
|
|
45718
|
+
letterSpacing: "0.02em"
|
|
45719
|
+
},
|
|
45720
|
+
children: "Draft"
|
|
45721
|
+
}
|
|
45722
|
+
),
|
|
45723
|
+
/* @__PURE__ */ jsxs(
|
|
45724
|
+
"span",
|
|
45725
|
+
{
|
|
45726
|
+
style: {
|
|
45727
|
+
fontFamily: theme2.fonts.heading,
|
|
45728
|
+
fontWeight: 600,
|
|
45729
|
+
color: theme2.colors.textSecondary
|
|
45730
|
+
},
|
|
45731
|
+
children: [
|
|
45732
|
+
"#",
|
|
45733
|
+
pr.number
|
|
45734
|
+
]
|
|
45735
|
+
}
|
|
45736
|
+
),
|
|
45737
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
45738
|
+
"by ",
|
|
45739
|
+
((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"
|
|
45740
|
+
] }),
|
|
45741
|
+
/* @__PURE__ */ jsxs(
|
|
45742
|
+
"span",
|
|
45743
|
+
{
|
|
45744
|
+
style: {
|
|
45745
|
+
display: "inline-flex",
|
|
45746
|
+
alignItems: "center",
|
|
45747
|
+
gap: "4px"
|
|
45748
|
+
},
|
|
45749
|
+
children: [
|
|
45750
|
+
/* @__PURE__ */ jsx(Calendar, { size: 12 }),
|
|
45751
|
+
" ",
|
|
45752
|
+
formatDate(pr.created_at)
|
|
45753
|
+
]
|
|
45754
|
+
}
|
|
45755
|
+
),
|
|
45756
|
+
!isOpen && /* @__PURE__ */ jsxs(
|
|
45757
|
+
"span",
|
|
45758
|
+
{
|
|
45759
|
+
style: {
|
|
45760
|
+
display: "inline-flex",
|
|
45761
|
+
alignItems: "center",
|
|
45762
|
+
gap: "4px"
|
|
45763
|
+
},
|
|
45764
|
+
children: [
|
|
45765
|
+
isMerged ? "Merged" : "Closed",
|
|
45766
|
+
" ",
|
|
45767
|
+
formatDate(pr.merged_at || pr.updated_at)
|
|
45768
|
+
]
|
|
45769
|
+
}
|
|
45770
|
+
),
|
|
45771
|
+
totalComments > 0 && /* @__PURE__ */ jsxs(
|
|
45772
|
+
"span",
|
|
45773
|
+
{
|
|
45774
|
+
style: {
|
|
45775
|
+
display: "inline-flex",
|
|
45776
|
+
alignItems: "center",
|
|
45777
|
+
gap: "4px"
|
|
45778
|
+
},
|
|
45779
|
+
children: [
|
|
45780
|
+
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
45781
|
+
" ",
|
|
45782
|
+
totalComments
|
|
45783
|
+
]
|
|
45784
|
+
}
|
|
45785
|
+
)
|
|
45786
|
+
]
|
|
45787
|
+
}
|
|
45788
|
+
)
|
|
45789
|
+
]
|
|
45148
45790
|
}
|
|
45149
|
-
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
45161
|
-
|
|
45162
|
-
|
|
45163
|
-
|
|
45164
|
-
|
|
45165
|
-
|
|
45166
|
-
|
|
45167
|
-
|
|
45168
|
-
|
|
45169
|
-
|
|
45170
|
-
|
|
45791
|
+
);
|
|
45792
|
+
};
|
|
45793
|
+
const GitPullRequestsPanelPreview = () => {
|
|
45794
|
+
const { theme: theme2 } = useTheme();
|
|
45795
|
+
return /* @__PURE__ */ jsxs(
|
|
45796
|
+
"div",
|
|
45797
|
+
{
|
|
45798
|
+
style: {
|
|
45799
|
+
padding: "12px",
|
|
45800
|
+
fontFamily: theme2.fonts.body,
|
|
45801
|
+
fontSize: theme2.fontSizes[0],
|
|
45802
|
+
color: theme2.colors.text,
|
|
45803
|
+
display: "flex",
|
|
45804
|
+
flexDirection: "column",
|
|
45805
|
+
gap: "8px"
|
|
45806
|
+
},
|
|
45807
|
+
children: [
|
|
45808
|
+
/* @__PURE__ */ jsxs(
|
|
45809
|
+
"div",
|
|
45810
|
+
{
|
|
45811
|
+
style: {
|
|
45812
|
+
display: "flex",
|
|
45813
|
+
alignItems: "center",
|
|
45814
|
+
gap: "8px"
|
|
45815
|
+
},
|
|
45816
|
+
children: [
|
|
45817
|
+
/* @__PURE__ */ jsx(
|
|
45818
|
+
"span",
|
|
45819
|
+
{
|
|
45820
|
+
style: {
|
|
45821
|
+
display: "inline-flex",
|
|
45822
|
+
alignItems: "center",
|
|
45823
|
+
gap: "6px",
|
|
45824
|
+
padding: "2px 8px",
|
|
45825
|
+
borderRadius: "999px",
|
|
45826
|
+
backgroundColor: "#3b82f622",
|
|
45827
|
+
color: "#3b82f6",
|
|
45828
|
+
fontFamily: theme2.fonts.heading,
|
|
45829
|
+
fontSize: theme2.fontSizes[0],
|
|
45830
|
+
fontWeight: 600,
|
|
45831
|
+
textTransform: "uppercase"
|
|
45832
|
+
},
|
|
45833
|
+
children: "Review"
|
|
45834
|
+
}
|
|
45835
|
+
),
|
|
45836
|
+
/* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "#42 Refine panel layout system" })
|
|
45837
|
+
]
|
|
45838
|
+
}
|
|
45839
|
+
),
|
|
45840
|
+
/* @__PURE__ */ jsx(
|
|
45841
|
+
"div",
|
|
45842
|
+
{
|
|
45843
|
+
style: {
|
|
45844
|
+
paddingLeft: "4px",
|
|
45845
|
+
color: theme2.colors.textSecondary,
|
|
45846
|
+
fontSize: theme2.fontSizes[0],
|
|
45847
|
+
lineHeight: 1.4
|
|
45848
|
+
},
|
|
45849
|
+
children: "Adds preview registry and consolidates configurator metadata."
|
|
45850
|
+
}
|
|
45851
|
+
),
|
|
45852
|
+
/* @__PURE__ */ jsxs(
|
|
45853
|
+
"div",
|
|
45854
|
+
{
|
|
45855
|
+
style: {
|
|
45856
|
+
display: "flex",
|
|
45857
|
+
alignItems: "center",
|
|
45858
|
+
gap: "8px",
|
|
45859
|
+
color: theme2.colors.textSecondary,
|
|
45860
|
+
fontSize: theme2.fontSizes[0]
|
|
45861
|
+
},
|
|
45862
|
+
children: [
|
|
45863
|
+
/* @__PURE__ */ jsx("span", { children: "4 checks" }),
|
|
45864
|
+
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
45865
|
+
/* @__PURE__ */ jsx("span", { children: "1 reviewer" })
|
|
45866
|
+
]
|
|
45867
|
+
}
|
|
45868
|
+
)
|
|
45869
|
+
]
|
|
45171
45870
|
}
|
|
45172
|
-
|
|
45871
|
+
);
|
|
45173
45872
|
};
|
|
45174
45873
|
const GitPullRequestDetailPanelContent = ({
|
|
45175
45874
|
events
|
|
@@ -45731,10 +46430,66 @@ const pullRequestDetailToolsMetadata = {
|
|
|
45731
46430
|
description: "Tools for the pull request detail panel",
|
|
45732
46431
|
tools: pullRequestDetailTools
|
|
45733
46432
|
};
|
|
46433
|
+
const selectCommitTool = {
|
|
46434
|
+
name: "select_commit",
|
|
46435
|
+
description: "Selects a commit to display in the detail panel (triggers host to fetch full details)",
|
|
46436
|
+
inputs: {
|
|
46437
|
+
type: "object",
|
|
46438
|
+
properties: {
|
|
46439
|
+
hash: {
|
|
46440
|
+
type: "string",
|
|
46441
|
+
description: "The commit hash to select"
|
|
46442
|
+
}
|
|
46443
|
+
},
|
|
46444
|
+
required: ["hash"]
|
|
46445
|
+
},
|
|
46446
|
+
outputs: {
|
|
46447
|
+
type: "object",
|
|
46448
|
+
properties: {
|
|
46449
|
+
success: { type: "boolean" },
|
|
46450
|
+
message: { type: "string" }
|
|
46451
|
+
}
|
|
46452
|
+
},
|
|
46453
|
+
tags: ["git", "commits", "detail", "select"],
|
|
46454
|
+
tool_call_template: {
|
|
46455
|
+
call_template_type: "panel_event",
|
|
46456
|
+
event_type: "git-panels.commit:selected"
|
|
46457
|
+
}
|
|
46458
|
+
};
|
|
46459
|
+
const deselectCommitTool = {
|
|
46460
|
+
name: "deselect_commit",
|
|
46461
|
+
description: "Clears the current commit selection",
|
|
46462
|
+
inputs: {
|
|
46463
|
+
type: "object",
|
|
46464
|
+
properties: {}
|
|
46465
|
+
},
|
|
46466
|
+
outputs: {
|
|
46467
|
+
type: "object",
|
|
46468
|
+
properties: {
|
|
46469
|
+
success: { type: "boolean" }
|
|
46470
|
+
}
|
|
46471
|
+
},
|
|
46472
|
+
tags: ["git", "commits", "detail", "deselect"],
|
|
46473
|
+
tool_call_template: {
|
|
46474
|
+
call_template_type: "panel_event",
|
|
46475
|
+
event_type: "git-panels.commit:deselected"
|
|
46476
|
+
}
|
|
46477
|
+
};
|
|
46478
|
+
const commitDetailTools = [
|
|
46479
|
+
selectCommitTool,
|
|
46480
|
+
deselectCommitTool
|
|
46481
|
+
];
|
|
46482
|
+
const commitDetailToolsMetadata = {
|
|
46483
|
+
id: "git-panels.commit-detail",
|
|
46484
|
+
name: "Commit Details",
|
|
46485
|
+
description: "Tools for the commit detail panel",
|
|
46486
|
+
tools: commitDetailTools
|
|
46487
|
+
};
|
|
45734
46488
|
const allGitPanelTools = [
|
|
45735
46489
|
...commitHistoryTools,
|
|
45736
46490
|
...pullRequestsTools,
|
|
45737
|
-
...pullRequestDetailTools
|
|
46491
|
+
...pullRequestDetailTools,
|
|
46492
|
+
...commitDetailTools
|
|
45738
46493
|
];
|
|
45739
46494
|
const panels = [
|
|
45740
46495
|
{
|
|
@@ -45755,6 +46510,20 @@ const panels = [
|
|
|
45755
46510
|
}
|
|
45756
46511
|
}
|
|
45757
46512
|
},
|
|
46513
|
+
{
|
|
46514
|
+
metadata: {
|
|
46515
|
+
id: "git-panels.commit-detail",
|
|
46516
|
+
name: "Commit Details",
|
|
46517
|
+
icon: "git-commit",
|
|
46518
|
+
version: "0.1.0",
|
|
46519
|
+
author: "Principal ADE",
|
|
46520
|
+
description: "View detailed commit information with files changed",
|
|
46521
|
+
slices: [],
|
|
46522
|
+
// No slices - receives data via events from host
|
|
46523
|
+
tools: commitDetailTools
|
|
46524
|
+
},
|
|
46525
|
+
component: GitCommitDetailPanel
|
|
46526
|
+
},
|
|
45758
46527
|
{
|
|
45759
46528
|
metadata: {
|
|
45760
46529
|
id: "git-panels.pull-requests",
|
|
@@ -45795,6 +46564,8 @@ const onPackageUnload = async () => {
|
|
|
45795
46564
|
console.log("[git-panels] Package unloading");
|
|
45796
46565
|
};
|
|
45797
46566
|
export {
|
|
46567
|
+
GitCommitDetailPanel,
|
|
46568
|
+
GitCommitDetailPanelPreview,
|
|
45798
46569
|
GitCommitHistoryPanel,
|
|
45799
46570
|
GitCommitHistoryPanelPreview,
|
|
45800
46571
|
GitPullRequestDetailPanel,
|
|
@@ -45802,8 +46573,11 @@ export {
|
|
|
45802
46573
|
GitPullRequestsPanel,
|
|
45803
46574
|
GitPullRequestsPanelPreview,
|
|
45804
46575
|
allGitPanelTools,
|
|
46576
|
+
commitDetailTools,
|
|
46577
|
+
commitDetailToolsMetadata,
|
|
45805
46578
|
commitHistoryTools,
|
|
45806
46579
|
commitHistoryToolsMetadata,
|
|
46580
|
+
deselectCommitTool,
|
|
45807
46581
|
deselectPullRequestTool,
|
|
45808
46582
|
onPackageLoad,
|
|
45809
46583
|
onPackageUnload,
|
|
@@ -45814,6 +46588,7 @@ export {
|
|
|
45814
46588
|
pullRequestsToolsMetadata,
|
|
45815
46589
|
refreshCommitsTool,
|
|
45816
46590
|
refreshPullRequestsTool,
|
|
46591
|
+
selectCommitTool,
|
|
45817
46592
|
selectPullRequestTool,
|
|
45818
46593
|
setCommitLimitTool,
|
|
45819
46594
|
setPRFilterTool
|