@kud/jira-ink 0.5.2 → 0.6.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 CHANGED
@@ -279,6 +279,23 @@ type IssueBoardProps = {
279
279
  */
280
280
  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
281
 
282
+ type PriorityMarker = {
283
+ /** Always one column wide, so a list filling every row keeps its grid. */
284
+ marker: "▲" | "▼" | " ";
285
+ /** Absent for the blank: nothing to paint. */
286
+ color?: string;
287
+ };
288
+ /**
289
+ * The priority cell as the board draws it — glyph and colour together, so a
290
+ * host filling gh-ink's `marker` / `markerColor` pair and the board's own row
291
+ * cannot disagree on a hue. Shape is the channel (`▲` above normal, `▼`
292
+ * below, nothing for normal); the hues sit in different bins so the two arrows
293
+ * do not merge at row-scan speed, and a warm one on the high end so it clears
294
+ * the row text. The hex-vs-token question was settled with the pill map: one
295
+ * site, here, never a host-side table that drifts.
296
+ */
297
+ declare const priorityMarker: (name: string | null) => PriorityMarker;
298
+
282
299
  /**
283
300
  * An invented board for screenshots and tests — every key, name and host is
284
301
  * made up. It carries what the contract must keep exercising: a container
@@ -288,4 +305,4 @@ declare const IssueBoard: ({ model, viewer, loadedAt, scope, showingAll, searchE
288
305
  declare const MOCK_BOARD_ROWS: BoardRow[];
289
306
  declare const mockBoard: () => BoardModel;
290
307
 
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 };
308
+ 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 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, colors, TextInput, SelectableRow, Pill, LoadingScreen } from '@kud/ink-ui';
2
+ import { useTabs, KeyValue, Badge, Tabs, FooterHints, StatusMessage, colors, 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';
@@ -382,6 +382,10 @@ var boardOf = async (client, jql, { tabs, board, limit = 200 } = {}) => {
382
382
  ]);
383
383
  return { rows: issues.map(toBoardRow), tabs: derived ?? tabsFromCategories() };
384
384
  };
385
+ var priorityMarker = (name) => {
386
+ const marker = priorityGlyph(name);
387
+ return marker === "\u25B2" ? { marker, color: colors.warning } : marker === "\u25BC" ? { marker, color: colors.muted } : { marker };
388
+ };
385
389
  var CHROME = 6;
386
390
  var LEGEND = [
387
391
  ["\u25B2", "high priority"],
@@ -578,13 +582,7 @@ var IssueBoard = ({
578
582
  width - 7
579
583
  ) }) }, `f:${block.key ?? "none"}`) : /* @__PURE__ */ jsxs(SelectableRow, { active: start + i === focus, children: [
580
584
  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
- ) }),
585
+ /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: 2, children: /* @__PURE__ */ jsx(Text, { color: priorityMarker(block.row.priority).color, children: priorityMarker(block.row.priority).marker }) }),
588
586
  /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: keyWidth + 2, children: /* @__PURE__ */ jsx(Text, { color: colors.accent, bold: start + i === focus, children: block.row.key }) }),
589
587
  /* @__PURE__ */ jsx(Box, { flexShrink: 0, width: typeWidth + 2, children: /* @__PURE__ */ jsx(Pill, { tone: "soft", variant: pillVariantFor(block.row), children: block.row.type.toLowerCase() }) }),
590
588
  /* @__PURE__ */ jsx(Box, { flexGrow: 1, children: /* @__PURE__ */ jsx(Text, { wrap: "truncate-end", bold: start + i === focus, children: block.row.summary }) }),
@@ -700,4 +698,4 @@ var mockBoard = () => ({
700
698
  tabs: tabsFromCategories()
701
699
  });
702
700
 
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 };
701
+ 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-ink",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
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",