@industry-theme/git-panels 0.1.11 → 0.1.13
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/GitCommitDetailPanel.stories.d.ts +42 -0
- package/dist/panels/GitCommitDetailPanel.stories.d.ts.map +1 -0
- package/dist/panels/GitCommitHistoryPanel.d.ts.map +1 -1
- package/dist/panels.bundle.js +1931 -1355
- 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/dist/utils/formatters.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/panels.bundle.js
CHANGED
|
@@ -107,70 +107,59 @@ 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$j = [
|
|
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$j);
|
|
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$i = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
124
|
+
const Check = createLucideIcon("check", __iconNode$i);
|
|
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$h = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
132
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$h);
|
|
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$g = [
|
|
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$
|
|
145
|
-
/**
|
|
146
|
-
* @license lucide-react v0.552.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/
|
|
151
|
-
const __iconNode$d = [
|
|
152
|
-
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
153
|
-
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
154
|
-
];
|
|
155
|
-
const Clock = createLucideIcon("clock", __iconNode$d);
|
|
144
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$g);
|
|
156
145
|
/**
|
|
157
146
|
* @license lucide-react v0.552.0 - ISC
|
|
158
147
|
*
|
|
159
148
|
* This source code is licensed under the ISC license.
|
|
160
149
|
* See the LICENSE file in the root directory of this source tree.
|
|
161
150
|
*/
|
|
162
|
-
const __iconNode$
|
|
151
|
+
const __iconNode$f = [
|
|
163
152
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
164
153
|
["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
154
|
];
|
|
166
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
155
|
+
const Copy = createLucideIcon("copy", __iconNode$f);
|
|
167
156
|
/**
|
|
168
157
|
* @license lucide-react v0.552.0 - ISC
|
|
169
158
|
*
|
|
170
159
|
* This source code is licensed under the ISC license.
|
|
171
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
172
161
|
*/
|
|
173
|
-
const __iconNode$
|
|
162
|
+
const __iconNode$e = [
|
|
174
163
|
["path", { d: "m15 15 6 6", key: "1s409w" }],
|
|
175
164
|
["path", { d: "m15 9 6-6", key: "ko1vev" }],
|
|
176
165
|
["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
|
|
@@ -180,26 +169,26 @@ const __iconNode$b = [
|
|
|
180
169
|
["path", { d: "M3 8V3h5", key: "1ln10m" }],
|
|
181
170
|
["path", { d: "M9 9 3 3", key: "v551iv" }]
|
|
182
171
|
];
|
|
183
|
-
const Expand = createLucideIcon("expand", __iconNode$
|
|
172
|
+
const Expand = createLucideIcon("expand", __iconNode$e);
|
|
184
173
|
/**
|
|
185
174
|
* @license lucide-react v0.552.0 - ISC
|
|
186
175
|
*
|
|
187
176
|
* This source code is licensed under the ISC license.
|
|
188
177
|
* See the LICENSE file in the root directory of this source tree.
|
|
189
178
|
*/
|
|
190
|
-
const __iconNode$
|
|
179
|
+
const __iconNode$d = [
|
|
191
180
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
192
181
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
193
182
|
["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
183
|
];
|
|
195
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
184
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$d);
|
|
196
185
|
/**
|
|
197
186
|
* @license lucide-react v0.552.0 - ISC
|
|
198
187
|
*
|
|
199
188
|
* This source code is licensed under the ISC license.
|
|
200
189
|
* See the LICENSE file in the root directory of this source tree.
|
|
201
190
|
*/
|
|
202
|
-
const __iconNode$
|
|
191
|
+
const __iconNode$c = [
|
|
203
192
|
[
|
|
204
193
|
"path",
|
|
205
194
|
{
|
|
@@ -212,47 +201,59 @@ const __iconNode$9 = [
|
|
|
212
201
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
213
202
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
214
203
|
];
|
|
215
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
204
|
+
const FileText = createLucideIcon("file-text", __iconNode$c);
|
|
216
205
|
/**
|
|
217
206
|
* @license lucide-react v0.552.0 - ISC
|
|
218
207
|
*
|
|
219
208
|
* This source code is licensed under the ISC license.
|
|
220
209
|
* See the LICENSE file in the root directory of this source tree.
|
|
221
210
|
*/
|
|
222
|
-
const __iconNode$
|
|
211
|
+
const __iconNode$b = [
|
|
212
|
+
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }],
|
|
213
|
+
["line", { x1: "3", x2: "9", y1: "12", y2: "12", key: "1dyftd" }],
|
|
214
|
+
["line", { x1: "15", x2: "21", y1: "12", y2: "12", key: "oup4p8" }]
|
|
215
|
+
];
|
|
216
|
+
const GitCommitHorizontal = createLucideIcon("git-commit-horizontal", __iconNode$b);
|
|
217
|
+
/**
|
|
218
|
+
* @license lucide-react v0.552.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/
|
|
223
|
+
const __iconNode$a = [
|
|
223
224
|
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
|
|
224
225
|
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
225
226
|
["path", { d: "M13 6h3a2 2 0 0 1 2 2v7", key: "1yeb86" }],
|
|
226
227
|
["line", { x1: "6", x2: "6", y1: "9", y2: "21", key: "rroup" }]
|
|
227
228
|
];
|
|
228
|
-
const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$
|
|
229
|
+
const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$a);
|
|
229
230
|
/**
|
|
230
231
|
* @license lucide-react v0.552.0 - ISC
|
|
231
232
|
*
|
|
232
233
|
* This source code is licensed under the ISC license.
|
|
233
234
|
* See the LICENSE file in the root directory of this source tree.
|
|
234
235
|
*/
|
|
235
|
-
const __iconNode$
|
|
236
|
+
const __iconNode$9 = [
|
|
236
237
|
["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
238
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
238
239
|
["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
|
|
239
240
|
];
|
|
240
|
-
const History = createLucideIcon("history", __iconNode$
|
|
241
|
+
const History = createLucideIcon("history", __iconNode$9);
|
|
241
242
|
/**
|
|
242
243
|
* @license lucide-react v0.552.0 - ISC
|
|
243
244
|
*
|
|
244
245
|
* This source code is licensed under the ISC license.
|
|
245
246
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
247
|
*/
|
|
247
|
-
const __iconNode$
|
|
248
|
-
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$
|
|
248
|
+
const __iconNode$8 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
249
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$8);
|
|
249
250
|
/**
|
|
250
251
|
* @license lucide-react v0.552.0 - ISC
|
|
251
252
|
*
|
|
252
253
|
* This source code is licensed under the ISC license.
|
|
253
254
|
* See the LICENSE file in the root directory of this source tree.
|
|
254
255
|
*/
|
|
255
|
-
const __iconNode$
|
|
256
|
+
const __iconNode$7 = [
|
|
256
257
|
[
|
|
257
258
|
"path",
|
|
258
259
|
{
|
|
@@ -261,37 +262,45 @@ const __iconNode$5 = [
|
|
|
261
262
|
}
|
|
262
263
|
]
|
|
263
264
|
];
|
|
264
|
-
const MessageSquare = createLucideIcon("message-square", __iconNode$
|
|
265
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$7);
|
|
265
266
|
/**
|
|
266
267
|
* @license lucide-react v0.552.0 - ISC
|
|
267
268
|
*
|
|
268
269
|
* This source code is licensed under the ISC license.
|
|
269
270
|
* See the LICENSE file in the root directory of this source tree.
|
|
270
271
|
*/
|
|
271
|
-
const __iconNode$
|
|
272
|
+
const __iconNode$6 = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
273
|
+
const Minus = createLucideIcon("minus", __iconNode$6);
|
|
274
|
+
/**
|
|
275
|
+
* @license lucide-react v0.552.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/
|
|
280
|
+
const __iconNode$5 = [
|
|
272
281
|
["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
|
|
273
282
|
["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
|
|
274
283
|
["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
|
|
275
284
|
];
|
|
276
|
-
const Monitor = createLucideIcon("monitor", __iconNode$
|
|
285
|
+
const Monitor = createLucideIcon("monitor", __iconNode$5);
|
|
277
286
|
/**
|
|
278
287
|
* @license lucide-react v0.552.0 - ISC
|
|
279
288
|
*
|
|
280
289
|
* This source code is licensed under the ISC license.
|
|
281
290
|
* See the LICENSE file in the root directory of this source tree.
|
|
282
291
|
*/
|
|
283
|
-
const __iconNode$
|
|
292
|
+
const __iconNode$4 = [
|
|
284
293
|
["path", { d: "M18 8L22 12L18 16", key: "1r0oui" }],
|
|
285
294
|
["path", { d: "M2 12H22", key: "1m8cig" }]
|
|
286
295
|
];
|
|
287
|
-
const MoveRight = createLucideIcon("move-right", __iconNode$
|
|
296
|
+
const MoveRight = createLucideIcon("move-right", __iconNode$4);
|
|
288
297
|
/**
|
|
289
298
|
* @license lucide-react v0.552.0 - ISC
|
|
290
299
|
*
|
|
291
300
|
* This source code is licensed under the ISC license.
|
|
292
301
|
* See the LICENSE file in the root directory of this source tree.
|
|
293
302
|
*/
|
|
294
|
-
const __iconNode$
|
|
303
|
+
const __iconNode$3 = [
|
|
295
304
|
[
|
|
296
305
|
"path",
|
|
297
306
|
{
|
|
@@ -300,7 +309,18 @@ const __iconNode$2 = [
|
|
|
300
309
|
}
|
|
301
310
|
]
|
|
302
311
|
];
|
|
303
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
312
|
+
const Play = createLucideIcon("play", __iconNode$3);
|
|
313
|
+
/**
|
|
314
|
+
* @license lucide-react v0.552.0 - ISC
|
|
315
|
+
*
|
|
316
|
+
* This source code is licensed under the ISC license.
|
|
317
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
318
|
+
*/
|
|
319
|
+
const __iconNode$2 = [
|
|
320
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
321
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
322
|
+
];
|
|
323
|
+
const Plus = createLucideIcon("plus", __iconNode$2);
|
|
304
324
|
/**
|
|
305
325
|
* @license lucide-react v0.552.0 - ISC
|
|
306
326
|
*
|
|
@@ -362,7 +382,8 @@ function formatRelativeTime(dateStr) {
|
|
|
362
382
|
const hours = Math.floor(minutes / 60);
|
|
363
383
|
if (hours < 24) return `${hours} hour${hours === 1 ? "" : "s"} ago`;
|
|
364
384
|
const days = Math.floor(hours / 24);
|
|
365
|
-
if (days
|
|
385
|
+
if (days === 1) return "Yesterday";
|
|
386
|
+
if (days < 30) return `${days} days ago`;
|
|
366
387
|
const months = Math.floor(days / 30);
|
|
367
388
|
if (months < 12) return `${months} month${months === 1 ? "" : "s"} ago`;
|
|
368
389
|
const years = Math.floor(months / 12);
|
|
@@ -391,6 +412,7 @@ const GitCommitHistoryPanel = ({
|
|
|
391
412
|
var _a;
|
|
392
413
|
const { theme: theme2 } = useTheme();
|
|
393
414
|
const [limit, setLimit] = useState(25);
|
|
415
|
+
const [selectedHash, setSelectedHash] = useState(null);
|
|
394
416
|
const commitsSlice = context.getSlice("commits");
|
|
395
417
|
const hasCommits = context.hasSlice("commits");
|
|
396
418
|
const isLoading = context.isSliceLoading("commits");
|
|
@@ -434,7 +456,7 @@ const GitCommitHistoryPanel = ({
|
|
|
434
456
|
display: "flex",
|
|
435
457
|
flexDirection: "column",
|
|
436
458
|
height: "100%",
|
|
437
|
-
backgroundColor: theme2.colors.
|
|
459
|
+
backgroundColor: theme2.colors.background,
|
|
438
460
|
overflow: "hidden"
|
|
439
461
|
};
|
|
440
462
|
const renderState = (message) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
@@ -458,6 +480,7 @@ const GitCommitHistoryPanel = ({
|
|
|
458
480
|
return renderState("Commit history data is not available.");
|
|
459
481
|
}
|
|
460
482
|
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
483
|
+
/* @__PURE__ */ jsx("style", { children: `.hide-scrollbar::-webkit-scrollbar { display: none; }` }),
|
|
461
484
|
/* @__PURE__ */ jsxs(
|
|
462
485
|
"div",
|
|
463
486
|
{
|
|
@@ -466,20 +489,32 @@ const GitCommitHistoryPanel = ({
|
|
|
466
489
|
minHeight: "40px",
|
|
467
490
|
padding: "0 12px",
|
|
468
491
|
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
492
|
+
backgroundColor: theme2.colors.background,
|
|
469
493
|
display: "flex",
|
|
470
494
|
alignItems: "center",
|
|
471
495
|
justifyContent: "space-between",
|
|
472
|
-
color: theme2.colors.textSecondary,
|
|
473
|
-
textTransform: "uppercase",
|
|
474
|
-
fontWeight: 600,
|
|
475
|
-
fontSize: theme2.fontSizes[1],
|
|
476
496
|
boxSizing: "border-box"
|
|
477
497
|
},
|
|
478
498
|
children: [
|
|
479
|
-
/* @__PURE__ */ jsxs(
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
499
|
+
/* @__PURE__ */ jsxs(
|
|
500
|
+
"div",
|
|
501
|
+
{
|
|
502
|
+
style: {
|
|
503
|
+
display: "flex",
|
|
504
|
+
alignItems: "center",
|
|
505
|
+
gap: "8px",
|
|
506
|
+
color: theme2.colors.textSecondary,
|
|
507
|
+
fontFamily: theme2.fonts.heading,
|
|
508
|
+
fontSize: theme2.fontSizes[0],
|
|
509
|
+
fontWeight: 600,
|
|
510
|
+
textTransform: "uppercase"
|
|
511
|
+
},
|
|
512
|
+
children: [
|
|
513
|
+
/* @__PURE__ */ jsx(History, { size: 14 }),
|
|
514
|
+
"Commit History"
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
),
|
|
483
518
|
/* @__PURE__ */ jsxs(
|
|
484
519
|
"button",
|
|
485
520
|
{
|
|
@@ -496,7 +531,8 @@ const GitCommitHistoryPanel = ({
|
|
|
496
531
|
backgroundColor: theme2.colors.background,
|
|
497
532
|
color: theme2.colors.text,
|
|
498
533
|
cursor: isLoading ? "default" : "pointer",
|
|
499
|
-
|
|
534
|
+
fontFamily: theme2.fonts.body,
|
|
535
|
+
fontSize: theme2.fontSizes[0],
|
|
500
536
|
fontWeight: 500,
|
|
501
537
|
opacity: isLoading ? 0.7 : 1
|
|
502
538
|
},
|
|
@@ -515,11 +551,12 @@ const GitCommitHistoryPanel = ({
|
|
|
515
551
|
style: {
|
|
516
552
|
flex: 1,
|
|
517
553
|
overflowY: "auto",
|
|
518
|
-
padding: "16px",
|
|
519
554
|
display: "flex",
|
|
520
555
|
flexDirection: "column",
|
|
521
|
-
|
|
556
|
+
scrollbarWidth: "none",
|
|
557
|
+
msOverflowStyle: "none"
|
|
522
558
|
},
|
|
559
|
+
className: "hide-scrollbar",
|
|
523
560
|
children: [
|
|
524
561
|
isLoading && commits.length === 0 && /* @__PURE__ */ jsx(
|
|
525
562
|
"div",
|
|
@@ -536,51 +573,87 @@ const GitCommitHistoryPanel = ({
|
|
|
536
573
|
children: "Loading commit history..."
|
|
537
574
|
}
|
|
538
575
|
),
|
|
539
|
-
!isLoading && sortedCommits.length === 0 && /* @__PURE__ */
|
|
576
|
+
!isLoading && sortedCommits.length === 0 && /* @__PURE__ */ jsxs(
|
|
540
577
|
"div",
|
|
541
578
|
{
|
|
542
579
|
style: {
|
|
543
|
-
|
|
544
|
-
display: "flex",
|
|
545
|
-
alignItems: "center",
|
|
546
|
-
justifyContent: "center",
|
|
580
|
+
marginTop: "48px",
|
|
547
581
|
textAlign: "center",
|
|
548
582
|
color: theme2.colors.textSecondary,
|
|
549
|
-
|
|
583
|
+
fontFamily: theme2.fonts.body
|
|
550
584
|
},
|
|
551
|
-
children:
|
|
585
|
+
children: [
|
|
586
|
+
/* @__PURE__ */ jsx(History, { size: 32, style: { marginBottom: "12px" } }),
|
|
587
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No commits found" }),
|
|
588
|
+
/* @__PURE__ */ jsx("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: "There are no commits to display." })
|
|
589
|
+
]
|
|
552
590
|
}
|
|
553
591
|
),
|
|
554
|
-
sortedCommits.map((commit) => /* @__PURE__ */ jsx(
|
|
592
|
+
sortedCommits.map((commit) => /* @__PURE__ */ jsx(
|
|
593
|
+
CommitCard,
|
|
594
|
+
{
|
|
595
|
+
commit,
|
|
596
|
+
theme: theme2,
|
|
597
|
+
isSelected: selectedHash === commit.hash,
|
|
598
|
+
onClick: () => {
|
|
599
|
+
setSelectedHash(commit.hash);
|
|
600
|
+
events.emit({
|
|
601
|
+
type: "git-panels.commit:selected",
|
|
602
|
+
source: "git-panels.commit-history",
|
|
603
|
+
timestamp: Date.now(),
|
|
604
|
+
payload: { hash: commit.hash }
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
commit.hash
|
|
609
|
+
))
|
|
555
610
|
]
|
|
556
611
|
}
|
|
557
612
|
)
|
|
558
613
|
] });
|
|
559
614
|
};
|
|
560
|
-
const CommitCard = ({ commit, theme: theme2 }) => {
|
|
615
|
+
const CommitCard = ({ commit, theme: theme2, isSelected, onClick }) => {
|
|
616
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
617
|
+
const isActive = isHovered || isSelected;
|
|
561
618
|
const firstLine = commit.message.split("\n")[0];
|
|
562
619
|
const relative = formatRelativeTime(commit.date);
|
|
563
620
|
return /* @__PURE__ */ jsxs(
|
|
564
621
|
"div",
|
|
565
622
|
{
|
|
623
|
+
onClick,
|
|
624
|
+
role: "button",
|
|
625
|
+
tabIndex: 0,
|
|
626
|
+
onKeyDown: (e) => {
|
|
627
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
628
|
+
e.preventDefault();
|
|
629
|
+
onClick == null ? void 0 : onClick();
|
|
630
|
+
}
|
|
631
|
+
},
|
|
632
|
+
onMouseEnter: () => setIsHovered(true),
|
|
633
|
+
onMouseLeave: () => setIsHovered(false),
|
|
566
634
|
style: {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
635
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
636
|
+
padding: "16px",
|
|
637
|
+
backgroundColor: isActive ? theme2.colors.background : theme2.colors.backgroundSecondary,
|
|
571
638
|
display: "flex",
|
|
572
639
|
flexDirection: "column",
|
|
573
|
-
gap: "
|
|
640
|
+
gap: "8px",
|
|
641
|
+
cursor: onClick ? "pointer" : "default",
|
|
642
|
+
minWidth: 0,
|
|
643
|
+
transition: "background-color 0.15s ease"
|
|
574
644
|
},
|
|
575
645
|
children: [
|
|
576
646
|
/* @__PURE__ */ jsx(
|
|
577
647
|
"div",
|
|
578
648
|
{
|
|
579
649
|
style: {
|
|
650
|
+
fontFamily: theme2.fonts.heading,
|
|
580
651
|
fontSize: theme2.fontSizes[2],
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
lineHeight: 1.
|
|
652
|
+
fontWeight: 600,
|
|
653
|
+
color: isActive ? theme2.colors.primary : theme2.colors.text,
|
|
654
|
+
lineHeight: 1.3,
|
|
655
|
+
wordBreak: "break-word",
|
|
656
|
+
transition: "color 0.15s ease"
|
|
584
657
|
},
|
|
585
658
|
children: firstLine
|
|
586
659
|
}
|
|
@@ -590,40 +663,18 @@ const CommitCard = ({ commit, theme: theme2 }) => {
|
|
|
590
663
|
{
|
|
591
664
|
style: {
|
|
592
665
|
display: "flex",
|
|
593
|
-
flexWrap: "wrap",
|
|
594
|
-
gap: "8px",
|
|
595
666
|
alignItems: "center",
|
|
596
|
-
|
|
597
|
-
color: theme2.colors.textSecondary
|
|
667
|
+
gap: "4px",
|
|
668
|
+
color: theme2.colors.textSecondary,
|
|
669
|
+
fontFamily: theme2.fonts.body,
|
|
670
|
+
fontSize: theme2.fontSizes[0]
|
|
598
671
|
},
|
|
599
672
|
children: [
|
|
600
|
-
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
style: {
|
|
606
|
-
fontFamily: theme2.fonts.monospace,
|
|
607
|
-
fontSize: "11px"
|
|
608
|
-
},
|
|
609
|
-
children: commit.hash.substring(0, 8)
|
|
610
|
-
}
|
|
611
|
-
),
|
|
612
|
-
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: "•" }),
|
|
613
|
-
/* @__PURE__ */ jsxs(
|
|
614
|
-
"span",
|
|
615
|
-
{
|
|
616
|
-
style: {
|
|
617
|
-
display: "inline-flex",
|
|
618
|
-
alignItems: "center",
|
|
619
|
-
gap: "4px"
|
|
620
|
-
},
|
|
621
|
-
children: [
|
|
622
|
-
/* @__PURE__ */ jsx(Clock, { size: 12 }),
|
|
623
|
-
/* @__PURE__ */ jsx("span", { title: new Date(commit.date).toLocaleString(), children: relative })
|
|
624
|
-
]
|
|
625
|
-
}
|
|
626
|
-
)
|
|
673
|
+
/* @__PURE__ */ jsx("span", { title: new Date(commit.date).toLocaleString(), children: relative }),
|
|
674
|
+
commit.author && /* @__PURE__ */ jsxs("span", { children: [
|
|
675
|
+
"by ",
|
|
676
|
+
commit.author
|
|
677
|
+
] })
|
|
627
678
|
]
|
|
628
679
|
}
|
|
629
680
|
)
|
|
@@ -698,753 +749,235 @@ const GitCommitHistoryPanelPreview = () => {
|
|
|
698
749
|
}
|
|
699
750
|
);
|
|
700
751
|
};
|
|
701
|
-
const
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
events.on("git-panels.pull-requests:refresh", async () => {
|
|
717
|
-
try {
|
|
718
|
-
await context.refresh("repository", "pullRequests");
|
|
719
|
-
} catch (error) {
|
|
720
|
-
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
721
|
-
}
|
|
722
|
-
}),
|
|
723
|
-
// Tool: set filter
|
|
724
|
-
events.on("git-panels.pull-requests:set-filter", (event) => {
|
|
725
|
-
var _a2;
|
|
726
|
-
const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
|
|
727
|
-
if (newFilter && ["open", "closed"].includes(newFilter)) {
|
|
728
|
-
setFilter(newFilter);
|
|
729
|
-
}
|
|
730
|
-
})
|
|
731
|
-
];
|
|
732
|
-
return () => unsubscribers.forEach((unsub) => unsub());
|
|
733
|
-
}, [events, context]);
|
|
734
|
-
const filteredPullRequests = useMemo(() => {
|
|
735
|
-
return pullRequests.filter((pr) => pr.state === filter);
|
|
736
|
-
}, [filter, pullRequests]);
|
|
737
|
-
const counts = useMemo(() => {
|
|
738
|
-
const open = pullRequests.filter((pr) => pr.state === "open").length;
|
|
739
|
-
const closed = pullRequests.filter((pr) => pr.state === "closed").length;
|
|
740
|
-
return { open, closed };
|
|
741
|
-
}, [pullRequests]);
|
|
742
|
-
const handleRefresh = async () => {
|
|
743
|
-
try {
|
|
744
|
-
await context.refresh("repository", "pullRequests");
|
|
745
|
-
} catch (error) {
|
|
746
|
-
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
747
|
-
}
|
|
752
|
+
const VOID = -1;
|
|
753
|
+
const PRIMITIVE = 0;
|
|
754
|
+
const ARRAY = 1;
|
|
755
|
+
const OBJECT = 2;
|
|
756
|
+
const DATE = 3;
|
|
757
|
+
const REGEXP = 4;
|
|
758
|
+
const MAP = 5;
|
|
759
|
+
const SET = 6;
|
|
760
|
+
const ERROR = 7;
|
|
761
|
+
const BIGINT = 8;
|
|
762
|
+
const env = typeof self === "object" ? self : globalThis;
|
|
763
|
+
const deserializer = ($2, _) => {
|
|
764
|
+
const as = (out, index2) => {
|
|
765
|
+
$2.set(index2, out);
|
|
766
|
+
return out;
|
|
748
767
|
};
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
768
|
+
const unpair = (index2) => {
|
|
769
|
+
if ($2.has(index2))
|
|
770
|
+
return $2.get(index2);
|
|
771
|
+
const [type, value] = _[index2];
|
|
772
|
+
switch (type) {
|
|
773
|
+
case PRIMITIVE:
|
|
774
|
+
case VOID:
|
|
775
|
+
return as(value, index2);
|
|
776
|
+
case ARRAY: {
|
|
777
|
+
const arr = as([], index2);
|
|
778
|
+
for (const index3 of value)
|
|
779
|
+
arr.push(unpair(index3));
|
|
780
|
+
return arr;
|
|
781
|
+
}
|
|
782
|
+
case OBJECT: {
|
|
783
|
+
const object = as({}, index2);
|
|
784
|
+
for (const [key, index3] of value)
|
|
785
|
+
object[unpair(key)] = unpair(index3);
|
|
786
|
+
return object;
|
|
787
|
+
}
|
|
788
|
+
case DATE:
|
|
789
|
+
return as(new Date(value), index2);
|
|
790
|
+
case REGEXP: {
|
|
791
|
+
const { source: source2, flags } = value;
|
|
792
|
+
return as(new RegExp(source2, flags), index2);
|
|
793
|
+
}
|
|
794
|
+
case MAP: {
|
|
795
|
+
const map2 = as(/* @__PURE__ */ new Map(), index2);
|
|
796
|
+
for (const [key, index3] of value)
|
|
797
|
+
map2.set(unpair(key), unpair(index3));
|
|
798
|
+
return map2;
|
|
799
|
+
}
|
|
800
|
+
case SET: {
|
|
801
|
+
const set = as(/* @__PURE__ */ new Set(), index2);
|
|
802
|
+
for (const index3 of value)
|
|
803
|
+
set.add(unpair(index3));
|
|
804
|
+
return set;
|
|
805
|
+
}
|
|
806
|
+
case ERROR: {
|
|
807
|
+
const { name: name2, message } = value;
|
|
808
|
+
return as(new env[name2](message), index2);
|
|
809
|
+
}
|
|
810
|
+
case BIGINT:
|
|
811
|
+
return as(BigInt(value), index2);
|
|
812
|
+
case "BigInt":
|
|
813
|
+
return as(Object(BigInt(value)), index2);
|
|
814
|
+
case "ArrayBuffer":
|
|
815
|
+
return as(new Uint8Array(value).buffer, value);
|
|
816
|
+
case "DataView": {
|
|
817
|
+
const { buffer } = new Uint8Array(value);
|
|
818
|
+
return as(new DataView(buffer), value);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return as(new env[type](value), index2);
|
|
757
822
|
};
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
823
|
+
return unpair;
|
|
824
|
+
};
|
|
825
|
+
const deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
826
|
+
const EMPTY = "";
|
|
827
|
+
const { toString: toString$2 } = {};
|
|
828
|
+
const { keys } = Object;
|
|
829
|
+
const typeOf = (value) => {
|
|
830
|
+
const type = typeof value;
|
|
831
|
+
if (type !== "object" || !value)
|
|
832
|
+
return [PRIMITIVE, type];
|
|
833
|
+
const asString = toString$2.call(value).slice(8, -1);
|
|
834
|
+
switch (asString) {
|
|
835
|
+
case "Array":
|
|
836
|
+
return [ARRAY, EMPTY];
|
|
837
|
+
case "Object":
|
|
838
|
+
return [OBJECT, EMPTY];
|
|
839
|
+
case "Date":
|
|
840
|
+
return [DATE, EMPTY];
|
|
841
|
+
case "RegExp":
|
|
842
|
+
return [REGEXP, EMPTY];
|
|
843
|
+
case "Map":
|
|
844
|
+
return [MAP, EMPTY];
|
|
845
|
+
case "Set":
|
|
846
|
+
return [SET, EMPTY];
|
|
847
|
+
case "DataView":
|
|
848
|
+
return [ARRAY, asString];
|
|
849
|
+
}
|
|
850
|
+
if (asString.includes("Array"))
|
|
851
|
+
return [ARRAY, asString];
|
|
852
|
+
if (asString.includes("Error"))
|
|
853
|
+
return [ERROR, asString];
|
|
854
|
+
return [OBJECT, asString];
|
|
855
|
+
};
|
|
856
|
+
const shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
857
|
+
const serializer = (strict, json2, $2, _) => {
|
|
858
|
+
const as = (out, value) => {
|
|
859
|
+
const index2 = _.push(out) - 1;
|
|
860
|
+
$2.set(value, index2);
|
|
861
|
+
return index2;
|
|
764
862
|
};
|
|
765
|
-
const
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
},
|
|
786
|
-
children: [
|
|
787
|
-
/* @__PURE__ */ jsx("div", { children: icon }),
|
|
788
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
789
|
-
/* @__PURE__ */ jsx(
|
|
790
|
-
"h3",
|
|
791
|
-
{
|
|
792
|
-
style: {
|
|
793
|
-
margin: 0,
|
|
794
|
-
marginBottom: "8px",
|
|
795
|
-
color: theme2.colors.text,
|
|
796
|
-
fontFamily: theme2.fonts.heading,
|
|
797
|
-
fontSize: theme2.fontSizes[2],
|
|
798
|
-
fontWeight: 600
|
|
799
|
-
},
|
|
800
|
-
children: title
|
|
801
|
-
}
|
|
802
|
-
),
|
|
803
|
-
description && /* @__PURE__ */ jsx(
|
|
804
|
-
"p",
|
|
805
|
-
{
|
|
806
|
-
style: {
|
|
807
|
-
margin: 0,
|
|
808
|
-
color: theme2.colors.textSecondary,
|
|
809
|
-
fontFamily: theme2.fonts.body,
|
|
810
|
-
fontSize: theme2.fontSizes[1],
|
|
811
|
-
lineHeight: 1.5
|
|
812
|
-
},
|
|
813
|
-
children: description
|
|
814
|
-
}
|
|
815
|
-
)
|
|
816
|
-
] })
|
|
817
|
-
]
|
|
863
|
+
const pair = (value) => {
|
|
864
|
+
if ($2.has(value))
|
|
865
|
+
return $2.get(value);
|
|
866
|
+
let [TYPE, type] = typeOf(value);
|
|
867
|
+
switch (TYPE) {
|
|
868
|
+
case PRIMITIVE: {
|
|
869
|
+
let entry = value;
|
|
870
|
+
switch (type) {
|
|
871
|
+
case "bigint":
|
|
872
|
+
TYPE = BIGINT;
|
|
873
|
+
entry = value.toString();
|
|
874
|
+
break;
|
|
875
|
+
case "function":
|
|
876
|
+
case "symbol":
|
|
877
|
+
if (strict)
|
|
878
|
+
throw new TypeError("unable to serialize " + type);
|
|
879
|
+
entry = null;
|
|
880
|
+
break;
|
|
881
|
+
case "undefined":
|
|
882
|
+
return as([VOID], value);
|
|
818
883
|
}
|
|
819
|
-
|
|
884
|
+
return as([TYPE, entry], value);
|
|
885
|
+
}
|
|
886
|
+
case ARRAY: {
|
|
887
|
+
if (type) {
|
|
888
|
+
let spread = value;
|
|
889
|
+
if (type === "DataView") {
|
|
890
|
+
spread = new Uint8Array(value.buffer);
|
|
891
|
+
} else if (type === "ArrayBuffer") {
|
|
892
|
+
spread = new Uint8Array(value);
|
|
893
|
+
}
|
|
894
|
+
return as([type, [...spread]], value);
|
|
895
|
+
}
|
|
896
|
+
const arr = [];
|
|
897
|
+
const index2 = as([TYPE, arr], value);
|
|
898
|
+
for (const entry of value)
|
|
899
|
+
arr.push(pair(entry));
|
|
900
|
+
return index2;
|
|
901
|
+
}
|
|
902
|
+
case OBJECT: {
|
|
903
|
+
if (type) {
|
|
904
|
+
switch (type) {
|
|
905
|
+
case "BigInt":
|
|
906
|
+
return as([type, value.toString()], value);
|
|
907
|
+
case "Boolean":
|
|
908
|
+
case "Number":
|
|
909
|
+
case "String":
|
|
910
|
+
return as([type, value.valueOf()], value);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
if (json2 && "toJSON" in value)
|
|
914
|
+
return pair(value.toJSON());
|
|
915
|
+
const entries = [];
|
|
916
|
+
const index2 = as([TYPE, entries], value);
|
|
917
|
+
for (const key of keys(value)) {
|
|
918
|
+
if (strict || !shouldSkip(typeOf(value[key])))
|
|
919
|
+
entries.push([pair(key), pair(value[key])]);
|
|
920
|
+
}
|
|
921
|
+
return index2;
|
|
922
|
+
}
|
|
923
|
+
case DATE:
|
|
924
|
+
return as([TYPE, value.toISOString()], value);
|
|
925
|
+
case REGEXP: {
|
|
926
|
+
const { source: source2, flags } = value;
|
|
927
|
+
return as([TYPE, { source: source2, flags }], value);
|
|
928
|
+
}
|
|
929
|
+
case MAP: {
|
|
930
|
+
const entries = [];
|
|
931
|
+
const index2 = as([TYPE, entries], value);
|
|
932
|
+
for (const [key, entry] of value) {
|
|
933
|
+
if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
|
|
934
|
+
entries.push([pair(key), pair(entry)]);
|
|
935
|
+
}
|
|
936
|
+
return index2;
|
|
937
|
+
}
|
|
938
|
+
case SET: {
|
|
939
|
+
const entries = [];
|
|
940
|
+
const index2 = as([TYPE, entries], value);
|
|
941
|
+
for (const entry of value) {
|
|
942
|
+
if (strict || !shouldSkip(typeOf(entry)))
|
|
943
|
+
entries.push(pair(entry));
|
|
944
|
+
}
|
|
945
|
+
return index2;
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
const { message } = value;
|
|
949
|
+
return as([TYPE, { name: type, message }], value);
|
|
950
|
+
};
|
|
951
|
+
return pair;
|
|
952
|
+
};
|
|
953
|
+
const serialize$1 = (value, { json: json2, lossy } = {}) => {
|
|
954
|
+
const _ = [];
|
|
955
|
+
return serializer(!(json2 || lossy), !!json2, /* @__PURE__ */ new Map(), _)(value), _;
|
|
956
|
+
};
|
|
957
|
+
const structuredClone$1 = typeof structuredClone === "function" ? (
|
|
958
|
+
/* c8 ignore start */
|
|
959
|
+
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize$1(any, options)) : structuredClone(any)
|
|
960
|
+
) : (any, options) => deserialize(serialize$1(any, options));
|
|
961
|
+
const pointEnd = point$3("end");
|
|
962
|
+
const pointStart = point$3("start");
|
|
963
|
+
function point$3(type) {
|
|
964
|
+
return point2;
|
|
965
|
+
function point2(node2) {
|
|
966
|
+
const point3 = node2 && node2.position && node2.position[type] || {};
|
|
967
|
+
if (typeof point3.line === "number" && point3.line > 0 && typeof point3.column === "number" && point3.column > 0) {
|
|
968
|
+
return {
|
|
969
|
+
line: point3.line,
|
|
970
|
+
column: point3.column,
|
|
971
|
+
offset: typeof point3.offset === "number" && point3.offset > -1 ? point3.offset : void 0
|
|
972
|
+
};
|
|
820
973
|
}
|
|
821
|
-
) });
|
|
822
|
-
if (isLoading && pullRequests.length === 0) {
|
|
823
|
-
return renderState(
|
|
824
|
-
/* @__PURE__ */ jsx(LoaderCircle, { size: 32, style: { color: theme2.colors.textSecondary }, className: "spin" }),
|
|
825
|
-
"Loading pull requests...",
|
|
826
|
-
"Fetching pull request data for this repository."
|
|
827
|
-
);
|
|
828
|
-
}
|
|
829
|
-
if (!context.currentScope.repository) {
|
|
830
|
-
return renderState(
|
|
831
|
-
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.textSecondary } }),
|
|
832
|
-
"No repository selected",
|
|
833
|
-
"Select a repository to view pull requests."
|
|
834
|
-
);
|
|
835
974
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}
|
|
843
|
-
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
844
|
-
/* @__PURE__ */ jsx("style", { children: `.hide-scrollbar::-webkit-scrollbar { display: none; }` }),
|
|
845
|
-
/* @__PURE__ */ jsxs(
|
|
846
|
-
"div",
|
|
847
|
-
{
|
|
848
|
-
style: {
|
|
849
|
-
height: "40px",
|
|
850
|
-
minHeight: "40px",
|
|
851
|
-
padding: "0 12px",
|
|
852
|
-
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
853
|
-
backgroundColor: theme2.colors.background,
|
|
854
|
-
display: "flex",
|
|
855
|
-
alignItems: "center",
|
|
856
|
-
justifyContent: "space-between",
|
|
857
|
-
boxSizing: "border-box"
|
|
858
|
-
},
|
|
859
|
-
children: [
|
|
860
|
-
/* @__PURE__ */ jsxs(
|
|
861
|
-
"div",
|
|
862
|
-
{
|
|
863
|
-
style: {
|
|
864
|
-
display: "flex",
|
|
865
|
-
alignItems: "center",
|
|
866
|
-
gap: "8px",
|
|
867
|
-
color: theme2.colors.textSecondary,
|
|
868
|
-
fontFamily: theme2.fonts.heading,
|
|
869
|
-
fontSize: theme2.fontSizes[0],
|
|
870
|
-
fontWeight: 600,
|
|
871
|
-
textTransform: "uppercase"
|
|
872
|
-
},
|
|
873
|
-
children: [
|
|
874
|
-
/* @__PURE__ */ jsx(GitPullRequest, { size: 14 }),
|
|
875
|
-
"Pull Requests"
|
|
876
|
-
]
|
|
877
|
-
}
|
|
878
|
-
),
|
|
879
|
-
/* @__PURE__ */ jsxs(
|
|
880
|
-
"button",
|
|
881
|
-
{
|
|
882
|
-
type: "button",
|
|
883
|
-
onClick: handleRefresh,
|
|
884
|
-
disabled: isLoading,
|
|
885
|
-
style: {
|
|
886
|
-
display: "inline-flex",
|
|
887
|
-
alignItems: "center",
|
|
888
|
-
gap: "6px",
|
|
889
|
-
padding: "4px 10px",
|
|
890
|
-
borderRadius: "4px",
|
|
891
|
-
border: `1px solid ${theme2.colors.border}`,
|
|
892
|
-
backgroundColor: theme2.colors.background,
|
|
893
|
-
color: theme2.colors.text,
|
|
894
|
-
cursor: isLoading ? "default" : "pointer",
|
|
895
|
-
fontFamily: theme2.fonts.body,
|
|
896
|
-
fontSize: theme2.fontSizes[0],
|
|
897
|
-
fontWeight: 500,
|
|
898
|
-
opacity: isLoading ? 0.7 : 1
|
|
899
|
-
},
|
|
900
|
-
children: [
|
|
901
|
-
isLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "spin" }) : /* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
902
|
-
isLoading ? "Refreshing..." : "Refresh"
|
|
903
|
-
]
|
|
904
|
-
}
|
|
905
|
-
)
|
|
906
|
-
]
|
|
907
|
-
}
|
|
908
|
-
),
|
|
909
|
-
/* @__PURE__ */ jsx(
|
|
910
|
-
"div",
|
|
911
|
-
{
|
|
912
|
-
style: {
|
|
913
|
-
display: "flex",
|
|
914
|
-
borderBottom: `1px solid ${theme2.colors.border}`
|
|
915
|
-
},
|
|
916
|
-
children: ["open", "closed"].map((value) => {
|
|
917
|
-
const isActive = filter === value;
|
|
918
|
-
const label = value === "open" ? "Open" : "Closed";
|
|
919
|
-
return /* @__PURE__ */ jsxs(
|
|
920
|
-
"button",
|
|
921
|
-
{
|
|
922
|
-
type: "button",
|
|
923
|
-
onClick: () => setFilter(value),
|
|
924
|
-
style: {
|
|
925
|
-
flex: 1,
|
|
926
|
-
display: "flex",
|
|
927
|
-
alignItems: "center",
|
|
928
|
-
justifyContent: "center",
|
|
929
|
-
gap: "6px",
|
|
930
|
-
padding: "8px 12px",
|
|
931
|
-
border: "none",
|
|
932
|
-
borderBottom: isActive ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
|
|
933
|
-
backgroundColor: "transparent",
|
|
934
|
-
color: isActive ? theme2.colors.text : theme2.colors.textSecondary,
|
|
935
|
-
fontFamily: theme2.fonts.body,
|
|
936
|
-
fontSize: theme2.fontSizes[1],
|
|
937
|
-
fontWeight: isActive ? 600 : 500,
|
|
938
|
-
cursor: "pointer",
|
|
939
|
-
marginBottom: "-1px"
|
|
940
|
-
},
|
|
941
|
-
children: [
|
|
942
|
-
label,
|
|
943
|
-
/* @__PURE__ */ jsxs("span", { style: { opacity: 0.7 }, children: [
|
|
944
|
-
"(",
|
|
945
|
-
counts[value],
|
|
946
|
-
")"
|
|
947
|
-
] })
|
|
948
|
-
]
|
|
949
|
-
},
|
|
950
|
-
value
|
|
951
|
-
);
|
|
952
|
-
})
|
|
953
|
-
}
|
|
954
|
-
),
|
|
955
|
-
/* @__PURE__ */ jsx(
|
|
956
|
-
"div",
|
|
957
|
-
{
|
|
958
|
-
style: {
|
|
959
|
-
flex: 1,
|
|
960
|
-
overflowY: "auto",
|
|
961
|
-
display: "flex",
|
|
962
|
-
flexDirection: "column",
|
|
963
|
-
scrollbarWidth: "none",
|
|
964
|
-
msOverflowStyle: "none"
|
|
965
|
-
},
|
|
966
|
-
className: "hide-scrollbar",
|
|
967
|
-
children: filteredPullRequests.length === 0 ? /* @__PURE__ */ jsxs(
|
|
968
|
-
"div",
|
|
969
|
-
{
|
|
970
|
-
style: {
|
|
971
|
-
marginTop: "48px",
|
|
972
|
-
textAlign: "center",
|
|
973
|
-
color: theme2.colors.textSecondary,
|
|
974
|
-
fontFamily: theme2.fonts.body
|
|
975
|
-
},
|
|
976
|
-
children: [
|
|
977
|
-
/* @__PURE__ */ jsx(GitPullRequest, { size: 32, style: { marginBottom: "12px" } }),
|
|
978
|
-
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No pull requests found" }),
|
|
979
|
-
/* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: [
|
|
980
|
-
"There are no ",
|
|
981
|
-
filter,
|
|
982
|
-
" pull requests to display."
|
|
983
|
-
] })
|
|
984
|
-
]
|
|
985
|
-
}
|
|
986
|
-
) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme: theme2, isSelected: selectedPrId === pr.id, onClick: () => handlePRClick(pr) }, pr.id))
|
|
987
|
-
}
|
|
988
|
-
)
|
|
989
|
-
] });
|
|
990
|
-
};
|
|
991
|
-
const PullRequestCard = ({ pr, theme: theme2, isSelected, onClick }) => {
|
|
992
|
-
var _a;
|
|
993
|
-
const [isHovered, setIsHovered] = useState(false);
|
|
994
|
-
const isActive = isHovered || isSelected;
|
|
995
|
-
const isMerged = pr.merged_at !== null;
|
|
996
|
-
const isOpen = pr.state === "open";
|
|
997
|
-
const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
|
|
998
|
-
return /* @__PURE__ */ jsxs(
|
|
999
|
-
"div",
|
|
1000
|
-
{
|
|
1001
|
-
onClick,
|
|
1002
|
-
role: "button",
|
|
1003
|
-
tabIndex: 0,
|
|
1004
|
-
onKeyDown: (e) => {
|
|
1005
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1006
|
-
e.preventDefault();
|
|
1007
|
-
onClick == null ? void 0 : onClick();
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
onMouseEnter: () => setIsHovered(true),
|
|
1011
|
-
onMouseLeave: () => setIsHovered(false),
|
|
1012
|
-
style: {
|
|
1013
|
-
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
1014
|
-
padding: "16px 16px",
|
|
1015
|
-
backgroundColor: isActive ? theme2.colors.background : theme2.colors.backgroundSecondary,
|
|
1016
|
-
display: "flex",
|
|
1017
|
-
flexDirection: "column",
|
|
1018
|
-
gap: "8px",
|
|
1019
|
-
cursor: onClick ? "pointer" : "default",
|
|
1020
|
-
minWidth: 0,
|
|
1021
|
-
transition: "background-color 0.15s ease"
|
|
1022
|
-
},
|
|
1023
|
-
children: [
|
|
1024
|
-
/* @__PURE__ */ jsx(
|
|
1025
|
-
"div",
|
|
1026
|
-
{
|
|
1027
|
-
style: {
|
|
1028
|
-
fontFamily: theme2.fonts.heading,
|
|
1029
|
-
fontSize: theme2.fontSizes[2],
|
|
1030
|
-
fontWeight: 600,
|
|
1031
|
-
color: isActive ? theme2.colors.primary : theme2.colors.text,
|
|
1032
|
-
lineHeight: 1.3,
|
|
1033
|
-
wordBreak: "break-word",
|
|
1034
|
-
transition: "color 0.15s ease"
|
|
1035
|
-
},
|
|
1036
|
-
children: pr.title
|
|
1037
|
-
}
|
|
1038
|
-
),
|
|
1039
|
-
/* @__PURE__ */ jsxs(
|
|
1040
|
-
"div",
|
|
1041
|
-
{
|
|
1042
|
-
style: {
|
|
1043
|
-
display: "flex",
|
|
1044
|
-
alignItems: "center",
|
|
1045
|
-
gap: "8px 12px",
|
|
1046
|
-
flexWrap: "wrap",
|
|
1047
|
-
color: theme2.colors.textSecondary,
|
|
1048
|
-
fontFamily: theme2.fonts.body,
|
|
1049
|
-
fontSize: theme2.fontSizes[0]
|
|
1050
|
-
},
|
|
1051
|
-
children: [
|
|
1052
|
-
pr.draft && /* @__PURE__ */ jsx(
|
|
1053
|
-
"span",
|
|
1054
|
-
{
|
|
1055
|
-
style: {
|
|
1056
|
-
padding: "4px 10px",
|
|
1057
|
-
borderRadius: "999px",
|
|
1058
|
-
backgroundColor: theme2.colors.background,
|
|
1059
|
-
color: theme2.colors.textSecondary,
|
|
1060
|
-
fontFamily: theme2.fonts.heading,
|
|
1061
|
-
fontSize: theme2.fontSizes[0],
|
|
1062
|
-
fontWeight: 600,
|
|
1063
|
-
textTransform: "uppercase",
|
|
1064
|
-
letterSpacing: "0.02em"
|
|
1065
|
-
},
|
|
1066
|
-
children: "Draft"
|
|
1067
|
-
}
|
|
1068
|
-
),
|
|
1069
|
-
/* @__PURE__ */ jsxs(
|
|
1070
|
-
"span",
|
|
1071
|
-
{
|
|
1072
|
-
style: {
|
|
1073
|
-
fontFamily: theme2.fonts.heading,
|
|
1074
|
-
fontWeight: 600,
|
|
1075
|
-
color: theme2.colors.textSecondary
|
|
1076
|
-
},
|
|
1077
|
-
children: [
|
|
1078
|
-
"#",
|
|
1079
|
-
pr.number
|
|
1080
|
-
]
|
|
1081
|
-
}
|
|
1082
|
-
),
|
|
1083
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
1084
|
-
"by ",
|
|
1085
|
-
((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"
|
|
1086
|
-
] }),
|
|
1087
|
-
/* @__PURE__ */ jsxs(
|
|
1088
|
-
"span",
|
|
1089
|
-
{
|
|
1090
|
-
style: {
|
|
1091
|
-
display: "inline-flex",
|
|
1092
|
-
alignItems: "center",
|
|
1093
|
-
gap: "4px"
|
|
1094
|
-
},
|
|
1095
|
-
children: [
|
|
1096
|
-
/* @__PURE__ */ jsx(Calendar, { size: 12 }),
|
|
1097
|
-
" ",
|
|
1098
|
-
formatDate(pr.created_at)
|
|
1099
|
-
]
|
|
1100
|
-
}
|
|
1101
|
-
),
|
|
1102
|
-
!isOpen && /* @__PURE__ */ jsxs(
|
|
1103
|
-
"span",
|
|
1104
|
-
{
|
|
1105
|
-
style: {
|
|
1106
|
-
display: "inline-flex",
|
|
1107
|
-
alignItems: "center",
|
|
1108
|
-
gap: "4px"
|
|
1109
|
-
},
|
|
1110
|
-
children: [
|
|
1111
|
-
isMerged ? "Merged" : "Closed",
|
|
1112
|
-
" ",
|
|
1113
|
-
formatDate(pr.merged_at || pr.updated_at)
|
|
1114
|
-
]
|
|
1115
|
-
}
|
|
1116
|
-
),
|
|
1117
|
-
totalComments > 0 && /* @__PURE__ */ jsxs(
|
|
1118
|
-
"span",
|
|
1119
|
-
{
|
|
1120
|
-
style: {
|
|
1121
|
-
display: "inline-flex",
|
|
1122
|
-
alignItems: "center",
|
|
1123
|
-
gap: "4px"
|
|
1124
|
-
},
|
|
1125
|
-
children: [
|
|
1126
|
-
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
1127
|
-
" ",
|
|
1128
|
-
totalComments
|
|
1129
|
-
]
|
|
1130
|
-
}
|
|
1131
|
-
)
|
|
1132
|
-
]
|
|
1133
|
-
}
|
|
1134
|
-
)
|
|
1135
|
-
]
|
|
1136
|
-
}
|
|
1137
|
-
);
|
|
1138
|
-
};
|
|
1139
|
-
const GitPullRequestsPanelPreview = () => {
|
|
1140
|
-
const { theme: theme2 } = useTheme();
|
|
1141
|
-
return /* @__PURE__ */ jsxs(
|
|
1142
|
-
"div",
|
|
1143
|
-
{
|
|
1144
|
-
style: {
|
|
1145
|
-
padding: "12px",
|
|
1146
|
-
fontFamily: theme2.fonts.body,
|
|
1147
|
-
fontSize: theme2.fontSizes[0],
|
|
1148
|
-
color: theme2.colors.text,
|
|
1149
|
-
display: "flex",
|
|
1150
|
-
flexDirection: "column",
|
|
1151
|
-
gap: "8px"
|
|
1152
|
-
},
|
|
1153
|
-
children: [
|
|
1154
|
-
/* @__PURE__ */ jsxs(
|
|
1155
|
-
"div",
|
|
1156
|
-
{
|
|
1157
|
-
style: {
|
|
1158
|
-
display: "flex",
|
|
1159
|
-
alignItems: "center",
|
|
1160
|
-
gap: "8px"
|
|
1161
|
-
},
|
|
1162
|
-
children: [
|
|
1163
|
-
/* @__PURE__ */ jsx(
|
|
1164
|
-
"span",
|
|
1165
|
-
{
|
|
1166
|
-
style: {
|
|
1167
|
-
display: "inline-flex",
|
|
1168
|
-
alignItems: "center",
|
|
1169
|
-
gap: "6px",
|
|
1170
|
-
padding: "2px 8px",
|
|
1171
|
-
borderRadius: "999px",
|
|
1172
|
-
backgroundColor: "#3b82f622",
|
|
1173
|
-
color: "#3b82f6",
|
|
1174
|
-
fontFamily: theme2.fonts.heading,
|
|
1175
|
-
fontSize: theme2.fontSizes[0],
|
|
1176
|
-
fontWeight: 600,
|
|
1177
|
-
textTransform: "uppercase"
|
|
1178
|
-
},
|
|
1179
|
-
children: "Review"
|
|
1180
|
-
}
|
|
1181
|
-
),
|
|
1182
|
-
/* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "#42 Refine panel layout system" })
|
|
1183
|
-
]
|
|
1184
|
-
}
|
|
1185
|
-
),
|
|
1186
|
-
/* @__PURE__ */ jsx(
|
|
1187
|
-
"div",
|
|
1188
|
-
{
|
|
1189
|
-
style: {
|
|
1190
|
-
paddingLeft: "4px",
|
|
1191
|
-
color: theme2.colors.textSecondary,
|
|
1192
|
-
fontSize: theme2.fontSizes[0],
|
|
1193
|
-
lineHeight: 1.4
|
|
1194
|
-
},
|
|
1195
|
-
children: "Adds preview registry and consolidates configurator metadata."
|
|
1196
|
-
}
|
|
1197
|
-
),
|
|
1198
|
-
/* @__PURE__ */ jsxs(
|
|
1199
|
-
"div",
|
|
1200
|
-
{
|
|
1201
|
-
style: {
|
|
1202
|
-
display: "flex",
|
|
1203
|
-
alignItems: "center",
|
|
1204
|
-
gap: "8px",
|
|
1205
|
-
color: theme2.colors.textSecondary,
|
|
1206
|
-
fontSize: theme2.fontSizes[0]
|
|
1207
|
-
},
|
|
1208
|
-
children: [
|
|
1209
|
-
/* @__PURE__ */ jsx("span", { children: "4 checks" }),
|
|
1210
|
-
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
1211
|
-
/* @__PURE__ */ jsx("span", { children: "1 reviewer" })
|
|
1212
|
-
]
|
|
1213
|
-
}
|
|
1214
|
-
)
|
|
1215
|
-
]
|
|
1216
|
-
}
|
|
1217
|
-
);
|
|
1218
|
-
};
|
|
1219
|
-
const VOID = -1;
|
|
1220
|
-
const PRIMITIVE = 0;
|
|
1221
|
-
const ARRAY = 1;
|
|
1222
|
-
const OBJECT = 2;
|
|
1223
|
-
const DATE = 3;
|
|
1224
|
-
const REGEXP = 4;
|
|
1225
|
-
const MAP = 5;
|
|
1226
|
-
const SET = 6;
|
|
1227
|
-
const ERROR = 7;
|
|
1228
|
-
const BIGINT = 8;
|
|
1229
|
-
const env = typeof self === "object" ? self : globalThis;
|
|
1230
|
-
const deserializer = ($2, _) => {
|
|
1231
|
-
const as = (out, index2) => {
|
|
1232
|
-
$2.set(index2, out);
|
|
1233
|
-
return out;
|
|
1234
|
-
};
|
|
1235
|
-
const unpair = (index2) => {
|
|
1236
|
-
if ($2.has(index2))
|
|
1237
|
-
return $2.get(index2);
|
|
1238
|
-
const [type, value] = _[index2];
|
|
1239
|
-
switch (type) {
|
|
1240
|
-
case PRIMITIVE:
|
|
1241
|
-
case VOID:
|
|
1242
|
-
return as(value, index2);
|
|
1243
|
-
case ARRAY: {
|
|
1244
|
-
const arr = as([], index2);
|
|
1245
|
-
for (const index3 of value)
|
|
1246
|
-
arr.push(unpair(index3));
|
|
1247
|
-
return arr;
|
|
1248
|
-
}
|
|
1249
|
-
case OBJECT: {
|
|
1250
|
-
const object = as({}, index2);
|
|
1251
|
-
for (const [key, index3] of value)
|
|
1252
|
-
object[unpair(key)] = unpair(index3);
|
|
1253
|
-
return object;
|
|
1254
|
-
}
|
|
1255
|
-
case DATE:
|
|
1256
|
-
return as(new Date(value), index2);
|
|
1257
|
-
case REGEXP: {
|
|
1258
|
-
const { source: source2, flags } = value;
|
|
1259
|
-
return as(new RegExp(source2, flags), index2);
|
|
1260
|
-
}
|
|
1261
|
-
case MAP: {
|
|
1262
|
-
const map2 = as(/* @__PURE__ */ new Map(), index2);
|
|
1263
|
-
for (const [key, index3] of value)
|
|
1264
|
-
map2.set(unpair(key), unpair(index3));
|
|
1265
|
-
return map2;
|
|
1266
|
-
}
|
|
1267
|
-
case SET: {
|
|
1268
|
-
const set = as(/* @__PURE__ */ new Set(), index2);
|
|
1269
|
-
for (const index3 of value)
|
|
1270
|
-
set.add(unpair(index3));
|
|
1271
|
-
return set;
|
|
1272
|
-
}
|
|
1273
|
-
case ERROR: {
|
|
1274
|
-
const { name: name2, message } = value;
|
|
1275
|
-
return as(new env[name2](message), index2);
|
|
1276
|
-
}
|
|
1277
|
-
case BIGINT:
|
|
1278
|
-
return as(BigInt(value), index2);
|
|
1279
|
-
case "BigInt":
|
|
1280
|
-
return as(Object(BigInt(value)), index2);
|
|
1281
|
-
case "ArrayBuffer":
|
|
1282
|
-
return as(new Uint8Array(value).buffer, value);
|
|
1283
|
-
case "DataView": {
|
|
1284
|
-
const { buffer } = new Uint8Array(value);
|
|
1285
|
-
return as(new DataView(buffer), value);
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
return as(new env[type](value), index2);
|
|
1289
|
-
};
|
|
1290
|
-
return unpair;
|
|
1291
|
-
};
|
|
1292
|
-
const deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
1293
|
-
const EMPTY = "";
|
|
1294
|
-
const { toString: toString$2 } = {};
|
|
1295
|
-
const { keys } = Object;
|
|
1296
|
-
const typeOf = (value) => {
|
|
1297
|
-
const type = typeof value;
|
|
1298
|
-
if (type !== "object" || !value)
|
|
1299
|
-
return [PRIMITIVE, type];
|
|
1300
|
-
const asString = toString$2.call(value).slice(8, -1);
|
|
1301
|
-
switch (asString) {
|
|
1302
|
-
case "Array":
|
|
1303
|
-
return [ARRAY, EMPTY];
|
|
1304
|
-
case "Object":
|
|
1305
|
-
return [OBJECT, EMPTY];
|
|
1306
|
-
case "Date":
|
|
1307
|
-
return [DATE, EMPTY];
|
|
1308
|
-
case "RegExp":
|
|
1309
|
-
return [REGEXP, EMPTY];
|
|
1310
|
-
case "Map":
|
|
1311
|
-
return [MAP, EMPTY];
|
|
1312
|
-
case "Set":
|
|
1313
|
-
return [SET, EMPTY];
|
|
1314
|
-
case "DataView":
|
|
1315
|
-
return [ARRAY, asString];
|
|
1316
|
-
}
|
|
1317
|
-
if (asString.includes("Array"))
|
|
1318
|
-
return [ARRAY, asString];
|
|
1319
|
-
if (asString.includes("Error"))
|
|
1320
|
-
return [ERROR, asString];
|
|
1321
|
-
return [OBJECT, asString];
|
|
1322
|
-
};
|
|
1323
|
-
const shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
1324
|
-
const serializer = (strict, json2, $2, _) => {
|
|
1325
|
-
const as = (out, value) => {
|
|
1326
|
-
const index2 = _.push(out) - 1;
|
|
1327
|
-
$2.set(value, index2);
|
|
1328
|
-
return index2;
|
|
1329
|
-
};
|
|
1330
|
-
const pair = (value) => {
|
|
1331
|
-
if ($2.has(value))
|
|
1332
|
-
return $2.get(value);
|
|
1333
|
-
let [TYPE, type] = typeOf(value);
|
|
1334
|
-
switch (TYPE) {
|
|
1335
|
-
case PRIMITIVE: {
|
|
1336
|
-
let entry = value;
|
|
1337
|
-
switch (type) {
|
|
1338
|
-
case "bigint":
|
|
1339
|
-
TYPE = BIGINT;
|
|
1340
|
-
entry = value.toString();
|
|
1341
|
-
break;
|
|
1342
|
-
case "function":
|
|
1343
|
-
case "symbol":
|
|
1344
|
-
if (strict)
|
|
1345
|
-
throw new TypeError("unable to serialize " + type);
|
|
1346
|
-
entry = null;
|
|
1347
|
-
break;
|
|
1348
|
-
case "undefined":
|
|
1349
|
-
return as([VOID], value);
|
|
1350
|
-
}
|
|
1351
|
-
return as([TYPE, entry], value);
|
|
1352
|
-
}
|
|
1353
|
-
case ARRAY: {
|
|
1354
|
-
if (type) {
|
|
1355
|
-
let spread = value;
|
|
1356
|
-
if (type === "DataView") {
|
|
1357
|
-
spread = new Uint8Array(value.buffer);
|
|
1358
|
-
} else if (type === "ArrayBuffer") {
|
|
1359
|
-
spread = new Uint8Array(value);
|
|
1360
|
-
}
|
|
1361
|
-
return as([type, [...spread]], value);
|
|
1362
|
-
}
|
|
1363
|
-
const arr = [];
|
|
1364
|
-
const index2 = as([TYPE, arr], value);
|
|
1365
|
-
for (const entry of value)
|
|
1366
|
-
arr.push(pair(entry));
|
|
1367
|
-
return index2;
|
|
1368
|
-
}
|
|
1369
|
-
case OBJECT: {
|
|
1370
|
-
if (type) {
|
|
1371
|
-
switch (type) {
|
|
1372
|
-
case "BigInt":
|
|
1373
|
-
return as([type, value.toString()], value);
|
|
1374
|
-
case "Boolean":
|
|
1375
|
-
case "Number":
|
|
1376
|
-
case "String":
|
|
1377
|
-
return as([type, value.valueOf()], value);
|
|
1378
|
-
}
|
|
1379
|
-
}
|
|
1380
|
-
if (json2 && "toJSON" in value)
|
|
1381
|
-
return pair(value.toJSON());
|
|
1382
|
-
const entries = [];
|
|
1383
|
-
const index2 = as([TYPE, entries], value);
|
|
1384
|
-
for (const key of keys(value)) {
|
|
1385
|
-
if (strict || !shouldSkip(typeOf(value[key])))
|
|
1386
|
-
entries.push([pair(key), pair(value[key])]);
|
|
1387
|
-
}
|
|
1388
|
-
return index2;
|
|
1389
|
-
}
|
|
1390
|
-
case DATE:
|
|
1391
|
-
return as([TYPE, value.toISOString()], value);
|
|
1392
|
-
case REGEXP: {
|
|
1393
|
-
const { source: source2, flags } = value;
|
|
1394
|
-
return as([TYPE, { source: source2, flags }], value);
|
|
1395
|
-
}
|
|
1396
|
-
case MAP: {
|
|
1397
|
-
const entries = [];
|
|
1398
|
-
const index2 = as([TYPE, entries], value);
|
|
1399
|
-
for (const [key, entry] of value) {
|
|
1400
|
-
if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
|
|
1401
|
-
entries.push([pair(key), pair(entry)]);
|
|
1402
|
-
}
|
|
1403
|
-
return index2;
|
|
1404
|
-
}
|
|
1405
|
-
case SET: {
|
|
1406
|
-
const entries = [];
|
|
1407
|
-
const index2 = as([TYPE, entries], value);
|
|
1408
|
-
for (const entry of value) {
|
|
1409
|
-
if (strict || !shouldSkip(typeOf(entry)))
|
|
1410
|
-
entries.push(pair(entry));
|
|
1411
|
-
}
|
|
1412
|
-
return index2;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
const { message } = value;
|
|
1416
|
-
return as([TYPE, { name: type, message }], value);
|
|
1417
|
-
};
|
|
1418
|
-
return pair;
|
|
1419
|
-
};
|
|
1420
|
-
const serialize$1 = (value, { json: json2, lossy } = {}) => {
|
|
1421
|
-
const _ = [];
|
|
1422
|
-
return serializer(!(json2 || lossy), !!json2, /* @__PURE__ */ new Map(), _)(value), _;
|
|
1423
|
-
};
|
|
1424
|
-
const structuredClone$1 = typeof structuredClone === "function" ? (
|
|
1425
|
-
/* c8 ignore start */
|
|
1426
|
-
(any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize$1(any, options)) : structuredClone(any)
|
|
1427
|
-
) : (any, options) => deserialize(serialize$1(any, options));
|
|
1428
|
-
const pointEnd = point$3("end");
|
|
1429
|
-
const pointStart = point$3("start");
|
|
1430
|
-
function point$3(type) {
|
|
1431
|
-
return point2;
|
|
1432
|
-
function point2(node2) {
|
|
1433
|
-
const point3 = node2 && node2.position && node2.position[type] || {};
|
|
1434
|
-
if (typeof point3.line === "number" && point3.line > 0 && typeof point3.column === "number" && point3.column > 0) {
|
|
1435
|
-
return {
|
|
1436
|
-
line: point3.line,
|
|
1437
|
-
column: point3.column,
|
|
1438
|
-
offset: typeof point3.offset === "number" && point3.offset > -1 ? point3.offset : void 0
|
|
1439
|
-
};
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
function position$2(node2) {
|
|
1444
|
-
const start = pointStart(node2);
|
|
1445
|
-
const end = pointEnd(node2);
|
|
1446
|
-
if (start && end) {
|
|
1447
|
-
return { start, end };
|
|
975
|
+
}
|
|
976
|
+
function position$2(node2) {
|
|
977
|
+
const start = pointStart(node2);
|
|
978
|
+
const end = pointEnd(node2);
|
|
979
|
+
if (start && end) {
|
|
980
|
+
return { start, end };
|
|
1448
981
|
}
|
|
1449
982
|
}
|
|
1450
983
|
const aria$1 = ["ariaDescribedBy", "ariaLabel", "ariaLabelledBy"];
|
|
@@ -44628,542 +44161,1509 @@ function PanelGroupWithForwardedRef({
|
|
|
44628
44161
|
unsafeLayout = state.layout;
|
|
44629
44162
|
}
|
|
44630
44163
|
}
|
|
44631
|
-
if (unsafeLayout == null) {
|
|
44632
|
-
unsafeLayout = calculateUnsafeDefaultLayout({
|
|
44633
|
-
panelDataArray
|
|
44634
|
-
});
|
|
44164
|
+
if (unsafeLayout == null) {
|
|
44165
|
+
unsafeLayout = calculateUnsafeDefaultLayout({
|
|
44166
|
+
panelDataArray
|
|
44167
|
+
});
|
|
44168
|
+
}
|
|
44169
|
+
const nextLayout = validatePanelGroupLayout({
|
|
44170
|
+
layout: unsafeLayout,
|
|
44171
|
+
panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
|
|
44172
|
+
});
|
|
44173
|
+
if (!areEqual(prevLayout, nextLayout)) {
|
|
44174
|
+
setLayout(nextLayout);
|
|
44175
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
44176
|
+
if (onLayout2) {
|
|
44177
|
+
onLayout2(nextLayout);
|
|
44178
|
+
}
|
|
44179
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
44180
|
+
}
|
|
44181
|
+
}
|
|
44182
|
+
});
|
|
44183
|
+
useIsomorphicLayoutEffect(() => {
|
|
44184
|
+
const eagerValues = eagerValuesRef.current;
|
|
44185
|
+
return () => {
|
|
44186
|
+
eagerValues.layout = [];
|
|
44187
|
+
};
|
|
44188
|
+
}, []);
|
|
44189
|
+
const registerResizeHandle2 = useCallback((dragHandleId) => {
|
|
44190
|
+
let isRTL = false;
|
|
44191
|
+
const panelGroupElement = panelGroupElementRef.current;
|
|
44192
|
+
if (panelGroupElement) {
|
|
44193
|
+
const style22 = window.getComputedStyle(panelGroupElement, null);
|
|
44194
|
+
if (style22.getPropertyValue("direction") === "rtl") {
|
|
44195
|
+
isRTL = true;
|
|
44196
|
+
}
|
|
44197
|
+
}
|
|
44198
|
+
return function resizeHandler(event) {
|
|
44199
|
+
event.preventDefault();
|
|
44200
|
+
const panelGroupElement2 = panelGroupElementRef.current;
|
|
44201
|
+
if (!panelGroupElement2) {
|
|
44202
|
+
return () => null;
|
|
44203
|
+
}
|
|
44204
|
+
const {
|
|
44205
|
+
direction: direction2,
|
|
44206
|
+
dragState: dragState2,
|
|
44207
|
+
id: groupId2,
|
|
44208
|
+
keyboardResizeBy: keyboardResizeBy2,
|
|
44209
|
+
onLayout: onLayout2
|
|
44210
|
+
} = committedValuesRef.current;
|
|
44211
|
+
const {
|
|
44212
|
+
layout: prevLayout,
|
|
44213
|
+
panelDataArray
|
|
44214
|
+
} = eagerValuesRef.current;
|
|
44215
|
+
const {
|
|
44216
|
+
initialLayout
|
|
44217
|
+
} = dragState2 !== null && dragState2 !== void 0 ? dragState2 : {};
|
|
44218
|
+
const pivotIndices = determinePivotIndices(groupId2, dragHandleId, panelGroupElement2);
|
|
44219
|
+
let delta = calculateDeltaPercentage(event, dragHandleId, direction2, dragState2, keyboardResizeBy2, panelGroupElement2);
|
|
44220
|
+
const isHorizontal = direction2 === "horizontal";
|
|
44221
|
+
if (isHorizontal && isRTL) {
|
|
44222
|
+
delta = -delta;
|
|
44223
|
+
}
|
|
44224
|
+
const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
|
|
44225
|
+
const nextLayout = adjustLayoutByDelta({
|
|
44226
|
+
delta,
|
|
44227
|
+
initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
|
|
44228
|
+
panelConstraints,
|
|
44229
|
+
pivotIndices,
|
|
44230
|
+
prevLayout,
|
|
44231
|
+
trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
|
|
44232
|
+
});
|
|
44233
|
+
const layoutChanged = !compareLayouts(prevLayout, nextLayout);
|
|
44234
|
+
if (isPointerEvent(event) || isMouseEvent(event)) {
|
|
44235
|
+
if (prevDeltaRef.current != delta) {
|
|
44236
|
+
prevDeltaRef.current = delta;
|
|
44237
|
+
if (!layoutChanged && delta !== 0) {
|
|
44238
|
+
if (isHorizontal) {
|
|
44239
|
+
reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
|
|
44240
|
+
} else {
|
|
44241
|
+
reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
|
|
44242
|
+
}
|
|
44243
|
+
} else {
|
|
44244
|
+
reportConstraintsViolation(dragHandleId, 0);
|
|
44245
|
+
}
|
|
44246
|
+
}
|
|
44247
|
+
}
|
|
44248
|
+
if (layoutChanged) {
|
|
44249
|
+
setLayout(nextLayout);
|
|
44250
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
44251
|
+
if (onLayout2) {
|
|
44252
|
+
onLayout2(nextLayout);
|
|
44253
|
+
}
|
|
44254
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
44255
|
+
}
|
|
44256
|
+
};
|
|
44257
|
+
}, []);
|
|
44258
|
+
const resizePanel2 = useCallback((panelData, unsafePanelSize) => {
|
|
44259
|
+
const {
|
|
44260
|
+
onLayout: onLayout2
|
|
44261
|
+
} = committedValuesRef.current;
|
|
44262
|
+
const {
|
|
44263
|
+
layout: prevLayout,
|
|
44264
|
+
panelDataArray
|
|
44265
|
+
} = eagerValuesRef.current;
|
|
44266
|
+
const panelConstraintsArray = panelDataArray.map((panelData2) => panelData2.constraints);
|
|
44267
|
+
const {
|
|
44268
|
+
panelSize,
|
|
44269
|
+
pivotIndices
|
|
44270
|
+
} = panelDataHelper(panelDataArray, panelData, prevLayout);
|
|
44271
|
+
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
44272
|
+
const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
|
|
44273
|
+
const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
|
|
44274
|
+
const nextLayout = adjustLayoutByDelta({
|
|
44275
|
+
delta,
|
|
44276
|
+
initialLayout: prevLayout,
|
|
44277
|
+
panelConstraints: panelConstraintsArray,
|
|
44278
|
+
pivotIndices,
|
|
44279
|
+
prevLayout,
|
|
44280
|
+
trigger: "imperative-api"
|
|
44281
|
+
});
|
|
44282
|
+
if (!compareLayouts(prevLayout, nextLayout)) {
|
|
44283
|
+
setLayout(nextLayout);
|
|
44284
|
+
eagerValuesRef.current.layout = nextLayout;
|
|
44285
|
+
if (onLayout2) {
|
|
44286
|
+
onLayout2(nextLayout);
|
|
44287
|
+
}
|
|
44288
|
+
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
44289
|
+
}
|
|
44290
|
+
}, []);
|
|
44291
|
+
const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
|
|
44292
|
+
const {
|
|
44293
|
+
layout: layout2,
|
|
44294
|
+
panelDataArray
|
|
44295
|
+
} = eagerValuesRef.current;
|
|
44296
|
+
const {
|
|
44297
|
+
collapsedSize: prevCollapsedSize = 0,
|
|
44298
|
+
collapsible: prevCollapsible
|
|
44299
|
+
} = prevConstraints;
|
|
44300
|
+
const {
|
|
44301
|
+
collapsedSize: nextCollapsedSize = 0,
|
|
44302
|
+
collapsible: nextCollapsible,
|
|
44303
|
+
maxSize: nextMaxSize = 100,
|
|
44304
|
+
minSize: nextMinSize = 0
|
|
44305
|
+
} = panelData.constraints;
|
|
44306
|
+
const {
|
|
44307
|
+
panelSize: prevPanelSize
|
|
44308
|
+
} = panelDataHelper(panelDataArray, panelData, layout2);
|
|
44309
|
+
if (prevPanelSize == null) {
|
|
44310
|
+
return;
|
|
44311
|
+
}
|
|
44312
|
+
if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
|
|
44313
|
+
if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) {
|
|
44314
|
+
resizePanel2(panelData, nextCollapsedSize);
|
|
44315
|
+
}
|
|
44316
|
+
} else if (prevPanelSize < nextMinSize) {
|
|
44317
|
+
resizePanel2(panelData, nextMinSize);
|
|
44318
|
+
} else if (prevPanelSize > nextMaxSize) {
|
|
44319
|
+
resizePanel2(panelData, nextMaxSize);
|
|
44320
|
+
}
|
|
44321
|
+
}, [resizePanel2]);
|
|
44322
|
+
const startDragging = useCallback((dragHandleId, event) => {
|
|
44323
|
+
const {
|
|
44324
|
+
direction: direction2
|
|
44325
|
+
} = committedValuesRef.current;
|
|
44326
|
+
const {
|
|
44327
|
+
layout: layout2
|
|
44328
|
+
} = eagerValuesRef.current;
|
|
44329
|
+
if (!panelGroupElementRef.current) {
|
|
44330
|
+
return;
|
|
44331
|
+
}
|
|
44332
|
+
const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
|
|
44333
|
+
assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
|
|
44334
|
+
const initialCursorPosition = getResizeEventCursorPosition(direction2, event);
|
|
44335
|
+
setDragState({
|
|
44336
|
+
dragHandleId,
|
|
44337
|
+
dragHandleRect: handleElement.getBoundingClientRect(),
|
|
44338
|
+
initialCursorPosition,
|
|
44339
|
+
initialLayout: layout2
|
|
44340
|
+
});
|
|
44341
|
+
}, []);
|
|
44342
|
+
const stopDragging = useCallback(() => {
|
|
44343
|
+
setDragState(null);
|
|
44344
|
+
}, []);
|
|
44345
|
+
const unregisterPanel = useCallback((panelData) => {
|
|
44346
|
+
const {
|
|
44347
|
+
panelDataArray
|
|
44348
|
+
} = eagerValuesRef.current;
|
|
44349
|
+
const index2 = findPanelDataIndex(panelDataArray, panelData);
|
|
44350
|
+
if (index2 >= 0) {
|
|
44351
|
+
panelDataArray.splice(index2, 1);
|
|
44352
|
+
delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
|
|
44353
|
+
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
44354
|
+
forceUpdate();
|
|
44355
|
+
}
|
|
44356
|
+
}, [forceUpdate]);
|
|
44357
|
+
const context = useMemo(() => ({
|
|
44358
|
+
collapsePanel,
|
|
44359
|
+
direction,
|
|
44360
|
+
dragState,
|
|
44361
|
+
expandPanel,
|
|
44362
|
+
getPanelSize,
|
|
44363
|
+
getPanelStyle,
|
|
44364
|
+
groupId,
|
|
44365
|
+
isPanelCollapsed,
|
|
44366
|
+
isPanelExpanded,
|
|
44367
|
+
reevaluatePanelConstraints,
|
|
44368
|
+
registerPanel,
|
|
44369
|
+
registerResizeHandle: registerResizeHandle2,
|
|
44370
|
+
resizePanel: resizePanel2,
|
|
44371
|
+
startDragging,
|
|
44372
|
+
stopDragging,
|
|
44373
|
+
unregisterPanel,
|
|
44374
|
+
panelGroupElement: panelGroupElementRef.current
|
|
44375
|
+
}), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle2, resizePanel2, startDragging, stopDragging, unregisterPanel]);
|
|
44376
|
+
const style2 = {
|
|
44377
|
+
display: "flex",
|
|
44378
|
+
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
44379
|
+
height: "100%",
|
|
44380
|
+
overflow: "hidden",
|
|
44381
|
+
width: "100%"
|
|
44382
|
+
};
|
|
44383
|
+
return createElement(PanelGroupContext.Provider, {
|
|
44384
|
+
value: context
|
|
44385
|
+
}, createElement(Type, {
|
|
44386
|
+
...rest,
|
|
44387
|
+
children: children2,
|
|
44388
|
+
className: classNameFromProps,
|
|
44389
|
+
id: idFromProps,
|
|
44390
|
+
ref: panelGroupElementRef,
|
|
44391
|
+
style: {
|
|
44392
|
+
...style2,
|
|
44393
|
+
...styleFromProps
|
|
44394
|
+
},
|
|
44395
|
+
[DATA_ATTRIBUTES.group]: "",
|
|
44396
|
+
[DATA_ATTRIBUTES.groupDirection]: direction,
|
|
44397
|
+
[DATA_ATTRIBUTES.groupId]: groupId
|
|
44398
|
+
}));
|
|
44399
|
+
}
|
|
44400
|
+
var PanelGroup = forwardRef((props2, ref) => createElement(PanelGroupWithForwardedRef, {
|
|
44401
|
+
...props2,
|
|
44402
|
+
forwardedRef: ref
|
|
44403
|
+
}));
|
|
44404
|
+
PanelGroupWithForwardedRef.displayName = "PanelGroup";
|
|
44405
|
+
PanelGroup.displayName = "forwardRef(PanelGroup)";
|
|
44406
|
+
function findPanelDataIndex(panelDataArray, panelData) {
|
|
44407
|
+
return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
|
|
44408
|
+
}
|
|
44409
|
+
function panelDataHelper(panelDataArray, panelData, layout) {
|
|
44410
|
+
const panelIndex = findPanelDataIndex(panelDataArray, panelData);
|
|
44411
|
+
const isLastPanel = panelIndex === panelDataArray.length - 1;
|
|
44412
|
+
const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
|
|
44413
|
+
const panelSize = layout[panelIndex];
|
|
44414
|
+
return {
|
|
44415
|
+
...panelData.constraints,
|
|
44416
|
+
panelSize,
|
|
44417
|
+
pivotIndices
|
|
44418
|
+
};
|
|
44419
|
+
}
|
|
44420
|
+
function S(e2) {
|
|
44421
|
+
return { "--panel-background": e2.colors.background, "--panel-border": e2.colors.border, "--panel-handle": e2.colors.backgroundSecondary, "--panel-handle-hover": e2.colors.backgroundHover, "--panel-handle-active": e2.colors.primary, "--panel-button-bg": e2.colors.surface, "--panel-button-hover": e2.colors.backgroundHover, "--panel-button-border": e2.colors.border, "--panel-button-icon": e2.colors.textSecondary, "--panel-accent-bg": e2.colors.primary + "15" };
|
|
44422
|
+
}
|
|
44423
|
+
var M = forwardRef(({ panels: o2, className: a2 = "", style: s2, theme: d2, minPanelWidth: u2 = 350, idealPanelWidth: p2 = 0.333, showSeparator: h2 = false, onPanelChange: m2, preventKeyboardScroll: f2 = true }, g) => {
|
|
44424
|
+
const v = useRef(null), b = S(d2);
|
|
44425
|
+
useImperativeHandle(g, () => ({ scrollToPanel: (e2) => {
|
|
44426
|
+
if (!v.current)
|
|
44427
|
+
return;
|
|
44428
|
+
const t2 = v.current, n2 = t2.children[e2];
|
|
44429
|
+
if (n2) {
|
|
44430
|
+
const e3 = n2.offsetLeft;
|
|
44431
|
+
t2.scrollTo({ left: e3, behavior: "smooth" });
|
|
44432
|
+
}
|
|
44433
|
+
}, getCurrentPanel: () => {
|
|
44434
|
+
if (!v.current || v.current.children.length === 0)
|
|
44435
|
+
return 0;
|
|
44436
|
+
const e2 = v.current, t2 = e2.getBoundingClientRect().left;
|
|
44437
|
+
let n2 = 0, r2 = 1 / 0;
|
|
44438
|
+
for (let o3 = 0; o3 < e2.children.length; o3++) {
|
|
44439
|
+
const i2 = e2.children[o3].getBoundingClientRect(), a3 = Math.abs(i2.left - t2);
|
|
44440
|
+
a3 < r2 && (r2 = a3, n2 = o3);
|
|
44441
|
+
}
|
|
44442
|
+
return n2;
|
|
44443
|
+
} }));
|
|
44444
|
+
useEffect(() => {
|
|
44445
|
+
if (!f2 || !v.current)
|
|
44446
|
+
return;
|
|
44447
|
+
const e2 = v.current, t2 = (e3) => {
|
|
44448
|
+
const t3 = e3.target;
|
|
44449
|
+
if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
|
|
44450
|
+
return;
|
|
44451
|
+
[" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e3.key) && e3.preventDefault();
|
|
44452
|
+
};
|
|
44453
|
+
return e2.addEventListener("keydown", t2), () => {
|
|
44454
|
+
e2.removeEventListener("keydown", t2);
|
|
44455
|
+
};
|
|
44456
|
+
}, [f2]);
|
|
44457
|
+
const y2 = o2.length, w2 = 2 * u2;
|
|
44458
|
+
let x2;
|
|
44459
|
+
x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
|
|
44460
|
+
const C = React2__default.useId().replace(/:/g, "_");
|
|
44461
|
+
return jsxs(Fragment, { children: [
|
|
44462
|
+
y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
|
|
44463
|
+
.snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
|
|
44464
|
+
width: 100%;
|
|
44465
|
+
}
|
|
44466
|
+
@container (min-width: ${w2}px) {
|
|
44467
|
+
.snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
|
|
44468
|
+
width: 50%;
|
|
44469
|
+
}
|
|
44470
|
+
}
|
|
44471
|
+
` }),
|
|
44472
|
+
/* @__PURE__ */ jsx("div", { ref: v, className: `snap-carousel-container ${a2}`, style: { ...b, ...s2, "--snap-carousel-min-width": `${u2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": x2, "--snap-carousel-panel-count": y2, "--snap-carousel-two-panel-threshold": `${w2}px` }, onScroll: (e2) => {
|
|
44473
|
+
if (!m2 || !v.current || v.current.children.length === 0)
|
|
44474
|
+
return;
|
|
44475
|
+
const t2 = v.current, n2 = t2.getBoundingClientRect().left;
|
|
44476
|
+
let r2 = 0, o3 = 1 / 0;
|
|
44477
|
+
for (let i2 = 0; i2 < t2.children.length; i2++) {
|
|
44478
|
+
const e3 = t2.children[i2].getBoundingClientRect(), a3 = Math.abs(e3.left - n2);
|
|
44479
|
+
a3 < o3 && (o3 = a3, r2 = i2);
|
|
44480
|
+
}
|
|
44481
|
+
m2(r2);
|
|
44482
|
+
}, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
44483
|
+
] });
|
|
44484
|
+
});
|
|
44485
|
+
M.displayName = "SnapCarousel";
|
|
44486
|
+
var se;
|
|
44487
|
+
var ce;
|
|
44488
|
+
(ce = se || (se = {})).DragStart = "dragStart", ce.DragMove = "dragMove", ce.DragEnd = "dragEnd", ce.DragCancel = "dragCancel", ce.DragOver = "dragOver", ce.RegisterDroppable = "registerDroppable", ce.SetDroppableDisabled = "setDroppableDisabled", ce.UnregisterDroppable = "unregisterDroppable";
|
|
44489
|
+
var ue = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
44490
|
+
var Te;
|
|
44491
|
+
var ke;
|
|
44492
|
+
(ke = Te || (Te = {}))[ke.Forward = 1] = "Forward", ke[ke.Backward = -1] = "Backward";
|
|
44493
|
+
var je;
|
|
44494
|
+
var He;
|
|
44495
|
+
var Ke;
|
|
44496
|
+
var Ue;
|
|
44497
|
+
(He = je || (je = {})).Click = "click", He.DragStart = "dragstart", He.Keydown = "keydown", He.ContextMenu = "contextmenu", He.Resize = "resize", He.SelectionChange = "selectionchange", He.VisibilityChange = "visibilitychange", (Ue = Ke || (Ke = {})).Space = "Space", Ue.Down = "ArrowDown", Ue.Right = "ArrowRight", Ue.Left = "ArrowLeft", Ue.Up = "ArrowUp", Ue.Esc = "Escape", Ue.Enter = "Enter", Ue.Tab = "Tab";
|
|
44498
|
+
({ start: [Ke.Space, Ke.Enter], cancel: [Ke.Esc], end: [Ke.Space, Ke.Enter, Ke.Tab] });
|
|
44499
|
+
var ot;
|
|
44500
|
+
var it;
|
|
44501
|
+
(it = ot || (ot = {}))[it.RightClick = 2] = "RightClick";
|
|
44502
|
+
var lt;
|
|
44503
|
+
var st;
|
|
44504
|
+
var ct;
|
|
44505
|
+
var dt;
|
|
44506
|
+
(st = lt || (lt = {}))[st.Pointer = 0] = "Pointer", st[st.DraggableRect = 1] = "DraggableRect", (dt = ct || (ct = {}))[dt.TreeOrder = 0] = "TreeOrder", dt[dt.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
44507
|
+
({ x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } });
|
|
44508
|
+
var ht;
|
|
44509
|
+
var mt;
|
|
44510
|
+
var ft;
|
|
44511
|
+
(mt = ht || (ht = {}))[mt.Always = 0] = "Always", mt[mt.BeforeDragging = 1] = "BeforeDragging", mt[mt.WhileDragging = 2] = "WhileDragging", (ft || (ft = {})).Optimized = "optimized";
|
|
44512
|
+
({ droppable: { strategy: ht.WhileDragging, frequency: ft.Optimized } });
|
|
44513
|
+
/* @__PURE__ */ createContext({ ...ue, scaleX: 1, scaleY: 1 });
|
|
44514
|
+
var Bt;
|
|
44515
|
+
var Ot;
|
|
44516
|
+
(Ot = Bt || (Bt = {}))[Ot.Uninitialized = 0] = "Uninitialized", Ot[Ot.Initializing = 1] = "Initializing", Ot[Ot.Initialized = 2] = "Initialized";
|
|
44517
|
+
var Vt;
|
|
44518
|
+
(() => {
|
|
44519
|
+
if (typeof window != "undefined") {
|
|
44520
|
+
const e2 = window;
|
|
44521
|
+
return e2.__principlemd_theme_context__ || (e2.__principlemd_theme_context__ = createContext(void 0)), e2.__principlemd_theme_context__;
|
|
44522
|
+
}
|
|
44523
|
+
return Vt || (Vt = createContext(void 0)), Vt;
|
|
44524
|
+
})();
|
|
44525
|
+
var DocumentView = ({
|
|
44526
|
+
content: content2,
|
|
44527
|
+
showSegmented = false,
|
|
44528
|
+
onCheckboxChange,
|
|
44529
|
+
onSectionClick,
|
|
44530
|
+
maxWidth = "900px",
|
|
44531
|
+
showSectionHeaders = true,
|
|
44532
|
+
showSeparators = true,
|
|
44533
|
+
slideIdPrefix = "document",
|
|
44534
|
+
enableHtmlPopout = true,
|
|
44535
|
+
enableKeyboardScrolling = true,
|
|
44536
|
+
onLinkClick,
|
|
44537
|
+
handleRunBashCommand,
|
|
44538
|
+
handlePromptCopy,
|
|
44539
|
+
repositoryInfo,
|
|
44540
|
+
fontSizeScale,
|
|
44541
|
+
theme: theme2,
|
|
44542
|
+
transparentBackground = false
|
|
44543
|
+
}) => {
|
|
44544
|
+
const containerRef = useRef(null);
|
|
44545
|
+
const sectionRefs = useRef([]);
|
|
44546
|
+
const backgroundColor = transparentBackground ? "transparent" : theme2.colors.background;
|
|
44547
|
+
const scrollToSection = useCallback((sectionIndex) => {
|
|
44548
|
+
var _a;
|
|
44549
|
+
if (sectionRefs.current[sectionIndex]) {
|
|
44550
|
+
(_a = sectionRefs.current[sectionIndex]) == null ? void 0 : _a.scrollIntoView({
|
|
44551
|
+
behavior: "smooth",
|
|
44552
|
+
block: "start"
|
|
44553
|
+
});
|
|
44554
|
+
}
|
|
44555
|
+
}, []);
|
|
44556
|
+
const handleSectionClick = useCallback((index2) => {
|
|
44557
|
+
scrollToSection(index2);
|
|
44558
|
+
onSectionClick == null ? void 0 : onSectionClick(index2);
|
|
44559
|
+
}, [scrollToSection, onSectionClick]);
|
|
44560
|
+
if (typeof content2 === "string") {
|
|
44561
|
+
return /* @__PURE__ */ React2__default.createElement("div", {
|
|
44562
|
+
ref: containerRef,
|
|
44563
|
+
style: {
|
|
44564
|
+
height: "100%",
|
|
44565
|
+
overflow: "auto",
|
|
44566
|
+
backgroundColor
|
|
44567
|
+
}
|
|
44568
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44569
|
+
style: {
|
|
44570
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44571
|
+
margin: "0 auto",
|
|
44572
|
+
height: "100%"
|
|
44635
44573
|
}
|
|
44636
|
-
|
|
44637
|
-
|
|
44638
|
-
|
|
44639
|
-
|
|
44640
|
-
|
|
44641
|
-
|
|
44642
|
-
|
|
44643
|
-
|
|
44644
|
-
|
|
44645
|
-
|
|
44646
|
-
|
|
44574
|
+
}, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44575
|
+
content: content2,
|
|
44576
|
+
slideIdPrefix,
|
|
44577
|
+
slideIndex: 0,
|
|
44578
|
+
isVisible: true,
|
|
44579
|
+
theme: theme2,
|
|
44580
|
+
onCheckboxChange,
|
|
44581
|
+
enableHtmlPopout,
|
|
44582
|
+
enableKeyboardScrolling,
|
|
44583
|
+
onLinkClick,
|
|
44584
|
+
handleRunBashCommand,
|
|
44585
|
+
fontSizeScale,
|
|
44586
|
+
handlePromptCopy,
|
|
44587
|
+
repositoryInfo,
|
|
44588
|
+
transparentBackground
|
|
44589
|
+
})));
|
|
44590
|
+
}
|
|
44591
|
+
if (!showSegmented) {
|
|
44592
|
+
const fullContent = content2.join(`
|
|
44593
|
+
|
|
44594
|
+
---
|
|
44595
|
+
|
|
44596
|
+
`);
|
|
44597
|
+
return /* @__PURE__ */ React2__default.createElement("div", {
|
|
44598
|
+
ref: containerRef,
|
|
44599
|
+
style: {
|
|
44600
|
+
height: "100%",
|
|
44601
|
+
overflow: "auto",
|
|
44602
|
+
backgroundColor
|
|
44603
|
+
}
|
|
44604
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44605
|
+
style: {
|
|
44606
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44607
|
+
margin: "0 auto",
|
|
44608
|
+
height: "100%"
|
|
44647
44609
|
}
|
|
44610
|
+
}, /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44611
|
+
content: fullContent,
|
|
44612
|
+
slideIdPrefix,
|
|
44613
|
+
slideIndex: 0,
|
|
44614
|
+
isVisible: true,
|
|
44615
|
+
theme: theme2,
|
|
44616
|
+
onCheckboxChange,
|
|
44617
|
+
enableHtmlPopout,
|
|
44618
|
+
enableKeyboardScrolling,
|
|
44619
|
+
onLinkClick,
|
|
44620
|
+
handleRunBashCommand,
|
|
44621
|
+
fontSizeScale,
|
|
44622
|
+
handlePromptCopy,
|
|
44623
|
+
repositoryInfo,
|
|
44624
|
+
transparentBackground
|
|
44625
|
+
})));
|
|
44626
|
+
}
|
|
44627
|
+
return /* @__PURE__ */ React2__default.createElement("div", {
|
|
44628
|
+
ref: containerRef,
|
|
44629
|
+
style: {
|
|
44630
|
+
height: "100%",
|
|
44631
|
+
overflow: "auto",
|
|
44632
|
+
backgroundColor
|
|
44648
44633
|
}
|
|
44649
|
-
}
|
|
44650
|
-
|
|
44651
|
-
|
|
44634
|
+
}, /* @__PURE__ */ React2__default.createElement("div", {
|
|
44635
|
+
style: {
|
|
44636
|
+
maxWidth: typeof maxWidth === "number" ? `${maxWidth}px` : maxWidth,
|
|
44637
|
+
margin: "0 auto"
|
|
44638
|
+
}
|
|
44639
|
+
}, content2.map((slideContent, index2) => /* @__PURE__ */ React2__default.createElement("div", {
|
|
44640
|
+
key: index2,
|
|
44641
|
+
ref: (el) => {
|
|
44642
|
+
if (el)
|
|
44643
|
+
sectionRefs.current[index2] = el;
|
|
44644
|
+
},
|
|
44645
|
+
style: {
|
|
44646
|
+
marginBottom: index2 < content2.length - 1 ? "48px" : "0",
|
|
44647
|
+
scrollMarginTop: "20px"
|
|
44648
|
+
}
|
|
44649
|
+
}, showSectionHeaders && /* @__PURE__ */ React2__default.createElement("div", {
|
|
44650
|
+
onClick: () => handleSectionClick(index2),
|
|
44651
|
+
style: {
|
|
44652
|
+
display: "flex",
|
|
44653
|
+
alignItems: "center",
|
|
44654
|
+
justifyContent: "space-between",
|
|
44655
|
+
marginBottom: "16px",
|
|
44656
|
+
paddingBottom: "8px",
|
|
44657
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
44658
|
+
opacity: 0.7,
|
|
44659
|
+
cursor: "pointer",
|
|
44660
|
+
transition: "opacity 0.2s ease"
|
|
44661
|
+
},
|
|
44662
|
+
onMouseOver: (e2) => {
|
|
44663
|
+
e2.currentTarget.style.opacity = "1";
|
|
44664
|
+
},
|
|
44665
|
+
onMouseOut: (e2) => {
|
|
44666
|
+
e2.currentTarget.style.opacity = "0.7";
|
|
44667
|
+
}
|
|
44668
|
+
}, /* @__PURE__ */ React2__default.createElement("span", {
|
|
44669
|
+
style: {
|
|
44670
|
+
fontSize: "11px",
|
|
44671
|
+
fontWeight: 600,
|
|
44672
|
+
color: theme2.colors.textSecondary,
|
|
44673
|
+
textTransform: "uppercase",
|
|
44674
|
+
letterSpacing: "0.5px"
|
|
44675
|
+
}
|
|
44676
|
+
}, "Section ", index2 + 1, " of ", content2.length)), /* @__PURE__ */ React2__default.createElement(IndustryMarkdownSlide, {
|
|
44677
|
+
content: slideContent,
|
|
44678
|
+
slideIdPrefix: `${slideIdPrefix}-${index2}`,
|
|
44679
|
+
slideIndex: index2,
|
|
44680
|
+
isVisible: true,
|
|
44681
|
+
theme: theme2,
|
|
44682
|
+
onCheckboxChange,
|
|
44683
|
+
enableHtmlPopout,
|
|
44684
|
+
enableKeyboardScrolling,
|
|
44685
|
+
onLinkClick,
|
|
44686
|
+
handleRunBashCommand,
|
|
44687
|
+
fontSizeScale,
|
|
44688
|
+
handlePromptCopy,
|
|
44689
|
+
repositoryInfo,
|
|
44690
|
+
transparentBackground
|
|
44691
|
+
}), showSeparators && index2 < content2.length - 1 && /* @__PURE__ */ React2__default.createElement("div", {
|
|
44692
|
+
style: {
|
|
44693
|
+
marginTop: "32px",
|
|
44694
|
+
marginBottom: "32px",
|
|
44695
|
+
height: "1px",
|
|
44696
|
+
backgroundColor: theme2.colors.border,
|
|
44697
|
+
opacity: 0.3
|
|
44698
|
+
}
|
|
44699
|
+
})))));
|
|
44700
|
+
};
|
|
44701
|
+
const GitCommitDetailPanelContent = ({
|
|
44702
|
+
events
|
|
44703
|
+
}) => {
|
|
44704
|
+
const { theme: theme2 } = useTheme();
|
|
44705
|
+
const [selectedCommit, setSelectedCommit] = useState(null);
|
|
44706
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
44707
|
+
const [error, setError] = useState(null);
|
|
44708
|
+
useEffect(() => {
|
|
44709
|
+
if (!events) return;
|
|
44710
|
+
const unsubscribers = [
|
|
44711
|
+
// Host is loading commit details
|
|
44712
|
+
events.on(
|
|
44713
|
+
"git-panels.commit-detail:loading",
|
|
44714
|
+
(event) => {
|
|
44715
|
+
setIsLoading(true);
|
|
44716
|
+
setError(null);
|
|
44717
|
+
}
|
|
44718
|
+
),
|
|
44719
|
+
// Host loaded commit details
|
|
44720
|
+
events.on(
|
|
44721
|
+
"git-panels.commit-detail:loaded",
|
|
44722
|
+
(event) => {
|
|
44723
|
+
var _a;
|
|
44724
|
+
const commit = (_a = event.payload) == null ? void 0 : _a.commit;
|
|
44725
|
+
if (commit) {
|
|
44726
|
+
setSelectedCommit(commit);
|
|
44727
|
+
setIsLoading(false);
|
|
44728
|
+
setError(null);
|
|
44729
|
+
}
|
|
44730
|
+
}
|
|
44731
|
+
),
|
|
44732
|
+
// Host encountered error
|
|
44733
|
+
events.on(
|
|
44734
|
+
"git-panels.commit-detail:error",
|
|
44735
|
+
(event) => {
|
|
44736
|
+
var _a;
|
|
44737
|
+
setError(((_a = event.payload) == null ? void 0 : _a.error) || "Failed to load commit");
|
|
44738
|
+
setIsLoading(false);
|
|
44739
|
+
}
|
|
44740
|
+
)
|
|
44741
|
+
];
|
|
44652
44742
|
return () => {
|
|
44653
|
-
|
|
44743
|
+
unsubscribers.forEach((unsub) => unsub && unsub());
|
|
44654
44744
|
};
|
|
44655
|
-
}, []);
|
|
44656
|
-
const
|
|
44657
|
-
|
|
44658
|
-
|
|
44659
|
-
if (
|
|
44660
|
-
|
|
44661
|
-
|
|
44662
|
-
|
|
44663
|
-
|
|
44745
|
+
}, [events]);
|
|
44746
|
+
const handleClose = () => {
|
|
44747
|
+
setSelectedCommit(null);
|
|
44748
|
+
setError(null);
|
|
44749
|
+
if (events) {
|
|
44750
|
+
events.emit({
|
|
44751
|
+
type: "git-panels.commit:deselected",
|
|
44752
|
+
source: "git-panels.commit-detail",
|
|
44753
|
+
timestamp: Date.now(),
|
|
44754
|
+
payload: {}
|
|
44755
|
+
});
|
|
44664
44756
|
}
|
|
44665
|
-
|
|
44666
|
-
|
|
44667
|
-
|
|
44668
|
-
|
|
44669
|
-
|
|
44757
|
+
};
|
|
44758
|
+
const containerStyle = {
|
|
44759
|
+
display: "flex",
|
|
44760
|
+
flexDirection: "column",
|
|
44761
|
+
height: "100%",
|
|
44762
|
+
backgroundColor: theme2.colors.background,
|
|
44763
|
+
overflow: "hidden"
|
|
44764
|
+
};
|
|
44765
|
+
if (isLoading) {
|
|
44766
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
44767
|
+
/* @__PURE__ */ jsxs(
|
|
44768
|
+
"div",
|
|
44769
|
+
{
|
|
44770
|
+
style: {
|
|
44771
|
+
flex: 1,
|
|
44772
|
+
display: "flex",
|
|
44773
|
+
flexDirection: "column",
|
|
44774
|
+
alignItems: "center",
|
|
44775
|
+
justifyContent: "center",
|
|
44776
|
+
gap: "16px",
|
|
44777
|
+
padding: "24px",
|
|
44778
|
+
textAlign: "center"
|
|
44779
|
+
},
|
|
44780
|
+
children: [
|
|
44781
|
+
/* @__PURE__ */ jsx(
|
|
44782
|
+
LoaderCircle,
|
|
44783
|
+
{
|
|
44784
|
+
size: 32,
|
|
44785
|
+
style: {
|
|
44786
|
+
color: theme2.colors.primary,
|
|
44787
|
+
animation: "spin 1s linear infinite"
|
|
44788
|
+
}
|
|
44789
|
+
}
|
|
44790
|
+
),
|
|
44791
|
+
/* @__PURE__ */ jsx(
|
|
44792
|
+
"p",
|
|
44793
|
+
{
|
|
44794
|
+
style: {
|
|
44795
|
+
margin: 0,
|
|
44796
|
+
fontFamily: theme2.fonts.body,
|
|
44797
|
+
fontSize: theme2.fontSizes[1],
|
|
44798
|
+
color: theme2.colors.textSecondary
|
|
44799
|
+
},
|
|
44800
|
+
children: "Loading commit details..."
|
|
44801
|
+
}
|
|
44802
|
+
)
|
|
44803
|
+
]
|
|
44804
|
+
}
|
|
44805
|
+
),
|
|
44806
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` })
|
|
44807
|
+
] });
|
|
44808
|
+
}
|
|
44809
|
+
if (error) {
|
|
44810
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
|
|
44811
|
+
"div",
|
|
44812
|
+
{
|
|
44813
|
+
style: {
|
|
44814
|
+
flex: 1,
|
|
44815
|
+
display: "flex",
|
|
44816
|
+
flexDirection: "column",
|
|
44817
|
+
alignItems: "center",
|
|
44818
|
+
justifyContent: "center",
|
|
44819
|
+
gap: "16px",
|
|
44820
|
+
padding: "24px",
|
|
44821
|
+
textAlign: "center"
|
|
44822
|
+
},
|
|
44823
|
+
children: [
|
|
44824
|
+
/* @__PURE__ */ jsx(X, { size: 48, style: { color: theme2.colors.error || "#ef4444" } }),
|
|
44825
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
44826
|
+
/* @__PURE__ */ jsx(
|
|
44827
|
+
"h3",
|
|
44828
|
+
{
|
|
44829
|
+
style: {
|
|
44830
|
+
margin: 0,
|
|
44831
|
+
marginBottom: "8px",
|
|
44832
|
+
fontFamily: theme2.fonts.heading,
|
|
44833
|
+
fontSize: theme2.fontSizes[3],
|
|
44834
|
+
fontWeight: 600,
|
|
44835
|
+
color: theme2.colors.text
|
|
44836
|
+
},
|
|
44837
|
+
children: "Failed to Load Commit"
|
|
44838
|
+
}
|
|
44839
|
+
),
|
|
44840
|
+
/* @__PURE__ */ jsx(
|
|
44841
|
+
"p",
|
|
44842
|
+
{
|
|
44843
|
+
style: {
|
|
44844
|
+
margin: 0,
|
|
44845
|
+
fontFamily: theme2.fonts.body,
|
|
44846
|
+
fontSize: theme2.fontSizes[1],
|
|
44847
|
+
color: theme2.colors.textSecondary
|
|
44848
|
+
},
|
|
44849
|
+
children: error
|
|
44850
|
+
}
|
|
44851
|
+
)
|
|
44852
|
+
] })
|
|
44853
|
+
]
|
|
44670
44854
|
}
|
|
44671
|
-
|
|
44672
|
-
|
|
44673
|
-
|
|
44674
|
-
|
|
44675
|
-
|
|
44676
|
-
|
|
44677
|
-
|
|
44678
|
-
|
|
44679
|
-
|
|
44680
|
-
|
|
44681
|
-
|
|
44682
|
-
|
|
44683
|
-
|
|
44684
|
-
|
|
44685
|
-
|
|
44686
|
-
|
|
44687
|
-
|
|
44688
|
-
|
|
44689
|
-
|
|
44855
|
+
) });
|
|
44856
|
+
}
|
|
44857
|
+
if (!selectedCommit) {
|
|
44858
|
+
return /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsxs(
|
|
44859
|
+
"div",
|
|
44860
|
+
{
|
|
44861
|
+
style: {
|
|
44862
|
+
flex: 1,
|
|
44863
|
+
display: "flex",
|
|
44864
|
+
flexDirection: "column",
|
|
44865
|
+
alignItems: "center",
|
|
44866
|
+
justifyContent: "center",
|
|
44867
|
+
gap: "16px",
|
|
44868
|
+
padding: "24px",
|
|
44869
|
+
textAlign: "center"
|
|
44870
|
+
},
|
|
44871
|
+
children: [
|
|
44872
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 48, style: { color: theme2.colors.textMuted } }),
|
|
44873
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
44874
|
+
/* @__PURE__ */ jsx(
|
|
44875
|
+
"h3",
|
|
44876
|
+
{
|
|
44877
|
+
style: {
|
|
44878
|
+
margin: 0,
|
|
44879
|
+
marginBottom: "8px",
|
|
44880
|
+
fontFamily: theme2.fonts.heading,
|
|
44881
|
+
fontSize: theme2.fontSizes[3],
|
|
44882
|
+
fontWeight: 600,
|
|
44883
|
+
color: theme2.colors.text
|
|
44884
|
+
},
|
|
44885
|
+
children: "No Commit Selected"
|
|
44886
|
+
}
|
|
44887
|
+
),
|
|
44888
|
+
/* @__PURE__ */ jsx(
|
|
44889
|
+
"p",
|
|
44890
|
+
{
|
|
44891
|
+
style: {
|
|
44892
|
+
margin: 0,
|
|
44893
|
+
fontFamily: theme2.fonts.body,
|
|
44894
|
+
fontSize: theme2.fontSizes[1],
|
|
44895
|
+
color: theme2.colors.textSecondary,
|
|
44896
|
+
lineHeight: 1.5
|
|
44897
|
+
},
|
|
44898
|
+
children: "Click on a commit in the history to view its details."
|
|
44899
|
+
}
|
|
44900
|
+
)
|
|
44901
|
+
] })
|
|
44902
|
+
]
|
|
44690
44903
|
}
|
|
44691
|
-
|
|
44692
|
-
|
|
44693
|
-
|
|
44694
|
-
|
|
44695
|
-
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
|
|
44700
|
-
|
|
44701
|
-
|
|
44702
|
-
|
|
44703
|
-
|
|
44704
|
-
|
|
44705
|
-
|
|
44706
|
-
|
|
44707
|
-
|
|
44708
|
-
|
|
44904
|
+
) });
|
|
44905
|
+
}
|
|
44906
|
+
const shortHash = selectedCommit.hash.substring(0, 8);
|
|
44907
|
+
const [firstLine, ...restLines] = selectedCommit.message.split("\n");
|
|
44908
|
+
const messageBody = restLines.join("\n").trim();
|
|
44909
|
+
const relative = formatRelativeTime(selectedCommit.date);
|
|
44910
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
44911
|
+
/* @__PURE__ */ jsxs(
|
|
44912
|
+
"div",
|
|
44913
|
+
{
|
|
44914
|
+
style: {
|
|
44915
|
+
height: "40px",
|
|
44916
|
+
minHeight: "40px",
|
|
44917
|
+
padding: "0 12px",
|
|
44918
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
44919
|
+
backgroundColor: theme2.colors.backgroundSecondary,
|
|
44920
|
+
display: "flex",
|
|
44921
|
+
alignItems: "center",
|
|
44922
|
+
gap: "8px",
|
|
44923
|
+
boxSizing: "border-box"
|
|
44924
|
+
},
|
|
44925
|
+
children: [
|
|
44926
|
+
selectedCommit.files && selectedCommit.files.length > 0 && /* @__PURE__ */ jsxs(
|
|
44927
|
+
"span",
|
|
44928
|
+
{
|
|
44929
|
+
style: {
|
|
44930
|
+
color: theme2.colors.textSecondary,
|
|
44931
|
+
fontSize: theme2.fontSizes[0],
|
|
44932
|
+
fontFamily: theme2.fonts.body
|
|
44933
|
+
},
|
|
44934
|
+
children: [
|
|
44935
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.primary }, children: [
|
|
44936
|
+
selectedCommit.files.length,
|
|
44937
|
+
" ",
|
|
44938
|
+
selectedCommit.files.length === 1 ? "file" : "files"
|
|
44939
|
+
] }),
|
|
44940
|
+
" changed"
|
|
44941
|
+
]
|
|
44709
44942
|
}
|
|
44710
|
-
|
|
44711
|
-
|
|
44943
|
+
),
|
|
44944
|
+
/* @__PURE__ */ jsxs(
|
|
44945
|
+
"span",
|
|
44946
|
+
{
|
|
44947
|
+
style: {
|
|
44948
|
+
display: "inline-flex",
|
|
44949
|
+
alignItems: "center",
|
|
44950
|
+
gap: "6px",
|
|
44951
|
+
color: theme2.colors.textSecondary,
|
|
44952
|
+
fontSize: theme2.fontSizes[0],
|
|
44953
|
+
fontFamily: theme2.fonts.body
|
|
44954
|
+
},
|
|
44955
|
+
children: [
|
|
44956
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: relative }),
|
|
44957
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
44958
|
+
"by ",
|
|
44959
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.primary }, children: selectedCommit.author })
|
|
44960
|
+
] }),
|
|
44961
|
+
/* @__PURE__ */ jsx("span", { children: "as" }),
|
|
44962
|
+
/* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.monospace }, children: [
|
|
44963
|
+
"sha ",
|
|
44964
|
+
shortHash
|
|
44965
|
+
] })
|
|
44966
|
+
]
|
|
44967
|
+
}
|
|
44968
|
+
),
|
|
44969
|
+
selectedCommit.stats && /* @__PURE__ */ jsxs(
|
|
44970
|
+
"span",
|
|
44971
|
+
{
|
|
44972
|
+
style: {
|
|
44973
|
+
display: "inline-flex",
|
|
44974
|
+
alignItems: "center",
|
|
44975
|
+
gap: "6px",
|
|
44976
|
+
padding: "4px 10px",
|
|
44977
|
+
borderRadius: "999px",
|
|
44978
|
+
backgroundColor: `${theme2.colors.primary}20`,
|
|
44979
|
+
color: theme2.colors.primary,
|
|
44980
|
+
fontFamily: theme2.fonts.heading,
|
|
44981
|
+
fontSize: theme2.fontSizes[0],
|
|
44982
|
+
fontWeight: 600
|
|
44983
|
+
},
|
|
44984
|
+
children: [
|
|
44985
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.success || "#22c55e", display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
|
|
44986
|
+
/* @__PURE__ */ jsx(Plus, { size: 12 }),
|
|
44987
|
+
selectedCommit.stats.additions
|
|
44988
|
+
] }),
|
|
44989
|
+
/* @__PURE__ */ jsxs("span", { style: { color: theme2.colors.error || "#ef4444", display: "inline-flex", alignItems: "center", gap: "2px" }, children: [
|
|
44990
|
+
/* @__PURE__ */ jsx(Minus, { size: 12 }),
|
|
44991
|
+
selectedCommit.stats.deletions
|
|
44992
|
+
] })
|
|
44993
|
+
]
|
|
44994
|
+
}
|
|
44995
|
+
),
|
|
44996
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
44997
|
+
selectedCommit.htmlUrl && /* @__PURE__ */ jsx(
|
|
44998
|
+
"a",
|
|
44999
|
+
{
|
|
45000
|
+
href: selectedCommit.htmlUrl,
|
|
45001
|
+
target: "_blank",
|
|
45002
|
+
rel: "noreferrer",
|
|
45003
|
+
title: "View on GitHub",
|
|
45004
|
+
style: {
|
|
45005
|
+
display: "inline-flex",
|
|
45006
|
+
alignItems: "center",
|
|
45007
|
+
justifyContent: "center",
|
|
45008
|
+
width: "28px",
|
|
45009
|
+
height: "28px",
|
|
45010
|
+
padding: 0,
|
|
45011
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45012
|
+
borderRadius: "6px",
|
|
45013
|
+
backgroundColor: theme2.colors.background,
|
|
45014
|
+
color: theme2.colors.textSecondary,
|
|
45015
|
+
textDecoration: "none"
|
|
45016
|
+
},
|
|
45017
|
+
children: /* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
45018
|
+
}
|
|
45019
|
+
),
|
|
45020
|
+
/* @__PURE__ */ jsx(
|
|
45021
|
+
"button",
|
|
45022
|
+
{
|
|
45023
|
+
type: "button",
|
|
45024
|
+
onClick: handleClose,
|
|
45025
|
+
title: "Close",
|
|
45026
|
+
style: {
|
|
45027
|
+
display: "inline-flex",
|
|
45028
|
+
alignItems: "center",
|
|
45029
|
+
justifyContent: "center",
|
|
45030
|
+
width: "28px",
|
|
45031
|
+
height: "28px",
|
|
45032
|
+
padding: 0,
|
|
45033
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45034
|
+
borderRadius: "6px",
|
|
45035
|
+
backgroundColor: theme2.colors.background,
|
|
45036
|
+
color: theme2.colors.textSecondary,
|
|
45037
|
+
cursor: "pointer"
|
|
45038
|
+
},
|
|
45039
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
45040
|
+
}
|
|
45041
|
+
)
|
|
45042
|
+
]
|
|
45043
|
+
}
|
|
45044
|
+
),
|
|
45045
|
+
/* @__PURE__ */ jsxs(
|
|
45046
|
+
"div",
|
|
45047
|
+
{
|
|
45048
|
+
style: {
|
|
45049
|
+
flex: 1,
|
|
45050
|
+
overflow: "auto",
|
|
45051
|
+
padding: "16px"
|
|
45052
|
+
},
|
|
45053
|
+
children: [
|
|
45054
|
+
/* @__PURE__ */ jsx(
|
|
45055
|
+
"h1",
|
|
45056
|
+
{
|
|
45057
|
+
style: {
|
|
45058
|
+
margin: 0,
|
|
45059
|
+
marginBottom: "16px",
|
|
45060
|
+
fontFamily: theme2.fonts.heading,
|
|
45061
|
+
fontSize: theme2.fontSizes[4] || 20,
|
|
45062
|
+
fontWeight: 600,
|
|
45063
|
+
color: theme2.colors.text,
|
|
45064
|
+
lineHeight: 1.3
|
|
45065
|
+
},
|
|
45066
|
+
children: firstLine
|
|
45067
|
+
}
|
|
45068
|
+
),
|
|
45069
|
+
messageBody && /* @__PURE__ */ jsx(
|
|
45070
|
+
"div",
|
|
45071
|
+
{
|
|
45072
|
+
style: {
|
|
45073
|
+
borderTop: `1px solid ${theme2.colors.border}`,
|
|
45074
|
+
paddingTop: "16px"
|
|
45075
|
+
},
|
|
45076
|
+
children: /* @__PURE__ */ jsx(
|
|
45077
|
+
DocumentView,
|
|
45078
|
+
{
|
|
45079
|
+
content: messageBody,
|
|
45080
|
+
theme: theme2,
|
|
45081
|
+
maxWidth: "100%",
|
|
45082
|
+
transparentBackground: true
|
|
45083
|
+
}
|
|
45084
|
+
)
|
|
45085
|
+
}
|
|
45086
|
+
)
|
|
45087
|
+
]
|
|
45088
|
+
}
|
|
45089
|
+
)
|
|
45090
|
+
] });
|
|
45091
|
+
};
|
|
45092
|
+
const GitCommitDetailPanel = GitCommitDetailPanelContent;
|
|
45093
|
+
const GitCommitDetailPanelPreview = () => {
|
|
45094
|
+
const { theme: theme2 } = useTheme();
|
|
45095
|
+
return /* @__PURE__ */ jsxs(
|
|
45096
|
+
"div",
|
|
45097
|
+
{
|
|
45098
|
+
style: {
|
|
45099
|
+
padding: "12px",
|
|
45100
|
+
fontFamily: theme2.fonts.body,
|
|
45101
|
+
fontSize: theme2.fontSizes[0],
|
|
45102
|
+
color: theme2.colors.text,
|
|
45103
|
+
display: "flex",
|
|
45104
|
+
flexDirection: "column",
|
|
45105
|
+
gap: "8px"
|
|
45106
|
+
},
|
|
45107
|
+
children: [
|
|
45108
|
+
/* @__PURE__ */ jsxs(
|
|
45109
|
+
"div",
|
|
45110
|
+
{
|
|
45111
|
+
style: {
|
|
45112
|
+
display: "flex",
|
|
45113
|
+
alignItems: "center",
|
|
45114
|
+
gap: "8px"
|
|
45115
|
+
},
|
|
45116
|
+
children: [
|
|
45117
|
+
/* @__PURE__ */ jsx(GitCommitHorizontal, { size: 12, style: { color: theme2.colors.primary } }),
|
|
45118
|
+
/* @__PURE__ */ jsx(
|
|
45119
|
+
"span",
|
|
45120
|
+
{
|
|
45121
|
+
style: {
|
|
45122
|
+
fontFamily: theme2.fonts.monospace,
|
|
45123
|
+
fontSize: theme2.fontSizes[0],
|
|
45124
|
+
color: theme2.colors.primary
|
|
45125
|
+
},
|
|
45126
|
+
children: "a1b2c3d4"
|
|
45127
|
+
}
|
|
45128
|
+
),
|
|
45129
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.success || "#22c55e", fontSize: "10px" }, children: "+42" }),
|
|
45130
|
+
/* @__PURE__ */ jsx("span", { style: { color: theme2.colors.error || "#ef4444", fontSize: "10px" }, children: "-15" })
|
|
45131
|
+
]
|
|
45132
|
+
}
|
|
45133
|
+
),
|
|
45134
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "feat: add commit detail panel" }),
|
|
45135
|
+
/* @__PURE__ */ jsx(
|
|
45136
|
+
"div",
|
|
45137
|
+
{
|
|
45138
|
+
style: {
|
|
45139
|
+
color: theme2.colors.textSecondary,
|
|
45140
|
+
fontSize: theme2.fontSizes[0],
|
|
45141
|
+
lineHeight: 1.4
|
|
45142
|
+
},
|
|
45143
|
+
children: "View commit message, stats, and files changed."
|
|
44712
45144
|
}
|
|
45145
|
+
)
|
|
45146
|
+
]
|
|
45147
|
+
}
|
|
45148
|
+
);
|
|
45149
|
+
};
|
|
45150
|
+
const GitPullRequestsPanel = ({
|
|
45151
|
+
context,
|
|
45152
|
+
events
|
|
45153
|
+
}) => {
|
|
45154
|
+
var _a;
|
|
45155
|
+
const { theme: theme2 } = useTheme();
|
|
45156
|
+
const [filter, setFilter] = useState("open");
|
|
45157
|
+
const [selectedPrId, setSelectedPrId] = useState(null);
|
|
45158
|
+
const prSlice = context.getSlice("pullRequests");
|
|
45159
|
+
const hasPRs = context.hasSlice("pullRequests");
|
|
45160
|
+
const isLoading = context.isSliceLoading("pullRequests");
|
|
45161
|
+
const pullRequests = ((_a = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _a.pullRequests) ?? [];
|
|
45162
|
+
useEffect(() => {
|
|
45163
|
+
const unsubscribers = [
|
|
45164
|
+
// Tool: refresh pull requests
|
|
45165
|
+
events.on("git-panels.pull-requests:refresh", async () => {
|
|
45166
|
+
try {
|
|
45167
|
+
await context.refresh("repository", "pullRequests");
|
|
45168
|
+
} catch (error) {
|
|
45169
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
44713
45170
|
}
|
|
44714
|
-
}
|
|
44715
|
-
|
|
44716
|
-
|
|
44717
|
-
|
|
44718
|
-
|
|
44719
|
-
|
|
45171
|
+
}),
|
|
45172
|
+
// Tool: set filter
|
|
45173
|
+
events.on("git-panels.pull-requests:set-filter", (event) => {
|
|
45174
|
+
var _a2;
|
|
45175
|
+
const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
|
|
45176
|
+
if (newFilter && ["open", "closed"].includes(newFilter)) {
|
|
45177
|
+
setFilter(newFilter);
|
|
44720
45178
|
}
|
|
44721
|
-
|
|
44722
|
-
|
|
44723
|
-
|
|
44724
|
-
}, []);
|
|
44725
|
-
const
|
|
44726
|
-
|
|
44727
|
-
|
|
44728
|
-
|
|
44729
|
-
const
|
|
44730
|
-
|
|
44731
|
-
|
|
44732
|
-
|
|
44733
|
-
|
|
44734
|
-
|
|
44735
|
-
|
|
44736
|
-
|
|
44737
|
-
|
|
44738
|
-
assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
|
|
44739
|
-
const isLastPanel = findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1;
|
|
44740
|
-
const delta = isLastPanel ? panelSize - unsafePanelSize : unsafePanelSize - panelSize;
|
|
44741
|
-
const nextLayout = adjustLayoutByDelta({
|
|
44742
|
-
delta,
|
|
44743
|
-
initialLayout: prevLayout,
|
|
44744
|
-
panelConstraints: panelConstraintsArray,
|
|
44745
|
-
pivotIndices,
|
|
44746
|
-
prevLayout,
|
|
44747
|
-
trigger: "imperative-api"
|
|
44748
|
-
});
|
|
44749
|
-
if (!compareLayouts(prevLayout, nextLayout)) {
|
|
44750
|
-
setLayout(nextLayout);
|
|
44751
|
-
eagerValuesRef.current.layout = nextLayout;
|
|
44752
|
-
if (onLayout2) {
|
|
44753
|
-
onLayout2(nextLayout);
|
|
44754
|
-
}
|
|
44755
|
-
callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
|
|
44756
|
-
}
|
|
44757
|
-
}, []);
|
|
44758
|
-
const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
|
|
44759
|
-
const {
|
|
44760
|
-
layout: layout2,
|
|
44761
|
-
panelDataArray
|
|
44762
|
-
} = eagerValuesRef.current;
|
|
44763
|
-
const {
|
|
44764
|
-
collapsedSize: prevCollapsedSize = 0,
|
|
44765
|
-
collapsible: prevCollapsible
|
|
44766
|
-
} = prevConstraints;
|
|
44767
|
-
const {
|
|
44768
|
-
collapsedSize: nextCollapsedSize = 0,
|
|
44769
|
-
collapsible: nextCollapsible,
|
|
44770
|
-
maxSize: nextMaxSize = 100,
|
|
44771
|
-
minSize: nextMinSize = 0
|
|
44772
|
-
} = panelData.constraints;
|
|
44773
|
-
const {
|
|
44774
|
-
panelSize: prevPanelSize
|
|
44775
|
-
} = panelDataHelper(panelDataArray, panelData, layout2);
|
|
44776
|
-
if (prevPanelSize == null) {
|
|
44777
|
-
return;
|
|
44778
|
-
}
|
|
44779
|
-
if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
|
|
44780
|
-
if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) {
|
|
44781
|
-
resizePanel2(panelData, nextCollapsedSize);
|
|
44782
|
-
}
|
|
44783
|
-
} else if (prevPanelSize < nextMinSize) {
|
|
44784
|
-
resizePanel2(panelData, nextMinSize);
|
|
44785
|
-
} else if (prevPanelSize > nextMaxSize) {
|
|
44786
|
-
resizePanel2(panelData, nextMaxSize);
|
|
44787
|
-
}
|
|
44788
|
-
}, [resizePanel2]);
|
|
44789
|
-
const startDragging = useCallback((dragHandleId, event) => {
|
|
44790
|
-
const {
|
|
44791
|
-
direction: direction2
|
|
44792
|
-
} = committedValuesRef.current;
|
|
44793
|
-
const {
|
|
44794
|
-
layout: layout2
|
|
44795
|
-
} = eagerValuesRef.current;
|
|
44796
|
-
if (!panelGroupElementRef.current) {
|
|
44797
|
-
return;
|
|
45179
|
+
})
|
|
45180
|
+
];
|
|
45181
|
+
return () => unsubscribers.forEach((unsub) => unsub());
|
|
45182
|
+
}, [events, context]);
|
|
45183
|
+
const filteredPullRequests = useMemo(() => {
|
|
45184
|
+
return pullRequests.filter((pr) => pr.state === filter);
|
|
45185
|
+
}, [filter, pullRequests]);
|
|
45186
|
+
const counts = useMemo(() => {
|
|
45187
|
+
const open = pullRequests.filter((pr) => pr.state === "open").length;
|
|
45188
|
+
const closed = pullRequests.filter((pr) => pr.state === "closed").length;
|
|
45189
|
+
return { open, closed };
|
|
45190
|
+
}, [pullRequests]);
|
|
45191
|
+
const handleRefresh = async () => {
|
|
45192
|
+
try {
|
|
45193
|
+
await context.refresh("repository", "pullRequests");
|
|
45194
|
+
} catch (error) {
|
|
45195
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
44798
45196
|
}
|
|
44799
|
-
|
|
44800
|
-
|
|
44801
|
-
|
|
44802
|
-
|
|
44803
|
-
|
|
44804
|
-
|
|
44805
|
-
|
|
44806
|
-
|
|
45197
|
+
};
|
|
45198
|
+
const handlePRClick = (pr) => {
|
|
45199
|
+
setSelectedPrId(pr.id);
|
|
45200
|
+
events.emit({
|
|
45201
|
+
type: "git-panels.pull-request:selected",
|
|
45202
|
+
source: "git-panels.pull-requests",
|
|
45203
|
+
timestamp: Date.now(),
|
|
45204
|
+
payload: { pr }
|
|
44807
45205
|
});
|
|
44808
|
-
}
|
|
44809
|
-
const
|
|
44810
|
-
setDragState(null);
|
|
44811
|
-
}, []);
|
|
44812
|
-
const unregisterPanel = useCallback((panelData) => {
|
|
44813
|
-
const {
|
|
44814
|
-
panelDataArray
|
|
44815
|
-
} = eagerValuesRef.current;
|
|
44816
|
-
const index2 = findPanelDataIndex(panelDataArray, panelData);
|
|
44817
|
-
if (index2 >= 0) {
|
|
44818
|
-
panelDataArray.splice(index2, 1);
|
|
44819
|
-
delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
|
|
44820
|
-
eagerValuesRef.current.panelDataArrayChanged = true;
|
|
44821
|
-
forceUpdate();
|
|
44822
|
-
}
|
|
44823
|
-
}, [forceUpdate]);
|
|
44824
|
-
const context = useMemo(() => ({
|
|
44825
|
-
collapsePanel,
|
|
44826
|
-
direction,
|
|
44827
|
-
dragState,
|
|
44828
|
-
expandPanel,
|
|
44829
|
-
getPanelSize,
|
|
44830
|
-
getPanelStyle,
|
|
44831
|
-
groupId,
|
|
44832
|
-
isPanelCollapsed,
|
|
44833
|
-
isPanelExpanded,
|
|
44834
|
-
reevaluatePanelConstraints,
|
|
44835
|
-
registerPanel,
|
|
44836
|
-
registerResizeHandle: registerResizeHandle2,
|
|
44837
|
-
resizePanel: resizePanel2,
|
|
44838
|
-
startDragging,
|
|
44839
|
-
stopDragging,
|
|
44840
|
-
unregisterPanel,
|
|
44841
|
-
panelGroupElement: panelGroupElementRef.current
|
|
44842
|
-
}), [collapsePanel, dragState, direction, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, isPanelExpanded, reevaluatePanelConstraints, registerPanel, registerResizeHandle2, resizePanel2, startDragging, stopDragging, unregisterPanel]);
|
|
44843
|
-
const style2 = {
|
|
45206
|
+
};
|
|
45207
|
+
const containerStyle = {
|
|
44844
45208
|
display: "flex",
|
|
44845
|
-
flexDirection:
|
|
45209
|
+
flexDirection: "column",
|
|
44846
45210
|
height: "100%",
|
|
44847
|
-
|
|
44848
|
-
|
|
44849
|
-
};
|
|
44850
|
-
return createElement(PanelGroupContext.Provider, {
|
|
44851
|
-
value: context
|
|
44852
|
-
}, createElement(Type, {
|
|
44853
|
-
...rest,
|
|
44854
|
-
children: children2,
|
|
44855
|
-
className: classNameFromProps,
|
|
44856
|
-
id: idFromProps,
|
|
44857
|
-
ref: panelGroupElementRef,
|
|
44858
|
-
style: {
|
|
44859
|
-
...style2,
|
|
44860
|
-
...styleFromProps
|
|
44861
|
-
},
|
|
44862
|
-
[DATA_ATTRIBUTES.group]: "",
|
|
44863
|
-
[DATA_ATTRIBUTES.groupDirection]: direction,
|
|
44864
|
-
[DATA_ATTRIBUTES.groupId]: groupId
|
|
44865
|
-
}));
|
|
44866
|
-
}
|
|
44867
|
-
var PanelGroup = forwardRef((props2, ref) => createElement(PanelGroupWithForwardedRef, {
|
|
44868
|
-
...props2,
|
|
44869
|
-
forwardedRef: ref
|
|
44870
|
-
}));
|
|
44871
|
-
PanelGroupWithForwardedRef.displayName = "PanelGroup";
|
|
44872
|
-
PanelGroup.displayName = "forwardRef(PanelGroup)";
|
|
44873
|
-
function findPanelDataIndex(panelDataArray, panelData) {
|
|
44874
|
-
return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
|
|
44875
|
-
}
|
|
44876
|
-
function panelDataHelper(panelDataArray, panelData, layout) {
|
|
44877
|
-
const panelIndex = findPanelDataIndex(panelDataArray, panelData);
|
|
44878
|
-
const isLastPanel = panelIndex === panelDataArray.length - 1;
|
|
44879
|
-
const pivotIndices = isLastPanel ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
|
|
44880
|
-
const panelSize = layout[panelIndex];
|
|
44881
|
-
return {
|
|
44882
|
-
...panelData.constraints,
|
|
44883
|
-
panelSize,
|
|
44884
|
-
pivotIndices
|
|
45211
|
+
backgroundColor: theme2.colors.background,
|
|
45212
|
+
overflow: "hidden"
|
|
44885
45213
|
};
|
|
44886
|
-
|
|
44887
|
-
|
|
44888
|
-
|
|
44889
|
-
|
|
44890
|
-
|
|
44891
|
-
|
|
44892
|
-
|
|
44893
|
-
|
|
44894
|
-
|
|
44895
|
-
|
|
44896
|
-
|
|
44897
|
-
|
|
44898
|
-
|
|
44899
|
-
|
|
44900
|
-
|
|
44901
|
-
|
|
44902
|
-
|
|
44903
|
-
|
|
44904
|
-
|
|
44905
|
-
|
|
44906
|
-
|
|
44907
|
-
|
|
45214
|
+
const renderState = (icon, title, description) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
45215
|
+
"div",
|
|
45216
|
+
{
|
|
45217
|
+
style: {
|
|
45218
|
+
flex: 1,
|
|
45219
|
+
display: "flex",
|
|
45220
|
+
alignItems: "center",
|
|
45221
|
+
justifyContent: "center",
|
|
45222
|
+
padding: "24px"
|
|
45223
|
+
},
|
|
45224
|
+
children: /* @__PURE__ */ jsxs(
|
|
45225
|
+
"div",
|
|
45226
|
+
{
|
|
45227
|
+
style: {
|
|
45228
|
+
display: "flex",
|
|
45229
|
+
flexDirection: "column",
|
|
45230
|
+
alignItems: "center",
|
|
45231
|
+
gap: "16px",
|
|
45232
|
+
maxWidth: "360px",
|
|
45233
|
+
textAlign: "center"
|
|
45234
|
+
},
|
|
45235
|
+
children: [
|
|
45236
|
+
/* @__PURE__ */ jsx("div", { children: icon }),
|
|
45237
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
45238
|
+
/* @__PURE__ */ jsx(
|
|
45239
|
+
"h3",
|
|
45240
|
+
{
|
|
45241
|
+
style: {
|
|
45242
|
+
margin: 0,
|
|
45243
|
+
marginBottom: "8px",
|
|
45244
|
+
color: theme2.colors.text,
|
|
45245
|
+
fontFamily: theme2.fonts.heading,
|
|
45246
|
+
fontSize: theme2.fontSizes[2],
|
|
45247
|
+
fontWeight: 600
|
|
45248
|
+
},
|
|
45249
|
+
children: title
|
|
45250
|
+
}
|
|
45251
|
+
),
|
|
45252
|
+
description && /* @__PURE__ */ jsx(
|
|
45253
|
+
"p",
|
|
45254
|
+
{
|
|
45255
|
+
style: {
|
|
45256
|
+
margin: 0,
|
|
45257
|
+
color: theme2.colors.textSecondary,
|
|
45258
|
+
fontFamily: theme2.fonts.body,
|
|
45259
|
+
fontSize: theme2.fontSizes[1],
|
|
45260
|
+
lineHeight: 1.5
|
|
45261
|
+
},
|
|
45262
|
+
children: description
|
|
45263
|
+
}
|
|
45264
|
+
)
|
|
45265
|
+
] })
|
|
45266
|
+
]
|
|
45267
|
+
}
|
|
45268
|
+
)
|
|
44908
45269
|
}
|
|
44909
|
-
|
|
44910
|
-
|
|
44911
|
-
|
|
44912
|
-
|
|
44913
|
-
|
|
44914
|
-
|
|
44915
|
-
|
|
44916
|
-
if (t3.tagName === "INPUT" || t3.tagName === "TEXTAREA" || t3.tagName === "SELECT" || t3.isContentEditable || t3.closest(".xterm") !== null || t3.closest('[contenteditable="true"]') !== null)
|
|
44917
|
-
return;
|
|
44918
|
-
[" ", "Space", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "PageUp", "PageDown"].includes(e3.key) && e3.preventDefault();
|
|
44919
|
-
};
|
|
44920
|
-
return e2.addEventListener("keydown", t2), () => {
|
|
44921
|
-
e2.removeEventListener("keydown", t2);
|
|
44922
|
-
};
|
|
44923
|
-
}, [f2]);
|
|
44924
|
-
const y2 = o2.length, w2 = 2 * u2;
|
|
44925
|
-
let x2;
|
|
44926
|
-
x2 = y2 === 1 || y2 === 2 ? "100%" : `max(${u2}px, ${100 * p2}%)`;
|
|
44927
|
-
const C = React2__default.useId().replace(/:/g, "_");
|
|
44928
|
-
return jsxs(Fragment, { children: [
|
|
44929
|
-
y2 === 2 && /* @__PURE__ */ jsx("style", { children: `
|
|
44930
|
-
.snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
|
|
44931
|
-
width: 100%;
|
|
44932
|
-
}
|
|
44933
|
-
@container (min-width: ${w2}px) {
|
|
44934
|
-
.snap-carousel-container[data-carousel-id="${C}"][data-panel-count="2"] .snap-carousel-panel {
|
|
44935
|
-
width: 50%;
|
|
44936
|
-
}
|
|
44937
|
-
}
|
|
44938
|
-
` }),
|
|
44939
|
-
/* @__PURE__ */ jsx("div", { ref: v, className: `snap-carousel-container ${a2}`, style: { ...b, ...s2, "--snap-carousel-min-width": `${u2}px`, "--snap-carousel-ideal-width": 100 * p2 + "%", "--snap-carousel-gap": h2 ? "1px" : "0px", "--snap-carousel-panel-width": x2, "--snap-carousel-panel-count": y2, "--snap-carousel-two-panel-threshold": `${w2}px` }, onScroll: (e2) => {
|
|
44940
|
-
if (!m2 || !v.current || v.current.children.length === 0)
|
|
44941
|
-
return;
|
|
44942
|
-
const t2 = v.current, n2 = t2.getBoundingClientRect().left;
|
|
44943
|
-
let r2 = 0, o3 = 1 / 0;
|
|
44944
|
-
for (let i2 = 0; i2 < t2.children.length; i2++) {
|
|
44945
|
-
const e3 = t2.children[i2].getBoundingClientRect(), a3 = Math.abs(e3.left - n2);
|
|
44946
|
-
a3 < o3 && (o3 = a3, r2 = i2);
|
|
44947
|
-
}
|
|
44948
|
-
m2(r2);
|
|
44949
|
-
}, "data-panel-count": y2, "data-carousel-id": C, children: o2.map((t2, n2) => /* @__PURE__ */ jsx("div", { className: "snap-carousel-panel", children: t2 }, n2)) })
|
|
44950
|
-
] });
|
|
44951
|
-
});
|
|
44952
|
-
M.displayName = "SnapCarousel";
|
|
44953
|
-
var se;
|
|
44954
|
-
var ce;
|
|
44955
|
-
(ce = se || (se = {})).DragStart = "dragStart", ce.DragMove = "dragMove", ce.DragEnd = "dragEnd", ce.DragCancel = "dragCancel", ce.DragOver = "dragOver", ce.RegisterDroppable = "registerDroppable", ce.SetDroppableDisabled = "setDroppableDisabled", ce.UnregisterDroppable = "unregisterDroppable";
|
|
44956
|
-
var ue = /* @__PURE__ */ Object.freeze({ x: 0, y: 0 });
|
|
44957
|
-
var Te;
|
|
44958
|
-
var ke;
|
|
44959
|
-
(ke = Te || (Te = {}))[ke.Forward = 1] = "Forward", ke[ke.Backward = -1] = "Backward";
|
|
44960
|
-
var je;
|
|
44961
|
-
var He;
|
|
44962
|
-
var Ke;
|
|
44963
|
-
var Ue;
|
|
44964
|
-
(He = je || (je = {})).Click = "click", He.DragStart = "dragstart", He.Keydown = "keydown", He.ContextMenu = "contextmenu", He.Resize = "resize", He.SelectionChange = "selectionchange", He.VisibilityChange = "visibilitychange", (Ue = Ke || (Ke = {})).Space = "Space", Ue.Down = "ArrowDown", Ue.Right = "ArrowRight", Ue.Left = "ArrowLeft", Ue.Up = "ArrowUp", Ue.Esc = "Escape", Ue.Enter = "Enter", Ue.Tab = "Tab";
|
|
44965
|
-
({ start: [Ke.Space, Ke.Enter], cancel: [Ke.Esc], end: [Ke.Space, Ke.Enter, Ke.Tab] });
|
|
44966
|
-
var ot;
|
|
44967
|
-
var it;
|
|
44968
|
-
(it = ot || (ot = {}))[it.RightClick = 2] = "RightClick";
|
|
44969
|
-
var lt;
|
|
44970
|
-
var st;
|
|
44971
|
-
var ct;
|
|
44972
|
-
var dt;
|
|
44973
|
-
(st = lt || (lt = {}))[st.Pointer = 0] = "Pointer", st[st.DraggableRect = 1] = "DraggableRect", (dt = ct || (ct = {}))[dt.TreeOrder = 0] = "TreeOrder", dt[dt.ReversedTreeOrder = 1] = "ReversedTreeOrder";
|
|
44974
|
-
({ x: { [Te.Backward]: false, [Te.Forward]: false }, y: { [Te.Backward]: false, [Te.Forward]: false } });
|
|
44975
|
-
var ht;
|
|
44976
|
-
var mt;
|
|
44977
|
-
var ft;
|
|
44978
|
-
(mt = ht || (ht = {}))[mt.Always = 0] = "Always", mt[mt.BeforeDragging = 1] = "BeforeDragging", mt[mt.WhileDragging = 2] = "WhileDragging", (ft || (ft = {})).Optimized = "optimized";
|
|
44979
|
-
({ droppable: { strategy: ht.WhileDragging, frequency: ft.Optimized } });
|
|
44980
|
-
/* @__PURE__ */ createContext({ ...ue, scaleX: 1, scaleY: 1 });
|
|
44981
|
-
var Bt;
|
|
44982
|
-
var Ot;
|
|
44983
|
-
(Ot = Bt || (Bt = {}))[Ot.Uninitialized = 0] = "Uninitialized", Ot[Ot.Initializing = 1] = "Initializing", Ot[Ot.Initialized = 2] = "Initialized";
|
|
44984
|
-
var Vt;
|
|
44985
|
-
(() => {
|
|
44986
|
-
if (typeof window != "undefined") {
|
|
44987
|
-
const e2 = window;
|
|
44988
|
-
return e2.__principlemd_theme_context__ || (e2.__principlemd_theme_context__ = createContext(void 0)), e2.__principlemd_theme_context__;
|
|
45270
|
+
) });
|
|
45271
|
+
if (isLoading && pullRequests.length === 0) {
|
|
45272
|
+
return renderState(
|
|
45273
|
+
/* @__PURE__ */ jsx(LoaderCircle, { size: 32, style: { color: theme2.colors.textSecondary }, className: "spin" }),
|
|
45274
|
+
"Loading pull requests...",
|
|
45275
|
+
"Fetching pull request data for this repository."
|
|
45276
|
+
);
|
|
44989
45277
|
}
|
|
44990
|
-
|
|
44991
|
-
|
|
44992
|
-
|
|
44993
|
-
|
|
44994
|
-
|
|
44995
|
-
|
|
44996
|
-
|
|
44997
|
-
|
|
44998
|
-
|
|
44999
|
-
|
|
45000
|
-
|
|
45001
|
-
|
|
45002
|
-
|
|
45003
|
-
|
|
45004
|
-
|
|
45005
|
-
|
|
45006
|
-
|
|
45007
|
-
|
|
45008
|
-
|
|
45009
|
-
|
|
45010
|
-
|
|
45011
|
-
|
|
45012
|
-
|
|
45013
|
-
|
|
45014
|
-
|
|
45015
|
-
|
|
45016
|
-
|
|
45017
|
-
|
|
45018
|
-
|
|
45019
|
-
|
|
45020
|
-
|
|
45021
|
-
|
|
45022
|
-
|
|
45023
|
-
|
|
45024
|
-
|
|
45025
|
-
|
|
45026
|
-
|
|
45027
|
-
|
|
45028
|
-
|
|
45029
|
-
|
|
45030
|
-
|
|
45031
|
-
|
|
45032
|
-
|
|
45033
|
-
|
|
45278
|
+
if (!context.currentScope.repository) {
|
|
45279
|
+
return renderState(
|
|
45280
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.textSecondary } }),
|
|
45281
|
+
"No repository selected",
|
|
45282
|
+
"Select a repository to view pull requests."
|
|
45283
|
+
);
|
|
45284
|
+
}
|
|
45285
|
+
if (!hasPRs) {
|
|
45286
|
+
return renderState(
|
|
45287
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme2.colors.warning || "#f59e0b" } }),
|
|
45288
|
+
"Pull requests unavailable",
|
|
45289
|
+
"Pull request data is not available for this repository."
|
|
45290
|
+
);
|
|
45291
|
+
}
|
|
45292
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
45293
|
+
/* @__PURE__ */ jsx("style", { children: `.hide-scrollbar::-webkit-scrollbar { display: none; }` }),
|
|
45294
|
+
/* @__PURE__ */ jsxs(
|
|
45295
|
+
"div",
|
|
45296
|
+
{
|
|
45297
|
+
style: {
|
|
45298
|
+
height: "40px",
|
|
45299
|
+
minHeight: "40px",
|
|
45300
|
+
padding: "0 12px",
|
|
45301
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
45302
|
+
backgroundColor: theme2.colors.background,
|
|
45303
|
+
display: "flex",
|
|
45304
|
+
alignItems: "center",
|
|
45305
|
+
justifyContent: "space-between",
|
|
45306
|
+
boxSizing: "border-box"
|
|
45307
|
+
},
|
|
45308
|
+
children: [
|
|
45309
|
+
/* @__PURE__ */ jsxs(
|
|
45310
|
+
"div",
|
|
45311
|
+
{
|
|
45312
|
+
style: {
|
|
45313
|
+
display: "flex",
|
|
45314
|
+
alignItems: "center",
|
|
45315
|
+
gap: "8px",
|
|
45316
|
+
color: theme2.colors.textSecondary,
|
|
45317
|
+
fontFamily: theme2.fonts.heading,
|
|
45318
|
+
fontSize: theme2.fontSizes[0],
|
|
45319
|
+
fontWeight: 600,
|
|
45320
|
+
textTransform: "uppercase"
|
|
45321
|
+
},
|
|
45322
|
+
children: [
|
|
45323
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 14 }),
|
|
45324
|
+
"Pull Requests"
|
|
45325
|
+
]
|
|
45326
|
+
}
|
|
45327
|
+
),
|
|
45328
|
+
/* @__PURE__ */ jsxs(
|
|
45329
|
+
"button",
|
|
45330
|
+
{
|
|
45331
|
+
type: "button",
|
|
45332
|
+
onClick: handleRefresh,
|
|
45333
|
+
disabled: isLoading,
|
|
45334
|
+
style: {
|
|
45335
|
+
display: "inline-flex",
|
|
45336
|
+
alignItems: "center",
|
|
45337
|
+
gap: "6px",
|
|
45338
|
+
padding: "4px 10px",
|
|
45339
|
+
borderRadius: "4px",
|
|
45340
|
+
border: `1px solid ${theme2.colors.border}`,
|
|
45341
|
+
backgroundColor: theme2.colors.background,
|
|
45342
|
+
color: theme2.colors.text,
|
|
45343
|
+
cursor: isLoading ? "default" : "pointer",
|
|
45344
|
+
fontFamily: theme2.fonts.body,
|
|
45345
|
+
fontSize: theme2.fontSizes[0],
|
|
45346
|
+
fontWeight: 500,
|
|
45347
|
+
opacity: isLoading ? 0.7 : 1
|
|
45348
|
+
},
|
|
45349
|
+
children: [
|
|
45350
|
+
isLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "spin" }) : /* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
45351
|
+
isLoading ? "Refreshing..." : "Refresh"
|
|
45352
|
+
]
|
|
45353
|
+
}
|
|
45354
|
+
)
|
|
45355
|
+
]
|
|
45034
45356
|
}
|
|
45035
|
-
|
|
45036
|
-
|
|
45037
|
-
|
|
45038
|
-
|
|
45039
|
-
|
|
45357
|
+
),
|
|
45358
|
+
/* @__PURE__ */ jsx(
|
|
45359
|
+
"div",
|
|
45360
|
+
{
|
|
45361
|
+
style: {
|
|
45362
|
+
display: "flex",
|
|
45363
|
+
borderBottom: `1px solid ${theme2.colors.border}`
|
|
45364
|
+
},
|
|
45365
|
+
children: ["open", "closed"].map((value) => {
|
|
45366
|
+
const isActive = filter === value;
|
|
45367
|
+
const label = value === "open" ? "Open" : "Closed";
|
|
45368
|
+
return /* @__PURE__ */ jsxs(
|
|
45369
|
+
"button",
|
|
45370
|
+
{
|
|
45371
|
+
type: "button",
|
|
45372
|
+
onClick: () => setFilter(value),
|
|
45373
|
+
style: {
|
|
45374
|
+
flex: 1,
|
|
45375
|
+
display: "flex",
|
|
45376
|
+
alignItems: "center",
|
|
45377
|
+
justifyContent: "center",
|
|
45378
|
+
gap: "6px",
|
|
45379
|
+
padding: "8px 12px",
|
|
45380
|
+
border: "none",
|
|
45381
|
+
borderBottom: isActive ? `2px solid ${theme2.colors.primary}` : "2px solid transparent",
|
|
45382
|
+
backgroundColor: "transparent",
|
|
45383
|
+
color: isActive ? theme2.colors.text : theme2.colors.textSecondary,
|
|
45384
|
+
fontFamily: theme2.fonts.body,
|
|
45385
|
+
fontSize: theme2.fontSizes[1],
|
|
45386
|
+
fontWeight: isActive ? 600 : 500,
|
|
45387
|
+
cursor: "pointer",
|
|
45388
|
+
marginBottom: "-1px"
|
|
45389
|
+
},
|
|
45390
|
+
children: [
|
|
45391
|
+
label,
|
|
45392
|
+
/* @__PURE__ */ jsxs("span", { style: { opacity: 0.7 }, children: [
|
|
45393
|
+
"(",
|
|
45394
|
+
counts[value],
|
|
45395
|
+
")"
|
|
45396
|
+
] })
|
|
45397
|
+
]
|
|
45398
|
+
},
|
|
45399
|
+
value
|
|
45400
|
+
);
|
|
45401
|
+
})
|
|
45040
45402
|
}
|
|
45041
|
-
|
|
45042
|
-
|
|
45043
|
-
|
|
45044
|
-
|
|
45045
|
-
|
|
45046
|
-
|
|
45047
|
-
|
|
45048
|
-
|
|
45049
|
-
|
|
45050
|
-
|
|
45051
|
-
|
|
45052
|
-
|
|
45053
|
-
|
|
45054
|
-
|
|
45055
|
-
|
|
45056
|
-
|
|
45057
|
-
|
|
45058
|
-
|
|
45059
|
-
|
|
45060
|
-
|
|
45061
|
-
|
|
45062
|
-
|
|
45063
|
-
|
|
45064
|
-
|
|
45065
|
-
|
|
45066
|
-
|
|
45067
|
-
|
|
45068
|
-
|
|
45069
|
-
|
|
45403
|
+
),
|
|
45404
|
+
/* @__PURE__ */ jsx(
|
|
45405
|
+
"div",
|
|
45406
|
+
{
|
|
45407
|
+
style: {
|
|
45408
|
+
flex: 1,
|
|
45409
|
+
overflowY: "auto",
|
|
45410
|
+
display: "flex",
|
|
45411
|
+
flexDirection: "column",
|
|
45412
|
+
scrollbarWidth: "none",
|
|
45413
|
+
msOverflowStyle: "none"
|
|
45414
|
+
},
|
|
45415
|
+
className: "hide-scrollbar",
|
|
45416
|
+
children: filteredPullRequests.length === 0 ? /* @__PURE__ */ jsxs(
|
|
45417
|
+
"div",
|
|
45418
|
+
{
|
|
45419
|
+
style: {
|
|
45420
|
+
marginTop: "48px",
|
|
45421
|
+
textAlign: "center",
|
|
45422
|
+
color: theme2.colors.textSecondary,
|
|
45423
|
+
fontFamily: theme2.fonts.body
|
|
45424
|
+
},
|
|
45425
|
+
children: [
|
|
45426
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 32, style: { marginBottom: "12px" } }),
|
|
45427
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: theme2.fonts.heading, fontSize: theme2.fontSizes[1], fontWeight: 600 }, children: "No pull requests found" }),
|
|
45428
|
+
/* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: theme2.fontSizes[0] }, children: [
|
|
45429
|
+
"There are no ",
|
|
45430
|
+
filter,
|
|
45431
|
+
" pull requests to display."
|
|
45432
|
+
] })
|
|
45433
|
+
]
|
|
45434
|
+
}
|
|
45435
|
+
) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme: theme2, isSelected: selectedPrId === pr.id, onClick: () => handlePRClick(pr) }, pr.id))
|
|
45070
45436
|
}
|
|
45071
|
-
|
|
45437
|
+
)
|
|
45438
|
+
] });
|
|
45439
|
+
};
|
|
45440
|
+
const PullRequestCard = ({ pr, theme: theme2, isSelected, onClick }) => {
|
|
45441
|
+
var _a;
|
|
45442
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
45443
|
+
const isActive = isHovered || isSelected;
|
|
45444
|
+
const isMerged = pr.merged_at !== null;
|
|
45445
|
+
const isOpen = pr.state === "open";
|
|
45446
|
+
const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
|
|
45447
|
+
return /* @__PURE__ */ jsxs(
|
|
45448
|
+
"div",
|
|
45449
|
+
{
|
|
45450
|
+
onClick,
|
|
45451
|
+
role: "button",
|
|
45452
|
+
tabIndex: 0,
|
|
45453
|
+
onKeyDown: (e) => {
|
|
45454
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
45455
|
+
e.preventDefault();
|
|
45456
|
+
onClick == null ? void 0 : onClick();
|
|
45457
|
+
}
|
|
45458
|
+
},
|
|
45459
|
+
onMouseEnter: () => setIsHovered(true),
|
|
45460
|
+
onMouseLeave: () => setIsHovered(false),
|
|
45072
45461
|
style: {
|
|
45073
|
-
|
|
45074
|
-
|
|
45075
|
-
|
|
45076
|
-
|
|
45077
|
-
|
|
45078
|
-
|
|
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
|
-
|
|
45462
|
+
borderBottom: `1px solid ${theme2.colors.border}`,
|
|
45463
|
+
padding: "16px 16px",
|
|
45464
|
+
backgroundColor: isActive ? theme2.colors.background : theme2.colors.backgroundSecondary,
|
|
45465
|
+
display: "flex",
|
|
45466
|
+
flexDirection: "column",
|
|
45467
|
+
gap: "8px",
|
|
45468
|
+
cursor: onClick ? "pointer" : "default",
|
|
45469
|
+
minWidth: 0,
|
|
45470
|
+
transition: "background-color 0.15s ease"
|
|
45471
|
+
},
|
|
45472
|
+
children: [
|
|
45473
|
+
/* @__PURE__ */ jsx(
|
|
45474
|
+
"div",
|
|
45475
|
+
{
|
|
45476
|
+
style: {
|
|
45477
|
+
fontFamily: theme2.fonts.heading,
|
|
45478
|
+
fontSize: theme2.fontSizes[2],
|
|
45479
|
+
fontWeight: 600,
|
|
45480
|
+
color: isActive ? theme2.colors.primary : theme2.colors.text,
|
|
45481
|
+
lineHeight: 1.3,
|
|
45482
|
+
wordBreak: "break-word",
|
|
45483
|
+
transition: "color 0.15s ease"
|
|
45484
|
+
},
|
|
45485
|
+
children: pr.title
|
|
45486
|
+
}
|
|
45487
|
+
),
|
|
45488
|
+
/* @__PURE__ */ jsxs(
|
|
45489
|
+
"div",
|
|
45490
|
+
{
|
|
45491
|
+
style: {
|
|
45492
|
+
display: "flex",
|
|
45493
|
+
alignItems: "center",
|
|
45494
|
+
gap: "8px 12px",
|
|
45495
|
+
flexWrap: "wrap",
|
|
45496
|
+
color: theme2.colors.textSecondary,
|
|
45497
|
+
fontFamily: theme2.fonts.body,
|
|
45498
|
+
fontSize: theme2.fontSizes[0]
|
|
45499
|
+
},
|
|
45500
|
+
children: [
|
|
45501
|
+
pr.draft && /* @__PURE__ */ jsx(
|
|
45502
|
+
"span",
|
|
45503
|
+
{
|
|
45504
|
+
style: {
|
|
45505
|
+
padding: "4px 10px",
|
|
45506
|
+
borderRadius: "999px",
|
|
45507
|
+
backgroundColor: theme2.colors.background,
|
|
45508
|
+
color: theme2.colors.textSecondary,
|
|
45509
|
+
fontFamily: theme2.fonts.heading,
|
|
45510
|
+
fontSize: theme2.fontSizes[0],
|
|
45511
|
+
fontWeight: 600,
|
|
45512
|
+
textTransform: "uppercase",
|
|
45513
|
+
letterSpacing: "0.02em"
|
|
45514
|
+
},
|
|
45515
|
+
children: "Draft"
|
|
45516
|
+
}
|
|
45517
|
+
),
|
|
45518
|
+
/* @__PURE__ */ jsxs(
|
|
45519
|
+
"span",
|
|
45520
|
+
{
|
|
45521
|
+
style: {
|
|
45522
|
+
fontFamily: theme2.fonts.heading,
|
|
45523
|
+
fontWeight: 600,
|
|
45524
|
+
color: theme2.colors.textSecondary
|
|
45525
|
+
},
|
|
45526
|
+
children: [
|
|
45527
|
+
"#",
|
|
45528
|
+
pr.number
|
|
45529
|
+
]
|
|
45530
|
+
}
|
|
45531
|
+
),
|
|
45532
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
45533
|
+
"by ",
|
|
45534
|
+
((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"
|
|
45535
|
+
] }),
|
|
45536
|
+
/* @__PURE__ */ jsxs(
|
|
45537
|
+
"span",
|
|
45538
|
+
{
|
|
45539
|
+
style: {
|
|
45540
|
+
display: "inline-flex",
|
|
45541
|
+
alignItems: "center",
|
|
45542
|
+
gap: "4px"
|
|
45543
|
+
},
|
|
45544
|
+
children: [
|
|
45545
|
+
/* @__PURE__ */ jsx(Calendar, { size: 12 }),
|
|
45546
|
+
" ",
|
|
45547
|
+
formatDate(pr.created_at)
|
|
45548
|
+
]
|
|
45549
|
+
}
|
|
45550
|
+
),
|
|
45551
|
+
!isOpen && /* @__PURE__ */ jsxs(
|
|
45552
|
+
"span",
|
|
45553
|
+
{
|
|
45554
|
+
style: {
|
|
45555
|
+
display: "inline-flex",
|
|
45556
|
+
alignItems: "center",
|
|
45557
|
+
gap: "4px"
|
|
45558
|
+
},
|
|
45559
|
+
children: [
|
|
45560
|
+
isMerged ? "Merged" : "Closed",
|
|
45561
|
+
" ",
|
|
45562
|
+
formatDate(pr.merged_at || pr.updated_at)
|
|
45563
|
+
]
|
|
45564
|
+
}
|
|
45565
|
+
),
|
|
45566
|
+
totalComments > 0 && /* @__PURE__ */ jsxs(
|
|
45567
|
+
"span",
|
|
45568
|
+
{
|
|
45569
|
+
style: {
|
|
45570
|
+
display: "inline-flex",
|
|
45571
|
+
alignItems: "center",
|
|
45572
|
+
gap: "4px"
|
|
45573
|
+
},
|
|
45574
|
+
children: [
|
|
45575
|
+
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
45576
|
+
" ",
|
|
45577
|
+
totalComments
|
|
45578
|
+
]
|
|
45579
|
+
}
|
|
45580
|
+
)
|
|
45581
|
+
]
|
|
45582
|
+
}
|
|
45583
|
+
)
|
|
45584
|
+
]
|
|
45142
45585
|
}
|
|
45143
|
-
|
|
45144
|
-
|
|
45145
|
-
|
|
45146
|
-
|
|
45147
|
-
|
|
45148
|
-
|
|
45149
|
-
|
|
45150
|
-
|
|
45151
|
-
|
|
45152
|
-
|
|
45153
|
-
|
|
45154
|
-
|
|
45155
|
-
|
|
45156
|
-
|
|
45157
|
-
|
|
45158
|
-
|
|
45159
|
-
|
|
45160
|
-
|
|
45161
|
-
|
|
45162
|
-
|
|
45163
|
-
|
|
45164
|
-
|
|
45586
|
+
);
|
|
45587
|
+
};
|
|
45588
|
+
const GitPullRequestsPanelPreview = () => {
|
|
45589
|
+
const { theme: theme2 } = useTheme();
|
|
45590
|
+
return /* @__PURE__ */ jsxs(
|
|
45591
|
+
"div",
|
|
45592
|
+
{
|
|
45593
|
+
style: {
|
|
45594
|
+
padding: "12px",
|
|
45595
|
+
fontFamily: theme2.fonts.body,
|
|
45596
|
+
fontSize: theme2.fontSizes[0],
|
|
45597
|
+
color: theme2.colors.text,
|
|
45598
|
+
display: "flex",
|
|
45599
|
+
flexDirection: "column",
|
|
45600
|
+
gap: "8px"
|
|
45601
|
+
},
|
|
45602
|
+
children: [
|
|
45603
|
+
/* @__PURE__ */ jsxs(
|
|
45604
|
+
"div",
|
|
45605
|
+
{
|
|
45606
|
+
style: {
|
|
45607
|
+
display: "flex",
|
|
45608
|
+
alignItems: "center",
|
|
45609
|
+
gap: "8px"
|
|
45610
|
+
},
|
|
45611
|
+
children: [
|
|
45612
|
+
/* @__PURE__ */ jsx(
|
|
45613
|
+
"span",
|
|
45614
|
+
{
|
|
45615
|
+
style: {
|
|
45616
|
+
display: "inline-flex",
|
|
45617
|
+
alignItems: "center",
|
|
45618
|
+
gap: "6px",
|
|
45619
|
+
padding: "2px 8px",
|
|
45620
|
+
borderRadius: "999px",
|
|
45621
|
+
backgroundColor: "#3b82f622",
|
|
45622
|
+
color: "#3b82f6",
|
|
45623
|
+
fontFamily: theme2.fonts.heading,
|
|
45624
|
+
fontSize: theme2.fontSizes[0],
|
|
45625
|
+
fontWeight: 600,
|
|
45626
|
+
textTransform: "uppercase"
|
|
45627
|
+
},
|
|
45628
|
+
children: "Review"
|
|
45629
|
+
}
|
|
45630
|
+
),
|
|
45631
|
+
/* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.heading, fontWeight: 600 }, children: "#42 Refine panel layout system" })
|
|
45632
|
+
]
|
|
45633
|
+
}
|
|
45634
|
+
),
|
|
45635
|
+
/* @__PURE__ */ jsx(
|
|
45636
|
+
"div",
|
|
45637
|
+
{
|
|
45638
|
+
style: {
|
|
45639
|
+
paddingLeft: "4px",
|
|
45640
|
+
color: theme2.colors.textSecondary,
|
|
45641
|
+
fontSize: theme2.fontSizes[0],
|
|
45642
|
+
lineHeight: 1.4
|
|
45643
|
+
},
|
|
45644
|
+
children: "Adds preview registry and consolidates configurator metadata."
|
|
45645
|
+
}
|
|
45646
|
+
),
|
|
45647
|
+
/* @__PURE__ */ jsxs(
|
|
45648
|
+
"div",
|
|
45649
|
+
{
|
|
45650
|
+
style: {
|
|
45651
|
+
display: "flex",
|
|
45652
|
+
alignItems: "center",
|
|
45653
|
+
gap: "8px",
|
|
45654
|
+
color: theme2.colors.textSecondary,
|
|
45655
|
+
fontSize: theme2.fontSizes[0]
|
|
45656
|
+
},
|
|
45657
|
+
children: [
|
|
45658
|
+
/* @__PURE__ */ jsx("span", { children: "4 checks" }),
|
|
45659
|
+
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
45660
|
+
/* @__PURE__ */ jsx("span", { children: "1 reviewer" })
|
|
45661
|
+
]
|
|
45662
|
+
}
|
|
45663
|
+
)
|
|
45664
|
+
]
|
|
45165
45665
|
}
|
|
45166
|
-
|
|
45666
|
+
);
|
|
45167
45667
|
};
|
|
45168
45668
|
const GitPullRequestDetailPanelContent = ({
|
|
45169
45669
|
events
|
|
@@ -45725,10 +46225,66 @@ const pullRequestDetailToolsMetadata = {
|
|
|
45725
46225
|
description: "Tools for the pull request detail panel",
|
|
45726
46226
|
tools: pullRequestDetailTools
|
|
45727
46227
|
};
|
|
46228
|
+
const selectCommitTool = {
|
|
46229
|
+
name: "select_commit",
|
|
46230
|
+
description: "Selects a commit to display in the detail panel (triggers host to fetch full details)",
|
|
46231
|
+
inputs: {
|
|
46232
|
+
type: "object",
|
|
46233
|
+
properties: {
|
|
46234
|
+
hash: {
|
|
46235
|
+
type: "string",
|
|
46236
|
+
description: "The commit hash to select"
|
|
46237
|
+
}
|
|
46238
|
+
},
|
|
46239
|
+
required: ["hash"]
|
|
46240
|
+
},
|
|
46241
|
+
outputs: {
|
|
46242
|
+
type: "object",
|
|
46243
|
+
properties: {
|
|
46244
|
+
success: { type: "boolean" },
|
|
46245
|
+
message: { type: "string" }
|
|
46246
|
+
}
|
|
46247
|
+
},
|
|
46248
|
+
tags: ["git", "commits", "detail", "select"],
|
|
46249
|
+
tool_call_template: {
|
|
46250
|
+
call_template_type: "panel_event",
|
|
46251
|
+
event_type: "git-panels.commit:selected"
|
|
46252
|
+
}
|
|
46253
|
+
};
|
|
46254
|
+
const deselectCommitTool = {
|
|
46255
|
+
name: "deselect_commit",
|
|
46256
|
+
description: "Clears the current commit selection",
|
|
46257
|
+
inputs: {
|
|
46258
|
+
type: "object",
|
|
46259
|
+
properties: {}
|
|
46260
|
+
},
|
|
46261
|
+
outputs: {
|
|
46262
|
+
type: "object",
|
|
46263
|
+
properties: {
|
|
46264
|
+
success: { type: "boolean" }
|
|
46265
|
+
}
|
|
46266
|
+
},
|
|
46267
|
+
tags: ["git", "commits", "detail", "deselect"],
|
|
46268
|
+
tool_call_template: {
|
|
46269
|
+
call_template_type: "panel_event",
|
|
46270
|
+
event_type: "git-panels.commit:deselected"
|
|
46271
|
+
}
|
|
46272
|
+
};
|
|
46273
|
+
const commitDetailTools = [
|
|
46274
|
+
selectCommitTool,
|
|
46275
|
+
deselectCommitTool
|
|
46276
|
+
];
|
|
46277
|
+
const commitDetailToolsMetadata = {
|
|
46278
|
+
id: "git-panels.commit-detail",
|
|
46279
|
+
name: "Commit Details",
|
|
46280
|
+
description: "Tools for the commit detail panel",
|
|
46281
|
+
tools: commitDetailTools
|
|
46282
|
+
};
|
|
45728
46283
|
const allGitPanelTools = [
|
|
45729
46284
|
...commitHistoryTools,
|
|
45730
46285
|
...pullRequestsTools,
|
|
45731
|
-
...pullRequestDetailTools
|
|
46286
|
+
...pullRequestDetailTools,
|
|
46287
|
+
...commitDetailTools
|
|
45732
46288
|
];
|
|
45733
46289
|
const panels = [
|
|
45734
46290
|
{
|
|
@@ -45749,6 +46305,20 @@ const panels = [
|
|
|
45749
46305
|
}
|
|
45750
46306
|
}
|
|
45751
46307
|
},
|
|
46308
|
+
{
|
|
46309
|
+
metadata: {
|
|
46310
|
+
id: "git-panels.commit-detail",
|
|
46311
|
+
name: "Commit Details",
|
|
46312
|
+
icon: "git-commit",
|
|
46313
|
+
version: "0.1.0",
|
|
46314
|
+
author: "Principal ADE",
|
|
46315
|
+
description: "View detailed commit information with files changed",
|
|
46316
|
+
slices: [],
|
|
46317
|
+
// No slices - receives data via events from host
|
|
46318
|
+
tools: commitDetailTools
|
|
46319
|
+
},
|
|
46320
|
+
component: GitCommitDetailPanel
|
|
46321
|
+
},
|
|
45752
46322
|
{
|
|
45753
46323
|
metadata: {
|
|
45754
46324
|
id: "git-panels.pull-requests",
|
|
@@ -45789,6 +46359,8 @@ const onPackageUnload = async () => {
|
|
|
45789
46359
|
console.log("[git-panels] Package unloading");
|
|
45790
46360
|
};
|
|
45791
46361
|
export {
|
|
46362
|
+
GitCommitDetailPanel,
|
|
46363
|
+
GitCommitDetailPanelPreview,
|
|
45792
46364
|
GitCommitHistoryPanel,
|
|
45793
46365
|
GitCommitHistoryPanelPreview,
|
|
45794
46366
|
GitPullRequestDetailPanel,
|
|
@@ -45796,8 +46368,11 @@ export {
|
|
|
45796
46368
|
GitPullRequestsPanel,
|
|
45797
46369
|
GitPullRequestsPanelPreview,
|
|
45798
46370
|
allGitPanelTools,
|
|
46371
|
+
commitDetailTools,
|
|
46372
|
+
commitDetailToolsMetadata,
|
|
45799
46373
|
commitHistoryTools,
|
|
45800
46374
|
commitHistoryToolsMetadata,
|
|
46375
|
+
deselectCommitTool,
|
|
45801
46376
|
deselectPullRequestTool,
|
|
45802
46377
|
onPackageLoad,
|
|
45803
46378
|
onPackageUnload,
|
|
@@ -45808,6 +46383,7 @@ export {
|
|
|
45808
46383
|
pullRequestsToolsMetadata,
|
|
45809
46384
|
refreshCommitsTool,
|
|
45810
46385
|
refreshPullRequestsTool,
|
|
46386
|
+
selectCommitTool,
|
|
45811
46387
|
selectPullRequestTool,
|
|
45812
46388
|
setCommitLimitTool,
|
|
45813
46389
|
setPRFilterTool
|