@kud/jira-ink 0.4.3 → 0.5.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 +16 -0
- package/dist/index.js +10 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -242,7 +242,23 @@ type IssueBoardProps = {
|
|
|
242
242
|
* what a test or an embedded pane wants.
|
|
243
243
|
*/
|
|
244
244
|
frame?: (parts: {
|
|
245
|
+
/** One string for a host with a plain title row. */
|
|
245
246
|
facts: string;
|
|
247
|
+
/**
|
|
248
|
+
* The same facts as segments, for a host drawing ink-ui's `Page` title
|
|
249
|
+
* row: how many rows the board holds (or `N of M` while narrowing),
|
|
250
|
+
* who the `mine` scope belongs to, the search as a further scope, and
|
|
251
|
+
* freshness as a quiet status.
|
|
252
|
+
*/
|
|
253
|
+
title: {
|
|
254
|
+
count: number;
|
|
255
|
+
user?: string;
|
|
256
|
+
scope?: string;
|
|
257
|
+
status: {
|
|
258
|
+
text: string;
|
|
259
|
+
tone: "quiet";
|
|
260
|
+
};
|
|
261
|
+
};
|
|
246
262
|
hints: Hint[];
|
|
247
263
|
body: ReactNode;
|
|
248
264
|
}) => ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -455,7 +455,7 @@ var IssueBoard = ({
|
|
|
455
455
|
}));
|
|
456
456
|
const listFocused = !search.open && !legend;
|
|
457
457
|
const initial = shown.find((t) => t.category === "indeterminate")?.value ?? shown[0]?.value;
|
|
458
|
-
const { active
|
|
458
|
+
const { active } = useTabs(tabItems, {
|
|
459
459
|
initial,
|
|
460
460
|
isActive: listFocused
|
|
461
461
|
});
|
|
@@ -487,11 +487,6 @@ var IssueBoard = ({
|
|
|
487
487
|
return;
|
|
488
488
|
}
|
|
489
489
|
if (key.return && issues[cursor]) onOpen(issues[cursor].row.key);
|
|
490
|
-
if ((key.leftArrow || key.rightArrow) && tabItems.length) {
|
|
491
|
-
const at = tabItems.findIndex((t) => t.value === tab);
|
|
492
|
-
const next = (at + (key.leftArrow ? -1 : 1) + tabItems.length) % tabItems.length;
|
|
493
|
-
setActive(tabItems[next].value);
|
|
494
|
-
}
|
|
495
490
|
if (input === "/")
|
|
496
491
|
setSearch((s) => ({
|
|
497
492
|
...s,
|
|
@@ -515,7 +510,14 @@ var IssueBoard = ({
|
|
|
515
510
|
);
|
|
516
511
|
const scopeLabel = scope.kind === "mine" ? `@${viewer}` : scope.mode === "jql" ? "jql" : `\u201C${scope.query}\u201D`;
|
|
517
512
|
const countLabel = search.open && narrowed.length !== model.rows.length ? `${narrowed.length} of ${model.rows.length}` : `${model.rows.length} ${model.rows.length === 1 ? "item" : "items"}`;
|
|
518
|
-
const
|
|
513
|
+
const updated = `updated ${relativeAge(new Date(loadedAt).toISOString(), now)} ago`;
|
|
514
|
+
const facts = `${countLabel} \xB7 ${scopeLabel} \xB7 ${updated}`;
|
|
515
|
+
const title = {
|
|
516
|
+
count: search.open && narrowed.length !== model.rows.length ? narrowed.length : model.rows.length,
|
|
517
|
+
...scope.kind === "mine" ? { user: viewer } : {},
|
|
518
|
+
...scope.kind === "search" ? { scope: scope.mode === "jql" ? "jql" : `\u201C${scope.query}\u201D` } : search.open && narrowed.length !== model.rows.length ? { scope: `of ${model.rows.length}` } : {},
|
|
519
|
+
status: { text: updated, tone: "quiet" }
|
|
520
|
+
};
|
|
519
521
|
const hints = search.open ? [
|
|
520
522
|
["enter", "run"],
|
|
521
523
|
["\u21E5", modeOf(search) === "jql" ? "as plain words" : "as jql"],
|
|
@@ -591,7 +593,7 @@ var IssueBoard = ({
|
|
|
591
593
|
) }),
|
|
592
594
|
/* @__PURE__ */ jsx(Box, { marginTop: 1, paddingLeft: 2, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: issues.length ? `${cursor + 1}/${issues.length}` : " " }) })
|
|
593
595
|
] });
|
|
594
|
-
if (frame) return frame({ facts, hints, body });
|
|
596
|
+
if (frame) return frame({ facts, title, hints, body });
|
|
595
597
|
return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
596
598
|
/* @__PURE__ */ jsx(Text, { dimColor: true, children: facts }),
|
|
597
599
|
body,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/jira-ink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Ink components for viewing Jira issues: the board and the issue detail screen, shared by jira-cli's TUI and cockpit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@kud/ink-markdown": "0.3.0",
|
|
33
|
-
"@kud/ink-ui": "0.
|
|
33
|
+
"@kud/ink-ui": "0.29.0",
|
|
34
34
|
"@kud/jira": "0.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|