epiq 0.0.1 → 0.0.3

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.
Files changed (134) hide show
  1. package/dist/app.js +11 -4
  2. package/dist/board/components/Board.js +4 -12
  3. package/dist/board/components/CommandLine.d.ts +2 -0
  4. package/dist/board/components/CommandLine.js +19 -0
  5. package/dist/{components/Help.d.ts → board/components/ContextBar.d.ts} +1 -1
  6. package/dist/board/components/ContextBar.js +8 -0
  7. package/dist/board/components/Help.js +18 -11
  8. package/dist/board/components/Swimlane.js +6 -3
  9. package/dist/board/components/Swimlanes.js +1 -1
  10. package/dist/board/components/TextInput.d.ts +6 -0
  11. package/dist/board/components/TextInput.js +9 -0
  12. package/dist/board/components/TicketListItem.js +5 -4
  13. package/dist/board/components/TicketUI.js +6 -7
  14. package/dist/board/hints/hints.d.ts +7 -0
  15. package/dist/board/hints/hints.js +29 -0
  16. package/dist/board/mock/board.js +526 -457
  17. package/dist/cli.d.ts +2 -1
  18. package/dist/cli.js +37 -14
  19. package/dist/debug-logger.d.ts +2 -0
  20. package/dist/debug-logger.js +15 -0
  21. package/dist/navigation/actions/add/add-actions.d.ts +2 -0
  22. package/dist/navigation/actions/add/add-actions.js +25 -0
  23. package/dist/navigation/actions/add/add-item-actions.d.ts +2 -0
  24. package/dist/navigation/actions/add/add-item-actions.js +25 -0
  25. package/dist/navigation/actions/add-item/add-item-actions.d.ts +3 -0
  26. package/dist/navigation/actions/add-item/add-item-actions.js +35 -0
  27. package/dist/navigation/actions/board-action-map.d.ts +10 -0
  28. package/dist/navigation/actions/board-action-map.js +12 -0
  29. package/dist/{lib/utils/default-actions.d.ts → navigation/actions/default/default-action-utils.d.ts} +2 -2
  30. package/dist/{lib/utils → navigation/actions/default}/default-action-utils.js +11 -10
  31. package/dist/navigation/actions/default/default-actions.d.ts +2 -0
  32. package/dist/navigation/actions/default/default-actions.js +78 -0
  33. package/dist/navigation/actions/input/command-line-input.d.ts +2 -0
  34. package/dist/navigation/actions/input/command-line-input.js +18 -0
  35. package/dist/navigation/actions/input/input-actions-utils.d.ts +8 -0
  36. package/dist/navigation/actions/input/input-actions-utils.js +47 -0
  37. package/dist/navigation/actions/input/input-actions.d.ts +2 -0
  38. package/dist/navigation/actions/input/input-actions.js +43 -0
  39. package/dist/navigation/actions/move/move-actions-routes.d.ts +4 -0
  40. package/dist/navigation/actions/move/move-actions-routes.js +55 -0
  41. package/dist/{lib/actions → navigation/actions/move}/move-actions-utils.d.ts +1 -1
  42. package/dist/{board/actions/move-actions.js → navigation/actions/move/move-actions-utils.js} +13 -9
  43. package/dist/navigation/actions/move/move-actions.d.ts +4 -0
  44. package/dist/navigation/actions/move/move-actions.js +53 -0
  45. package/dist/{lib/utils/default-action-utils.d.ts → navigation/actions/navigate/navigation-action-utils.d.ts} +1 -1
  46. package/dist/navigation/actions/navigate/navigation-actions.d.ts +2 -0
  47. package/dist/navigation/actions/navigate/navigation-actions.js +78 -0
  48. package/dist/navigation/command-line/command-line-actions.d.ts +2 -0
  49. package/dist/navigation/command-line/command-line-actions.js +32 -0
  50. package/dist/navigation/command-line/command-line-intent.d.ts +7 -0
  51. package/dist/navigation/command-line/command-line-intent.js +29 -0
  52. package/dist/navigation/command-line/command-line-sequence-actions.d.ts +2 -0
  53. package/dist/navigation/command-line/command-line-sequence-actions.js +31 -0
  54. package/dist/navigation/command-line/command-line-sequence-intent.d.ts +7 -0
  55. package/dist/navigation/command-line/command-line-sequence-intent.js +29 -0
  56. package/dist/navigation/model/action-map.model.d.ts +17 -5
  57. package/dist/navigation/model/action-map.model.js +2 -0
  58. package/dist/navigation/model/navigation-ctx.model.d.ts +2 -2
  59. package/dist/navigation/model/navigation-tree.model.d.ts +1 -0
  60. package/dist/navigation/navigation.d.ts +1 -1
  61. package/dist/navigation/navigation.js +48 -34
  62. package/dist/navigation/state/command-line.state.d.ts +13 -0
  63. package/dist/navigation/state/command-line.state.js +43 -0
  64. package/dist/navigation/state/state.d.ts +7 -6
  65. package/dist/navigation/state/state.js +31 -2
  66. package/dist/navigation/utils/get-command-line-intent.d.ts +3 -0
  67. package/dist/navigation/utils/get-command-line-intent.js +17 -0
  68. package/dist/navigation/utils/getKeyIntent.d.ts +5 -0
  69. package/dist/navigation/utils/getKeyIntent.js +71 -0
  70. package/dist/navigation/utils/key-intent.d.ts +19 -10
  71. package/dist/navigation/utils/key-intent.js +103 -43
  72. package/package.json +2 -2
  73. package/dist/board/actions/board-action-map.d.ts +0 -11
  74. package/dist/board/actions/board-action-map.js +0 -11
  75. package/dist/board/actions/move-actions-routes.d.ts +0 -4
  76. package/dist/board/actions/move-actions-routes.js +0 -31
  77. package/dist/board/actions/move-actions.d.ts +0 -5
  78. package/dist/board/board-action-map.d.ts +0 -9
  79. package/dist/board/board-action-map.js +0 -7
  80. package/dist/board/move-actions-routes.d.ts +0 -4
  81. package/dist/board/move-actions-routes.js +0 -31
  82. package/dist/board/move-actions.d.ts +0 -5
  83. package/dist/board/move-actions.js +0 -49
  84. package/dist/components/Board.d.ts +0 -6
  85. package/dist/components/Board.js +0 -15
  86. package/dist/components/Help.js +0 -21
  87. package/dist/components/Swimlane.d.ts +0 -8
  88. package/dist/components/Swimlane.js +0 -10
  89. package/dist/components/TicketListItem.d.ts +0 -6
  90. package/dist/components/TicketListItem.js +0 -12
  91. package/dist/lib/actions/board-action-map.d.ts +0 -9
  92. package/dist/lib/actions/board-action-map.js +0 -7
  93. package/dist/lib/actions/move-actions-utils.js +0 -43
  94. package/dist/lib/actions/move-actions.d.ts +0 -4
  95. package/dist/lib/actions/move-actions.js +0 -31
  96. package/dist/lib/board/board-action-map.d.ts +0 -9
  97. package/dist/lib/board/board-action-map.js +0 -7
  98. package/dist/lib/board/move-actions-routes.d.ts +0 -4
  99. package/dist/lib/board/move-actions-routes.js +0 -31
  100. package/dist/lib/board/move-actions.d.ts +0 -5
  101. package/dist/lib/board/move-actions.js +0 -43
  102. package/dist/lib/board-utils.d.ts +0 -7
  103. package/dist/lib/board-utils.js +0 -33
  104. package/dist/lib/default-actions-routes.d.ts +0 -4
  105. package/dist/lib/default-actions-routes.js +0 -47
  106. package/dist/lib/default-actions.d.ts +0 -4
  107. package/dist/lib/default-actions.js +0 -47
  108. package/dist/lib/navigation-context.d.ts +0 -16
  109. package/dist/lib/navigation.d.ts +0 -10
  110. package/dist/lib/navigation.js +0 -74
  111. package/dist/lib/render-utils.d.ts +0 -10
  112. package/dist/lib/render-utils.js +0 -12
  113. package/dist/lib/state.d.ts +0 -8
  114. package/dist/lib/state.js +0 -8
  115. package/dist/lib/types/action-map.model.d.ts +0 -14
  116. package/dist/lib/types/action-map.model.js +0 -4
  117. package/dist/lib/types/board.model.d.ts +0 -21
  118. package/dist/lib/types/board.model.js +0 -5
  119. package/dist/lib/types/navigation.model.d.ts +0 -9
  120. package/dist/lib/utils/array-utils.d.ts +0 -5
  121. package/dist/lib/utils/array-utils.js +0 -7
  122. package/dist/lib/utils/default-actions.js +0 -50
  123. package/dist/lib/utils/key-intent.d.ts +0 -16
  124. package/dist/lib/utils/key-intent.js +0 -65
  125. package/dist/lib/utils.d.ts +0 -10
  126. package/dist/lib/utils.js +0 -12
  127. package/dist/mock/board.d.ts +0 -2
  128. package/dist/mock/board.js +0 -139
  129. package/dist/navigation/actions/default-actions-routes.d.ts +0 -4
  130. package/dist/navigation/actions/default-actions-routes.js +0 -47
  131. package/dist/navigation/actions/default-actions.d.ts +0 -7
  132. /package/dist/navigation/actions/{default-actions.js → navigate/navigation-action-utils.js} +0 -0
  133. /package/dist/{lib/navigation-context.js → navigation/navigation-ctx.d.ts} +0 -0
  134. /package/dist/{lib/types/navigation.model.js → navigation/navigation-ctx.js} +0 -0
