@industry-theme/github-panels 0.1.54 → 0.1.56

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.
@@ -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$F = [
133
+ const __iconNode$G = [
134
134
  ["path", { d: "M12 7v14", key: "1akyts" }],
135
135
  [
136
136
  "path",
@@ -140,14 +140,14 @@ const __iconNode$F = [
140
140
  }
141
141
  ]
142
142
  ];
143
- const BookOpen = createLucideIcon("book-open", __iconNode$F);
143
+ const BookOpen = createLucideIcon("book-open", __iconNode$G);
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$E = [
150
+ const __iconNode$F = [
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,108 +160,108 @@ const __iconNode$E = [
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$E);
163
+ const Building2 = createLucideIcon("building-2", __iconNode$F);
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$D = [
170
+ const __iconNode$E = [
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$D);
176
+ const Calendar = createLucideIcon("calendar", __iconNode$E);
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$C = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
- const Check = createLucideIcon("check", __iconNode$C);
183
+ const __iconNode$D = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
184
+ const Check = createLucideIcon("check", __iconNode$D);
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$B = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
- const ChevronDown = createLucideIcon("chevron-down", __iconNode$B);
191
+ const __iconNode$C = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
192
+ const ChevronDown = createLucideIcon("chevron-down", __iconNode$C);
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$A = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$A);
199
+ const __iconNode$B = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
200
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$B);
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$z = [
207
+ const __iconNode$A = [
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$z);
212
+ const CircleAlert = createLucideIcon("circle-alert", __iconNode$A);
213
213
  /**
214
214
  * @license lucide-react v0.552.0 - ISC
215
215
  *
216
216
  * This source code is licensed under the ISC license.
217
217
  * See the LICENSE file in the root directory of this source tree.
218
218
  */
219
- const __iconNode$y = [
219
+ const __iconNode$z = [
220
220
  ["path", { d: "M21.801 10A10 10 0 1 1 17 3.335", key: "yps3ct" }],
221
221
  ["path", { d: "m9 11 3 3L22 4", key: "1pflzl" }]
222
222
  ];
223
- const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$y);
223
+ const CircleCheckBig = createLucideIcon("circle-check-big", __iconNode$z);
224
224
  /**
225
225
  * @license lucide-react v0.552.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const __iconNode$x = [
230
+ const __iconNode$y = [
231
231
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
232
232
  ["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }]
233
233
  ];
234
- const CircleDot = createLucideIcon("circle-dot", __iconNode$x);
234
+ const CircleDot = createLucideIcon("circle-dot", __iconNode$y);
235
235
  /**
236
236
  * @license lucide-react v0.552.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
240
  */
241
- const __iconNode$w = [
241
+ const __iconNode$x = [
242
242
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
243
243
  ["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" }]
244
244
  ];
245
- const Copy = createLucideIcon("copy", __iconNode$w);
245
+ const Copy = createLucideIcon("copy", __iconNode$x);
246
246
  /**
247
247
  * @license lucide-react v0.552.0 - ISC
248
248
  *
249
249
  * This source code is licensed under the ISC license.
250
250
  * See the LICENSE file in the root directory of this source tree.
251
251
  */
252
- const __iconNode$v = [
252
+ const __iconNode$w = [
253
253
  ["path", { d: "M12 15V3", key: "m9g1x1" }],
254
254
  ["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
255
255
  ["path", { d: "m7 10 5 5 5-5", key: "brsn70" }]
256
256
  ];
257
- const Download = createLucideIcon("download", __iconNode$v);
257
+ const Download = createLucideIcon("download", __iconNode$w);
258
258
  /**
259
259
  * @license lucide-react v0.552.0 - ISC
260
260
  *
261
261
  * This source code is licensed under the ISC license.
262
262
  * See the LICENSE file in the root directory of this source tree.
263
263
  */
264
- const __iconNode$u = [
264
+ const __iconNode$v = [
265
265
  ["path", { d: "m15 15 6 6", key: "1s409w" }],
266
266
  ["path", { d: "m15 9 6-6", key: "ko1vev" }],
267
267
  ["path", { d: "M21 16v5h-5", key: "1ck2sf" }],
@@ -271,19 +271,44 @@ const __iconNode$u = [
271
271
  ["path", { d: "M3 8V3h5", key: "1ln10m" }],
272
272
  ["path", { d: "M9 9 3 3", key: "v551iv" }]
273
273
  ];
274
- const Expand = createLucideIcon("expand", __iconNode$u);
274
+ const Expand = createLucideIcon("expand", __iconNode$v);
275
275
  /**
276
276
  * @license lucide-react v0.552.0 - ISC
277
277
  *
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
280
  */
281
- const __iconNode$t = [
281
+ const __iconNode$u = [
282
282
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
283
283
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
284
284
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
285
285
  ];
286
- const ExternalLink = createLucideIcon("external-link", __iconNode$t);
286
+ const ExternalLink = createLucideIcon("external-link", __iconNode$u);
287
+ /**
288
+ * @license lucide-react v0.552.0 - ISC
289
+ *
290
+ * This source code is licensed under the ISC license.
291
+ * See the LICENSE file in the root directory of this source tree.
292
+ */
293
+ const __iconNode$t = [
294
+ [
295
+ "path",
296
+ {
297
+ d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
298
+ key: "ct8e1f"
299
+ }
300
+ ],
301
+ ["path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242", key: "151rxh" }],
302
+ [
303
+ "path",
304
+ {
305
+ d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
306
+ key: "13bj9a"
307
+ }
308
+ ],
309
+ ["path", { d: "m2 2 20 20", key: "1ooewy" }]
310
+ ];
311
+ const EyeOff = createLucideIcon("eye-off", __iconNode$t);
287
312
  /**
288
313
  * @license lucide-react v0.552.0 - ISC
289
314
  *
@@ -49159,6 +49184,7 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49159
49184
  const [modalStep, setModalStep] = useState("type");
49160
49185
  const [selectedTaskType, setSelectedTaskType] = useState(null);
49161
49186
  const [additionalInstructions, setAdditionalInstructions] = useState("");
49187
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
49162
49188
  const panelRef = useRef(null);
49163
49189
  gt(
49164
49190
  "github-issue-detail",
@@ -49259,6 +49285,21 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49259
49285
  });
49260
49286
  }
49261
49287
  };
49288
+ const handleDelete2 = () => {
49289
+ if (selectedIssue && events) {
49290
+ events.emit({
49291
+ type: "github-issue:delete",
49292
+ source: "github-issue-detail-panel",
49293
+ timestamp: Date.now(),
49294
+ payload: {
49295
+ owner,
49296
+ repo,
49297
+ number: selectedIssue.number
49298
+ }
49299
+ });
49300
+ }
49301
+ setShowDeleteConfirm(false);
49302
+ };
49262
49303
  const containerStyle = {
49263
49304
  display: "flex",
49264
49305
  flexDirection: "column",
@@ -49390,6 +49431,28 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
49390
49431
  }
49391
49432
  ),
49392
49433
  /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
49434
+ /* @__PURE__ */ jsx(
49435
+ "button",
49436
+ {
49437
+ type: "button",
49438
+ onClick: () => setShowDeleteConfirm(true),
49439
+ title: "Delete issue",
49440
+ style: {
49441
+ display: "inline-flex",
49442
+ alignItems: "center",
49443
+ justifyContent: "center",
49444
+ width: "28px",
49445
+ height: "28px",
49446
+ padding: 0,
49447
+ border: `1px solid ${theme2.colors.border}`,
49448
+ borderRadius: "6px",
49449
+ backgroundColor: theme2.colors.background,
49450
+ color: theme2.colors.textSecondary,
49451
+ cursor: "pointer"
49452
+ },
49453
+ children: /* @__PURE__ */ jsx(Trash2, { size: 14 })
49454
+ }
49455
+ ),
49393
49456
  /* @__PURE__ */ jsx(
49394
49457
  "a",
49395
49458
  {
@@ -50072,6 +50135,149 @@ const GitHubIssueDetailPanelContent = ({ events }) => {
50072
50135
  }
50073
50136
  )
50074
50137
  }
50138
+ ),
50139
+ showDeleteConfirm && selectedIssue && /* @__PURE__ */ jsx(
50140
+ "div",
50141
+ {
50142
+ style: {
50143
+ position: "absolute",
50144
+ top: 0,
50145
+ left: 0,
50146
+ right: 0,
50147
+ bottom: 0,
50148
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
50149
+ display: "flex",
50150
+ alignItems: "center",
50151
+ justifyContent: "center",
50152
+ zIndex: 1e3
50153
+ },
50154
+ onClick: () => setShowDeleteConfirm(false),
50155
+ children: /* @__PURE__ */ jsxs(
50156
+ "div",
50157
+ {
50158
+ style: {
50159
+ backgroundColor: theme2.colors.background,
50160
+ border: `1px solid ${theme2.colors.border}`,
50161
+ borderRadius: "8px",
50162
+ padding: "24px",
50163
+ minWidth: "320px",
50164
+ maxWidth: "400px",
50165
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
50166
+ },
50167
+ onClick: (e) => e.stopPropagation(),
50168
+ children: [
50169
+ /* @__PURE__ */ jsxs(
50170
+ "div",
50171
+ {
50172
+ style: {
50173
+ display: "flex",
50174
+ alignItems: "center",
50175
+ gap: "12px",
50176
+ marginBottom: "16px"
50177
+ },
50178
+ children: [
50179
+ /* @__PURE__ */ jsx(
50180
+ "div",
50181
+ {
50182
+ style: {
50183
+ width: "40px",
50184
+ height: "40px",
50185
+ borderRadius: "50%",
50186
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
50187
+ display: "flex",
50188
+ alignItems: "center",
50189
+ justifyContent: "center",
50190
+ color: theme2.colors.error || "#ef4444"
50191
+ },
50192
+ children: /* @__PURE__ */ jsx(Trash2, { size: 20 })
50193
+ }
50194
+ ),
50195
+ /* @__PURE__ */ jsx(
50196
+ "h3",
50197
+ {
50198
+ style: {
50199
+ margin: 0,
50200
+ fontFamily: theme2.fonts.heading,
50201
+ fontSize: theme2.fontSizes[2],
50202
+ fontWeight: 600,
50203
+ color: theme2.colors.text
50204
+ },
50205
+ children: "Delete Issue?"
50206
+ }
50207
+ )
50208
+ ]
50209
+ }
50210
+ ),
50211
+ /* @__PURE__ */ jsxs(
50212
+ "p",
50213
+ {
50214
+ style: {
50215
+ margin: "0 0 24px 0",
50216
+ fontFamily: theme2.fonts.body,
50217
+ fontSize: theme2.fontSizes[1],
50218
+ color: theme2.colors.textSecondary,
50219
+ lineHeight: 1.5
50220
+ },
50221
+ children: [
50222
+ 'Are you sure you want to delete "',
50223
+ selectedIssue.title,
50224
+ '"? This action cannot be undone.'
50225
+ ]
50226
+ }
50227
+ ),
50228
+ /* @__PURE__ */ jsxs(
50229
+ "div",
50230
+ {
50231
+ style: {
50232
+ display: "flex",
50233
+ gap: "12px",
50234
+ justifyContent: "flex-end"
50235
+ },
50236
+ children: [
50237
+ /* @__PURE__ */ jsx(
50238
+ "button",
50239
+ {
50240
+ type: "button",
50241
+ onClick: () => setShowDeleteConfirm(false),
50242
+ style: {
50243
+ padding: "8px 16px",
50244
+ border: `1px solid ${theme2.colors.border}`,
50245
+ borderRadius: "6px",
50246
+ backgroundColor: theme2.colors.background,
50247
+ color: theme2.colors.text,
50248
+ fontFamily: theme2.fonts.body,
50249
+ fontSize: theme2.fontSizes[1],
50250
+ cursor: "pointer"
50251
+ },
50252
+ children: "Cancel"
50253
+ }
50254
+ ),
50255
+ /* @__PURE__ */ jsx(
50256
+ "button",
50257
+ {
50258
+ type: "button",
50259
+ onClick: handleDelete2,
50260
+ style: {
50261
+ padding: "8px 16px",
50262
+ border: "none",
50263
+ borderRadius: "6px",
50264
+ backgroundColor: theme2.colors.error || "#ef4444",
50265
+ color: "#ffffff",
50266
+ fontFamily: theme2.fonts.body,
50267
+ fontSize: theme2.fontSizes[1],
50268
+ fontWeight: 500,
50269
+ cursor: "pointer"
50270
+ },
50271
+ children: "Delete"
50272
+ }
50273
+ )
50274
+ ]
50275
+ }
50276
+ )
50277
+ ]
50278
+ }
50279
+ )
50280
+ }
50075
50281
  )
50076
50282
  ] });
50077
50283
  };
@@ -50087,6 +50293,26 @@ const GitHubIssueDetailPanelMetadata = {
50087
50293
  slices: [],
50088
50294
  surfaces: ["panel"]
50089
50295
  };
50296
+ const REACTION_EMOJI = {
50297
+ "+1": "👍",
50298
+ "-1": "👎",
50299
+ "laugh": "😄",
50300
+ "hooray": "🎉",
50301
+ "confused": "😕",
50302
+ "heart": "❤️",
50303
+ "rocket": "🚀",
50304
+ "eyes": "👀"
50305
+ };
50306
+ const REACTION_ORDER = [
50307
+ "+1",
50308
+ "heart",
50309
+ "hooray",
50310
+ "rocket",
50311
+ "eyes",
50312
+ "laugh",
50313
+ "confused",
50314
+ "-1"
50315
+ ];
50090
50316
  const formatDate = (dateString) => {
50091
50317
  const date = new Date(dateString);
50092
50318
  const now = /* @__PURE__ */ new Date();
@@ -50111,6 +50337,12 @@ const formatDate = (dateString) => {
50111
50337
  return `${years}y ago`;
50112
50338
  };
50113
50339
  const formatSha = (sha) => sha.substring(0, 7);
50340
+ const getEventTimestamp = (event) => {
50341
+ if ("created_at" in event) return event.created_at;
50342
+ if ("submitted_at" in event) return event.submitted_at;
50343
+ if ("committer" in event) return event.committer.date;
50344
+ return "";
50345
+ };
50114
50346
  const Avatar = ({ user, size = 32 }) => {
50115
50347
  const { theme: theme2 } = useTheme();
50116
50348
  return /* @__PURE__ */ jsx(
@@ -50127,152 +50359,294 @@ const Avatar = ({ user, size = 32 }) => {
50127
50359
  }
50128
50360
  );
50129
50361
  };
50130
- const ReactionsDisplay = ({ reactions }) => {
50362
+ const ReactionBar = ({ reactions, onToggleReaction, disabled }) => {
50131
50363
  const { theme: theme2 } = useTheme();
50132
- if (reactions.total_count === 0) return null;
50133
- const reactionEmojis = {
50134
- "+1": "👍",
50135
- "-1": "👎",
50136
- laugh: "😄",
50137
- hooray: "🎉",
50138
- confused: "😕",
50139
- heart: "❤️",
50140
- rocket: "🚀",
50141
- eyes: "👀"
50142
- };
50143
- const reactionCounts = {
50144
- "+1": reactions["+1"],
50145
- "-1": reactions["-1"],
50146
- laugh: reactions.laugh,
50147
- hooray: reactions.hooray,
50148
- confused: reactions.confused,
50149
- heart: reactions.heart,
50150
- rocket: reactions.rocket,
50151
- eyes: reactions.eyes
50152
- };
50153
- const activeReactions = Object.entries(reactionEmojis).filter(([key]) => reactionCounts[key] > 0).map(([key, emoji]) => ({
50154
- emoji,
50155
- count: reactionCounts[key]
50156
- }));
50157
- return /* @__PURE__ */ jsx("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: activeReactions.map(({ emoji, count }) => /* @__PURE__ */ jsxs(
50158
- "span",
50159
- {
50160
- style: {
50161
- display: "inline-flex",
50162
- alignItems: "center",
50163
- gap: "4px",
50164
- padding: "2px 8px",
50165
- borderRadius: "12px",
50166
- backgroundColor: theme2.colors.backgroundSecondary,
50167
- border: `1px solid ${theme2.colors.border}`,
50168
- fontSize: theme2.fontSizes[0]
50364
+ const [showPicker, setShowPicker] = useState(false);
50365
+ const sortedReactions = REACTION_ORDER.filter((type) => reactions[type] > 0).map((type) => {
50366
+ var _a, _b;
50367
+ return {
50368
+ type,
50369
+ count: reactions[type],
50370
+ viewerReacted: !!((_a = reactions.viewerReactions) == null ? void 0 : _a[type]),
50371
+ reactionId: (_b = reactions.viewerReactions) == null ? void 0 : _b[type]
50372
+ };
50373
+ });
50374
+ const handleReactionClick = (type, reactionId) => {
50375
+ if (disabled || !onToggleReaction) return;
50376
+ onToggleReaction(type, reactionId);
50377
+ };
50378
+ const handlePickerSelect = (type) => {
50379
+ var _a;
50380
+ setShowPicker(false);
50381
+ if (disabled || !onToggleReaction) return;
50382
+ const reactionId = (_a = reactions.viewerReactions) == null ? void 0 : _a[type];
50383
+ onToggleReaction(type, reactionId);
50384
+ };
50385
+ return /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", marginTop: "8px", flexWrap: "wrap", position: "relative" }, children: [
50386
+ sortedReactions.map(({ type, count, viewerReacted, reactionId }) => /* @__PURE__ */ jsxs(
50387
+ "button",
50388
+ {
50389
+ type: "button",
50390
+ onClick: (e) => {
50391
+ e.stopPropagation();
50392
+ handleReactionClick(type, reactionId);
50393
+ },
50394
+ disabled,
50395
+ style: {
50396
+ display: "inline-flex",
50397
+ alignItems: "center",
50398
+ gap: "4px",
50399
+ padding: "2px 8px",
50400
+ borderRadius: "12px",
50401
+ backgroundColor: viewerReacted ? `${theme2.colors.primary}20` : theme2.colors.backgroundSecondary,
50402
+ border: `1px solid ${viewerReacted ? theme2.colors.primary : theme2.colors.border}`,
50403
+ fontSize: theme2.fontSizes[0],
50404
+ cursor: disabled ? "default" : "pointer",
50405
+ opacity: disabled ? 0.5 : 1,
50406
+ transition: "all 0.2s"
50407
+ },
50408
+ title: viewerReacted ? "Remove reaction" : "Add reaction",
50409
+ children: [
50410
+ /* @__PURE__ */ jsx("span", { children: REACTION_EMOJI[type] }),
50411
+ /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: viewerReacted ? theme2.colors.primary : theme2.colors.textSecondary }, children: count })
50412
+ ]
50169
50413
  },
50170
- children: [
50171
- /* @__PURE__ */ jsx("span", { children: emoji }),
50172
- /* @__PURE__ */ jsx("span", { style: { fontFamily: theme2.fonts.body, color: theme2.colors.textSecondary }, children: count })
50173
- ]
50174
- },
50175
- emoji
50176
- )) });
50414
+ type
50415
+ )),
50416
+ onToggleReaction && /* @__PURE__ */ jsxs("div", { style: { position: "relative" }, children: [
50417
+ /* @__PURE__ */ jsx(
50418
+ "button",
50419
+ {
50420
+ type: "button",
50421
+ onClick: (e) => {
50422
+ e.stopPropagation();
50423
+ setShowPicker(!showPicker);
50424
+ },
50425
+ disabled,
50426
+ style: {
50427
+ display: "inline-flex",
50428
+ alignItems: "center",
50429
+ justifyContent: "center",
50430
+ width: "24px",
50431
+ height: "24px",
50432
+ borderRadius: "12px",
50433
+ backgroundColor: theme2.colors.backgroundSecondary,
50434
+ border: `1px solid ${theme2.colors.border}`,
50435
+ fontSize: theme2.fontSizes[1],
50436
+ color: theme2.colors.textMuted,
50437
+ cursor: disabled ? "default" : "pointer",
50438
+ opacity: disabled ? 0.5 : 1,
50439
+ transition: "all 0.2s"
50440
+ },
50441
+ title: "Add reaction",
50442
+ children: "+"
50443
+ }
50444
+ ),
50445
+ showPicker && /* @__PURE__ */ jsx(
50446
+ "div",
50447
+ {
50448
+ style: {
50449
+ position: "absolute",
50450
+ bottom: "100%",
50451
+ left: 0,
50452
+ marginBottom: "4px",
50453
+ padding: "4px",
50454
+ borderRadius: "8px",
50455
+ backgroundColor: theme2.colors.background,
50456
+ border: `1px solid ${theme2.colors.border}`,
50457
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
50458
+ display: "flex",
50459
+ gap: "2px",
50460
+ zIndex: 1e3
50461
+ },
50462
+ onClick: (e) => e.stopPropagation(),
50463
+ children: REACTION_ORDER.map((type) => {
50464
+ var _a;
50465
+ const viewerReacted = !!((_a = reactions.viewerReactions) == null ? void 0 : _a[type]);
50466
+ return /* @__PURE__ */ jsx(
50467
+ "button",
50468
+ {
50469
+ type: "button",
50470
+ onClick: (e) => {
50471
+ e.stopPropagation();
50472
+ handlePickerSelect(type);
50473
+ },
50474
+ style: {
50475
+ padding: "4px",
50476
+ borderRadius: "4px",
50477
+ backgroundColor: viewerReacted ? `${theme2.colors.primary}20` : "transparent",
50478
+ border: "none",
50479
+ cursor: "pointer",
50480
+ fontSize: "16px",
50481
+ transition: "transform 0.2s"
50482
+ },
50483
+ title: type,
50484
+ onMouseEnter: (e) => {
50485
+ e.currentTarget.style.transform = "scale(1.25)";
50486
+ },
50487
+ onMouseLeave: (e) => {
50488
+ e.currentTarget.style.transform = "scale(1)";
50489
+ },
50490
+ children: REACTION_EMOJI[type]
50491
+ },
50492
+ type
50493
+ );
50494
+ })
50495
+ }
50496
+ )
50497
+ ] })
50498
+ ] });
50177
50499
  };
