@industry-theme/git-panels 0.1.1
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/LICENSE +21 -0
- package/README.md +536 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/mocks/panelContext.d.ts +24 -0
- package/dist/mocks/panelContext.d.ts.map +1 -0
- package/dist/panels/GitCommitHistoryPanel.d.ts +19 -0
- package/dist/panels/GitCommitHistoryPanel.d.ts.map +1 -0
- package/dist/panels/GitCommitHistoryPanel.stories.d.ts +30 -0
- package/dist/panels/GitCommitHistoryPanel.stories.d.ts.map +1 -0
- package/dist/panels/GitConfigPanel.d.ts +20 -0
- package/dist/panels/GitConfigPanel.d.ts.map +1 -0
- package/dist/panels/GitConfigPanel.stories.d.ts +34 -0
- package/dist/panels/GitConfigPanel.stories.d.ts.map +1 -0
- package/dist/panels/GitPullRequestsPanel.d.ts +19 -0
- package/dist/panels/GitPullRequestsPanel.d.ts.map +1 -0
- package/dist/panels/GitPullRequestsPanel.stories.d.ts +34 -0
- package/dist/panels/GitPullRequestsPanel.stories.d.ts.map +1 -0
- package/dist/panels.bundle.js +1437 -0
- package/dist/panels.bundle.js.map +1 -0
- package/dist/tools/index.d.ts +48 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools.bundle.js +139 -0
- package/dist/types/index.d.ts +192 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/formatters.d.ts +12 -0
- package/dist/utils/formatters.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +98 -0
|
@@ -0,0 +1,1437 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, createElement, createContext, useContext, useState, useMemo, useEffect } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* @license lucide-react v0.552.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the ISC license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
const toKebabCase = (string) => string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
10
|
+
const toCamelCase = (string) => string.replace(
|
|
11
|
+
/^([A-Z])|[\s-_]+(\w)/g,
|
|
12
|
+
(match, p1, p2) => p2 ? p2.toUpperCase() : p1.toLowerCase()
|
|
13
|
+
);
|
|
14
|
+
const toPascalCase = (string) => {
|
|
15
|
+
const camelCase = toCamelCase(string);
|
|
16
|
+
return camelCase.charAt(0).toUpperCase() + camelCase.slice(1);
|
|
17
|
+
};
|
|
18
|
+
const mergeClasses = (...classes) => classes.filter((className, index, array) => {
|
|
19
|
+
return Boolean(className) && className.trim() !== "" && array.indexOf(className) === index;
|
|
20
|
+
}).join(" ").trim();
|
|
21
|
+
const hasA11yProp = (props) => {
|
|
22
|
+
for (const prop in props) {
|
|
23
|
+
if (prop.startsWith("aria-") || prop === "role" || prop === "title") {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* @license lucide-react v0.552.0 - ISC
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the ISC license.
|
|
32
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/
|
|
34
|
+
var defaultAttributes = {
|
|
35
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
36
|
+
width: 24,
|
|
37
|
+
height: 24,
|
|
38
|
+
viewBox: "0 0 24 24",
|
|
39
|
+
fill: "none",
|
|
40
|
+
stroke: "currentColor",
|
|
41
|
+
strokeWidth: 2,
|
|
42
|
+
strokeLinecap: "round",
|
|
43
|
+
strokeLinejoin: "round"
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* @license lucide-react v0.552.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/
|
|
51
|
+
const Icon = forwardRef(
|
|
52
|
+
({
|
|
53
|
+
color = "currentColor",
|
|
54
|
+
size = 24,
|
|
55
|
+
strokeWidth = 2,
|
|
56
|
+
absoluteStrokeWidth,
|
|
57
|
+
className = "",
|
|
58
|
+
children,
|
|
59
|
+
iconNode,
|
|
60
|
+
...rest
|
|
61
|
+
}, ref) => createElement(
|
|
62
|
+
"svg",
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
...defaultAttributes,
|
|
66
|
+
width: size,
|
|
67
|
+
height: size,
|
|
68
|
+
stroke: color,
|
|
69
|
+
strokeWidth: absoluteStrokeWidth ? Number(strokeWidth) * 24 / Number(size) : strokeWidth,
|
|
70
|
+
className: mergeClasses("lucide", className),
|
|
71
|
+
...!children && !hasA11yProp(rest) && { "aria-hidden": "true" },
|
|
72
|
+
...rest
|
|
73
|
+
},
|
|
74
|
+
[
|
|
75
|
+
...iconNode.map(([tag, attrs]) => createElement(tag, attrs)),
|
|
76
|
+
...Array.isArray(children) ? children : [children]
|
|
77
|
+
]
|
|
78
|
+
)
|
|
79
|
+
);
|
|
80
|
+
/**
|
|
81
|
+
* @license lucide-react v0.552.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/
|
|
86
|
+
const createLucideIcon = (iconName, iconNode) => {
|
|
87
|
+
const Component = forwardRef(
|
|
88
|
+
({ className, ...props }, ref) => createElement(Icon, {
|
|
89
|
+
ref,
|
|
90
|
+
iconNode,
|
|
91
|
+
className: mergeClasses(
|
|
92
|
+
`lucide-${toKebabCase(toPascalCase(iconName))}`,
|
|
93
|
+
`lucide-${iconName}`,
|
|
94
|
+
className
|
|
95
|
+
),
|
|
96
|
+
...props
|
|
97
|
+
})
|
|
98
|
+
);
|
|
99
|
+
Component.displayName = toPascalCase(iconName);
|
|
100
|
+
return Component;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* @license lucide-react v0.552.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/
|
|
108
|
+
const __iconNode$a = [
|
|
109
|
+
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
110
|
+
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
111
|
+
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
112
|
+
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
113
|
+
];
|
|
114
|
+
const Calendar = createLucideIcon("calendar", __iconNode$a);
|
|
115
|
+
/**
|
|
116
|
+
* @license lucide-react v0.552.0 - ISC
|
|
117
|
+
*
|
|
118
|
+
* This source code is licensed under the ISC license.
|
|
119
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
+
*/
|
|
121
|
+
const __iconNode$9 = [
|
|
122
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
123
|
+
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
124
|
+
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
125
|
+
];
|
|
126
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$9);
|
|
127
|
+
/**
|
|
128
|
+
* @license lucide-react v0.552.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/
|
|
133
|
+
const __iconNode$8 = [
|
|
134
|
+
["path", { d: "M12 6v6l4 2", key: "mmk7yg" }],
|
|
135
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
|
|
136
|
+
];
|
|
137
|
+
const Clock = createLucideIcon("clock", __iconNode$8);
|
|
138
|
+
/**
|
|
139
|
+
* @license lucide-react v0.552.0 - ISC
|
|
140
|
+
*
|
|
141
|
+
* This source code is licensed under the ISC license.
|
|
142
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
143
|
+
*/
|
|
144
|
+
const __iconNode$7 = [
|
|
145
|
+
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
146
|
+
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
147
|
+
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
148
|
+
];
|
|
149
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$7);
|
|
150
|
+
/**
|
|
151
|
+
* @license lucide-react v0.552.0 - ISC
|
|
152
|
+
*
|
|
153
|
+
* This source code is licensed under the ISC license.
|
|
154
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
+
*/
|
|
156
|
+
const __iconNode$6 = [
|
|
157
|
+
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
158
|
+
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
159
|
+
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
160
|
+
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
161
|
+
];
|
|
162
|
+
const GitBranch = createLucideIcon("git-branch", __iconNode$6);
|
|
163
|
+
/**
|
|
164
|
+
* @license lucide-react v0.552.0 - ISC
|
|
165
|
+
*
|
|
166
|
+
* This source code is licensed under the ISC license.
|
|
167
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
168
|
+
*/
|
|
169
|
+
const __iconNode$5 = [
|
|
170
|
+
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
|
|
171
|
+
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
172
|
+
["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
|
|
173
|
+
];
|
|
174
|
+
const GitMerge = createLucideIcon("git-merge", __iconNode$5);
|
|
175
|
+
/**
|
|
176
|
+
* @license lucide-react v0.552.0 - ISC
|
|
177
|
+
*
|
|
178
|
+
* This source code is licensed under the ISC license.
|
|
179
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
+
*/
|
|
181
|
+
const __iconNode$4 = [
|
|
182
|
+
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
|
|
183
|
+
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
|
|
184
|
+
["path", { d: "M13 6h3a2 2 0 0 1 2 2v7", key: "1yeb86" }],
|
|
185
|
+
["line", { x1: "6", x2: "6", y1: "9", y2: "21", key: "rroup" }]
|
|
186
|
+
];
|
|
187
|
+
const GitPullRequest = createLucideIcon("git-pull-request", __iconNode$4);
|
|
188
|
+
/**
|
|
189
|
+
* @license lucide-react v0.552.0 - ISC
|
|
190
|
+
*
|
|
191
|
+
* This source code is licensed under the ISC license.
|
|
192
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
193
|
+
*/
|
|
194
|
+
const __iconNode$3 = [
|
|
195
|
+
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
196
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
197
|
+
["path", { d: "M12 7v5l4 2", key: "1fdv2h" }]
|
|
198
|
+
];
|
|
199
|
+
const History = createLucideIcon("history", __iconNode$3);
|
|
200
|
+
/**
|
|
201
|
+
* @license lucide-react v0.552.0 - ISC
|
|
202
|
+
*
|
|
203
|
+
* This source code is licensed under the ISC license.
|
|
204
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
+
*/
|
|
206
|
+
const __iconNode$2 = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
207
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$2);
|
|
208
|
+
/**
|
|
209
|
+
* @license lucide-react v0.552.0 - ISC
|
|
210
|
+
*
|
|
211
|
+
* This source code is licensed under the ISC license.
|
|
212
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
213
|
+
*/
|
|
214
|
+
const __iconNode$1 = [
|
|
215
|
+
[
|
|
216
|
+
"path",
|
|
217
|
+
{
|
|
218
|
+
d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
|
|
219
|
+
key: "18887p"
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
];
|
|
223
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$1);
|
|
224
|
+
/**
|
|
225
|
+
* @license lucide-react v0.552.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/
|
|
230
|
+
const __iconNode = [
|
|
231
|
+
["path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "14sxne" }],
|
|
232
|
+
["path", { d: "M3 3v5h5", key: "1xhq8a" }],
|
|
233
|
+
["path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16", key: "1hlbsb" }],
|
|
234
|
+
["path", { d: "M16 16h5v5", key: "ccwih5" }]
|
|
235
|
+
];
|
|
236
|
+
const RefreshCcw = createLucideIcon("refresh-ccw", __iconNode);
|
|
237
|
+
var ThemeContext;
|
|
238
|
+
var getThemeContext = () => {
|
|
239
|
+
if (typeof window !== "undefined") {
|
|
240
|
+
const globalWindow = window;
|
|
241
|
+
if (!globalWindow.__principlemd_theme_context__) {
|
|
242
|
+
globalWindow.__principlemd_theme_context__ = createContext(void 0);
|
|
243
|
+
}
|
|
244
|
+
return globalWindow.__principlemd_theme_context__;
|
|
245
|
+
} else {
|
|
246
|
+
if (!ThemeContext) {
|
|
247
|
+
ThemeContext = createContext(void 0);
|
|
248
|
+
}
|
|
249
|
+
return ThemeContext;
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var ThemeContextSingleton = getThemeContext();
|
|
253
|
+
var useTheme = () => {
|
|
254
|
+
const context = useContext(ThemeContextSingleton);
|
|
255
|
+
if (!context) {
|
|
256
|
+
throw new Error("useTheme must be used within a ThemeProvider");
|
|
257
|
+
}
|
|
258
|
+
return context;
|
|
259
|
+
};
|
|
260
|
+
function formatRelativeTime(dateStr) {
|
|
261
|
+
if (!dateStr) return "Unknown";
|
|
262
|
+
const date = new Date(dateStr);
|
|
263
|
+
if (Number.isNaN(date.getTime())) {
|
|
264
|
+
return "Unknown";
|
|
265
|
+
}
|
|
266
|
+
const now = /* @__PURE__ */ new Date();
|
|
267
|
+
const diffMs = now.getTime() - date.getTime();
|
|
268
|
+
const minutes = Math.floor(diffMs / (1e3 * 60));
|
|
269
|
+
if (minutes < 1) return "Just now";
|
|
270
|
+
if (minutes < 60) return `${minutes} minute${minutes === 1 ? "" : "s"} ago`;
|
|
271
|
+
const hours = Math.floor(minutes / 60);
|
|
272
|
+
if (hours < 24) return `${hours} hour${hours === 1 ? "" : "s"} ago`;
|
|
273
|
+
const days = Math.floor(hours / 24);
|
|
274
|
+
if (days < 30) return `${days} day${days === 1 ? "" : "s"} ago`;
|
|
275
|
+
const months = Math.floor(days / 30);
|
|
276
|
+
if (months < 12) return `${months} month${months === 1 ? "" : "s"} ago`;
|
|
277
|
+
const years = Math.floor(months / 12);
|
|
278
|
+
return `${years} year${years === 1 ? "" : "s"} ago`;
|
|
279
|
+
}
|
|
280
|
+
function formatDate(dateString) {
|
|
281
|
+
if (!dateString) {
|
|
282
|
+
return "Unknown";
|
|
283
|
+
}
|
|
284
|
+
const date = new Date(dateString);
|
|
285
|
+
const now = /* @__PURE__ */ new Date();
|
|
286
|
+
const diffMs = now.getTime() - date.getTime();
|
|
287
|
+
const diffDays = Math.floor(diffMs / (1e3 * 60 * 60 * 24));
|
|
288
|
+
if (Number.isNaN(diffDays)) return "Unknown";
|
|
289
|
+
if (diffDays === 0) return "Today";
|
|
290
|
+
if (diffDays === 1) return "Yesterday";
|
|
291
|
+
if (diffDays < 7) return `${diffDays} days ago`;
|
|
292
|
+
if (diffDays < 30) return `${Math.floor(diffDays / 7)} weeks ago`;
|
|
293
|
+
if (diffDays < 365) return `${Math.floor(diffDays / 30)} months ago`;
|
|
294
|
+
return `${Math.floor(diffDays / 365)} years ago`;
|
|
295
|
+
}
|
|
296
|
+
const GitCommitHistoryPanel = ({
|
|
297
|
+
context,
|
|
298
|
+
events
|
|
299
|
+
}) => {
|
|
300
|
+
var _a;
|
|
301
|
+
const { theme } = useTheme();
|
|
302
|
+
const [limit, setLimit] = useState(25);
|
|
303
|
+
const commitsSlice = context.getSlice("commits");
|
|
304
|
+
const hasCommits = context.hasSlice("commits");
|
|
305
|
+
const isLoading = context.isSliceLoading("commits");
|
|
306
|
+
const commits = ((_a = commitsSlice == null ? void 0 : commitsSlice.data) == null ? void 0 : _a.commits) ?? [];
|
|
307
|
+
const sortedCommits = useMemo(() => {
|
|
308
|
+
return commits.slice(0, limit).sort((a, b) => {
|
|
309
|
+
const timeA = new Date(a.date).getTime();
|
|
310
|
+
const timeB = new Date(b.date).getTime();
|
|
311
|
+
return timeB - timeA;
|
|
312
|
+
});
|
|
313
|
+
}, [commits, limit]);
|
|
314
|
+
useEffect(() => {
|
|
315
|
+
const unsubscribers = [
|
|
316
|
+
// Tool: refresh commits
|
|
317
|
+
events.on("git-panels.commit-history:refresh", async (event) => {
|
|
318
|
+
try {
|
|
319
|
+
await context.refresh("repository", "commits");
|
|
320
|
+
} catch (error) {
|
|
321
|
+
console.error("[GitCommitHistoryPanel] Refresh failed:", error);
|
|
322
|
+
}
|
|
323
|
+
}),
|
|
324
|
+
// Tool: set limit
|
|
325
|
+
events.on("git-panels.commit-history:set-limit", (event) => {
|
|
326
|
+
var _a2;
|
|
327
|
+
const newLimit = (_a2 = event.payload) == null ? void 0 : _a2.limit;
|
|
328
|
+
if (newLimit && newLimit > 0) {
|
|
329
|
+
setLimit(newLimit);
|
|
330
|
+
}
|
|
331
|
+
})
|
|
332
|
+
];
|
|
333
|
+
return () => unsubscribers.forEach((unsub) => unsub());
|
|
334
|
+
}, [events, context]);
|
|
335
|
+
const handleRefresh = async () => {
|
|
336
|
+
try {
|
|
337
|
+
await context.refresh("repository", "commits");
|
|
338
|
+
} catch (error) {
|
|
339
|
+
console.error("[GitCommitHistoryPanel] Refresh failed:", error);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
342
|
+
const containerStyle = {
|
|
343
|
+
display: "flex",
|
|
344
|
+
flexDirection: "column",
|
|
345
|
+
height: "100%",
|
|
346
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
347
|
+
overflow: "hidden"
|
|
348
|
+
};
|
|
349
|
+
const renderState = (message) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
350
|
+
"div",
|
|
351
|
+
{
|
|
352
|
+
style: {
|
|
353
|
+
flex: 1,
|
|
354
|
+
display: "flex",
|
|
355
|
+
alignItems: "center",
|
|
356
|
+
justifyContent: "center",
|
|
357
|
+
padding: "24px",
|
|
358
|
+
color: theme.colors.textSecondary
|
|
359
|
+
},
|
|
360
|
+
children: message
|
|
361
|
+
}
|
|
362
|
+
) });
|
|
363
|
+
if (!context.currentScope.repository) {
|
|
364
|
+
return renderState("Connect a local repository to see commit history.");
|
|
365
|
+
}
|
|
366
|
+
if (!hasCommits) {
|
|
367
|
+
return renderState("Commit history data is not available.");
|
|
368
|
+
}
|
|
369
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
370
|
+
/* @__PURE__ */ jsxs(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
style: {
|
|
374
|
+
height: "40px",
|
|
375
|
+
minHeight: "40px",
|
|
376
|
+
padding: "0 12px",
|
|
377
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
378
|
+
display: "flex",
|
|
379
|
+
alignItems: "center",
|
|
380
|
+
justifyContent: "space-between",
|
|
381
|
+
color: theme.colors.textSecondary,
|
|
382
|
+
textTransform: "uppercase",
|
|
383
|
+
fontWeight: 600,
|
|
384
|
+
fontSize: theme.fontSizes[1],
|
|
385
|
+
boxSizing: "border-box"
|
|
386
|
+
},
|
|
387
|
+
children: [
|
|
388
|
+
/* @__PURE__ */ jsxs("span", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
389
|
+
/* @__PURE__ */ jsx(History, { size: 14 }),
|
|
390
|
+
"Commit History"
|
|
391
|
+
] }),
|
|
392
|
+
/* @__PURE__ */ jsxs(
|
|
393
|
+
"button",
|
|
394
|
+
{
|
|
395
|
+
type: "button",
|
|
396
|
+
onClick: handleRefresh,
|
|
397
|
+
disabled: isLoading,
|
|
398
|
+
style: {
|
|
399
|
+
display: "inline-flex",
|
|
400
|
+
alignItems: "center",
|
|
401
|
+
gap: "6px",
|
|
402
|
+
padding: "4px 10px",
|
|
403
|
+
borderRadius: "4px",
|
|
404
|
+
border: `1px solid ${theme.colors.border}`,
|
|
405
|
+
backgroundColor: theme.colors.background,
|
|
406
|
+
color: theme.colors.text,
|
|
407
|
+
cursor: isLoading ? "default" : "pointer",
|
|
408
|
+
fontSize: "12px",
|
|
409
|
+
fontWeight: 500,
|
|
410
|
+
opacity: isLoading ? 0.7 : 1
|
|
411
|
+
},
|
|
412
|
+
children: [
|
|
413
|
+
/* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
414
|
+
isLoading ? "Refreshing..." : "Refresh"
|
|
415
|
+
]
|
|
416
|
+
}
|
|
417
|
+
)
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
/* @__PURE__ */ jsxs(
|
|
422
|
+
"div",
|
|
423
|
+
{
|
|
424
|
+
style: {
|
|
425
|
+
flex: 1,
|
|
426
|
+
overflowY: "auto",
|
|
427
|
+
padding: "16px",
|
|
428
|
+
display: "flex",
|
|
429
|
+
flexDirection: "column",
|
|
430
|
+
gap: "10px"
|
|
431
|
+
},
|
|
432
|
+
children: [
|
|
433
|
+
isLoading && commits.length === 0 && /* @__PURE__ */ jsx(
|
|
434
|
+
"div",
|
|
435
|
+
{
|
|
436
|
+
style: {
|
|
437
|
+
flex: 1,
|
|
438
|
+
display: "flex",
|
|
439
|
+
alignItems: "center",
|
|
440
|
+
justifyContent: "center",
|
|
441
|
+
textAlign: "center",
|
|
442
|
+
color: theme.colors.textSecondary,
|
|
443
|
+
fontSize: theme.fontSizes[1]
|
|
444
|
+
},
|
|
445
|
+
children: "Loading commit history..."
|
|
446
|
+
}
|
|
447
|
+
),
|
|
448
|
+
!isLoading && sortedCommits.length === 0 && /* @__PURE__ */ jsx(
|
|
449
|
+
"div",
|
|
450
|
+
{
|
|
451
|
+
style: {
|
|
452
|
+
flex: 1,
|
|
453
|
+
display: "flex",
|
|
454
|
+
alignItems: "center",
|
|
455
|
+
justifyContent: "center",
|
|
456
|
+
textAlign: "center",
|
|
457
|
+
color: theme.colors.textSecondary,
|
|
458
|
+
fontSize: theme.fontSizes[1]
|
|
459
|
+
},
|
|
460
|
+
children: "No commits found."
|
|
461
|
+
}
|
|
462
|
+
),
|
|
463
|
+
sortedCommits.map((commit) => /* @__PURE__ */ jsx(CommitCard, { commit, theme }, commit.hash))
|
|
464
|
+
]
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
] });
|
|
468
|
+
};
|
|
469
|
+
const CommitCard = ({ commit, theme }) => {
|
|
470
|
+
const firstLine = commit.message.split("\n")[0];
|
|
471
|
+
const relative = formatRelativeTime(commit.date);
|
|
472
|
+
return /* @__PURE__ */ jsxs(
|
|
473
|
+
"div",
|
|
474
|
+
{
|
|
475
|
+
style: {
|
|
476
|
+
padding: "12px",
|
|
477
|
+
backgroundColor: theme.colors.background,
|
|
478
|
+
borderRadius: "6px",
|
|
479
|
+
border: `1px solid ${theme.colors.border}`,
|
|
480
|
+
display: "flex",
|
|
481
|
+
flexDirection: "column",
|
|
482
|
+
gap: "6px"
|
|
483
|
+
},
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ jsx(
|
|
486
|
+
"div",
|
|
487
|
+
{
|
|
488
|
+
style: {
|
|
489
|
+
fontSize: theme.fontSizes[2],
|
|
490
|
+
color: theme.colors.text,
|
|
491
|
+
fontWeight: 500,
|
|
492
|
+
lineHeight: 1.4
|
|
493
|
+
},
|
|
494
|
+
children: firstLine
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsxs(
|
|
498
|
+
"div",
|
|
499
|
+
{
|
|
500
|
+
style: {
|
|
501
|
+
display: "flex",
|
|
502
|
+
flexWrap: "wrap",
|
|
503
|
+
gap: "8px",
|
|
504
|
+
alignItems: "center",
|
|
505
|
+
fontSize: theme.fontSizes[1],
|
|
506
|
+
color: theme.colors.textSecondary
|
|
507
|
+
},
|
|
508
|
+
children: [
|
|
509
|
+
commit.author && /* @__PURE__ */ jsx("span", { children: commit.author }),
|
|
510
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: "•" }),
|
|
511
|
+
/* @__PURE__ */ jsx(
|
|
512
|
+
"span",
|
|
513
|
+
{
|
|
514
|
+
style: {
|
|
515
|
+
fontFamily: theme.fonts.monospace,
|
|
516
|
+
fontSize: "11px"
|
|
517
|
+
},
|
|
518
|
+
children: commit.hash.substring(0, 8)
|
|
519
|
+
}
|
|
520
|
+
),
|
|
521
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10px" }, children: "•" }),
|
|
522
|
+
/* @__PURE__ */ jsxs(
|
|
523
|
+
"span",
|
|
524
|
+
{
|
|
525
|
+
style: {
|
|
526
|
+
display: "inline-flex",
|
|
527
|
+
alignItems: "center",
|
|
528
|
+
gap: "4px"
|
|
529
|
+
},
|
|
530
|
+
children: [
|
|
531
|
+
/* @__PURE__ */ jsx(Clock, { size: 12 }),
|
|
532
|
+
/* @__PURE__ */ jsx("span", { title: new Date(commit.date).toLocaleString(), children: relative })
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
)
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
};
|
|
543
|
+
const GitCommitHistoryPanelPreview = () => {
|
|
544
|
+
const { theme } = useTheme();
|
|
545
|
+
return /* @__PURE__ */ jsx(
|
|
546
|
+
"div",
|
|
547
|
+
{
|
|
548
|
+
style: {
|
|
549
|
+
padding: "12px",
|
|
550
|
+
fontSize: "12px",
|
|
551
|
+
color: theme.colors.text,
|
|
552
|
+
display: "flex",
|
|
553
|
+
flexDirection: "column",
|
|
554
|
+
gap: "8px"
|
|
555
|
+
},
|
|
556
|
+
children: [
|
|
557
|
+
{
|
|
558
|
+
title: "chore: add commit history panel",
|
|
559
|
+
author: "Alex Engineer",
|
|
560
|
+
sha: "1a2b3c4d",
|
|
561
|
+
time: "2 hours ago"
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
title: "fix: handle empty repositories gracefully",
|
|
565
|
+
author: "Jamie Dev",
|
|
566
|
+
sha: "5f6g7h8i",
|
|
567
|
+
time: "Yesterday"
|
|
568
|
+
}
|
|
569
|
+
].map((commit) => /* @__PURE__ */ jsxs(
|
|
570
|
+
"div",
|
|
571
|
+
{
|
|
572
|
+
style: {
|
|
573
|
+
display: "flex",
|
|
574
|
+
flexDirection: "column",
|
|
575
|
+
gap: "4px",
|
|
576
|
+
border: `1px solid ${theme.colors.border}`,
|
|
577
|
+
borderRadius: "6px",
|
|
578
|
+
padding: "8px",
|
|
579
|
+
backgroundColor: theme.colors.background
|
|
580
|
+
},
|
|
581
|
+
children: [
|
|
582
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: commit.title }),
|
|
583
|
+
/* @__PURE__ */ jsxs(
|
|
584
|
+
"span",
|
|
585
|
+
{
|
|
586
|
+
style: {
|
|
587
|
+
display: "flex",
|
|
588
|
+
alignItems: "center",
|
|
589
|
+
gap: "6px",
|
|
590
|
+
color: theme.colors.textSecondary,
|
|
591
|
+
fontSize: "11px",
|
|
592
|
+
fontFamily: theme.fonts.body
|
|
593
|
+
},
|
|
594
|
+
children: [
|
|
595
|
+
/* @__PURE__ */ jsx("span", { children: commit.author }),
|
|
596
|
+
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
597
|
+
/* @__PURE__ */ jsx("span", { style: { fontFamily: theme.fonts.monospace }, children: commit.sha }),
|
|
598
|
+
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
599
|
+
/* @__PURE__ */ jsx("span", { children: commit.time })
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
)
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
commit.sha
|
|
606
|
+
))
|
|
607
|
+
}
|
|
608
|
+
);
|
|
609
|
+
};
|
|
610
|
+
const GitPullRequestsPanel = ({
|
|
611
|
+
context,
|
|
612
|
+
events
|
|
613
|
+
}) => {
|
|
614
|
+
var _a, _b, _c;
|
|
615
|
+
const { theme } = useTheme();
|
|
616
|
+
const [filter, setFilter] = useState("open");
|
|
617
|
+
const prSlice = context.getSlice("pullRequests");
|
|
618
|
+
const hasPRs = context.hasSlice("pullRequests");
|
|
619
|
+
const isLoading = context.isSliceLoading("pullRequests");
|
|
620
|
+
const pullRequests = ((_a = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _a.pullRequests) ?? [];
|
|
621
|
+
const owner = (_b = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _b.owner;
|
|
622
|
+
const repo = (_c = prSlice == null ? void 0 : prSlice.data) == null ? void 0 : _c.repo;
|
|
623
|
+
useEffect(() => {
|
|
624
|
+
const unsubscribers = [
|
|
625
|
+
// Tool: refresh pull requests
|
|
626
|
+
events.on("git-panels.pull-requests:refresh", async () => {
|
|
627
|
+
try {
|
|
628
|
+
await context.refresh("repository", "pullRequests");
|
|
629
|
+
} catch (error) {
|
|
630
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
631
|
+
}
|
|
632
|
+
}),
|
|
633
|
+
// Tool: set filter
|
|
634
|
+
events.on("git-panels.pull-requests:set-filter", (event) => {
|
|
635
|
+
var _a2;
|
|
636
|
+
const newFilter = (_a2 = event.payload) == null ? void 0 : _a2.filter;
|
|
637
|
+
if (newFilter && ["all", "open", "closed"].includes(newFilter)) {
|
|
638
|
+
setFilter(newFilter);
|
|
639
|
+
}
|
|
640
|
+
})
|
|
641
|
+
];
|
|
642
|
+
return () => unsubscribers.forEach((unsub) => unsub());
|
|
643
|
+
}, [events, context]);
|
|
644
|
+
const filteredPullRequests = useMemo(() => {
|
|
645
|
+
if (filter === "all") {
|
|
646
|
+
return pullRequests;
|
|
647
|
+
}
|
|
648
|
+
return pullRequests.filter((pr) => pr.state === filter);
|
|
649
|
+
}, [filter, pullRequests]);
|
|
650
|
+
const counts = useMemo(() => {
|
|
651
|
+
const open = pullRequests.filter((pr) => pr.state === "open").length;
|
|
652
|
+
const closed = pullRequests.filter((pr) => pr.state === "closed").length;
|
|
653
|
+
return { open, closed, all: pullRequests.length };
|
|
654
|
+
}, [pullRequests]);
|
|
655
|
+
const handleRefresh = async () => {
|
|
656
|
+
try {
|
|
657
|
+
await context.refresh("repository", "pullRequests");
|
|
658
|
+
} catch (error) {
|
|
659
|
+
console.error("[GitPullRequestsPanel] Refresh failed:", error);
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
const containerStyle = {
|
|
663
|
+
display: "flex",
|
|
664
|
+
flexDirection: "column",
|
|
665
|
+
height: "100%",
|
|
666
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
667
|
+
overflow: "hidden"
|
|
668
|
+
};
|
|
669
|
+
const renderState = (icon, title, description) => /* @__PURE__ */ jsx("div", { style: containerStyle, children: /* @__PURE__ */ jsx(
|
|
670
|
+
"div",
|
|
671
|
+
{
|
|
672
|
+
style: {
|
|
673
|
+
flex: 1,
|
|
674
|
+
display: "flex",
|
|
675
|
+
alignItems: "center",
|
|
676
|
+
justifyContent: "center",
|
|
677
|
+
padding: "24px"
|
|
678
|
+
},
|
|
679
|
+
children: /* @__PURE__ */ jsxs(
|
|
680
|
+
"div",
|
|
681
|
+
{
|
|
682
|
+
style: {
|
|
683
|
+
display: "flex",
|
|
684
|
+
flexDirection: "column",
|
|
685
|
+
alignItems: "center",
|
|
686
|
+
gap: "16px",
|
|
687
|
+
maxWidth: "360px",
|
|
688
|
+
textAlign: "center"
|
|
689
|
+
},
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ jsx("div", { children: icon }),
|
|
692
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
693
|
+
/* @__PURE__ */ jsx(
|
|
694
|
+
"h3",
|
|
695
|
+
{
|
|
696
|
+
style: {
|
|
697
|
+
margin: 0,
|
|
698
|
+
marginBottom: "8px",
|
|
699
|
+
color: theme.colors.text,
|
|
700
|
+
fontSize: "16px",
|
|
701
|
+
fontWeight: 600
|
|
702
|
+
},
|
|
703
|
+
children: title
|
|
704
|
+
}
|
|
705
|
+
),
|
|
706
|
+
description && /* @__PURE__ */ jsx(
|
|
707
|
+
"p",
|
|
708
|
+
{
|
|
709
|
+
style: {
|
|
710
|
+
margin: 0,
|
|
711
|
+
color: theme.colors.textSecondary,
|
|
712
|
+
lineHeight: 1.5
|
|
713
|
+
},
|
|
714
|
+
children: description
|
|
715
|
+
}
|
|
716
|
+
)
|
|
717
|
+
] })
|
|
718
|
+
]
|
|
719
|
+
}
|
|
720
|
+
)
|
|
721
|
+
}
|
|
722
|
+
) });
|
|
723
|
+
if (isLoading && pullRequests.length === 0) {
|
|
724
|
+
return renderState(
|
|
725
|
+
/* @__PURE__ */ jsx(LoaderCircle, { size: 32, style: { color: theme.colors.textSecondary }, className: "spin" }),
|
|
726
|
+
"Loading pull requests...",
|
|
727
|
+
"Fetching pull request data for this repository."
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
if (!context.currentScope.repository) {
|
|
731
|
+
return renderState(
|
|
732
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme.colors.textSecondary } }),
|
|
733
|
+
"No repository selected",
|
|
734
|
+
"Select a repository to view pull requests."
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
if (!hasPRs) {
|
|
738
|
+
return renderState(
|
|
739
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 32, style: { color: theme.colors.warning || "#f59e0b" } }),
|
|
740
|
+
"Pull requests unavailable",
|
|
741
|
+
"Pull request data is not available for this repository."
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
return /* @__PURE__ */ jsxs("div", { style: containerStyle, children: [
|
|
745
|
+
/* @__PURE__ */ jsxs(
|
|
746
|
+
"div",
|
|
747
|
+
{
|
|
748
|
+
style: {
|
|
749
|
+
height: "40px",
|
|
750
|
+
minHeight: "40px",
|
|
751
|
+
padding: "0 12px",
|
|
752
|
+
borderBottom: `1px solid ${theme.colors.border}`,
|
|
753
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
754
|
+
display: "flex",
|
|
755
|
+
alignItems: "center",
|
|
756
|
+
justifyContent: "space-between",
|
|
757
|
+
boxSizing: "border-box"
|
|
758
|
+
},
|
|
759
|
+
children: [
|
|
760
|
+
/* @__PURE__ */ jsxs(
|
|
761
|
+
"div",
|
|
762
|
+
{
|
|
763
|
+
style: {
|
|
764
|
+
display: "flex",
|
|
765
|
+
alignItems: "center",
|
|
766
|
+
gap: "8px",
|
|
767
|
+
color: theme.colors.textSecondary,
|
|
768
|
+
textTransform: "uppercase",
|
|
769
|
+
fontWeight: 600,
|
|
770
|
+
fontSize: "12px"
|
|
771
|
+
},
|
|
772
|
+
children: [
|
|
773
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 14 }),
|
|
774
|
+
"Pull Requests",
|
|
775
|
+
owner && repo && /* @__PURE__ */ jsxs(
|
|
776
|
+
"span",
|
|
777
|
+
{
|
|
778
|
+
style: {
|
|
779
|
+
fontWeight: 400,
|
|
780
|
+
textTransform: "none",
|
|
781
|
+
opacity: 0.7
|
|
782
|
+
},
|
|
783
|
+
children: [
|
|
784
|
+
"· ",
|
|
785
|
+
owner,
|
|
786
|
+
"/",
|
|
787
|
+
repo
|
|
788
|
+
]
|
|
789
|
+
}
|
|
790
|
+
)
|
|
791
|
+
]
|
|
792
|
+
}
|
|
793
|
+
),
|
|
794
|
+
/* @__PURE__ */ jsxs(
|
|
795
|
+
"button",
|
|
796
|
+
{
|
|
797
|
+
type: "button",
|
|
798
|
+
onClick: handleRefresh,
|
|
799
|
+
disabled: isLoading,
|
|
800
|
+
style: {
|
|
801
|
+
display: "inline-flex",
|
|
802
|
+
alignItems: "center",
|
|
803
|
+
gap: "6px",
|
|
804
|
+
padding: "4px 10px",
|
|
805
|
+
borderRadius: "4px",
|
|
806
|
+
border: `1px solid ${theme.colors.border}`,
|
|
807
|
+
backgroundColor: theme.colors.background,
|
|
808
|
+
color: theme.colors.text,
|
|
809
|
+
cursor: isLoading ? "default" : "pointer",
|
|
810
|
+
fontSize: "12px",
|
|
811
|
+
fontWeight: 500,
|
|
812
|
+
opacity: isLoading ? 0.7 : 1
|
|
813
|
+
},
|
|
814
|
+
children: [
|
|
815
|
+
isLoading ? /* @__PURE__ */ jsx(LoaderCircle, { size: 12, className: "spin" }) : /* @__PURE__ */ jsx(RefreshCcw, { size: 12 }),
|
|
816
|
+
isLoading ? "Refreshing..." : "Refresh"
|
|
817
|
+
]
|
|
818
|
+
}
|
|
819
|
+
)
|
|
820
|
+
]
|
|
821
|
+
}
|
|
822
|
+
),
|
|
823
|
+
/* @__PURE__ */ jsx(
|
|
824
|
+
"div",
|
|
825
|
+
{
|
|
826
|
+
style: {
|
|
827
|
+
display: "flex",
|
|
828
|
+
borderBottom: `1px solid ${theme.colors.border}`
|
|
829
|
+
},
|
|
830
|
+
children: ["open", "closed", "all"].map((value) => {
|
|
831
|
+
const isActive = filter === value;
|
|
832
|
+
const label = value === "open" ? "Open" : value === "closed" ? "Closed" : "All";
|
|
833
|
+
return /* @__PURE__ */ jsxs(
|
|
834
|
+
"button",
|
|
835
|
+
{
|
|
836
|
+
type: "button",
|
|
837
|
+
onClick: () => setFilter(value),
|
|
838
|
+
style: {
|
|
839
|
+
flex: 1,
|
|
840
|
+
display: "flex",
|
|
841
|
+
alignItems: "center",
|
|
842
|
+
justifyContent: "center",
|
|
843
|
+
gap: "6px",
|
|
844
|
+
padding: "8px 12px",
|
|
845
|
+
border: "none",
|
|
846
|
+
borderBottom: isActive ? `2px solid ${theme.colors.primary}` : "2px solid transparent",
|
|
847
|
+
backgroundColor: "transparent",
|
|
848
|
+
color: isActive ? theme.colors.text : theme.colors.textSecondary,
|
|
849
|
+
fontSize: "13px",
|
|
850
|
+
fontWeight: isActive ? 600 : 500,
|
|
851
|
+
cursor: "pointer",
|
|
852
|
+
marginBottom: "-1px"
|
|
853
|
+
},
|
|
854
|
+
children: [
|
|
855
|
+
label,
|
|
856
|
+
/* @__PURE__ */ jsxs("span", { style: { opacity: 0.7 }, children: [
|
|
857
|
+
"(",
|
|
858
|
+
counts[value],
|
|
859
|
+
")"
|
|
860
|
+
] })
|
|
861
|
+
]
|
|
862
|
+
},
|
|
863
|
+
value
|
|
864
|
+
);
|
|
865
|
+
})
|
|
866
|
+
}
|
|
867
|
+
),
|
|
868
|
+
/* @__PURE__ */ jsx(
|
|
869
|
+
"div",
|
|
870
|
+
{
|
|
871
|
+
style: {
|
|
872
|
+
flex: 1,
|
|
873
|
+
overflowY: "auto",
|
|
874
|
+
padding: "16px",
|
|
875
|
+
display: "flex",
|
|
876
|
+
flexDirection: "column",
|
|
877
|
+
gap: "12px"
|
|
878
|
+
},
|
|
879
|
+
children: filteredPullRequests.length === 0 ? /* @__PURE__ */ jsxs(
|
|
880
|
+
"div",
|
|
881
|
+
{
|
|
882
|
+
style: {
|
|
883
|
+
marginTop: "48px",
|
|
884
|
+
textAlign: "center",
|
|
885
|
+
color: theme.colors.textSecondary
|
|
886
|
+
},
|
|
887
|
+
children: [
|
|
888
|
+
/* @__PURE__ */ jsx(GitPullRequest, { size: 32, style: { marginBottom: "12px" } }),
|
|
889
|
+
/* @__PURE__ */ jsx("div", { style: { fontWeight: 600 }, children: "No pull requests found" }),
|
|
890
|
+
/* @__PURE__ */ jsxs("div", { style: { marginTop: "4px", fontSize: "13px" }, children: [
|
|
891
|
+
"There are no ",
|
|
892
|
+
filter !== "all" ? `${filter} ` : "",
|
|
893
|
+
"pull requests to display."
|
|
894
|
+
] })
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
) : filteredPullRequests.map((pr) => /* @__PURE__ */ jsx(PullRequestCard, { pr, theme }, pr.id))
|
|
898
|
+
}
|
|
899
|
+
)
|
|
900
|
+
] });
|
|
901
|
+
};
|
|
902
|
+
const PullRequestCard = ({ pr, theme }) => {
|
|
903
|
+
var _a, _b, _c, _d, _e;
|
|
904
|
+
const isMerged = pr.merged_at !== null;
|
|
905
|
+
const isOpen = pr.state === "open";
|
|
906
|
+
const badgeColor = isOpen ? theme.colors.success || "#22c55e" : isMerged ? theme.colors.primary : theme.colors.error || "#ef4444";
|
|
907
|
+
const badgeBg = `${badgeColor}22`;
|
|
908
|
+
const totalComments = (pr.comments || 0) + (pr.review_comments || 0);
|
|
909
|
+
return /* @__PURE__ */ jsxs(
|
|
910
|
+
"div",
|
|
911
|
+
{
|
|
912
|
+
style: {
|
|
913
|
+
border: `1px solid ${theme.colors.border}`,
|
|
914
|
+
borderRadius: "12px",
|
|
915
|
+
padding: "16px",
|
|
916
|
+
backgroundColor: theme.colors.background,
|
|
917
|
+
display: "flex",
|
|
918
|
+
flexDirection: "column",
|
|
919
|
+
gap: "10px"
|
|
920
|
+
},
|
|
921
|
+
children: [
|
|
922
|
+
/* @__PURE__ */ jsxs(
|
|
923
|
+
"div",
|
|
924
|
+
{
|
|
925
|
+
style: {
|
|
926
|
+
display: "flex",
|
|
927
|
+
alignItems: "flex-start",
|
|
928
|
+
justifyContent: "space-between",
|
|
929
|
+
gap: "12px"
|
|
930
|
+
},
|
|
931
|
+
children: [
|
|
932
|
+
/* @__PURE__ */ jsxs(
|
|
933
|
+
"div",
|
|
934
|
+
{
|
|
935
|
+
style: {
|
|
936
|
+
display: "flex",
|
|
937
|
+
flexDirection: "column",
|
|
938
|
+
gap: "8px",
|
|
939
|
+
flex: 1
|
|
940
|
+
},
|
|
941
|
+
children: [
|
|
942
|
+
/* @__PURE__ */ jsxs(
|
|
943
|
+
"div",
|
|
944
|
+
{
|
|
945
|
+
style: {
|
|
946
|
+
display: "flex",
|
|
947
|
+
alignItems: "center",
|
|
948
|
+
gap: "10px",
|
|
949
|
+
flexWrap: "wrap"
|
|
950
|
+
},
|
|
951
|
+
children: [
|
|
952
|
+
/* @__PURE__ */ jsxs(
|
|
953
|
+
"span",
|
|
954
|
+
{
|
|
955
|
+
style: {
|
|
956
|
+
display: "inline-flex",
|
|
957
|
+
alignItems: "center",
|
|
958
|
+
gap: "6px",
|
|
959
|
+
padding: "4px 10px",
|
|
960
|
+
borderRadius: "999px",
|
|
961
|
+
backgroundColor: badgeBg,
|
|
962
|
+
color: badgeColor,
|
|
963
|
+
fontSize: "12px",
|
|
964
|
+
fontWeight: 600,
|
|
965
|
+
textTransform: "uppercase",
|
|
966
|
+
letterSpacing: "0.02em"
|
|
967
|
+
},
|
|
968
|
+
children: [
|
|
969
|
+
isOpen ? "Open" : isMerged ? "Merged" : "Closed",
|
|
970
|
+
pr.draft && /* @__PURE__ */ jsx(
|
|
971
|
+
"span",
|
|
972
|
+
{
|
|
973
|
+
style: {
|
|
974
|
+
marginLeft: "6px",
|
|
975
|
+
padding: "2px 6px",
|
|
976
|
+
borderRadius: "8px",
|
|
977
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
978
|
+
color: theme.colors.textSecondary,
|
|
979
|
+
fontSize: "11px",
|
|
980
|
+
fontWeight: 500,
|
|
981
|
+
textTransform: "capitalize"
|
|
982
|
+
},
|
|
983
|
+
children: "Draft"
|
|
984
|
+
}
|
|
985
|
+
)
|
|
986
|
+
]
|
|
987
|
+
}
|
|
988
|
+
),
|
|
989
|
+
/* @__PURE__ */ jsxs(
|
|
990
|
+
"span",
|
|
991
|
+
{
|
|
992
|
+
style: {
|
|
993
|
+
fontSize: "16px",
|
|
994
|
+
fontWeight: 600,
|
|
995
|
+
color: theme.colors.text,
|
|
996
|
+
display: "inline-flex",
|
|
997
|
+
alignItems: "center",
|
|
998
|
+
gap: "8px"
|
|
999
|
+
},
|
|
1000
|
+
children: [
|
|
1001
|
+
"#",
|
|
1002
|
+
pr.number,
|
|
1003
|
+
" ",
|
|
1004
|
+
pr.title
|
|
1005
|
+
]
|
|
1006
|
+
}
|
|
1007
|
+
)
|
|
1008
|
+
]
|
|
1009
|
+
}
|
|
1010
|
+
),
|
|
1011
|
+
/* @__PURE__ */ jsxs(
|
|
1012
|
+
"div",
|
|
1013
|
+
{
|
|
1014
|
+
style: {
|
|
1015
|
+
display: "flex",
|
|
1016
|
+
alignItems: "center",
|
|
1017
|
+
gap: "12px",
|
|
1018
|
+
flexWrap: "wrap",
|
|
1019
|
+
color: theme.colors.textSecondary,
|
|
1020
|
+
fontSize: "12px"
|
|
1021
|
+
},
|
|
1022
|
+
children: [
|
|
1023
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
1024
|
+
"by ",
|
|
1025
|
+
((_a = pr.user) == null ? void 0 : _a.login) ?? "unknown"
|
|
1026
|
+
] }),
|
|
1027
|
+
/* @__PURE__ */ jsxs(
|
|
1028
|
+
"span",
|
|
1029
|
+
{
|
|
1030
|
+
style: {
|
|
1031
|
+
display: "inline-flex",
|
|
1032
|
+
alignItems: "center",
|
|
1033
|
+
gap: "4px"
|
|
1034
|
+
},
|
|
1035
|
+
children: [
|
|
1036
|
+
/* @__PURE__ */ jsx(Calendar, { size: 12 }),
|
|
1037
|
+
" Opened ",
|
|
1038
|
+
formatDate(pr.created_at)
|
|
1039
|
+
]
|
|
1040
|
+
}
|
|
1041
|
+
),
|
|
1042
|
+
!isOpen && /* @__PURE__ */ jsxs(
|
|
1043
|
+
"span",
|
|
1044
|
+
{
|
|
1045
|
+
style: {
|
|
1046
|
+
display: "inline-flex",
|
|
1047
|
+
alignItems: "center",
|
|
1048
|
+
gap: "4px"
|
|
1049
|
+
},
|
|
1050
|
+
children: [
|
|
1051
|
+
isMerged ? "Merged" : "Closed",
|
|
1052
|
+
" ",
|
|
1053
|
+
formatDate(pr.merged_at || pr.updated_at)
|
|
1054
|
+
]
|
|
1055
|
+
}
|
|
1056
|
+
),
|
|
1057
|
+
totalComments > 0 && /* @__PURE__ */ jsxs(
|
|
1058
|
+
"span",
|
|
1059
|
+
{
|
|
1060
|
+
style: {
|
|
1061
|
+
display: "inline-flex",
|
|
1062
|
+
alignItems: "center",
|
|
1063
|
+
gap: "4px"
|
|
1064
|
+
},
|
|
1065
|
+
children: [
|
|
1066
|
+
/* @__PURE__ */ jsx(MessageSquare, { size: 12 }),
|
|
1067
|
+
" ",
|
|
1068
|
+
totalComments,
|
|
1069
|
+
" comment",
|
|
1070
|
+
totalComments === 1 ? "" : "s"
|
|
1071
|
+
]
|
|
1072
|
+
}
|
|
1073
|
+
)
|
|
1074
|
+
]
|
|
1075
|
+
}
|
|
1076
|
+
),
|
|
1077
|
+
/* @__PURE__ */ jsxs(
|
|
1078
|
+
"div",
|
|
1079
|
+
{
|
|
1080
|
+
style: {
|
|
1081
|
+
display: "flex",
|
|
1082
|
+
alignItems: "center",
|
|
1083
|
+
gap: "8px",
|
|
1084
|
+
color: theme.colors.textSecondary,
|
|
1085
|
+
fontSize: "12px"
|
|
1086
|
+
},
|
|
1087
|
+
children: [
|
|
1088
|
+
/* @__PURE__ */ jsx(GitBranch, { size: 14 }),
|
|
1089
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
1090
|
+
((_b = pr.base) == null ? void 0 : _b.ref) ?? "unknown",
|
|
1091
|
+
" ",
|
|
1092
|
+
/* @__PURE__ */ jsx("span", { style: { opacity: 0.6 }, children: "←" }),
|
|
1093
|
+
" ",
|
|
1094
|
+
((_c = pr.head) == null ? void 0 : _c.ref) ?? "unknown"
|
|
1095
|
+
] })
|
|
1096
|
+
]
|
|
1097
|
+
}
|
|
1098
|
+
),
|
|
1099
|
+
pr.body && /* @__PURE__ */ jsx(
|
|
1100
|
+
"div",
|
|
1101
|
+
{
|
|
1102
|
+
style: {
|
|
1103
|
+
marginTop: "4px",
|
|
1104
|
+
color: theme.colors.textSecondary,
|
|
1105
|
+
fontSize: "13px",
|
|
1106
|
+
lineHeight: 1.5,
|
|
1107
|
+
maxHeight: "72px",
|
|
1108
|
+
overflow: "hidden",
|
|
1109
|
+
textOverflow: "ellipsis"
|
|
1110
|
+
},
|
|
1111
|
+
children: pr.body
|
|
1112
|
+
}
|
|
1113
|
+
)
|
|
1114
|
+
]
|
|
1115
|
+
}
|
|
1116
|
+
),
|
|
1117
|
+
/* @__PURE__ */ jsxs(
|
|
1118
|
+
"a",
|
|
1119
|
+
{
|
|
1120
|
+
href: pr.html_url,
|
|
1121
|
+
target: "_blank",
|
|
1122
|
+
rel: "noreferrer",
|
|
1123
|
+
style: {
|
|
1124
|
+
display: "inline-flex",
|
|
1125
|
+
alignItems: "center",
|
|
1126
|
+
gap: "6px",
|
|
1127
|
+
padding: "6px 10px",
|
|
1128
|
+
borderRadius: "6px",
|
|
1129
|
+
border: `1px solid ${theme.colors.border}`,
|
|
1130
|
+
backgroundColor: theme.colors.backgroundSecondary,
|
|
1131
|
+
color: theme.colors.text,
|
|
1132
|
+
textDecoration: "none",
|
|
1133
|
+
fontSize: "13px",
|
|
1134
|
+
fontWeight: 600,
|
|
1135
|
+
whiteSpace: "nowrap"
|
|
1136
|
+
},
|
|
1137
|
+
children: [
|
|
1138
|
+
"View",
|
|
1139
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 14 })
|
|
1140
|
+
]
|
|
1141
|
+
}
|
|
1142
|
+
)
|
|
1143
|
+
]
|
|
1144
|
+
}
|
|
1145
|
+
),
|
|
1146
|
+
isMerged && /* @__PURE__ */ jsxs(
|
|
1147
|
+
"div",
|
|
1148
|
+
{
|
|
1149
|
+
style: {
|
|
1150
|
+
display: "flex",
|
|
1151
|
+
alignItems: "center",
|
|
1152
|
+
gap: "6px",
|
|
1153
|
+
fontSize: "12px",
|
|
1154
|
+
color: theme.colors.primary
|
|
1155
|
+
},
|
|
1156
|
+
children: [
|
|
1157
|
+
/* @__PURE__ */ jsx(GitMerge, { size: 14 }),
|
|
1158
|
+
" Merged into ",
|
|
1159
|
+
((_d = pr.base) == null ? void 0 : _d.ref) ?? "base",
|
|
1160
|
+
" from",
|
|
1161
|
+
" ",
|
|
1162
|
+
((_e = pr.head) == null ? void 0 : _e.ref) ?? "head"
|
|
1163
|
+
]
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
]
|
|
1167
|
+
}
|
|
1168
|
+
);
|
|
1169
|
+
};
|
|
1170
|
+
const GitPullRequestsPanelPreview = () => {
|
|
1171
|
+
const { theme } = useTheme();
|
|
1172
|
+
return /* @__PURE__ */ jsxs(
|
|
1173
|
+
"div",
|
|
1174
|
+
{
|
|
1175
|
+
style: {
|
|
1176
|
+
padding: "12px",
|
|
1177
|
+
fontSize: "12px",
|
|
1178
|
+
color: theme.colors.text,
|
|
1179
|
+
display: "flex",
|
|
1180
|
+
flexDirection: "column",
|
|
1181
|
+
gap: "8px"
|
|
1182
|
+
},
|
|
1183
|
+
children: [
|
|
1184
|
+
/* @__PURE__ */ jsxs(
|
|
1185
|
+
"div",
|
|
1186
|
+
{
|
|
1187
|
+
style: {
|
|
1188
|
+
display: "flex",
|
|
1189
|
+
alignItems: "center",
|
|
1190
|
+
gap: "8px"
|
|
1191
|
+
},
|
|
1192
|
+
children: [
|
|
1193
|
+
/* @__PURE__ */ jsx(
|
|
1194
|
+
"span",
|
|
1195
|
+
{
|
|
1196
|
+
style: {
|
|
1197
|
+
display: "inline-flex",
|
|
1198
|
+
alignItems: "center",
|
|
1199
|
+
gap: "6px",
|
|
1200
|
+
padding: "2px 8px",
|
|
1201
|
+
borderRadius: "999px",
|
|
1202
|
+
backgroundColor: "#3b82f622",
|
|
1203
|
+
color: "#3b82f6",
|
|
1204
|
+
fontSize: "11px",
|
|
1205
|
+
fontWeight: 600,
|
|
1206
|
+
textTransform: "uppercase"
|
|
1207
|
+
},
|
|
1208
|
+
children: "Review"
|
|
1209
|
+
}
|
|
1210
|
+
),
|
|
1211
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 600 }, children: "#42 Refine panel layout system" })
|
|
1212
|
+
]
|
|
1213
|
+
}
|
|
1214
|
+
),
|
|
1215
|
+
/* @__PURE__ */ jsx(
|
|
1216
|
+
"div",
|
|
1217
|
+
{
|
|
1218
|
+
style: {
|
|
1219
|
+
paddingLeft: "4px",
|
|
1220
|
+
color: theme.colors.textSecondary,
|
|
1221
|
+
fontSize: "11px",
|
|
1222
|
+
lineHeight: 1.4
|
|
1223
|
+
},
|
|
1224
|
+
children: "Adds preview registry and consolidates configurator metadata."
|
|
1225
|
+
}
|
|
1226
|
+
),
|
|
1227
|
+
/* @__PURE__ */ jsxs(
|
|
1228
|
+
"div",
|
|
1229
|
+
{
|
|
1230
|
+
style: {
|
|
1231
|
+
display: "flex",
|
|
1232
|
+
alignItems: "center",
|
|
1233
|
+
gap: "8px",
|
|
1234
|
+
color: theme.colors.textSecondary,
|
|
1235
|
+
fontSize: "11px"
|
|
1236
|
+
},
|
|
1237
|
+
children: [
|
|
1238
|
+
/* @__PURE__ */ jsx("span", { children: "4 checks" }),
|
|
1239
|
+
/* @__PURE__ */ jsx("span", { children: "•" }),
|
|
1240
|
+
/* @__PURE__ */ jsx("span", { children: "1 reviewer" })
|
|
1241
|
+
]
|
|
1242
|
+
}
|
|
1243
|
+
)
|
|
1244
|
+
]
|
|
1245
|
+
}
|
|
1246
|
+
);
|
|
1247
|
+
};
|
|
1248
|
+
const refreshCommitsTool = {
|
|
1249
|
+
name: "refresh_commits",
|
|
1250
|
+
description: "Refreshes the commit history display",
|
|
1251
|
+
inputs: {
|
|
1252
|
+
type: "object",
|
|
1253
|
+
properties: {
|
|
1254
|
+
force: {
|
|
1255
|
+
type: "boolean",
|
|
1256
|
+
description: "Force refresh even if data is fresh"
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
},
|
|
1260
|
+
outputs: {
|
|
1261
|
+
type: "object",
|
|
1262
|
+
properties: {
|
|
1263
|
+
success: { type: "boolean" },
|
|
1264
|
+
message: { type: "string" }
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
tags: ["git", "commits", "refresh"],
|
|
1268
|
+
tool_call_template: {
|
|
1269
|
+
call_template_type: "panel_event",
|
|
1270
|
+
event_type: "git-panels.commit-history:refresh"
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
const setCommitLimitTool = {
|
|
1274
|
+
name: "set_commit_limit",
|
|
1275
|
+
description: "Sets the maximum number of commits to display",
|
|
1276
|
+
inputs: {
|
|
1277
|
+
type: "object",
|
|
1278
|
+
properties: {
|
|
1279
|
+
limit: {
|
|
1280
|
+
type: "number",
|
|
1281
|
+
description: "Maximum number of commits to show (1-100)"
|
|
1282
|
+
}
|
|
1283
|
+
},
|
|
1284
|
+
required: ["limit"]
|
|
1285
|
+
},
|
|
1286
|
+
outputs: {
|
|
1287
|
+
type: "object",
|
|
1288
|
+
properties: {
|
|
1289
|
+
success: { type: "boolean" },
|
|
1290
|
+
limit: { type: "number" }
|
|
1291
|
+
}
|
|
1292
|
+
},
|
|
1293
|
+
tags: ["git", "commits", "display"],
|
|
1294
|
+
tool_call_template: {
|
|
1295
|
+
call_template_type: "panel_event",
|
|
1296
|
+
event_type: "git-panels.commit-history:set-limit"
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
const commitHistoryTools = [
|
|
1300
|
+
refreshCommitsTool,
|
|
1301
|
+
setCommitLimitTool
|
|
1302
|
+
];
|
|
1303
|
+
const commitHistoryToolsMetadata = {
|
|
1304
|
+
id: "git-panels.commit-history",
|
|
1305
|
+
name: "Git Commit History",
|
|
1306
|
+
description: "Tools for the git commit history panel",
|
|
1307
|
+
tools: commitHistoryTools
|
|
1308
|
+
};
|
|
1309
|
+
const refreshPullRequestsTool = {
|
|
1310
|
+
name: "refresh_pull_requests",
|
|
1311
|
+
description: "Refreshes the pull requests display",
|
|
1312
|
+
inputs: {
|
|
1313
|
+
type: "object",
|
|
1314
|
+
properties: {
|
|
1315
|
+
force: {
|
|
1316
|
+
type: "boolean",
|
|
1317
|
+
description: "Force refresh even if data is fresh"
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
},
|
|
1321
|
+
outputs: {
|
|
1322
|
+
type: "object",
|
|
1323
|
+
properties: {
|
|
1324
|
+
success: { type: "boolean" },
|
|
1325
|
+
message: { type: "string" }
|
|
1326
|
+
}
|
|
1327
|
+
},
|
|
1328
|
+
tags: ["git", "pull-requests", "refresh"],
|
|
1329
|
+
tool_call_template: {
|
|
1330
|
+
call_template_type: "panel_event",
|
|
1331
|
+
event_type: "git-panels.pull-requests:refresh"
|
|
1332
|
+
}
|
|
1333
|
+
};
|
|
1334
|
+
const setPRFilterTool = {
|
|
1335
|
+
name: "set_pr_filter",
|
|
1336
|
+
description: "Sets the pull request filter (all, open, or closed)",
|
|
1337
|
+
inputs: {
|
|
1338
|
+
type: "object",
|
|
1339
|
+
properties: {
|
|
1340
|
+
filter: {
|
|
1341
|
+
type: "string",
|
|
1342
|
+
enum: ["all", "open", "closed"],
|
|
1343
|
+
description: "Filter to apply to pull requests"
|
|
1344
|
+
}
|
|
1345
|
+
},
|
|
1346
|
+
required: ["filter"]
|
|
1347
|
+
},
|
|
1348
|
+
outputs: {
|
|
1349
|
+
type: "object",
|
|
1350
|
+
properties: {
|
|
1351
|
+
success: { type: "boolean" },
|
|
1352
|
+
filter: { type: "string" }
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1355
|
+
tags: ["git", "pull-requests", "filter"],
|
|
1356
|
+
tool_call_template: {
|
|
1357
|
+
call_template_type: "panel_event",
|
|
1358
|
+
event_type: "git-panels.pull-requests:set-filter"
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
const pullRequestsTools = [
|
|
1362
|
+
refreshPullRequestsTool,
|
|
1363
|
+
setPRFilterTool
|
|
1364
|
+
];
|
|
1365
|
+
const pullRequestsToolsMetadata = {
|
|
1366
|
+
id: "git-panels.pull-requests",
|
|
1367
|
+
name: "Git Pull Requests",
|
|
1368
|
+
description: "Tools for the git pull requests panel",
|
|
1369
|
+
tools: pullRequestsTools
|
|
1370
|
+
};
|
|
1371
|
+
const allGitPanelTools = [
|
|
1372
|
+
...commitHistoryTools,
|
|
1373
|
+
...pullRequestsTools
|
|
1374
|
+
];
|
|
1375
|
+
const panels = [
|
|
1376
|
+
{
|
|
1377
|
+
metadata: {
|
|
1378
|
+
id: "git-panels.commit-history",
|
|
1379
|
+
name: "Git Commit History",
|
|
1380
|
+
icon: "history",
|
|
1381
|
+
version: "0.1.0",
|
|
1382
|
+
author: "Principal ADE",
|
|
1383
|
+
description: "View recent commits from the current repository",
|
|
1384
|
+
slices: ["commits"],
|
|
1385
|
+
tools: commitHistoryTools
|
|
1386
|
+
},
|
|
1387
|
+
component: GitCommitHistoryPanel,
|
|
1388
|
+
onMount: async (context) => {
|
|
1389
|
+
if (context.hasSlice("commits") && !context.isSliceLoading("commits")) {
|
|
1390
|
+
await context.refresh("repository", "commits");
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
metadata: {
|
|
1396
|
+
id: "git-panels.pull-requests",
|
|
1397
|
+
name: "Git Pull Requests",
|
|
1398
|
+
icon: "git-pull-request",
|
|
1399
|
+
version: "0.1.0",
|
|
1400
|
+
author: "Principal ADE",
|
|
1401
|
+
description: "Review open, merged, and closed pull requests",
|
|
1402
|
+
slices: ["pullRequests"],
|
|
1403
|
+
tools: pullRequestsTools
|
|
1404
|
+
},
|
|
1405
|
+
component: GitPullRequestsPanel,
|
|
1406
|
+
onMount: async (context) => {
|
|
1407
|
+
if (context.hasSlice("pullRequests") && !context.isSliceLoading("pullRequests")) {
|
|
1408
|
+
await context.refresh("repository", "pullRequests");
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
];
|
|
1413
|
+
const onPackageLoad = async () => {
|
|
1414
|
+
console.log("[git-panels] Package loaded");
|
|
1415
|
+
};
|
|
1416
|
+
const onPackageUnload = async () => {
|
|
1417
|
+
console.log("[git-panels] Package unloading");
|
|
1418
|
+
};
|
|
1419
|
+
export {
|
|
1420
|
+
GitCommitHistoryPanel,
|
|
1421
|
+
GitCommitHistoryPanelPreview,
|
|
1422
|
+
GitPullRequestsPanel,
|
|
1423
|
+
GitPullRequestsPanelPreview,
|
|
1424
|
+
allGitPanelTools,
|
|
1425
|
+
commitHistoryTools,
|
|
1426
|
+
commitHistoryToolsMetadata,
|
|
1427
|
+
onPackageLoad,
|
|
1428
|
+
onPackageUnload,
|
|
1429
|
+
panels,
|
|
1430
|
+
pullRequestsTools,
|
|
1431
|
+
pullRequestsToolsMetadata,
|
|
1432
|
+
refreshCommitsTool,
|
|
1433
|
+
refreshPullRequestsTool,
|
|
1434
|
+
setCommitLimitTool,
|
|
1435
|
+
setPRFilterTool
|
|
1436
|
+
};
|
|
1437
|
+
//# sourceMappingURL=panels.bundle.js.map
|