package/dist/app.js CHANGED
@@ -1,12 +1,19 @@
1
1
  import { Box } from 'ink';
2
2
  import React from 'react';
3
3
  import { BoardUI } from './board/components/Board.js';
4
+ import { ContextBar } from './board/components/ContextBar.js';
4
5
  import { HelpUI } from './board/components/Help.js';
6
+ import { Mode } from './navigation/model/action-map.model.js';
7
+ import { navigationState } from './navigation/state/state.js';
5
8
  export default function App({ board }) {
6
9
  const width = process.stdout.columns || 120;
7
- const swimlaneWidth = Math.floor(width / board.children.length);
8
- const renderedWidth = swimlaneWidth * board.children.length;
10
+ const swimlaneMaxWidth = Math.floor(process.stdout.columns / 3);
11
+ const swimlaneDynamicWidth = Math.floor(width / board.children.length);
12
+ const renderedWidth = swimlaneDynamicWidth * board.children.length;
13
+ const swimlaneWidth = Math.min(renderedWidth, swimlaneMaxWidth);
9
14
  return (React.createElement(Box, { flexDirection: "column" },
10
- React.createElement(BoardUI, { board: board, swimlaneWidth: swimlaneWidth }),
11
- React.createElement(HelpUI, { width: renderedWidth })));
15
+ !(navigationState.mode === Mode.HELP) && (React.createElement(React.Fragment, null,
16
+ React.createElement(BoardUI, { board: board, swimlaneWidth: swimlaneWidth }),
17
+ React.createElement(ContextBar, { width: width }))),
18
+ navigationState.mode === Mode.HELP && React.createElement(HelpUI, { width: renderedWidth })));
12
19
  }
