@industry-theme/github-panels 0.1.52 → 0.1.53
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GitHubIssueDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitHubIssueDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GitHubIssueDetailPanel.d.ts","sourceRoot":"","sources":["../../src/panels/GitHubIssueDetailPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAc3D,OAAO,KAAK,EAAE,mBAAmB,EAAqB,MAAM,UAAU,CAAC;AAyfvE;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAEhE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;CAQ1C,CAAC"}
|
package/dist/panels.bundle.js
CHANGED
|
@@ -130,7 +130,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
130
130
|
* This source code is licensed under the ISC license.
|
|
131
131
|
* See the LICENSE file in the root directory of this source tree.
|
|
132
132
|
*/
|
|
133
|
-
const __iconNode$
|
|
133
|
+
const __iconNode$F = [
|
|
134
134
|
["path", { d: "M12 7v14", key: "1akyts" }],
|
|
135
135
|
[
|
|
136
136
|
"path",
|
|
@@ -140,14 +140,14 @@ const __iconNode$E = [
|
|
|
140
140
|
}
|
|
141
141
|
]
|
|
142
142
|
];
|
|
143
|
-
const BookOpen = createLucideIcon("book-open", __iconNode$
|
|
143
|
+
const BookOpen = createLucideIcon("book-open", __iconNode$F);
|
|
144
144
|
/**
|
|
145
145
|
* @license lucide-react v0.552.0 - ISC
|
|
146
146
|
*
|
|
147
147
|
* This source code is licensed under the ISC license.
|
|
148
148
|
* See the LICENSE file in the root directory of this source tree.
|
|
149
149
|
*/
|
|
150
|
-
const __iconNode$
|
|
150
|
+
const __iconNode$E = [
|
|
151
151
|
["path", { d: "M10 12h4", key: "a56b0p" }],
|
|
152
152
|
["path", { d: "M10 8h4", key: "1sr2af" }],
|
|
153
153
|
["path", { d: "M14 21v-3a2 2 0 0 0-4 0v3", key: "1rgiei" }],
|
|
@@ -160,56 +160,67 @@ const __iconNode$D = [
|
|
|
160
160
|
],
|
|
161
161
|
["path", { d: "M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16", key: "16ra0t" }]
|
|
162
162
|
];
|
|
163
|
-
const Building2 = createLucideIcon("building-2", __iconNode$
|
|
163
|
+
const Building2 = createLucideIcon("building-2", __iconNode$E);
|
|
164
164
|
/**
|
|
165
165
|
* @license lucide-react v0.552.0 - ISC
|
|
166
166
|
*
|
|
167
167
|
* This source code is licensed under the ISC license.
|
|
168
168
|
* See the LICENSE file in the root directory of this source tree.
|
|
169
169
|
*/
|
|
170
|
-
const __iconNode$
|
|
170
|
+
const __iconNode$D = [
|
|
171
171
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
172
172
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
173
173
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
174
174
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
175
175
|
];
|
|
176
|
-
const Calendar = createLucideIcon("calendar", __iconNode$
|
|
176
|
+
const Calendar = createLucideIcon("calendar", __iconNode$D);
|
|
177
177
|
/**
|
|
178
178
|
* @license lucide-react v0.552.0 - ISC
|
|
179
179
|
*
|
|
180
180
|
* This source code is licensed under the ISC license.
|
|
181
181
|
* See the LICENSE file in the root directory of this source tree.
|
|
182
182
|
*/
|
|
183
|
-
const __iconNode$
|
|
184
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
183
|
+
const __iconNode$C = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
184
|
+
const Check = createLucideIcon("check", __iconNode$C);
|
|
185
185
|
/**
|
|
186
186
|
* @license lucide-react v0.552.0 - ISC
|
|
187
187
|
*
|
|
188
188
|
* This source code is licensed under the ISC license.
|
|
189
189
|
* See the LICENSE file in the root directory of this source tree.
|
|
190
190
|
*/
|
|
191
|
-
const __iconNode$
|
|
192
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
191
|
+
const __iconNode$B = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
192
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$B);
|
|
193
193
|
/**
|
|
194
194
|
* @license lucide-react v0.552.0 - ISC
|
|
195
195
|
*
|
|
196
196
|
* This source code is licensed under the ISC license.
|
|
197
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
198
198
|
*/
|
|
199
|
-
const __iconNode$
|
|
200
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
199
|
+
const __iconNode$A = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
200
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$A);
|
|
201
201
|
/**
|
|
202
202
|
* @license lucide-react v0.552.0 - ISC
|
|
203
203
|
*
|
|
204
204
|
* This source code is licensed under the ISC license.
|
|
205
205
|
* See the LICENSE file in the root directory of this source tree.
|
|
206
206
|
*/
|
|
207
|
-
const __iconNode$
|
|
207
|
+
const __iconNode$z = [
|
|
208
208
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
209
209
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
210
210
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
211
211
|
];
|
|
212
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
212
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$z);
|
|
213
|
+
/**
|
|
214
|
+
* @license lucide-react v0.552.0 - ISC
|
|
215
|
+
*
|
|
216
|
+
* This source code is licensed under the ISC license.
|
|
217
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
218
|
+
*/
|
|
219
|
+
const __iconNode$y = [
|
|
220
|
+
["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
|
|
221
|
+
["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
|
|
222
|
+
];
|
|
223
|
+
const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$y);
|
|
213
224
|
/**
|
|
214
225
|
* @license lucide-react v0.552.0 - ISC
|
|
215
226
|
*
|
|
@@ -49142,6 +49153,7 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
49142
49153
|
const [selectedIssue, setSelectedIssue] = useState(null);
|
|
49143
49154
|
const [owner, setOwner] = useState("");
|
|
49144
49155
|
const [repo, setRepo] = useState("");
|
|
49156
|
+
const [taskCreation, setTaskCreation] = useState({ status: "idle" });
|
|
49145
49157
|
const panelRef = useRef(null);
|
|
49146
49158
|
gt(
|
|
49147
49159
|
"github-issue-detail",
|
|
@@ -49151,12 +49163,27 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
49151
49163
|
return (_a = panelRef.current) == null ? void 0 : _a.focus();
|
|
49152
49164
|
}
|
|
49153
49165
|
);
|
|
49166
|
+
const handleCreateTask = () => {
|
|
49167
|
+
if (!events || !selectedIssue) return;
|
|
49168
|
+
setTaskCreation({ status: "loading" });
|
|
49169
|
+
events.emit({
|
|
49170
|
+
type: "issue:create-task",
|
|
49171
|
+
source: "github-issue-detail-panel",
|
|
49172
|
+
timestamp: Date.now(),
|
|
49173
|
+
payload: {
|
|
49174
|
+
issue: selectedIssue,
|
|
49175
|
+
owner,
|
|
49176
|
+
repo
|
|
49177
|
+
}
|
|
49178
|
+
});
|
|
49179
|
+
};
|
|
49154
49180
|
useEffect(() => {
|
|
49155
49181
|
if (!events) return;
|
|
49156
49182
|
const handleIssueSelected = (event) => {
|
|
49157
49183
|
setSelectedIssue(event.payload.issue);
|
|
49158
49184
|
setOwner(event.payload.owner);
|
|
49159
49185
|
setRepo(event.payload.repo);
|
|
49186
|
+
setTaskCreation({ status: "idle" });
|
|
49160
49187
|
};
|
|
49161
49188
|
const unsubscribe = events.on("issue:selected", handleIssueSelected);
|
|
49162
49189
|
return () => {
|
|
@@ -49165,6 +49192,34 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
49165
49192
|
}
|
|
49166
49193
|
};
|
|
49167
49194
|
}, [events]);
|
|
49195
|
+
useEffect(() => {
|
|
49196
|
+
if (!events) return;
|
|
49197
|
+
const unsubscribers = [
|
|
49198
|
+
events.on("issue:task-created", (event) => {
|
|
49199
|
+
const payload = event.payload;
|
|
49200
|
+
if (selectedIssue && payload.issueNumber === selectedIssue.number) {
|
|
49201
|
+
setTaskCreation({
|
|
49202
|
+
status: "success",
|
|
49203
|
+
taskId: payload.taskId
|
|
49204
|
+
});
|
|
49205
|
+
}
|
|
49206
|
+
}),
|
|
49207
|
+
events.on("issue:create-task:error", (event) => {
|
|
49208
|
+
const payload = event.payload;
|
|
49209
|
+
if (selectedIssue && payload.issueNumber === selectedIssue.number) {
|
|
49210
|
+
setTaskCreation({
|
|
49211
|
+
status: "error",
|
|
49212
|
+
error: payload.error
|
|
49213
|
+
});
|
|
49214
|
+
}
|
|
49215
|
+
})
|
|
49216
|
+
];
|
|
49217
|
+
return () => {
|
|
49218
|
+
unsubscribers.forEach((unsub) => {
|
|
49219
|
+
if (typeof unsub === "function") unsub();
|
|
49220
|
+
});
|
|
49221
|
+
};
|
|
49222
|
+
}, [events, selectedIssue]);
|
|
49168
49223
|
const handleBack = () => {
|
|
49169
49224
|
setSelectedIssue(null);
|
|
49170
49225
|
setOwner("");
|
|
@@ -49341,6 +49396,114 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
|
|
|
49341
49396
|
}
|
|
49342
49397
|
),
|
|
49343
49398
|
/* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
|
|
49399
|
+
taskCreation.status === "idle" && /* @__PURE__ */ jsxs(
|
|
49400
|
+
"button",
|
|
49401
|
+
{
|
|
49402
|
+
onClick: handleCreateTask,
|
|
49403
|
+
style: {
|
|
49404
|
+
display: "flex",
|
|
49405
|
+
alignItems: "center",
|
|
49406
|
+
gap: "6px",
|
|
49407
|
+
padding: "6px 12px",
|
|
49408
|
+
border: `1px solid ${theme2.colors.primary}`,
|
|
49409
|
+
borderRadius: theme2.radii[1],
|
|
49410
|
+
background: "transparent",
|
|
49411
|
+
cursor: "pointer",
|
|
49412
|
+
color: theme2.colors.primary,
|
|
49413
|
+
fontSize: theme2.fontSizes[1],
|
|
49414
|
+
fontWeight: theme2.fontWeights.medium,
|
|
49415
|
+
transition: "all 0.2s ease"
|
|
49416
|
+
},
|
|
49417
|
+
onMouseEnter: (e) => {
|
|
49418
|
+
e.currentTarget.style.background = theme2.colors.primary;
|
|
49419
|
+
e.currentTarget.style.color = theme2.colors.background;
|
|
49420
|
+
},
|
|
49421
|
+
onMouseLeave: (e) => {
|
|
49422
|
+
e.currentTarget.style.background = "transparent";
|
|
49423
|
+
e.currentTarget.style.color = theme2.colors.primary;
|
|
49424
|
+
},
|
|
49425
|
+
title: "Create task in backlog.md",
|
|
49426
|
+
children: [
|
|
49427
|
+
/* @__PURE__ */ jsx(FileText, { size: 14 }),
|
|
49428
|
+
"Create Task"
|
|
49429
|
+
]
|
|
49430
|
+
}
|
|
49431
|
+
),
|
|
49432
|
+
taskCreation.status === "loading" && /* @__PURE__ */ jsxs(
|
|
49433
|
+
"div",
|
|
49434
|
+
{
|
|
49435
|
+
style: {
|
|
49436
|
+
display: "flex",
|
|
49437
|
+
alignItems: "center",
|
|
49438
|
+
gap: "6px",
|
|
49439
|
+
padding: "6px 12px",
|
|
49440
|
+
color: theme2.colors.textSecondary,
|
|
49441
|
+
fontSize: theme2.fontSizes[1]
|
|
49442
|
+
},
|
|
49443
|
+
children: [
|
|
49444
|
+
/* @__PURE__ */ jsx(LoaderCircle, { size: 14, style: { animation: "spin 1s linear infinite" } }),
|
|
49445
|
+
"Creating..."
|
|
49446
|
+
]
|
|
49447
|
+
}
|
|
49448
|
+
),
|
|
49449
|
+
taskCreation.status === "success" && /* @__PURE__ */ jsxs(
|
|
49450
|
+
"div",
|
|
49451
|
+
{
|
|
49452
|
+
style: {
|
|
49453
|
+
display: "flex",
|
|
49454
|
+
alignItems: "center",
|
|
49455
|
+
gap: "6px",
|
|
49456
|
+
padding: "6px 12px",
|
|
49457
|
+
border: `1px solid ${theme2.colors.success}`,
|
|
49458
|
+
borderRadius: theme2.radii[1],
|
|
49459
|
+
background: `${theme2.colors.success}15`,
|
|
49460
|
+
color: theme2.colors.success,
|
|
49461
|
+
fontSize: theme2.fontSizes[1],
|
|
49462
|
+
fontWeight: theme2.fontWeights.medium
|
|
49463
|
+
},
|
|
49464
|
+
children: [
|
|
49465
|
+
/* @__PURE__ */ jsx(CircleCheckBig, { size: 14 }),
|
|
49466
|
+
"Task Created"
|
|
49467
|
+
]
|
|
49468
|
+
}
|
|
49469
|
+
),
|
|
49470
|
+
taskCreation.status === "error" && /* @__PURE__ */ jsxs(
|
|
49471
|
+
"div",
|
|
49472
|
+
{
|
|
49473
|
+
style: {
|
|
49474
|
+
display: "flex",
|
|
49475
|
+
alignItems: "center",
|
|
49476
|
+
gap: "6px",
|
|
49477
|
+
padding: "6px 12px",
|
|
49478
|
+
border: `1px solid ${theme2.colors.error}`,
|
|
49479
|
+
borderRadius: theme2.radii[1],
|
|
49480
|
+
background: `${theme2.colors.error}15`,
|
|
49481
|
+
color: theme2.colors.error,
|
|
49482
|
+
fontSize: theme2.fontSizes[1]
|
|
49483
|
+
},
|
|
49484
|
+
title: taskCreation.error,
|
|
49485
|
+
children: [
|
|
49486
|
+
/* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
|
|
49487
|
+
"Failed",
|
|
49488
|
+
/* @__PURE__ */ jsx(
|
|
49489
|
+
"button",
|
|
49490
|
+
{
|
|
49491
|
+
onClick: () => setTaskCreation({ status: "idle" }),
|
|
49492
|
+
style: {
|
|
49493
|
+
background: "none",
|
|
49494
|
+
border: "none",
|
|
49495
|
+
color: theme2.colors.error,
|
|
49496
|
+
cursor: "pointer",
|
|
49497
|
+
padding: "0 0 0 4px",
|
|
49498
|
+
fontSize: theme2.fontSizes[0],
|
|
49499
|
+
textDecoration: "underline"
|
|
49500
|
+
},
|
|
49501
|
+
children: "Retry"
|
|
49502
|
+
}
|
|
49503
|
+
)
|
|
49504
|
+
]
|
|
49505
|
+
}
|
|
49506
|
+
),
|
|
49344
49507
|
/* @__PURE__ */ jsx(
|
|
49345
49508
|
"a",
|
|
49346
49509
|
{
|