@kud/jira-ink 0.5.2 → 0.7.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 +32 -6
- package/dist/index.js +24 -13
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -183,13 +183,25 @@ type Block = {
|
|
|
183
183
|
declare const blocksFor: (rows: BoardRow[]) => Block[];
|
|
184
184
|
/** Index into `blocks` of the n-th issue, so a cursor over issues maps to a line. */
|
|
185
185
|
declare const blockIndexOfIssue: (blocks: Block[], issueIndex: number) => number;
|
|
186
|
+
type PriorityGlyph = "⇈" | "↑" | "=" | "↓" | "⇊" | " ";
|
|
186
187
|
/**
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
188
|
+
* Rank against the scheme's default rung, in Jira's own arrow grammar: two
|
|
189
|
+
* rungs above draws `⇈`, one `↑`, the default `=`, one below `↓`, two `⇊`.
|
|
190
|
+
*
|
|
191
|
+
* Five glyphs, not three, and the normal rung gets one. The column used to
|
|
192
|
+
* mark the two ends only (`▲` / `▼`, nothing for normal), which on a four-rung
|
|
193
|
+
* scheme — P1 to P4, the common shape — put a mark on half the rows, drew P2
|
|
194
|
+
* as if it were normal, and made P3 and P4 identical. And a blank beside a
|
|
195
|
+
* marked row read as MISSING rather than as normal: the absent-vs-zero
|
|
196
|
+
* distinction, one glyph at a time. So `=` says "we looked, it is normal",
|
|
197
|
+
* and the blank finally means only "no priority, or one we cannot place".
|
|
198
|
+
*
|
|
199
|
+
* Names are per-instance, so this matches the default scheme, the common
|
|
200
|
+
* renames and the P0–P5 ladder rather than an exact list. Deriving rank from
|
|
201
|
+
* the instance's ordered priority list, with its default flag, is the honest
|
|
202
|
+
* version of this and where it goes next; the names are the fallback.
|
|
191
203
|
*/
|
|
192
|
-
declare const priorityGlyph: (name: string | null) =>
|
|
204
|
+
declare const priorityGlyph: (name: string | null) => PriorityGlyph;
|
|
193
205
|
declare const relativeAge: (iso: string, now?: number) => string;
|
|
194
206
|
declare const pillVariantFor: (row: Pick<BoardRow, "type" | "container">) => "group" | "info" | "error" | "muted";
|
|
195
207
|
type BoardModel = {
|
|
@@ -279,6 +291,20 @@ type IssueBoardProps = {
|
|
|
279
291
|
*/
|
|
280
292
|
declare const IssueBoard: ({ model, viewer, loadedAt, scope, showingAll, searchError, width, height, onOpen, onToggleAll, onRefresh, onSearch, onClearSearch, frame, onInputFocus, }: IssueBoardProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react.JSX.Element | null | undefined;
|
|
281
293
|
|
|
294
|
+
type PriorityMarker = {
|
|
295
|
+
/** Always one column wide, so a list filling every row keeps its grid. */
|
|
296
|
+
marker: PriorityGlyph;
|
|
297
|
+
/** Absent for the blank: nothing to paint. */
|
|
298
|
+
color?: string;
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* The priority cell as the board draws it — glyph and colour together, so a
|
|
302
|
+
* host filling gh-ink's `marker` / `markerColor` pair and the board's own row
|
|
303
|
+
* cannot disagree on a hue. One site, never a host-side table that drifts;
|
|
304
|
+
* see `priorityGlyph` for what the glyphs say.
|
|
305
|
+
*/
|
|
306
|
+
declare const priorityMarker: (name: string | null) => PriorityMarker;
|
|
307
|
+
|
|
282
308
|
/**
|
|
283
309
|
* An invented board for screenshots and tests — every key, name and host is
|
|
284
310
|
* made up. It carries what the contract must keep exercising: a container
|
|
@@ -288,4 +314,4 @@ declare const IssueBoard: ({ model, viewer, loadedAt, scope, showingAll, searchE
|
|
|
288
314
|
declare const MOCK_BOARD_ROWS: BoardRow[];
|
|
289
315
|
declare const mockBoard: () => BoardModel;
|
|
290
316
|
|
|
291
|
-
export { type Block, type BoardModel, type BoardOptions, type BoardRow, type BoardScope, type BoardTab, type BoardTabs, IssueBoard, type IssueBoardProps, IssueBody, type IssueBodyProps, type IssueDetail, IssueDetailView, type IssueDetailViewProps, MOCK_BOARD_ROWS, OFF_BOARD, type StatusCategory, type TabSource, type Transition, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
|
|
317
|
+
export { type Block, type BoardModel, type BoardOptions, type BoardRow, type BoardScope, type BoardTab, type BoardTabs, IssueBoard, type IssueBoardProps, IssueBody, type IssueBodyProps, type IssueDetail, IssueDetailView, type IssueDetailViewProps, MOCK_BOARD_ROWS, OFF_BOARD, type PriorityGlyph, type PriorityMarker, type StatusCategory, type TabSource, type Transition, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, priorityMarker, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MarkdownViewport } from '@kud/ink-markdown';
|
|
2
|
-
import { useTabs, KeyValue, Badge, Tabs, FooterHints, StatusMessage, useListCursor, pillWidth,
|
|
2
|
+
import { colors, useTabs, KeyValue, Badge, Tabs, FooterHints, StatusMessage, useListCursor, pillWidth, TextInput, SelectableRow, Pill, LoadingScreen } from '@kud/ink-ui';
|
|
3
3
|
import { useInput, Box, Text, useStdout } from 'ink';
|
|
4
4
|
import { useState, useEffect, useMemo } from 'react';
|
|
5
5
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -346,8 +346,11 @@ var blockIndexOfIssue = (blocks, issueIndex) => {
|
|
|
346
346
|
};
|
|
347
347
|
var priorityGlyph = (name) => {
|
|
348
348
|
const n = (name ?? "").trim().toLowerCase();
|
|
349
|
-
if (
|
|
350
|
-
if (
|
|
349
|
+
if (/^(highest|blocker|critical|p[01])$/.test(n)) return "\u21C8";
|
|
350
|
+
if (/^(high|urgent|major|p2)$/.test(n)) return "\u2191";
|
|
351
|
+
if (/^(medium|normal|p3)$/.test(n)) return "=";
|
|
352
|
+
if (/^(low|minor|p4)$/.test(n)) return "\u2193";
|
|
353
|
+
if (/^(lowest|trivial|p5)$/.test(n)) return "\u21CA";
|
|
351
354
|
return " ";
|
|
352
355
|
};
|
|
353
356
|
var UNITS = [
|
|
@@ -382,10 +385,24 @@ var boardOf = async (client, jql, { tabs, board, limit = 200 } = {}) => {
|
|
|
382
385
|
]);
|
|
383
386
|
return { rows: issues.map(toBoardRow), tabs: derived ?? tabsFromCategories() };
|
|
384
387
|
};
|
|
388
|
+
var COLOUR = {
|
|
389
|
+
"\u21C8": colors.warning,
|
|
390
|
+
"\u2191": colors.warning,
|
|
391
|
+
"=": colors.muted,
|
|
392
|
+
"\u2193": colors.info,
|
|
393
|
+
"\u21CA": colors.info,
|
|
394
|
+
" ": void 0
|
|
395
|
+
};
|
|
396
|
+
var priorityMarker = (name) => {
|
|
397
|
+
const marker = priorityGlyph(name);
|
|
398
|
+
const color = COLOUR[marker];
|
|
399
|
+
return color ? { marker, color } : { marker };
|
|
400
|
+
};
|
|
385
401
|
var CHROME = 6;
|
|
386
402
|
var LEGEND = [
|
|
387
|
-
["\
|
|
388
|
-
["
|
|
403
|
+
["\u21C8 \u2191", "priority above the default"],
|
|
404
|
+
["=", "default priority"],
|
|
405
|
+
["\u2193 \u21CA", "priority below the default"],
|
|
389
406
|
["\u2500\u2500 epic \u2500\u2500", "a parent not in this tab; its rows hang beneath"],
|
|
390
407
|
["\u2514\u2500", "a row under the container above it"],
|
|
391
408
|
["story \xB7 bug \xB7 task", "issue type"],
|
|
@@ -578,13 +595,7 @@ var IssueBoard = ({
|
|
|
578
595
|
width - 7
|
|
579
596
|
) }) }, `f:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs(SelectableRow, { active: start + i === focus, children: [
|
|
580
597
|
block.depth === 1 ? /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 3, children: /* @__PURE__ */ jsx(Text, { dimColor: true, children: "\u2514\u2500 " }) }) : null,
|
|
581
|
-
/* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(
|
|
582
|
-
Text,
|
|
583
|
-
{
|
|
584
|
-
color: priorityGlyph(block.row.priority) === "\u25B2" ? colors.warning : colors.muted,
|
|
585
|
-
children: priorityGlyph(block.row.priority)
|
|
586
|
-
}
|
|
587
|
-
) }),
|
|
598
|
+
/* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(Text, { color: priorityMarker(block.row.priority).color, children: priorityMarker(block.row.priority).marker }) }),
|
|
588
599
|
/* @__PURE__ */ jsx(Box, { flexShrink: 0, width: keyWidth + 2, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, bold: start + i === focus, children: block.row.key }) }),
|
|
589
600
|
/* @__PURE__ */ jsx(Box, { flexShrink: 0, width: typeWidth + 2, children: /* @__PURE__ */ jsx(Pill, { tone: "soft", variant: pillVariantFor(block.row), children: block.row.type.toLowerCase() }) }),
|
|
590
601
|
/* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", bold: start + i === focus, children: block.row.summary }) }),
|
|
@@ -700,4 +711,4 @@ var mockBoard = () => ({
|
|
|
700
711
|
tabs: tabsFromCategories()
|
|
701
712
|
});
|
|
702
713
|
|
|
703
|
-
export { IssueBoard, IssueBody, IssueDetailView, MOCK_BOARD_ROWS, OFF_BOARD, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
|
|
714
|
+
export { IssueBoard, IssueBody, IssueDetailView, MOCK_BOARD_ROWS, OFF_BOARD, blockIndexOfIssue, blocksFor, boardOf, countsFor, issueDetailOf, mockBoard, pillVariantFor, priorityGlyph, priorityMarker, relativeAge, tabOf, tabsFromBoard, tabsFromCategories, tabsFromConfig, toBoardRow, transitionsOf, visibleTabs };
|
package/package.json
CHANGED