50178
- const CommentEvent = ({ event }) => {
50500
+ const CommentEvent = ({ event, onToggleReaction, getMergedReactions }) => {
50179
50501
  const { theme: theme2 } = useTheme();
50180
50502
  const user = event.user || event.actor;
50503
+ const containerRef = useRef(null);
50504
+ const [isLargeView, setIsLargeView] = useState(true);
50505
+ useEffect(() => {
50506
+ const checkWidth = () => {
50507
+ if (containerRef.current) {
50508
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
50509
+ }
50510
+ };
50511
+ checkWidth();
50512
+ window.addEventListener("resize", checkWidth);
50513
+ return () => window.removeEventListener("resize", checkWidth);
50514
+ }, []);
50515
+ const mergedReactions = getMergedReactions ? getMergedReactions(event.id, "comment", event.reactions) : event.reactions;
50181
50516
  return /* @__PURE__ */ jsxs(
50182
50517
  "div",
50183
50518
  {
50519
+ ref: containerRef,
50184
50520
  style: {
50185
- display: "flex",
50186
- gap: "12px",
50187
50521
  padding: "16px",
50188
50522
  borderBottom: `1px solid ${theme2.colors.border}`
50189
50523
  },
50190
50524
  children: [
50191
- /* @__PURE__ */ jsx(Avatar, { user }),
50192
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50193
- /* @__PURE__ */ jsxs(
50194
- "div",
50195
- {
50196
- style: {
50197
- display: "flex",
50198
- alignItems: "center",
50199
- gap: "8px",
50200
- marginBottom: "8px"
50201
- },
50202
- children: [
50203
- /* @__PURE__ */ jsx(
50204
- "span",
50205
- {
50206
- style: {
50207
- fontWeight: 600,
50208
- color: theme2.colors.text,
50209
- fontFamily: theme2.fonts.body,
50210
- fontSize: theme2.fontSizes[1]
50211
- },
50212
- children: user.login
50213
- }
50214
- ),
50215
- /* @__PURE__ */ jsxs(
50216
- "span",
50217
- {
50218
- style: {
50219
- fontFamily: theme2.fonts.body,
50220
- color: theme2.colors.textMuted,
50221
- fontSize: theme2.fontSizes[0]
50222
- },
50223
- children: [
50224
- "commented ",
50225
- formatDate(event.created_at)
50226
- ]
50227
- }
50228
- ),
50229
- event.author_association && event.author_association !== "NONE" && /* @__PURE__ */ jsx(
50230
- "span",
50231
- {
50232
- style: {
50233
- padding: "2px 6px",
50234
- borderRadius: "4px",
50235
- backgroundColor: theme2.colors.backgroundSecondary,
50236
- border: `1px solid ${theme2.colors.border}`,
50237
- fontFamily: theme2.fonts.body,
50238
- fontSize: theme2.fontSizes[0],
50239
- color: theme2.colors.textSecondary,
50240
- textTransform: "uppercase"
50241
- },
50242
- children: event.author_association.toLowerCase()
50243
- }
50244
- )
50245
- ]
50246
- }
50247
- ),
50248
- /* @__PURE__ */ jsx(
50249
- "div",
50250
- {
50251
- style: {
50252
- backgroundColor: theme2.colors.backgroundSecondary,
50253
- border: `1px solid ${theme2.colors.border}`,
50254
- borderRadius: "8px",
50255
- overflow: "hidden"
50256
- },
50257
- children: /* @__PURE__ */ jsx(
50258
- DocumentView,
50525
+ /* @__PURE__ */ jsxs(
50526
+ "div",
50527
+ {
50528
+ style: {
50529
+ display: "flex",
50530
+ gap: "12px",
50531
+ alignItems: "center",
50532
+ marginBottom: "8px"
50533
+ },
50534
+ children: [
50535
+ /* @__PURE__ */ jsx(Avatar, { user }),
50536
+ /* @__PURE__ */ jsxs(
50537
+ "div",
50538
+ {
50539
+ style: {
50540
+ display: "flex",
50541
+ alignItems: "center",
50542
+ gap: "8px",
50543
+ flex: 1,
50544
+ minWidth: 0
50545
+ },
50546
+ children: [
50547
+ /* @__PURE__ */ jsx(
50548
+ "span",
50549
+ {
50550
+ style: {
50551
+ fontWeight: 600,
50552
+ color: theme2.colors.text,
50553
+ fontFamily: theme2.fonts.body,
50554
+ fontSize: theme2.fontSizes[1]
50555
+ },
50556
+ children: user.login
50557
+ }
50558
+ ),
50559
+ /* @__PURE__ */ jsxs(
50560
+ "span",
50561
+ {
50562
+ style: {
50563
+ fontFamily: theme2.fonts.body,
50564
+ color: theme2.colors.textMuted,
50565
+ fontSize: theme2.fontSizes[0]
50566
+ },
50567
+ children: [
50568
+ "commented ",
50569
+ formatDate(event.created_at)
50570
+ ]
50571
+ }
50572
+ ),
50573
+ event.author_association && event.author_association !== "NONE" && /* @__PURE__ */ jsx(
50574
+ "span",
50575
+ {
50576
+ style: {
50577
+ padding: "2px 6px",
50578
+ borderRadius: "4px",
50579
+ backgroundColor: theme2.colors.backgroundSecondary,
50580
+ border: `1px solid ${theme2.colors.border}`,
50581
+ fontFamily: theme2.fonts.body,
50582
+ fontSize: theme2.fontSizes[0],
50583
+ color: theme2.colors.textSecondary,
50584
+ textTransform: "uppercase"
50585
+ },
50586
+ children: event.author_association.toLowerCase()
50587
+ }
50588
+ )
50589
+ ]
50590
+ }
50591
+ )
50592
+ ]
50593
+ }
50594
+ ),
50595
+ /* @__PURE__ */ jsxs(
50596
+ "div",
50597
+ {
50598
+ style: {
50599
+ marginLeft: isLargeView ? "44px" : "0"
50600
+ },
50601
+ children: [
50602
+ /* @__PURE__ */ jsx(
50603
+ "div",
50604
+ {
50605
+ style: {
50606
+ backgroundColor: theme2.colors.backgroundSecondary,
50607
+ border: `1px solid ${theme2.colors.border}`,
50608
+ borderRadius: "8px",
50609
+ overflow: "hidden"
50610
+ },
50611
+ children: /* @__PURE__ */ jsx(
50612
+ DocumentView,
50613
+ {
50614
+ content: event.body,
50615
+ theme: theme2,
50616
+ maxWidth: "100%",
50617
+ transparentBackground: true
50618
+ }
50619
+ )
50620
+ }
50621
+ ),
50622
+ mergedReactions && /* @__PURE__ */ jsx(
50623
+ ReactionBar,
50259
50624
  {
50260
- content: event.body,
50261
- theme: theme2,
50262
- maxWidth: "100%",
50263
- transparentBackground: true
50625
+ reactions: mergedReactions,
50626
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(event.id, "comment", type, reactionId) : void 0
50264
50627
  }
50265
50628
  )
50266
- }
50267
- ),
50268
- event.reactions && /* @__PURE__ */ jsx(ReactionsDisplay, { reactions: event.reactions })
50269
- ] })
50629
+ ]
50630
+ }
50631
+ )
50270
50632
  ]
50271
50633
  }
50272
50634
  );
