@kud/gh-ink 0.50.1 → 0.51.0
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 +1 -0
- package/dist/index.js +25 -13
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { spawn } from 'child_process';
|
|
|
8
8
|
import { readFileSync, mkdirSync, writeFileSync, existsSync, readdirSync, statSync, watch, rmSync } from 'fs';
|
|
9
9
|
import { join, dirname, basename } from 'path';
|
|
10
10
|
import { homedir } from 'os';
|
|
11
|
-
import { depthOf, checkoutDirs, profileOf, inboxConfig, relativeTime, filterBySearch, filterByRepos, filterByOrigin, PIN_MARK, sizeOf, labelPriority } from '@kud/gh-workflow';
|
|
11
|
+
import { depthOf, checkoutDirs, profileOf, inboxConfig, relativeTime, filterBySearch, filterByRepos, filterByOrigin, PIN_MARK, sizeOf, sizePartsOf, labelPriority } from '@kud/gh-workflow';
|
|
12
12
|
export { PIN_MARK, checkoutDirs, configureInbox, filterByOrigin, filterByRepos, filterBySearch, inboxConfig, insertRepoHeaders, labelPriority, layoutGHItems, profileOf, relativeTime, repoPriority, resetInboxConfig, sortByRecency, sortItems, whoseMove } from '@kud/gh-workflow';
|
|
13
13
|
|
|
14
14
|
// src/components/comments-panel.tsx
|
|
@@ -1929,6 +1929,7 @@ var ItemRow = ({
|
|
|
1929
1929
|
const numStr = `#${item.number}`.padEnd(7);
|
|
1930
1930
|
const showAuthor = !!item.author && item.author !== login;
|
|
1931
1931
|
const sizeLabel = showAuthor ? sizeOf(item) : null;
|
|
1932
|
+
const sizeParts = showAuthor ? sizePartsOf(item) : null;
|
|
1932
1933
|
const unresolvedLabel = item.unresolved > 0 ? `\uF086 ${item.unresolved}` : "";
|
|
1933
1934
|
const ageLabel = item.activityAge && item.activityAge !== item.age ? `${item.activityAge} \xB7 ${item.age}` : item.age;
|
|
1934
1935
|
const mergedLabel = merged ? "merged" : "";
|
|
@@ -2004,7 +2005,12 @@ var ItemRow = ({
|
|
|
2004
2005
|
),
|
|
2005
2006
|
labelLabel ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: labelLabel + " " }) : null,
|
|
2006
2007
|
repoLabel && !givingUp.repo ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: repoLabel }) : null,
|
|
2007
|
-
|
|
2008
|
+
sizeParts && !givingUp.size ? /* @__PURE__ */ jsxs(Text3, { children: [
|
|
2009
|
+
" ",
|
|
2010
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.success, children: sizeParts.added }),
|
|
2011
|
+
" ",
|
|
2012
|
+
/* @__PURE__ */ jsx(Text3, { color: colors.error, children: sizeParts.removed })
|
|
2013
|
+
] }) : null,
|
|
2008
2014
|
unresolvedLabel && !givingUp.threads ? /* @__PURE__ */ jsx(Text3, { bold: !spokeLast, color: spokeLast ? "#888888" : "#FF8700", children: " " + unresolvedLabel }) : null,
|
|
2009
2015
|
showAuthor && !givingUp.author ? /* @__PURE__ */ jsx(Text3, { dimColor: true, italic: true, children: " by " + item.author }) : null,
|
|
2010
2016
|
ageLabel && !givingUp.age ? /* @__PURE__ */ jsx(Text3, { dimColor: true, children: " " + ageLabel }) : null,
|
|
@@ -2320,6 +2326,9 @@ var RepoPicker = ({
|
|
|
2320
2326
|
);
|
|
2321
2327
|
};
|
|
2322
2328
|
var extensionFor = (input, extensions) => input ? extensions?.find((e) => e.key === input) : void 0;
|
|
2329
|
+
var drillExtensionFor = (item, extensions) => extensions?.find(
|
|
2330
|
+
(e) => e.scope === "item" && (e.drills?.includes(item.kind) ?? false)
|
|
2331
|
+
);
|
|
2323
2332
|
var extensionLegend = (extensions) => (extensions ?? []).map((e) => [e.key, e.title]);
|
|
2324
2333
|
var itemExtensions = (extensions) => (extensions ?? []).filter((e) => e.scope === "item");
|
|
2325
2334
|
var BrowseScreen = ({
|
|
@@ -2515,6 +2524,13 @@ var BrowseScreen = ({
|
|
|
2515
2524
|
useEffect(() => {
|
|
2516
2525
|
if (refreshError) showFlash(`\u2717 ${refreshError.message}`);
|
|
2517
2526
|
}, [refreshError]);
|
|
2527
|
+
const extensionTargetFor = (item) => ({
|
|
2528
|
+
item: item && !isHeader(item) ? item : void 0,
|
|
2529
|
+
ciJob: ciStatus?.job,
|
|
2530
|
+
login,
|
|
2531
|
+
onRemove: (row) => dismissItem(row),
|
|
2532
|
+
showFlash
|
|
2533
|
+
});
|
|
2518
2534
|
const openDrillView = (item) => {
|
|
2519
2535
|
const open = (fn, i) => {
|
|
2520
2536
|
menu.close();
|
|
@@ -2523,6 +2539,12 @@ var BrowseScreen = ({
|
|
|
2523
2539
|
};
|
|
2524
2540
|
if (item.kind === "pr" && onOpenPr) return open(onOpenPr, item);
|
|
2525
2541
|
if (item.kind === "issue" && onOpenIssue) return open(onOpenIssue, item);
|
|
2542
|
+
const ext = drillExtensionFor(item, extensions);
|
|
2543
|
+
if (ext && onOpenExt) {
|
|
2544
|
+
menu.close();
|
|
2545
|
+
onOpenExt(ext.id, extensionTargetFor(item));
|
|
2546
|
+
return true;
|
|
2547
|
+
}
|
|
2526
2548
|
return false;
|
|
2527
2549
|
};
|
|
2528
2550
|
const openMenu = () => {
|
|
@@ -2681,17 +2703,7 @@ var BrowseScreen = ({
|
|
|
2681
2703
|
}
|
|
2682
2704
|
const ext = extensionFor(input, extensions);
|
|
2683
2705
|
if (ext) {
|
|
2684
|
-
onOpenExt?.(ext.id,
|
|
2685
|
-
// ExtensionTarget.item has always been documented as absent on a header
|
|
2686
|
-
// row, and until the fence became selectable that was true for free.
|
|
2687
|
-
// Now it has to be said: every extension body narrows on `kind` for a
|
|
2688
|
-
// pr / issue / task and none of them expect a repo-header.
|
|
2689
|
-
item: activeItem && !isHeader(activeItem) ? activeItem : void 0,
|
|
2690
|
-
ciJob: ciStatus?.job,
|
|
2691
|
-
login,
|
|
2692
|
-
onRemove: (row) => dismissItem(row),
|
|
2693
|
-
showFlash
|
|
2694
|
-
});
|
|
2706
|
+
onOpenExt?.(ext.id, extensionTargetFor(activeItem));
|
|
2695
2707
|
return;
|
|
2696
2708
|
}
|
|
2697
2709
|
if (activeItem?.kind === "repo-header") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/gh-ink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.51.0",
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@kud/gh": "0.16.0",
|
|
52
|
-
"@kud/gh-workflow": "0.
|
|
52
|
+
"@kud/gh-workflow": "0.8.0",
|
|
53
53
|
"@kud/ink-ui": "0.25.0",
|
|
54
54
|
"zx": "8.8.5"
|
|
55
55
|
},
|