@@ -1,19 +1,11 @@
1
- import { Box, Text, useApp, useInput } from 'ink';
1
+ import { Box, Text } from 'ink';
2
2
  import React from 'react';
3
+ import { navigationState } from '../../navigation/state/state.js';
3
4
  import { BoardContentUI } from './Swimlanes.js';
4
5
  export const BoardUI = ({ board, swimlaneWidth, }) => {
5
- const { exit } = useApp();
6
- useInput((input, key) => {
7
- if (key.escape || input === 'q') {
8
- exit();
9
- }
10
- });
11
6
  return (React.createElement(Box, { flexDirection: "column" },
12
- React.createElement(Box, { padding: 1, justifyContent: "center" },
13
- React.createElement(Text, null,
14
- "--- ",
15
- board.name,
16
- " ---")),
7
+ React.createElement(Box, { paddingLeft: 1 },
8
+ React.createElement(Text, null, navigationState.breadCrumb.map(b => ' > ' + b.name))),
17
9
  React.createElement(Box, { flexDirection: "row" },
18
10
  React.createElement(BoardContentUI, { items: board.children, width: swimlaneWidth }))));
19
11
  };
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const CommandLine: React.FC;
@@ -0,0 +1,19 @@
1
+ import React from 'react';
2
+ import { Box, Text } from 'ink';
3
+ import { getCommandLineInput } from '../../navigation/state/command-line.state.js';
4
+ const roleColors = {
5
+ command: 'cyan',
6
+ argument: 'white',
7
+ };
8
+ export const CommandLine = () => {
9
+ const input = getCommandLineInput();
10
+ // Split only on the FIRST space
11
+ const [command, ...rest] = input.split(' ');
12
+ const argument = rest.join(' ');
13
+ return (React.createElement(Box, null,
14
+ React.createElement(Text, { color: "gray" }, ":"),
15
+ command && React.createElement(Text, { color: roleColors.command }, command),
16
+ argument && (React.createElement(Text, null,
17
+ ' ',
18
+ React.createElement(Text, { color: roleColors.argument }, "'" + argument + "'")))));
19
+ };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- export declare const HelpUI: React.FC<{
2
+ export declare const ContextBar: React.FC<{
3
3
  width: number;
4
4
  }>;
@@ -0,0 +1,8 @@
1
+ import { Box, Text } from 'ink';
2
+ import React from 'react';
3
+ import { Mode } from '../../navigation/model/action-map.model.js';
4
+ import { navigationState } from '../../navigation/state/state.js';
5
+ import { CommandLine } from './CommandLine.js';
6
+ export const ContextBar = ({ width }) => (React.createElement(Box, { flexDirection: "column", paddingLeft: 1, paddingRight: 1, borderColor: "gray", borderStyle: "round", width: width },
7
+ React.createElement(Box, null, navigationState.mode === Mode.COMMAND_LINE ? (React.createElement(Box, null,
8
+ React.createElement(CommandLine, null))) : (React.createElement(Text, null, navigationState.availableHints.join(' '))))));
@@ -1,21 +1,28 @@
1
1
  import { Box, Text } from 'ink';
2
2
  import { navigationState } from '../../navigation/state/state.js';
3
3
  import React from 'react';
4
- export const HelpUI = ({ width }) => (React.createElement(Box, { flexDirection: "column", paddingLeft: 1, paddingRight: 1, borderColor: "gray", borderStyle: "round", width: width },
5
- React.createElement(Box, null,
6
- React.createElement(Text, { color: "gray" }, "H: help")),
7
- navigationState.viewHelp
8
- ? navigationState.availableActions
4
+ import { Mode } from '../../navigation/model/action-map.model.js';
5
+ export const HelpUI = ({ width }) => (React.createElement(Box, { flexDirection: "column", marginTop: 3, borderColor: "gray", borderStyle: "round", width: width, minHeight: 19 },
6
+ React.createElement(Box, { flexDirection: "column", width: width }, navigationState.mode === Mode.HELP
7
+ ? [
8
+ {
9
+ action: '',
10
+ description: '[COMMAND] DESCRIPTION',
11
+ mode: navigationState.mode,
12
+ },
13
+ ...navigationState.availableActions,
14
+ ]
9
15
  .filter(action => Boolean(action.description))
10
- .filter(x => x.mode === navigationState.mode)
16
+ // .filter(x => x.mode === navigationState.mode)
11
17
  .map((action, index) => {
12
18
  const [leftRaw, rightRaw] = action.description.split(']');
13
19
  const left = leftRaw?.replace('[', '');
14
20
  const right = rightRaw?.trim(); // no extra space
15
21
  return (React.createElement(Box, { paddingLeft: 1, key: index, flexDirection: "row" },
16
- React.createElement(Box, { width: 20 },
17
- React.createElement(Text, { color: "cyan" }, left)),
18
- React.createElement(Box, { flexGrow: 1 },
19
- React.createElement(Text, { color: "white" }, right))));
22
+ React.createElement(Box, { key: index, flexDirection: "row", paddingBottom: index ? 0 : 1 },
23
+ React.createElement(Box, { flexGrow: 1, width: 30 },
24
+ React.createElement(Text, { color: index ? 'white' : 'gray' }, right)),
25
+ React.createElement(Box, { width: 20 },
26
+ React.createElement(Text, { color: index ? 'yellow' : 'gray' }, left)))));
20
27
  })
21
- : null));
28
+ : null)));
@@ -2,9 +2,12 @@ import { Box, Text } from 'ink';
2
2
  import React from 'react';