50273
50635
  };
50274
50636
  const ReviewEvent = ({ event }) => {
50275
50637
  const { theme: theme2 } = useTheme();
50638
+ const containerRef = useRef(null);
50639
+ const [isLargeView, setIsLargeView] = useState(true);
50640
+ useEffect(() => {
50641
+ const checkWidth = () => {
50642
+ if (containerRef.current) {
50643
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
50644
+ }
50645
+ };
50646
+ checkWidth();
50647
+ window.addEventListener("resize", checkWidth);
50648
+ return () => window.removeEventListener("resize", checkWidth);
50649
+ }, []);
50276
50650
  const stateConfig = {
50277
50651
  approved: {
50278
50652
  icon: /* @__PURE__ */ jsx(Check, { size: 16 }),
@@ -50299,85 +50673,104 @@ const ReviewEvent = ({ event }) => {
50299
50673
  return /* @__PURE__ */ jsxs(
50300
50674
  "div",
50301
50675
  {
50676
+ ref: containerRef,
50302
50677
  style: {
50303
- display: "flex",
50304
- gap: "12px",
50305
50678
  padding: "16px",
50306
50679
  borderBottom: `1px solid ${theme2.colors.border}`
50307
50680
  },
50308
50681
  children: [
50309
- /* @__PURE__ */ jsx(Avatar, { user: event.user }),
50310
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50311
- /* @__PURE__ */ jsxs(
50312
- "div",
50313
- {
50314
- style: {
50315
- display: "flex",
50316
- alignItems: "center",
50317
- gap: "8px",
50318
- marginBottom: event.body ? "8px" : 0
50319
- },
50320
- children: [
50321
- /* @__PURE__ */ jsx("span", { style: { color: config.color }, children: config.icon }),
50322
- /* @__PURE__ */ jsx(
50323
- "span",
50324
- {
50325
- style: {
50326
- fontWeight: 600,
50327
- color: theme2.colors.text,
50328
- fontFamily: theme2.fonts.body,
50329
- fontSize: theme2.fontSizes[1]
50330
- },
50331
- children: event.user.login
50332
- }
50333
- ),
50334
- /* @__PURE__ */ jsx(
50335
- "span",
50336
- {
50337
- style: {
50338
- fontFamily: theme2.fonts.body,
50339
- color: config.color,
50340
- fontWeight: 500,
50341
- fontSize: theme2.fontSizes[1]
50342
- },
50343
- children: config.label
50344
- }
50345
- ),
50346
- /* @__PURE__ */ jsx(
50347
- "span",
50348
- {
50349
- style: {
50350
- fontFamily: theme2.fonts.body,
50351
- color: theme2.colors.textMuted,
50352
- fontSize: theme2.fontSizes[0]
50353
- },
50354
- children: formatDate(event.submitted_at)
50355
- }
50356
- )
50357
- ]
50358
- }
50359
- ),
50360
- event.body && /* @__PURE__ */ jsx(
50361
- "div",
50362
- {
50363
- style: {
50364
- backgroundColor: theme2.colors.backgroundSecondary,
50365
- border: `1px solid ${theme2.colors.border}`,
50366
- borderRadius: "8px",
50367
- overflow: "hidden"
50368
- },
50369
- children: /* @__PURE__ */ jsx(
50370
- DocumentView,
50682
+ /* @__PURE__ */ jsxs(
50683
+ "div",
50684
+ {
50685
+ style: {
50686
+ display: "flex",
50687
+ gap: "12px",
50688
+ alignItems: "center",
50689
+ marginBottom: event.body ? "8px" : 0
50690
+ },
50691
+ children: [
50692
+ /* @__PURE__ */ jsx(Avatar, { user: event.user }),
50693
+ /* @__PURE__ */ jsxs(
50694
+ "div",
50371
50695
  {
50372
- content: event.body,
50373
- theme: theme2,
50374
- maxWidth: "100%",
50375
- transparentBackground: true
50696
+ style: {
50697
+ display: "flex",
50698
+ alignItems: "center",
50699
+ gap: "8px",
50700
+ flex: 1,
50701
+ minWidth: 0
50702
+ },
50703
+ children: [
50704
+ /* @__PURE__ */ jsx("span", { style: { color: config.color }, children: config.icon }),
50705
+ /* @__PURE__ */ jsx(
50706
+ "span",
50707
+ {
50708
+ style: {
50709
+ fontWeight: 600,
50710
+ color: theme2.colors.text,
50711
+ fontFamily: theme2.fonts.body,
50712
+ fontSize: theme2.fontSizes[1]
50713
+ },
50714
+ children: event.user.login
50715
+ }
50716
+ ),
50717
+ /* @__PURE__ */ jsx(
50718
+ "span",
50719
+ {
50720
+ style: {
50721
+ fontFamily: theme2.fonts.body,
50722
+ color: config.color,
50723
+ fontWeight: 500,
50724
+ fontSize: theme2.fontSizes[1]
50725
+ },
50726
+ children: config.label
50727
+ }
50728
+ ),
50729
+ /* @__PURE__ */ jsx(
50730
+ "span",
50731
+ {
50732
+ style: {
50733
+ fontFamily: theme2.fonts.body,
50734
+ color: theme2.colors.textMuted,
50735
+ fontSize: theme2.fontSizes[0]
50736
+ },
50737
+ children: formatDate(event.submitted_at)
50738
+ }
50739
+ )
50740
+ ]
50376
50741
  }
50377
50742
  )
50378
- }
50379
- )
50380
- ] })
50743
+ ]
50744
+ }
50745
+ ),
50746
+ event.body && /* @__PURE__ */ jsx(
50747
+ "div",
50748
+ {
50749
+ style: {
50750
+ marginLeft: isLargeView ? "44px" : "0"
50751
+ },
50752
+ children: /* @__PURE__ */ jsx(
50753
+ "div",
50754
+ {
50755
+ style: {
50756
+ backgroundColor: theme2.colors.backgroundSecondary,
50757
+ border: `1px solid ${theme2.colors.border}`,
50758
+ borderRadius: "8px",
50759
+ overflow: "hidden"
50760
+ },
50761
+ children: /* @__PURE__ */ jsx(
50762
+ DocumentView,
50763
+ {
50764
+ content: event.body,
50765
+ theme: theme2,
50766
+ maxWidth: "100%",
50767
+ transparentBackground: true
50768
+ }
50769
+ )
50770
+ }
50771
+ )
50772
+ }
50773
+ )
50381
50774
  ]
50382
50775
  }
50383
50776
  );
@@ -50398,7 +50791,7 @@ const CommitEvent = ({ event }) => {
50398
50791
  gap: "12px",
50399
50792
  padding: "12px 16px",
50400
50793
  borderBottom: `1px solid ${theme2.colors.border}`,
50401
- backgroundColor: theme2.colors.background
50794
+ backgroundColor: theme2.colors.backgroundSecondary
50402
50795
  },
50403
50796
  children: [
50404
50797
  /* @__PURE__ */ jsx(
@@ -50683,123 +51076,171 @@ const RefEvent = ({ event }) => {
50683
51076
  }
50684
51077
  );
50685
51078
  };
50686
- const InlineReviewComment = ({ comment: comment2 }) => {
51079
+ const InlineReviewComment = ({ comment: comment2, onToggleReaction, getMergedReactions }) => {
50687
51080
  const { theme: theme2 } = useTheme();
51081
+ const containerRef = useRef(null);
51082
+ const [isLargeView, setIsLargeView] = useState(true);
51083
+ useEffect(() => {
51084
+ const checkWidth = () => {
51085
+ if (containerRef.current) {
51086
+ setIsLargeView(containerRef.current.offsetWidth >= 400);
51087
+ }
51088
+ };
51089
+ checkWidth();
51090
+ window.addEventListener("resize", checkWidth);
51091
+ return () => window.removeEventListener("resize", checkWidth);
51092
+ }, []);
51093
+ const mergedReactions = getMergedReactions ? getMergedReactions(comment2.id, "review_comment", comment2.reactions) : comment2.reactions;
50688
51094
  return /* @__PURE__ */ jsxs(
50689
51095
  "div",
50690
51096
  {
51097
+ ref: containerRef,
50691
51098
  style: {
50692
- display: "flex",
50693
- gap: "12px",
50694
51099
  padding: "12px 16px",
50695
51100
  borderBottom: `1px solid ${theme2.colors.border}`,
50696
51101
  backgroundColor: theme2.colors.backgroundSecondary
50697
51102
  },
50698
51103
  children: [
50699
- /* @__PURE__ */ jsx(Avatar, { user: comment2.user, size: 28 }),
50700
- /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
50701
- /* @__PURE__ */ jsxs(
50702
- "div",
50703
- {
50704
- style: {
50705
- display: "flex",
50706
- alignItems: "center",
50707
- gap: "8px",
50708
- marginBottom: "8px"
50709
- },
50710
- children: [
50711
- /* @__PURE__ */ jsx(
50712
- "span",
50713
- {
50714
- style: {
50715
- fontFamily: theme2.fonts.body,
50716
- fontWeight: 600,
50717
- color: theme2.colors.text,
50718
- fontSize: theme2.fontSizes[0]
50719
- },
50720
- children: comment2.user.login
50721
- }
50722
- ),
50723
- /* @__PURE__ */ jsx(
50724
- "span",
50725
- {
50726
- style: {
50727
- fontFamily: theme2.fonts.body,
50728
- color: theme2.colors.textMuted,
50729
- fontSize: theme2.fontSizes[0]
50730
- },
50731
- children: "on"
50732
- }
50733
- ),
50734
- /* @__PURE__ */ jsx(
50735
- "code",
50736
- {
50737
- style: {
50738
- padding: "2px 6px",
50739
- borderRadius: "4px",
50740
- backgroundColor: theme2.colors.background,
50741
- fontFamily: theme2.fonts.monospace,
50742
- fontSize: "11px",
50743
- color: theme2.colors.primary
50744
- },
50745
- children: comment2.path
50746
- }
50747
- ),
50748
- comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
50749
- "line ",
50750
- comment2.line
50751
- ] })
50752
- ]
50753
- }
50754
- ),
50755
- comment2.diff_hunk && /* @__PURE__ */ jsx(
50756
- "pre",
50757
- {
50758
- style: {
50759
- margin: "0 0 8px 0",
50760
- padding: "8px",
50761
- backgroundColor: theme2.colors.background,
50762
- border: `1px solid ${theme2.colors.border}`,
50763
- borderRadius: "6px",
50764
- fontFamily: theme2.fonts.monospace,
50765
- fontSize: "11px",
50766
- color: theme2.colors.textSecondary,
50767
- overflow: "auto",
50768
- maxHeight: "100px"
50769
- },
50770
- children: comment2.diff_hunk
50771
- }
50772
- ),
50773
- /* @__PURE__ */ jsx(
50774
- "div",
50775
- {
50776
- style: {
50777
- backgroundColor: theme2.colors.background,
50778
- border: `1px solid ${theme2.colors.border}`,
50779
- borderRadius: "6px",
50780
- overflow: "hidden"
50781
- },
50782
- children: /* @__PURE__ */ jsx(
50783
- DocumentView,
51104
+ /* @__PURE__ */ jsxs(
51105
+ "div",
51106
+ {
51107
+ style: {
51108
+ display: "flex",
51109
+ gap: "12px",
51110
+ alignItems: "center",
51111
+ marginBottom: "8px"
51112
+ },
51113
+ children: [
51114
+ /* @__PURE__ */ jsx(Avatar, { user: comment2.user, size: 28 }),
51115
+ /* @__PURE__ */ jsxs(
51116
+ "div",
50784
51117
  {
50785
- content: comment2.body,
50786
- theme: theme2,
50787
- maxWidth: "100%",
50788
- transparentBackground: true
51118
+ style: {
51119
+ display: "flex",
51120
+ alignItems: "center",
51121
+ gap: "8px",
51122
+ flex: 1,
51123
+ minWidth: 0
51124
+ },
51125
+ children: [
51126
+ /* @__PURE__ */ jsx(
51127
+ "span",
51128
+ {
51129
+ style: {
51130
+ fontFamily: theme2.fonts.body,
51131
+ fontWeight: 600,
51132
+ color: theme2.colors.text,
51133
+ fontSize: theme2.fontSizes[0]
51134
+ },
51135
+ children: comment2.user.login
51136
+ }
51137
+ ),
51138
+ /* @__PURE__ */ jsx(
51139
+ "span",
51140
+ {
51141
+ style: {
51142
+ fontFamily: theme2.fonts.body,
51143
+ color: theme2.colors.textMuted,
51144
+ fontSize: theme2.fontSizes[0]
51145
+ },
51146
+ children: "on"
51147
+ }
51148
+ ),
51149
+ /* @__PURE__ */ jsx(
51150
+ "code",
51151
+ {
51152
+ style: {
51153
+ padding: "2px 6px",
51154
+ borderRadius: "4px",
51155
+ backgroundColor: theme2.colors.background,
51156
+ fontFamily: theme2.fonts.monospace,
51157
+ fontSize: "11px",
51158
+ color: theme2.colors.primary
51159
+ },
51160
+ children: comment2.path
51161
+ }
51162
+ ),
51163
+ comment2.line && /* @__PURE__ */ jsxs("span", { style: { fontFamily: theme2.fonts.body, fontSize: theme2.fontSizes[0], color: theme2.colors.textSecondary }, children: [
51164
+ "line ",
51165
+ comment2.line
51166
+ ] })
51167
+ ]
50789
51168
  }
50790
51169
  )
50791
- }
50792
- ),
50793
- comment2.reactions && /* @__PURE__ */ jsx(ReactionsDisplay, { reactions: comment2.reactions })
50794
- ] })
51170
+ ]
51171
+ }
51172
+ ),
51173
+ /* @__PURE__ */ jsxs(
51174
+ "div",
51175
+ {
51176
+ style: {
51177
+ marginLeft: isLargeView ? "40px" : "0"
51178
+ },
51179
+ children: [
51180
+ /* @__PURE__ */ jsx(
51181
+ "div",
51182
+ {
51183
+ style: {
51184
+ backgroundColor: theme2.colors.background,
51185
+ border: `1px solid ${theme2.colors.border}`,
51186
+ borderRadius: "6px",
51187
+ overflow: "hidden",
51188
+ marginBottom: comment2.diff_hunk ? "8px" : 0
51189
+ },
51190
+ children: /* @__PURE__ */ jsx(
51191
+ DocumentView,
51192
+ {
51193
+ content: comment2.body,
51194
+ theme: theme2,
51195
+ maxWidth: "100%",
51196
+ transparentBackground: true
51197
+ }
51198
+ )
51199
+ }
51200
+ ),
51201
+ comment2.diff_hunk && /* @__PURE__ */ jsx(
51202
+ "pre",
51203
+ {
51204
+ style: {
51205
+ margin: 0,
51206
+ padding: "8px",
51207
+ backgroundColor: theme2.colors.background,
51208
+ border: `1px solid ${theme2.colors.border}`,
51209
+ borderRadius: "6px",
51210
+ fontFamily: theme2.fonts.monospace,
51211
+ fontSize: "11px",
51212
+ color: theme2.colors.textSecondary,
51213
+ overflow: "auto",
51214
+ maxHeight: "100px"
51215
+ },
51216
+ children: comment2.diff_hunk
51217
+ }
51218
+ ),
51219
+ mergedReactions && /* @__PURE__ */ jsx(
51220
+ ReactionBar,
51221
+ {
51222
+ reactions: mergedReactions,
51223
+ onToggleReaction: onToggleReaction ? (type, reactionId) => onToggleReaction(comment2.id, "review_comment", type, reactionId) : void 0
51224
+ }
51225
+ )
51226
+ ]
51227
+ }
51228
+ )
50795
51229
  ]
50796
51230
  }
