@kud/jira-ink 0.4.0 → 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 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
@@ -421,7 +421,8 @@ var IssueBoard = ({
421
421
  onRefresh,
422
422
  onSearch,
423
423
  onClearSearch,
424
- frame
424
+ frame,
425
+ onInputFocus
425
426
  }) => {
426
427
  const [legend, setLegend] = useState(false);
427
428
  const [search, setSearch] = useState({
@@ -434,6 +435,9 @@ var IssueBoard = ({
434
435
  const tick = setInterval(() => setNow(Date.now()), 3e4);
435
436
  return () => clearInterval(tick);
436
437
  }, []);
438
+ useEffect(() => {
439
+ onInputFocus?.(search.open);
440
+ }, [search.open, onInputFocus]);
437
441
  const narrowed = useMemo(() => {
438
442
  if (!search.open || modeOf(search) === "jql" || !search.draft.trim())
439
443
  return model.rows;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/jira-ink",
3
- "version": "0.4.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",