3
3
  import { ScrollBoxUI } from './ScrollBox.js';
4
4
  import { TicketListItemUI } from './TicketListItem.js';
5
+ import { navigationState } from '../../navigation/state/state.js';
5
6
  export const SwimlaneUI = ({ item, width }) => {
6
- return (React.createElement(Box, { flexDirection: "column", width: width, borderStyle: "round", borderColor: item.isSelected ? 'cyan' : 'gray', paddingRight: 1, paddingLeft: 1, paddingBottom: 1, minHeight: 15 },
7
- React.createElement(Box, { borderStyle: "round", borderColor: 'gray', justifyContent: "center" },
7
+ const color = navigationState.currentNode?.id === item.id ? 'cyan' : 'gray';
8
+ return (React.createElement(Box, { flexDirection: "column", width: width, borderStyle: "round", borderColor: item.isSelected ? 'cyan' : 'gray', paddingRight: 1, paddingLeft: 1, minHeight: 15, height: 20 },
9
+ React.createElement(Box, { borderStyle: "round", borderColor: color, justifyContent: "center" },
8
10
  React.createElement(Text, { bold: true }, item.name)),
9
- React.createElement(ScrollBoxUI, { selectedIndex: item.children.findIndex(x => x.isSelected), width: width, size: 10, children: item.children.map((ticket, index) => (React.createElement(TicketListItemUI, { key: index, width: width, ticket: ticket }))) })));
11
+ React.createElement(Box, { padding: 1 },
12
+ React.createElement(ScrollBoxUI, { selectedIndex: item.children.findIndex(x => x.isSelected), width: width, size: 10, children: item.children.map((ticket, index) => (React.createElement(TicketListItemUI, { key: index, width: width, ticket: ticket }))) }))));
10
13
  };
@@ -16,5 +16,5 @@ export const BoardContentUI = ({ items, width }) => {
16
16
  return (React.createElement(Box, { flexDirection: "row" },
17
17
  isSwimlaneContext &&
18
18
  items.map((lane, index) => (React.createElement(SwimlaneUI, { key: index, width: width, item: lane }))),
19
- isTicketContext && navigationState.currentNode && (React.createElement(TicketUI, { width: width * items.length, item: navigationState.currentNode }))));
19
+ isTicketContext && navigationState.currentNode && (React.createElement(TicketUI, { width: width * items.length, item: navigationState.breadCrumb[navigationState.breadCrumb.length - 1] }))));
20
20
  };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export declare const TextInput: React.FC<{
3
+ value: string;
4
+ onChange: (value: string) => void;
5
+ onSubmit: (value: string) => void;
6
+ }>;
@@ -0,0 +1,9 @@
1
+ import { Text } from 'ink';
2
+ import React from 'react';
3
+ // const onChange = (_value: string) => {
4
+ // // No-op for now
5
+ // };
6
+ // const onSubmit = (_value: string) => {
7
+ // // No-op for now
8
+ // };
9
+ export const TextInput = ({ value }) => React.createElement(Text, null, value);
@@ -1,12 +1,13 @@
1
1
  import { Box, Text } from 'ink';