50797
51231
  );
50798
51232
  };
50799
- const TimelineEventRenderer = ({ event }) => {
51233
+ const TimelineEventRenderer = ({ event, onToggleReaction, getMergedReactions }) => {
50800
51234
  switch (event.event) {
50801
51235
  case "commented":
50802
- return /* @__PURE__ */ jsx(CommentEvent, { event });
51236
+ return /* @__PURE__ */ jsx(
51237
+ CommentEvent,
51238
+ {
51239
+ event,
51240
+ onToggleReaction,
51241
+ getMergedReactions
51242
+ }
51243
+ );
50803
51244
  case "reviewed":
50804
51245
  return /* @__PURE__ */ jsx(ReviewEvent, { event });
50805
51246
  case "committed":
@@ -50827,14 +51268,180 @@ const TimelineEventRenderer = ({ event }) => {
50827
51268
  }
50828
51269
  };
50829
51270
  const GitHubMessagesPanelContent = ({ context, events }) => {
51271
+ var _a;
50830
51272
  const { theme: theme2 } = useTheme();
50831
51273
  const panelRef = useRef(null);
51274
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);
51275
+ const [localReactions, setLocalReactions] = useState({});
51276
+ const [hiddenMessages, setHiddenMessages] = useState(() => {
51277
+ if (typeof window !== "undefined") {
51278
+ const stored = localStorage.getItem("github-messages-hidden");
51279
+ return stored ? new Set(JSON.parse(stored)) : /* @__PURE__ */ new Set();
51280
+ }
51281
+ return /* @__PURE__ */ new Set();
51282
+ });
51283
+ const [showHiddenMessages, setShowHiddenMessages] = useState(false);
51284
+ const [commentText, setCommentText] = useState("");
51285
+ const [isSending, setIsSending] = useState(false);
51286
+ const [sendError, setSendError] = useState(null);
51287
+ const textareaRef = useRef(null);
51288
+ const handleDelete2 = () => {
51289
+ const messagesSlice2 = context.getSlice("github-messages");
51290
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51291
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && events) {
51292
+ const { target: target2, owner, repo } = messagesData2;
51293
+ events.emit({
51294
+ type: target2.type === "pull_request" ? "github-pr:delete" : "github-issue:delete",
51295
+ source: "github-messages-panel",
51296
+ timestamp: Date.now(),
51297
+ payload: {
51298
+ owner,
51299
+ repo,
51300
+ number: target2.number
51301
+ }
51302
+ });
51303
+ }
51304
+ setShowDeleteConfirm(false);
51305
+ };
51306
+ const handleToggleReaction = useCallback((itemId, itemType, reactionType, currentReactionId) => {
51307
+ const messagesSlice2 = context.getSlice("github-messages");
51308
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51309
+ if (!(messagesData2 == null ? void 0 : messagesData2.target) || !events) return;
51310
+ const { owner, repo, target: target2 } = messagesData2;
51311
+ const key = `${itemType}-${itemId}`;
51312
+ setLocalReactions((prev) => {
51313
+ const current = prev[key] || {
51314
+ url: "",
51315
+ total_count: 0,
51316
+ "+1": 0,
51317
+ "-1": 0,
51318
+ laugh: 0,
51319
+ hooray: 0,
51320
+ confused: 0,
51321
+ heart: 0,
51322
+ rocket: 0,
51323
+ eyes: 0,
51324
+ viewerReactions: {}
51325
+ };
51326
+ const updated = { ...current };
51327
+ const viewerReactions = { ...updated.viewerReactions };
51328
+ if (currentReactionId) {
51329
+ updated[reactionType] = Math.max(0, (updated[reactionType] || 0) - 1);
51330
+ updated.total_count = Math.max(0, updated.total_count - 1);
51331
+ delete viewerReactions[reactionType];
51332
+ } else {
51333
+ updated[reactionType] = (updated[reactionType] || 0) + 1;
51334
+ updated.total_count = (updated.total_count || 0) + 1;
51335
+ viewerReactions[reactionType] = -1;
51336
+ }
51337
+ updated.viewerReactions = viewerReactions;
51338
+ return { ...prev, [key]: updated };
51339
+ });
51340
+ if (currentReactionId) {
51341
+ events.emit({
51342
+ type: "github-messages:reaction:remove",
51343
+ source: "github-messages-panel",
51344
+ timestamp: Date.now(),
51345
+ payload: {
51346
+ owner,
51347
+ repo,
51348
+ targetType: target2.type,
51349
+ targetNumber: target2.number,
51350
+ itemType,
51351
+ itemId,
51352
+ reactionId: currentReactionId
51353
+ }
51354
+ });
51355
+ } else {
51356
+ events.emit({
51357
+ type: "github-messages:reaction:add",
51358
+ source: "github-messages-panel",
51359
+ timestamp: Date.now(),
51360
+ payload: {
51361
+ owner,
51362
+ repo,
51363
+ targetType: target2.type,
51364
+ targetNumber: target2.number,
51365
+ itemType,
51366
+ itemId,
51367
+ reactionType
51368
+ }
51369
+ });
51370
+ setHiddenMessages((prev) => {
51371
+ const next2 = new Set(prev);
51372
+ next2.add(key);
51373
+ if (typeof window !== "undefined") {
51374
+ localStorage.setItem("github-messages-hidden", JSON.stringify([...next2]));
51375
+ }
51376
+ return next2;
51377
+ });
51378
+ }
51379
+ }, [context, events]);
51380
+ const handleSendComment = useCallback(() => {
51381
+ const messagesSlice2 = context.getSlice("github-messages");
51382
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51383
+ if (!events || !(messagesData2 == null ? void 0 : messagesData2.target) || !commentText.trim() || isSending) return;
51384
+ const { owner, repo, target: target2 } = messagesData2;
51385
+ setIsSending(true);
51386
+ setSendError(null);
51387
+ events.emit({
51388
+ type: "github-messages:comment:create",
51389
+ source: "github-messages-panel",
51390
+ timestamp: Date.now(),
51391
+ payload: {
51392
+ owner,
51393
+ repo,
51394
+ targetType: target2.type,
51395
+ targetNumber: target2.number,
51396
+ body: commentText.trim()
51397
+ }
51398
+ });
51399
+ setCommentText("");
51400
+ }, [context, events, commentText, isSending]);
51401
+ const getMergedReactions = useCallback((itemId, itemType, apiReactions) => {
51402
+ const key = `${itemType}-${itemId}`;
51403
+ const local = localReactions[key];
51404
+ if (!apiReactions && !local) {
51405
+ return {
51406
+ url: "",
51407
+ total_count: 0,
51408
+ "+1": 0,
51409
+ "-1": 0,
51410
+ laugh: 0,
51411
+ hooray: 0,
51412
+ confused: 0,
51413
+ heart: 0,
51414
+ rocket: 0,
51415
+ eyes: 0,
51416
+ viewerReactions: {}
51417
+ };
51418
+ }
51419
+ if (local) {
51420
+ return local;
51421
+ }
51422
+ return {
51423
+ ...apiReactions,
51424
+ viewerReactions: {}
51425
+ };
51426
+ }, [localReactions]);
51427
+ const getMergedTimeline = useCallback((timeline2, reviewComments2) => {
51428
+ const merged = [
51429
+ ...timeline2.map((event) => ({ type: "event", data: event })),
51430
+ ...reviewComments2.map((comment2) => ({ type: "review_comment", data: comment2 }))
51431
+ ];
51432
+ merged.sort((a, b) => {
51433
+ const timeA = a.type === "event" ? getEventTimestamp(a.data) : a.data.created_at;
51434
+ const timeB = b.type === "event" ? getEventTimestamp(b.data) : b.data.created_at;
51435
+ return new Date(timeA).getTime() - new Date(timeB).getTime();
51436
+ });
51437
+ return merged;
51438
+ }, []);
50832
51439
  gt(
50833
51440
  "github-messages",
50834
51441
  events,
50835
51442
  () => {
50836
- var _a;
50837
- return (_a = panelRef.current) == null ? void 0 : _a.focus();
51443
+ var _a2;
51444
+ return (_a2 = panelRef.current) == null ? void 0 : _a2.focus();
50838
51445
  }
50839
51446
  );
50840
51447
  const messagesSlice = context.getSlice("github-messages");
@@ -50876,6 +51483,46 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
50876
51483
  if (typeof unsubPR === "function") unsubPR();
50877
51484
  };
