@kud/gh-ink 0.65.0 → 0.65.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/dist/index.d.ts +8 -1
- package/dist/index.js +94 -71
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -209,6 +209,13 @@ type PrRowProps = {
|
|
|
209
209
|
item: GHItem;
|
|
210
210
|
active: boolean;
|
|
211
211
|
login?: string;
|
|
212
|
+
/**
|
|
213
|
+
* The selection wash for this frame, resolved by the list — see
|
|
214
|
+
* `selectionBackground` in the inbox. A prop rather than an import because
|
|
215
|
+
* the constant lives next to the inbox's `OVERLAY_BG` and importing the inbox
|
|
216
|
+
* here would cycle back through this module. Absent the row draws no wash.
|
|
217
|
+
*/
|
|
218
|
+
selectionBg?: string;
|
|
212
219
|
/**
|
|
213
220
|
* Columns available to this row, which is NOT always the frame width: a rail
|
|
214
221
|
* beside the list takes its share, and a budget that does not know the rail is
|
|
@@ -318,7 +325,7 @@ declare const sectionShedOf: (rows: readonly Pick<LayoutInput, "item" | "prefix"
|
|
|
318
325
|
* arrival, merge and departure belongs to whoever owns the list, and reaches
|
|
319
326
|
* the row as `icon`, `motion` and `announcements` after the decisions are made.
|
|
320
327
|
*/
|
|
321
|
-
declare const PrRow: ({ item, active, login, cols, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, numberCols, }: PrRowProps) => React.JSX.Element;
|
|
328
|
+
declare const PrRow: ({ item, active, login, cols, selectionBg, icon: iconOverride, prefix, uniformLabels, motion, announcements, columns, shed, numberCols, }: PrRowProps) => React.JSX.Element;
|
|
322
329
|
|
|
323
330
|
/**
|
|
324
331
|
* One state per thing, from a closed set the strip knows how to draw. The host
|
package/dist/index.js
CHANGED
|
@@ -950,6 +950,7 @@ var PrRow = ({
|
|
|
950
950
|
active,
|
|
951
951
|
login,
|
|
952
952
|
cols,
|
|
953
|
+
selectionBg,
|
|
953
954
|
icon: iconOverride,
|
|
954
955
|
prefix = "",
|
|
955
956
|
uniformLabels = [],
|
|
@@ -990,68 +991,72 @@ var PrRow = ({
|
|
|
990
991
|
shed,
|
|
991
992
|
numberCols
|
|
992
993
|
});
|
|
993
|
-
return
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
Text3,
|
|
1001
|
-
{
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
{
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
/* @__PURE__ */
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
/* @__PURE__ */ jsx(
|
|
1053
|
-
|
|
1054
|
-
|
|
994
|
+
return (
|
|
995
|
+
// The wash paints every cell of the fixed-width row — an Ink Box's
|
|
996
|
+
// background covers its full measure, not just the inked cells.
|
|
997
|
+
/* @__PURE__ */ jsxs(Box, { width: cols, backgroundColor: selectionBg, children: [
|
|
998
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
999
|
+
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: prefix }),
|
|
1000
|
+
/* @__PURE__ */ jsx(Text3, { color, bold: true, children: icon + " " }),
|
|
1001
|
+
/* @__PURE__ */ jsx(Text3, { color: turnColor, bold: turnIcon === "\u2190", children: turnIcon + " " }),
|
|
1002
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.accent, children: numStr }),
|
|
1003
|
+
/* @__PURE__ */ jsx(
|
|
1004
|
+
Text3,
|
|
1005
|
+
{
|
|
1006
|
+
bold: active || motion === "arriving",
|
|
1007
|
+
dimColor: motion === "departing" || motion === "withdrawn",
|
|
1008
|
+
strikethrough: motion === "withdrawn",
|
|
1009
|
+
children: truncate(
|
|
1010
|
+
item.needsYou?.decision ? item.needsYou.decision : item.title,
|
|
1011
|
+
titleMax
|
|
1012
|
+
) + " "
|
|
1013
|
+
}
|
|
1014
|
+
),
|
|
1015
|
+
labelLabel ? /* @__PURE__ */ jsx(Text3, { color: colors.secondary, children: labelLabel + " " }) : null,
|
|
1016
|
+
repoLabel && !givingUp.repo ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: repoLabel }) : null,
|
|
1017
|
+
showAuthor && !givingUp.author ? /* @__PURE__ */ jsx(Text3, { dimColor: true, italic: true, children: " by " + item.author }) : null,
|
|
1018
|
+
/* @__PURE__ */ jsx(Box, { flexGrow: 1 }),
|
|
1019
|
+
block.threads > 0 && !givingUp.threads ? /* @__PURE__ */ jsx(
|
|
1020
|
+
Box,
|
|
1021
|
+
{
|
|
1022
|
+
marginLeft: 2,
|
|
1023
|
+
width: block.threads,
|
|
1024
|
+
justifyContent: "flex-end",
|
|
1025
|
+
flexShrink: 0,
|
|
1026
|
+
children: unresolvedLabel ? /* @__PURE__ */ jsx(
|
|
1027
|
+
Text3,
|
|
1028
|
+
{
|
|
1029
|
+
bold: !spokeLast,
|
|
1030
|
+
color: spokeLast ? colors.secondary : colors.accent,
|
|
1031
|
+
children: unresolvedLabel
|
|
1032
|
+
}
|
|
1033
|
+
) : null
|
|
1034
|
+
}
|
|
1035
|
+
) : null,
|
|
1036
|
+
block.size > 0 && !givingUp.size ? /* @__PURE__ */ jsx(
|
|
1037
|
+
Box,
|
|
1038
|
+
{
|
|
1039
|
+
marginLeft: 2,
|
|
1040
|
+
width: block.size,
|
|
1041
|
+
justifyContent: "flex-end",
|
|
1042
|
+
flexShrink: 0,
|
|
1043
|
+
children: sizeParts ? /* @__PURE__ */ jsxs(Text3, { children: [
|
|
1044
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.success, children: sizeParts.added }),
|
|
1045
|
+
" ",
|
|
1046
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.error, children: sizeParts.removed })
|
|
1047
|
+
] }) : null
|
|
1048
|
+
}
|
|
1049
|
+
) : null,
|
|
1050
|
+
block.age > 0 && !givingUp.age ? /* @__PURE__ */ jsx(Box, { marginLeft: 2, width: block.age, flexShrink: 0, children: agePair ? /* @__PURE__ */ jsxs(Text3, { children: [
|
|
1051
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.secondary, children: agePair.activity }),
|
|
1052
|
+
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: ` (${agePair.lifetime})` })
|
|
1053
|
+
] }) : ageLabel2 ? /* @__PURE__ */ jsx(Text3, { color: colors.secondary, children: ageLabel2 }) : null }) : null,
|
|
1054
|
+
backdropped ? null : announcements.map((a) => /* @__PURE__ */ jsxs(React2.Fragment, { children: [
|
|
1055
|
+
/* @__PURE__ */ jsx(Text3, { children: " " }),
|
|
1056
|
+
/* @__PURE__ */ jsx(Pill, { color: a.color, children: a.label })
|
|
1057
|
+
] }, a.label))
|
|
1058
|
+
] })
|
|
1059
|
+
);
|
|
1055
1060
|
};
|
|
1056
1061
|
var stripGlyph = (state) => {
|
|
1057
1062
|
switch (state) {
|
|
@@ -1850,6 +1855,11 @@ var COLS = (process.stdout.columns ?? 120) - FRAME_CHROME_COLS;
|
|
|
1850
1855
|
var MODAL_CHROME_COLS = 2 + 1 * 2;
|
|
1851
1856
|
var ROW_MAX_COLS = 140;
|
|
1852
1857
|
var OVERLAY_BG = "#22222e";
|
|
1858
|
+
var SELECTION_BG = "#16161f";
|
|
1859
|
+
var selectionBackground = (active, backdropped) => active && !backdropped ? SELECTION_BG : void 0;
|
|
1860
|
+
var taskKeyStyle = (active) => ({
|
|
1861
|
+
bold: active
|
|
1862
|
+
});
|
|
1853
1863
|
var workCount = (s) => {
|
|
1854
1864
|
let n = 0;
|
|
1855
1865
|
for (let i = 0; i < s.items.length; i++) {
|
|
@@ -2316,12 +2326,14 @@ var FENCE_COLS = 46;
|
|
|
2316
2326
|
var RepoHeaderRow = ({
|
|
2317
2327
|
repo,
|
|
2318
2328
|
gap,
|
|
2319
|
-
active
|
|
2329
|
+
active,
|
|
2330
|
+
cols,
|
|
2331
|
+
selectionBg
|
|
2320
2332
|
}) => {
|
|
2321
2333
|
const label = `\u2500\u2500 ${repo} `;
|
|
2322
2334
|
const fill = Math.max(4, FENCE_COLS - label.length);
|
|
2323
2335
|
const rule = "\u2500".repeat(fill);
|
|
2324
|
-
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, children: [
|
|
2336
|
+
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, width: cols, backgroundColor: selectionBg, children: [
|
|
2325
2337
|
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
2326
2338
|
/* @__PURE__ */ jsx(Text3, { dimColor: !active, children: "\u2500\u2500 " }),
|
|
2327
2339
|
/* @__PURE__ */ jsx(
|
|
@@ -2393,27 +2405,37 @@ var ItemRow = ({
|
|
|
2393
2405
|
numberCols
|
|
2394
2406
|
}) => {
|
|
2395
2407
|
const backdropped = useBackdropped();
|
|
2408
|
+
const selBg = selectionBackground(active, backdropped);
|
|
2396
2409
|
const transient = leaving ? "out" : refreshMark;
|
|
2397
2410
|
const transitFrame = Math.floor(sparkFrame / TRANSIT_FRAME_TICKS);
|
|
2398
2411
|
const rampAt = (len) => rampFrame(len, transitFrame, transitAt);
|
|
2399
2412
|
const farewellLabel = leaving ? TRANSIT_LABEL.out : "";
|
|
2400
2413
|
if (item.kind === "repo-header")
|
|
2401
|
-
return /* @__PURE__ */ jsx(
|
|
2414
|
+
return /* @__PURE__ */ jsx(
|
|
2415
|
+
RepoHeaderRow,
|
|
2416
|
+
{
|
|
2417
|
+
repo: item.repo,
|
|
2418
|
+
gap: gap ?? false,
|
|
2419
|
+
active,
|
|
2420
|
+
cols,
|
|
2421
|
+
selectionBg: selBg
|
|
2422
|
+
}
|
|
2423
|
+
);
|
|
2402
2424
|
if (item.kind === "subgroup-header")
|
|
2403
|
-
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, children: [
|
|
2425
|
+
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, width: cols, backgroundColor: selBg, children: [
|
|
2404
2426
|
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
2405
2427
|
/* @__PURE__ */ jsx(Text3, { color: colors.accent, bold: true, children: "\xBB " }),
|
|
2406
2428
|
/* @__PURE__ */ jsx(Text3, { bold: true, children: item.label })
|
|
2407
2429
|
] });
|
|
2408
2430
|
if (item.kind === "show-more")
|
|
2409
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
2431
|
+
return /* @__PURE__ */ jsxs(Box, { width: cols, backgroundColor: selBg, children: [
|
|
2410
2432
|
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
2411
2433
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: prefix }),
|
|
2412
2434
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: active ? "\u21B5 " : " " }),
|
|
2413
2435
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: `+${item.hidden.length} more` })
|
|
2414
2436
|
] });
|
|
2415
2437
|
if (item.kind === "show-less")
|
|
2416
|
-
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
2438
|
+
return /* @__PURE__ */ jsxs(Box, { width: cols, backgroundColor: selBg, children: [
|
|
2417
2439
|
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
2418
2440
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: prefix }),
|
|
2419
2441
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: active ? "\u21B5 " : " " }),
|
|
@@ -2426,13 +2448,13 @@ var ItemRow = ({
|
|
|
2426
2448
|
1,
|
|
2427
2449
|
cols - item.key.length - note.length - (item.pill ? pillWidth(item.pill) + 1 : 0) - (farewellLabel ? pillWidth(farewellLabel) + 2 : 0) - prefix.length - (markerCols > 0 ? markerCols + 1 : 0) - 12
|
|
2428
2450
|
);
|
|
2429
|
-
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, children: [
|
|
2451
|
+
return /* @__PURE__ */ jsxs(Box, { marginTop: gap ? 1 : 0, width: cols, backgroundColor: selBg, children: [
|
|
2430
2452
|
/* @__PURE__ */ jsx(Text3, { color: colors.info, children: active ? "\u276F " : " " }),
|
|
2431
2453
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: prefix }),
|
|
2432
2454
|
/* @__PURE__ */ jsx(Text3, { dimColor: true, children: parent ? "\u252C " : " " }),
|
|
2433
2455
|
/* @__PURE__ */ jsx(Text3, { bold: true, color: transient ? TRANSIT_COLOUR[transient] : void 0, children: transitIcon + " " }),
|
|
2434
2456
|
markerCols > 0 ? /* @__PURE__ */ jsx(Text3, { color: item.markerColor, children: (item.marker ?? "").padEnd(markerCols) + " " }) : null,
|
|
2435
|
-
/* @__PURE__ */ jsx(Text3, {
|
|
2457
|
+
/* @__PURE__ */ jsx(Text3, { ...taskKeyStyle(active), children: item.key + " " }),
|
|
2436
2458
|
/* @__PURE__ */ jsx(
|
|
2437
2459
|
Text3,
|
|
2438
2460
|
{
|
|
@@ -2480,6 +2502,7 @@ var ItemRow = ({
|
|
|
2480
2502
|
active,
|
|
2481
2503
|
login,
|
|
2482
2504
|
cols,
|
|
2505
|
+
selectionBg: selBg,
|
|
2483
2506
|
prefix,
|
|
2484
2507
|
uniformLabels,
|
|
2485
2508
|
columns,
|
|
@@ -3728,7 +3751,7 @@ var BrowseScreen = ({
|
|
|
3728
3751
|
prefix: treePrefix(section.items, viewStart + i),
|
|
3729
3752
|
parent: item.kind === "task" && depthOf(section.items[viewStart + i + 1]) > depthOf(item),
|
|
3730
3753
|
sparkFrame,
|
|
3731
|
-
cols: item.kind === "pr" || item.kind === "issue" ? rowCols : listCols,
|
|
3754
|
+
cols: item.kind === "pr" || item.kind === "issue" || item.kind === "repo-header" || item.kind === "subgroup-header" || item.kind === "task" || item.kind === "show-more" || item.kind === "show-less" ? rowCols : listCols,
|
|
3732
3755
|
markerCols,
|
|
3733
3756
|
uniformLabels,
|
|
3734
3757
|
columns: trailingColumns,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/gh-ink",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.1",
|
|
4
4
|
"description": "Ink components for rendering GitHub PR review comments and health — controlled, presentation-only, built on @kud/ink-ui and fed by @kud/gh.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|