2
2
  import React from 'react';
3
+ import { Mode } from '../../navigation/model/action-map.model.js';
3
4
  import { navigationState } from '../../navigation/state/state.js';
4
5
  const truncateWithEllipsis = (str, width) => str.length >= width ? str.slice(0, width - 3) + '...' : str;
5
6
  export const TicketListItemUI = ({ width, ticket }) => (React.createElement(Box, { borderBottom: true },
6
- React.createElement(Text, { color: ticket.isSelected && navigationState.mode === 'move'
7
- ? 'white'
7
+ React.createElement(Text, { color: ticket.isSelected && navigationState.mode === Mode.MOVE
8
+ ? 'cyan'
8
9
  : ticket.isSelected
9
10
  ? 'cyan'
10
- : navigationState.mode === 'move'
11
+ : navigationState.mode === Mode.MOVE
11
12
  ? 'gray'
12
- : 'white' }, truncateWithEllipsis(ticket.id + ' - ' + ticket.name, width - 6))));
13
+ : 'white' }, truncateWithEllipsis(ticket.name, width - 6))));
@@ -1,9 +1,8 @@
1
1
  import { Box, Text } from 'ink';
2
2
  import React from 'react';
3
- export const TicketUI = ({ item, width }) => {
4
- return (React.createElement(Box, { flexDirection: "row", padding: 1, paddingLeft: 2, borderStyle: 'round', width: width, minHeight: 16, borderColor: 'gray' },
5
- React.createElement(Box, { flexDirection: "row" },
6
- React.createElement(Box, { width: 20 },
7
- React.createElement(Text, { color: 'cyan' }, 'Description: ')),
8
- React.createElement(Text, null, item.name))));
9
- };
3
+ export const TicketUI = ({ item, width }) => (React.createElement(Box, { flexDirection: "column", padding: 1, paddingLeft: 2, borderStyle: "round", width: width, minHeight: 16, borderColor: "gray" }, item.children.map(child => (React.createElement(Box, { key: child.id, flexDirection: "row", borderStyle: 'round', borderColor: child.isSelected ? 'cyan' : 'gray', paddingLeft: 1 },
4
+ React.createElement(Box, { width: 30 },
5
+ React.createElement(Text, { color: "cyan" },
6
+ child.name,
7
+ ":")),
8
+ React.createElement(Text, null, child.description))))));
@@ -0,0 +1,7 @@
1
+ export declare const Hints: {
2
+ readonly [x: string]: readonly [] | readonly [":h Help", "hjkl: move between swimlanes", "e: enter swimlane", "q: exit"] | readonly ["hjkl: move between tickets", "e: view ticket details", "i: edit", "y: select for yank/move", "q: exit"] | readonly ["q: exit", "I: edit field"] | readonly ["hjkl: move selection", "y: confirm move/yank", "q: exit"];
3
+ readonly BOARD: readonly [];
4
+ readonly SWIMLANE: readonly [":h Help", "hjkl: move between swimlanes", "e: enter swimlane", "q: exit"];
5
+ readonly TICKET_LIST_ITEM: readonly ["hjkl: move between tickets", "e: view ticket details", "i: edit", "y: select for yank/move", "q: exit"];
6
+ readonly TICKET: readonly ["q: exit", "I: edit field"];
7
+ };
@@ -0,0 +1,29 @@
1
+ import { Mode } from '../../navigation/model/action-map.model.js';
2
+ import { BoardItemTypes } from '../model/board.model.js';
3
+ export const Hints = {
4
+ [BoardItemTypes.BOARD]: [],
5
+ [BoardItemTypes.SWIMLANE]: [
6
+ ':h Help',
7
+ 'hjkl: move between swimlanes',
8
+ 'e: enter swimlane',
9
+ 'q: exit',
10
+ ],
11
+ [BoardItemTypes.TICKET_LIST_ITEM]: [
12
+ 'hjkl: move between tickets',
13
+ 'e: view ticket details',
14
+ 'i: edit',
15
+ 'y: select for yank/move',
16
+ 'q: exit',
17
+ ],
18
+ [BoardItemTypes.TICKET]: ['q: exit', 'I: edit field'],
19
+ [BoardItemTypes.SWIMLANE + Mode.MOVE]: [
20
+ 'hjkl: move selection',
21
+ 'y: confirm move/yank',
22
+ 'q: exit',
23
+ ],
24
+ [BoardItemTypes.TICKET_LIST_ITEM + Mode.MOVE]: [
25
+ 'hjkl: move selection',
26
+ 'y: confirm move/yank',
27
+ 'q: exit',
28
+ ],
29
+ };