50878
51485
  }, [events]);
51486
+ useEffect(() => {
51487
+ if (textareaRef.current) {
51488
+ const minHeight = 36;
51489
+ const maxHeight = 200;
51490
+ if (!commentText) {
51491
+ textareaRef.current.style.height = `${minHeight}px`;
51492
+ return;
51493
+ }
51494
+ textareaRef.current.style.height = `${minHeight}px`;
51495
+ const scrollHeight = textareaRef.current.scrollHeight;
51496
+ const newHeight = Math.min(Math.max(scrollHeight, minHeight), maxHeight);
51497
+ textareaRef.current.style.height = `${newHeight}px`;
51498
+ }
51499
+ }, [commentText]);
51500
+ useEffect(() => {
51501
+ if (!events) return;
51502
+ const messagesSlice2 = context.getSlice("github-messages");
51503
+ const messagesData2 = messagesSlice2 == null ? void 0 : messagesSlice2.data;
51504
+ const unsubscribers = [
51505
+ events.on("github-messages:comment:created", (event) => {
51506
+ const payload = event.payload;
51507
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && payload.targetNumber === messagesData2.target.number) {
51508
+ setIsSending(false);
51509
+ setSendError(null);
51510
+ }
51511
+ }),
51512
+ events.on("github-messages:comment:error", (event) => {
51513
+ const payload = event.payload;
51514
+ if ((messagesData2 == null ? void 0 : messagesData2.target) && payload.targetNumber === messagesData2.target.number) {
51515
+ setIsSending(false);
51516
+ setSendError(payload.error);
51517
+ }
51518
+ })
51519
+ ];
51520
+ return () => {
51521
+ unsubscribers.forEach((unsub) => {
51522
+ if (typeof unsub === "function") unsub();
51523
+ });
51524
+ };
51525
+ }, [events, context]);
50879
51526
  const containerStyle = {
50880
51527
  display: "flex",
50881
51528
  flexDirection: "column",
@@ -50976,30 +51623,128 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
50976
51623
  "div",
50977
51624
  {
50978
51625
  style: {
50979
- height: "40px",
50980
51626
  minHeight: "40px",
50981
- padding: "0 12px",
51627
+ padding: "8px 12px",
50982
51628
  borderBottom: `1px solid ${theme2.colors.border}`,
50983
51629
  backgroundColor: theme2.colors.backgroundSecondary,
50984
51630
  display: "flex",
50985
51631
  alignItems: "center",
50986
- gap: "12px",
50987
- boxSizing: "border-box"
51632
+ gap: "8px",
51633
+ boxSizing: "border-box",
51634
+ flexWrap: "wrap"
50988
51635
  },
50989
51636
  children: [
50990
- /* @__PURE__ */ jsx(
50991
- "span",
51637
+ target.labels && target.labels.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" }, children: [
51638
+ /* @__PURE__ */ jsx(
51639
+ "span",
51640
+ {
51641
+ style: {
51642
+ fontFamily: theme2.fonts.body,
51643
+ fontSize: theme2.fontSizes[0],
51644
+ color: theme2.colors.textMuted,
51645
+ fontWeight: 500
51646
+ },
51647
+ children: "Tagged as"
51648
+ }
51649
+ ),
51650
+ target.labels.map((label) => /* @__PURE__ */ jsx(
51651
+ "span",
51652
+ {
51653
+ style: {
51654
+ padding: "2px 8px",
51655
+ borderRadius: "12px",
51656
+ backgroundColor: `#${label.color}`,
51657
+ color: parseInt(label.color, 16) > 8388607 ? "#000" : "#fff",
51658
+ fontFamily: theme2.fonts.body,
51659
+ fontSize: theme2.fontSizes[0],
51660
+ fontWeight: 500
51661
+ },
51662
+ children: label.name
51663
+ },
51664
+ label.id
51665
+ ))
51666
+ ] }),
51667
+ target.assignees && target.assignees.length > 0 && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "6px", alignItems: "center", flexWrap: "wrap" }, children: [
51668
+ /* @__PURE__ */ jsx(
51669
+ "span",
51670
+ {
51671
+ style: {
51672
+ fontFamily: theme2.fonts.body,
51673
+ fontSize: theme2.fontSizes[0],
51674
+ color: theme2.colors.textMuted,
51675
+ fontWeight: 500
51676
+ },
51677
+ children: "Assigned to"
51678
+ }
51679
+ ),
51680
+ target.assignees.map((assignee) => /* @__PURE__ */ jsxs(
51681
+ "div",
51682
+ {
51683
+ style: {
51684
+ display: "flex",
51685
+ alignItems: "center",
51686
+ gap: "4px",
51687
+ padding: "2px 8px",
51688
+ borderRadius: "12px",
51689
+ backgroundColor: theme2.colors.backgroundSecondary,
51690
+ border: `1px solid ${theme2.colors.border}`
51691
+ },
51692
+ children: [
51693
+ /* @__PURE__ */ jsx(
51694
+ "img",
51695
+ {
51696
+ src: assignee.avatar_url,
51697
+ alt: assignee.login,
51698
+ style: {
51699
+ width: 20,
51700
+ height: 20,
51701
+ borderRadius: "50%"
51702
+ }
51703
+ }
51704
+ ),
51705
+ /* @__PURE__ */ jsx(
51706
+ "span",
51707
+ {
51708
+ style: {
51709
+ fontFamily: theme2.fonts.body,
51710
+ fontSize: theme2.fontSizes[0],
51711
+ color: theme2.colors.text,
51712
+ fontWeight: 500
51713
+ },
51714
+ children: assignee.login
51715
+ }
51716
+ )
51717
+ ]
51718
+ },
51719
+ assignee.login
51720
+ ))
51721
+ ] }),
51722
+ /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
51723
+ hiddenMessages.size > 0 && /* @__PURE__ */ jsxs(
51724
+ "button",
50992
51725
  {
51726
+ type: "button",
51727
+ onClick: () => setShowHiddenMessages(!showHiddenMessages),
51728
+ title: showHiddenMessages ? "Hide reacted messages" : `Show ${hiddenMessages.size} hidden message${hiddenMessages.size > 1 ? "s" : ""}`,
50993
51729
  style: {
50994
- flex: 1,
50995
- overflow: "hidden",
50996
- textOverflow: "ellipsis",
50997
- whiteSpace: "nowrap",
50998
- fontFamily: theme2.fonts.heading,
50999
- color: theme2.colors.text,
51000
- fontSize: theme2.fontSizes[1]
51730
+ display: "inline-flex",
51731
+ alignItems: "center",
51732
+ justifyContent: "center",
51733
+ gap: "4px",
51734
+ height: "28px",
51735
+ padding: "0 8px",
51736
+ border: `1px solid ${theme2.colors.border}`,
51737
+ borderRadius: "6px",
51738
+ backgroundColor: showHiddenMessages ? `${theme2.colors.primary}20` : theme2.colors.background,
51739
+ color: showHiddenMessages ? theme2.colors.primary : theme2.colors.textSecondary,
51740
+ cursor: "pointer",
51741
+ fontSize: theme2.fontSizes[0],
51742
+ fontFamily: theme2.fonts.body
51001
51743
  },
51002
- children: target.title
51744
+ children: [
51745
+ /* @__PURE__ */ jsx(EyeOff, { size: 14 }),
51746
+ /* @__PURE__ */ jsx("span", { children: hiddenMessages.size })
51747
+ ]
51003
51748
  }
51004
51749
  ),
