@kud/jira-ink 0.3.1 → 0.4.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 +6 -1
- package/dist/index.js +7 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -246,6 +246,11 @@ type IssueBoardProps = {
|
|
|
246
246
|
hints: Hint[];
|
|
247
247
|
body: ReactNode;
|
|
248
248
|
}) => ReactNode;
|
|
249
|
+
/**
|
|
250
|
+
* Fires when the search box takes or loses focus, so the host can stand its
|
|
251
|
+
* app keys down while a letter is a letter — `q` must type there, not quit.
|
|
252
|
+
*/
|
|
253
|
+
onInputFocus?: (focused: boolean) => void;
|
|
249
254
|
};
|
|
250
255
|
/**
|
|
251
256
|
* Rows are windowed by hand rather than handed to `Table`, which renders every
|
|
@@ -256,7 +261,7 @@ type IssueBoardProps = {
|
|
|
256
261
|
* host — only the keys that open and close the layers it pushes itself: the
|
|
257
262
|
* search input and the legend.
|
|
258
263
|
*/
|
|
259
|
-
declare const IssueBoard: ({ model, viewer, loadedAt, scope, showingAll, searchError, width, height, onOpen, onToggleAll, onRefresh, onSearch, onClearSearch, frame, }: 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;
|
|
264
|
+
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;
|
|
260
265
|
|
|
261
266
|
/**
|
|
262
267
|
* An invented board for screenshots and tests — every key, name and host is
|
package/dist/index.js
CHANGED
|
@@ -52,7 +52,6 @@ var IssueDetailView = ({
|
|
|
52
52
|
const { active } = useTabs(tabs, { initial: "description" });
|
|
53
53
|
const [scroll, setScroll] = useState(0);
|
|
54
54
|
useInput((input, key) => {
|
|
55
|
-
if (key.escape) return onBack();
|
|
56
55
|
if (input === "t" && onTransition) return onTransition();
|
|
57
56
|
if (input === "c" && onComment) return onComment();
|
|
58
57
|
if (input === "a" && onAssign) return onAssign();
|
|
@@ -71,7 +70,7 @@ var IssueDetailView = ({
|
|
|
71
70
|
...onComment ? [["c", "comment"]] : [],
|
|
72
71
|
...onAssign ? [["a", "assign to me"]] : [],
|
|
73
72
|
...onOpenBrowser ? [["o", "browser"]] : [],
|
|
74
|
-
["
|
|
73
|
+
["\u232B", "back"]
|
|
75
74
|
];
|
|
76
75
|
const body = /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
77
76
|
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
|
|
@@ -191,14 +190,10 @@ var IssueBody = ({
|
|
|
191
190
|
live = false;
|
|
192
191
|
};
|
|
193
192
|
}, [client, baseUrl, issueKey]);
|
|
194
|
-
useInput((input, key) => {
|
|
195
|
-
if (input === "q") return onExit();
|
|
196
|
-
if (key.escape && state.phase !== "ready") onExit();
|
|
197
|
-
});
|
|
198
193
|
const framed = (body) => frame ? frame({
|
|
199
194
|
title: issueKey,
|
|
200
195
|
subtitle: "",
|
|
201
|
-
hints: [["
|
|
196
|
+
hints: [["\u232B", "back"]],
|
|
202
197
|
body
|
|
203
198
|
}) : body;
|
|
204
199
|
if (state.phase === "loading")
|
|
@@ -426,7 +421,8 @@ var IssueBoard = ({
|
|
|
426
421
|
onRefresh,
|
|
427
422
|
onSearch,
|
|
428
423
|
onClearSearch,
|
|
429
|
-
frame
|
|
424
|
+
frame,
|
|
425
|
+
onInputFocus
|
|
430
426
|
}) => {
|
|
431
427
|
const [legend, setLegend] = useState(false);
|
|
432
428
|
const [search, setSearch] = useState({
|
|
@@ -439,6 +435,9 @@ var IssueBoard = ({
|
|
|
439
435
|
const tick = setInterval(() => setNow(Date.now()), 3e4);
|
|
440
436
|
return () => clearInterval(tick);
|
|
441
437
|
}, []);
|
|
438
|
+
useEffect(() => {
|
|
439
|
+
onInputFocus?.(search.open);
|
|
440
|
+
}, [search.open, onInputFocus]);
|
|
442
441
|
const narrowed = useMemo(() => {
|
|
443
442
|
if (!search.open || modeOf(search) === "jql" || !search.draft.trim())
|
|
444
443
|
return model.rows;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kud/jira-ink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.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.27.0",
|
|
34
34
|
"@kud/jira": "0.4.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|