51005
51750
  /* @__PURE__ */ jsx(
@@ -51047,32 +51792,335 @@ const GitHubMessagesPanelContent = ({ context, events }) => {
51047
51792
  },
51048
51793
  children: "No activity yet."
51049
51794
  }
51050
- ) : /* @__PURE__ */ jsxs(Fragment, { children: [
51051
- timeline.map((event, index2) => /* @__PURE__ */ jsx(TimelineEventRenderer, { event }, `${event.event}-${index2}`)),
51052
- reviewComments.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
51053
- /* @__PURE__ */ jsxs(
51054
- "div",
51795
+ ) : /* @__PURE__ */ jsx(Fragment, { children: getMergedTimeline(timeline, reviewComments).filter((item) => {
51796
+ if (item.type === "event") {
51797
+ const event = item.data;
51798
+ if (!showHiddenMessages && event.event === "commented") {
51799
+ const key = `comment-${event.id}`;
51800
+ if (hiddenMessages.has(key)) return false;
51801
+ }
51802
+ if (event.event === "labeled" || event.event === "unlabeled") {
51803
+ return false;
51804
+ }
51805
+ if (event.event === "assigned" || event.event === "unassigned") {
51806
+ return false;
51807
+ }
51808
+ return true;
51809
+ } else {
51810
+ const comment2 = item.data;
51811
+ if (!showHiddenMessages) {
51812
+ const key = `review_comment-${comment2.id}`;
51813
+ if (hiddenMessages.has(key)) return false;
51814
+ }
51815
+ return true;
51816
+ }
51817
+ }).map((item, index2) => {
51818
+ if (item.type === "event") {
51819
+ const event = item.data;
51820
+ return /* @__PURE__ */ jsx(
51821
+ TimelineEventRenderer,
51055
51822
  {
51056
- style: {
51057
- padding: "12px 16px",
51058
- backgroundColor: theme2.colors.backgroundSecondary,
51059
- borderBottom: `1px solid ${theme2.colors.border}`,
51060
- fontFamily: theme2.fonts.heading,
51061
- fontWeight: 600,
51062
- fontSize: theme2.fontSizes[0],
51063
- color: theme2.colors.textSecondary,
51064
- textTransform: "uppercase"
51065
- },
51066
- children: [
51067
- "Inline Review Comments (",
51068
- reviewComments.length,
51069
- ")"
51070
- ]
51071
- }
51072
- ),
51073
- reviewComments.map((comment2) => /* @__PURE__ */ jsx(InlineReviewComment, { comment: comment2 }, comment2.id))
51074
- ] })
51075
- ] })
51823
+ event,
51824
+ onToggleReaction: handleToggleReaction,
51825
+ getMergedReactions
51826
+ },
51827
+ `event-${event.event}-${index2}`
51828
+ );
51829
+ } else {
51830
+ const comment2 = item.data;
51831
+ return /* @__PURE__ */ jsx(
51832
+ InlineReviewComment,
51833
+ {
51834
+ comment: comment2,
51835
+ onToggleReaction: handleToggleReaction,
51836
+ getMergedReactions
51837
+ },
51838
+ `review-comment-${comment2.id}`
51839
+ );
51840
+ }
51841
+ }) })
51842
+ }
51843
+ ),
51844
+ /* @__PURE__ */ jsxs(
51845
+ "div",
51846
+ {
51847
+ style: {
51848
+ borderTop: `1px solid ${theme2.colors.border}`,
51849
+ backgroundColor: theme2.colors.background,
51850
+ padding: "12px",
51851
+ display: "flex",
51852
+ flexDirection: "column",
51853
+ gap: "8px"
51854
+ },
51855
+ children: [
51856
+ sendError && /* @__PURE__ */ jsxs(
51857
+ "div",
51858
+ {
51859
+ style: {
51860
+ padding: "8px 12px",
51861
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
51862
+ border: `1px solid ${theme2.colors.error || "#ef4444"}`,
51863
+ borderRadius: "6px",
51864
+ color: theme2.colors.error || "#ef4444",
51865
+ fontSize: theme2.fontSizes[0],
51866
+ fontFamily: theme2.fonts.body,
51867
+ display: "flex",
51868
+ alignItems: "center",
51869
+ gap: "8px"
51870
+ },
51871
+ children: [
51872
+ /* @__PURE__ */ jsx(CircleAlert, { size: 14 }),
51873
+ /* @__PURE__ */ jsx("span", { children: sendError }),
51874
+ /* @__PURE__ */ jsx(
51875
+ "button",
51876
+ {
51877
+ type: "button",
51878
+ onClick: () => setSendError(null),
51879
+ style: {
51880
+ marginLeft: "auto",
51881
+ background: "none",
51882
+ border: "none",
51883
+ cursor: "pointer",
51884
+ color: "inherit",
51885
+ padding: "2px"
51886
+ },
51887
+ children: /* @__PURE__ */ jsx(X, { size: 14 })
51888
+ }
51889
+ )
51890
+ ]
51891
+ }
51892
+ ),
51893
+ /* @__PURE__ */ jsxs(
51894
+ "div",
51895
+ {
51896
+ style: {
51897
+ display: "flex",
51898
+ gap: "8px",
51899
+ alignItems: "flex-end"
51900
+ },
51901
+ children: [
51902
+ /* @__PURE__ */ jsx(
51903
+ "textarea",
51904
+ {
51905
+ ref: textareaRef,
51906
+ value: commentText,
51907
+ onChange: (e) => setCommentText(e.target.value),
51908
+ onKeyDown: (e) => {
51909
+ if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
51910
+ e.preventDefault();
51911
+ handleSendComment();
51912
+ }
51913
+ },
51914
+ placeholder: "Write a comment",
51915
+ disabled: isSending,
51916
+ "aria-label": "Write a comment",
51917
+ style: {
51918
+ flex: 1,
51919
+ height: "36px",
51920
+ maxHeight: "200px",
51921
+ padding: "8px 12px",
51922
+ border: `1px solid ${theme2.colors.border}`,
51923
+ borderRadius: "6px",
51924
+ backgroundColor: isSending ? theme2.colors.backgroundSecondary : theme2.colors.background,
51925
+ color: theme2.colors.text,
51926
+ fontFamily: theme2.fonts.body,
51927
+ fontSize: theme2.fontSizes[1],
51928
+ lineHeight: 1.5,
51929
+ resize: "none",
51930
+ outline: "none",
51931
+ transition: "border-color 0.2s",
51932
+ overflow: "hidden",
51933
+ boxSizing: "border-box"
51934
+ },
51935
+ onFocus: (e) => {
51936
+ e.currentTarget.style.borderColor = theme2.colors.primary;
51937
+ },
51938
+ onBlur: (e) => {
51939
+ e.currentTarget.style.borderColor = theme2.colors.border;
51940
+ }
51941
+ }
51942
+ ),
51943
+ /* @__PURE__ */ jsx(
51944
+ "button",
51945
+ {
51946
+ type: "button",
51947
+ onClick: handleSendComment,
51948
+ disabled: !commentText.trim() || isSending,
51949
+ "aria-label": "Send comment",
51950
+ title: isSending ? "Sending..." : "Send comment (Cmd/Ctrl+Enter)",
51951
+ style: {
51952
+ padding: "12px 20px",
51953
+ border: "none",
51954
+ borderRadius: "6px",
51955
+ backgroundColor: !commentText.trim() || isSending ? theme2.colors.backgroundSecondary : theme2.colors.primary,
51956
+ color: !commentText.trim() || isSending ? theme2.colors.textMuted : theme2.colors.textOnPrimary || "#ffffff",
51957
+ cursor: !commentText.trim() || isSending ? "not-allowed" : "pointer",
51958
+ fontFamily: theme2.fonts.body,
51959
+ fontSize: theme2.fontSizes[1],
51960
+ fontWeight: ((_a = theme2.fontWeights) == null ? void 0 : _a.medium) || 500,
51961
+ display: "flex",
51962
+ alignItems: "center",
51963
+ gap: "8px",
51964
+ transition: "background-color 0.2s",
51965
+ opacity: !commentText.trim() || isSending ? 0.5 : 1
51966
+ },
51967
+ children: isSending ? /* @__PURE__ */ jsxs(Fragment, { children: [
51968
+ /* @__PURE__ */ jsx(LoaderCircle, { size: 16, style: { animation: "spin 1s linear infinite" } }),
51969
+ "Sending..."
51970
+ ] }) : "Send"
51971
+ }
51972
+ )
51973
+ ]
51974
+ }
51975
+ )
51976
+ ]
51977
+ }
51978
+ ),
51979
+ showDeleteConfirm && /* @__PURE__ */ jsx(
51980
+ "div",
51981
+ {
51982
+ style: {
51983
+ position: "absolute",
51984
+ top: 0,
51985
+ left: 0,
51986
+ right: 0,
51987
+ bottom: 0,
51988
+ backgroundColor: "rgba(0, 0, 0, 0.5)",
51989
+ display: "flex",
51990
+ alignItems: "center",
51991
+ justifyContent: "center",
51992
+ zIndex: 1e3
51993
+ },
51994
+ onClick: () => setShowDeleteConfirm(false),
51995
+ children: /* @__PURE__ */ jsxs(
51996
+ "div",
51997
+ {
51998
+ style: {
51999
+ backgroundColor: theme2.colors.background,
52000
+ border: `1px solid ${theme2.colors.border}`,
52001
+ borderRadius: "8px",
52002
+ padding: "24px",
52003
+ minWidth: "320px",
52004
+ maxWidth: "400px",
52005
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)"
52006
+ },
52007
+ onClick: (e) => e.stopPropagation(),
52008
+ children: [
52009
+ /* @__PURE__ */ jsxs(
52010
+ "div",
52011
+ {
52012
+ style: {
52013
+ display: "flex",
52014
+ alignItems: "center",
52015
+ gap: "12px",
52016
+ marginBottom: "16px"
52017
+ },
52018
+ children: [
52019
+ /* @__PURE__ */ jsx(
52020
+ "div",
52021
+ {
52022
+ style: {
52023
+ width: "40px",
52024
+ height: "40px",
52025
+ borderRadius: "50%",
52026
+ backgroundColor: theme2.colors.error ? `${theme2.colors.error}20` : "#ef444420",
52027
+ display: "flex",
52028
+ alignItems: "center",
52029
+ justifyContent: "center",
52030
+ color: theme2.colors.error || "#ef4444"
52031
+ },
52032
+ children: /* @__PURE__ */ jsx(Trash2, { size: 20 })
52033
+ }
52034
+ ),
52035
+ /* @__PURE__ */ jsxs(
52036
+ "h3",
52037
+ {
52038
+ style: {
52039
+ margin: 0,
52040
+ fontFamily: theme2.fonts.heading,
52041
+ fontSize: theme2.fontSizes[2],
52042
+ fontWeight: 600,
52043
+ color: theme2.colors.text
52044
+ },
52045
+ children: [
52046
+ "Delete ",
52047
+ target.type === "pull_request" ? "Pull Request" : "Issue",
52048
+ "?"
52049
+ ]
52050
+ }
52051
+ )
52052
+ ]
52053
+ }
52054
+ ),
52055
+ /* @__PURE__ */ jsxs(
52056
+ "p",
52057
+ {
52058
+ style: {
52059
+ margin: "0 0 24px 0",
52060
+ fontFamily: theme2.fonts.body,
52061
+ fontSize: theme2.fontSizes[1],
52062
+ color: theme2.colors.textSecondary,
52063
+ lineHeight: 1.5
52064
+ },
52065
+ children: [
52066
+ 'Are you sure you want to delete "',
52067
+ target.title,
52068
+ '"? This action cannot be undone.'
52069
+ ]
52070
+ }
52071
+ ),
52072
+ /* @__PURE__ */ jsxs(
52073
+ "div",
52074
+ {
52075
+ style: {
52076
+ display: "flex",
52077
+ gap: "12px",
52078
+ justifyContent: "flex-end"
52079
+ },
52080
+ children: [
52081
+ /* @__PURE__ */ jsx(
52082
+ "button",
52083
+ {
52084
+ type: "button",
52085
+ onClick: () => setShowDeleteConfirm(false),
52086
+ style: {
52087
+ padding: "8px 16px",
52088
+ border: `1px solid ${theme2.colors.border}`,
52089
+ borderRadius: "6px",
52090
+ backgroundColor: theme2.colors.background,
52091
+ color: theme2.colors.text,
52092
+ fontFamily: theme2.fonts.body,
52093
+ fontSize: theme2.fontSizes[1],
52094
+ cursor: "pointer"
52095
+ },
52096
+ children: "Cancel"
52097
+ }
52098
+ ),
52099
+ /* @__PURE__ */ jsx(
52100
+ "button",
52101
+ {
52102
+ type: "button",
52103
+ onClick: handleDelete2,
52104
+ style: {
52105
+ padding: "8px 16px",
52106
+ border: "none",
52107
+ borderRadius: "6px",
52108
+ backgroundColor: theme2.colors.error || "#ef4444",
52109
+ color: "#ffffff",
52110
+ fontFamily: theme2.fonts.body,
52111
+ fontSize: theme2.fontSizes[1],
52112
+ fontWeight: 500,
52113
+ cursor: "pointer"
52114
+ },
52115
+ children: "Delete"
52116
+ }
52117
+ )
52118
+ ]
52119
+ }
52120
+ )
52121
+ ]
52122
+ }
52123
+ )
51076
52124
  }
51077
52125
  )
51078
52126
  ] });