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.
- package/dist/app.js +11 -4
- package/dist/board/components/Board.js +4 -12
- package/dist/board/components/CommandLine.d.ts +2 -0
- package/dist/board/components/CommandLine.js +19 -0
- package/dist/{components/Help.d.ts → board/components/ContextBar.d.ts} +1 -1
- package/dist/board/components/ContextBar.js +8 -0
- package/dist/board/components/Help.js +18 -11
- package/dist/board/components/Swimlane.js +6 -3
- package/dist/board/components/Swimlanes.js +1 -1
- package/dist/board/components/TextInput.d.ts +6 -0
- package/dist/board/components/TextInput.js +9 -0
- package/dist/board/components/TicketListItem.js +5 -4
- package/dist/board/components/TicketUI.js +6 -7
- package/dist/board/hints/hints.d.ts +7 -0
- package/dist/board/hints/hints.js +29 -0
- package/dist/board/mock/board.js +526 -457
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +37 -14
- package/dist/debug-logger.d.ts +2 -0
- package/dist/debug-logger.js +15 -0
- package/dist/navigation/actions/add/add-actions.d.ts +2 -0
- package/dist/navigation/actions/add/add-actions.js +25 -0
- package/dist/navigation/actions/add/add-item-actions.d.ts +2 -0
- package/dist/navigation/actions/add/add-item-actions.js +25 -0
- package/dist/navigation/actions/add-item/add-item-actions.d.ts +3 -0
- package/dist/navigation/actions/add-item/add-item-actions.js +35 -0
- package/dist/navigation/actions/board-action-map.d.ts +10 -0
- package/dist/navigation/actions/board-action-map.js +12 -0
- package/dist/{lib/utils/default-actions.d.ts → navigation/actions/default/default-action-utils.d.ts} +2 -2
- package/dist/{lib/utils → navigation/actions/default}/default-action-utils.js +11 -10
- package/dist/navigation/actions/default/default-actions.d.ts +2 -0
- package/dist/navigation/actions/default/default-actions.js +78 -0
- package/dist/navigation/actions/input/command-line-input.d.ts +2 -0
- package/dist/navigation/actions/input/command-line-input.js +18 -0
- package/dist/navigation/actions/input/input-actions-utils.d.ts +8 -0
- package/dist/navigation/actions/input/input-actions-utils.js +47 -0
- package/dist/navigation/actions/input/input-actions.d.ts +2 -0
- package/dist/navigation/actions/input/input-actions.js +43 -0
- package/dist/navigation/actions/move/move-actions-routes.d.ts +4 -0
- package/dist/navigation/actions/move/move-actions-routes.js +55 -0
- package/dist/{lib/actions → navigation/actions/move}/move-actions-utils.d.ts +1 -1
- package/dist/{board/actions/move-actions.js → navigation/actions/move/move-actions-utils.js} +13 -9
- package/dist/navigation/actions/move/move-actions.d.ts +4 -0
- package/dist/navigation/actions/move/move-actions.js +53 -0
- package/dist/{lib/utils/default-action-utils.d.ts → navigation/actions/navigate/navigation-action-utils.d.ts} +1 -1
- package/dist/navigation/actions/navigate/navigation-actions.d.ts +2 -0
- package/dist/navigation/actions/navigate/navigation-actions.js +78 -0
- package/dist/navigation/command-line/command-line-actions.d.ts +2 -0
- package/dist/navigation/command-line/command-line-actions.js +32 -0
- package/dist/navigation/command-line/command-line-intent.d.ts +7 -0
- package/dist/navigation/command-line/command-line-intent.js +29 -0
- package/dist/navigation/command-line/command-line-sequence-actions.d.ts +2 -0
- package/dist/navigation/command-line/command-line-sequence-actions.js +31 -0
- package/dist/navigation/command-line/command-line-sequence-intent.d.ts +7 -0
- package/dist/navigation/command-line/command-line-sequence-intent.js +29 -0
- package/dist/navigation/model/action-map.model.d.ts +17 -5
- package/dist/navigation/model/action-map.model.js +2 -0
- package/dist/navigation/model/navigation-ctx.model.d.ts +2 -2
- package/dist/navigation/model/navigation-tree.model.d.ts +1 -0
- package/dist/navigation/navigation.d.ts +1 -1
- package/dist/navigation/navigation.js +48 -34
- package/dist/navigation/state/command-line.state.d.ts +13 -0
- package/dist/navigation/state/command-line.state.js +43 -0
- package/dist/navigation/state/state.d.ts +7 -6
- package/dist/navigation/state/state.js +31 -2
- package/dist/navigation/utils/get-command-line-intent.d.ts +3 -0
- package/dist/navigation/utils/get-command-line-intent.js +17 -0
- package/dist/navigation/utils/getKeyIntent.d.ts +5 -0
- package/dist/navigation/utils/getKeyIntent.js +71 -0
- package/dist/navigation/utils/key-intent.d.ts +19 -10
- package/dist/navigation/utils/key-intent.js +103 -43
- package/package.json +2 -2
- package/dist/board/actions/board-action-map.d.ts +0 -11
- package/dist/board/actions/board-action-map.js +0 -11
- package/dist/board/actions/move-actions-routes.d.ts +0 -4
- package/dist/board/actions/move-actions-routes.js +0 -31
- package/dist/board/actions/move-actions.d.ts +0 -5
- package/dist/board/board-action-map.d.ts +0 -9
- package/dist/board/board-action-map.js +0 -7
- package/dist/board/move-actions-routes.d.ts +0 -4
- package/dist/board/move-actions-routes.js +0 -31
- package/dist/board/move-actions.d.ts +0 -5
- package/dist/board/move-actions.js +0 -49
- package/dist/components/Board.d.ts +0 -6
- package/dist/components/Board.js +0 -15
- package/dist/components/Help.js +0 -21
- package/dist/components/Swimlane.d.ts +0 -8
- package/dist/components/Swimlane.js +0 -10
- package/dist/components/TicketListItem.d.ts +0 -6
- package/dist/components/TicketListItem.js +0 -12
- package/dist/lib/actions/board-action-map.d.ts +0 -9
- package/dist/lib/actions/board-action-map.js +0 -7
- package/dist/lib/actions/move-actions-utils.js +0 -43
- package/dist/lib/actions/move-actions.d.ts +0 -4
- package/dist/lib/actions/move-actions.js +0 -31
- package/dist/lib/board/board-action-map.d.ts +0 -9
- package/dist/lib/board/board-action-map.js +0 -7
- package/dist/lib/board/move-actions-routes.d.ts +0 -4
- package/dist/lib/board/move-actions-routes.js +0 -31
- package/dist/lib/board/move-actions.d.ts +0 -5
- package/dist/lib/board/move-actions.js +0 -43
- package/dist/lib/board-utils.d.ts +0 -7
- package/dist/lib/board-utils.js +0 -33
- package/dist/lib/default-actions-routes.d.ts +0 -4
- package/dist/lib/default-actions-routes.js +0 -47
- package/dist/lib/default-actions.d.ts +0 -4
- package/dist/lib/default-actions.js +0 -47
- package/dist/lib/navigation-context.d.ts +0 -16
- package/dist/lib/navigation.d.ts +0 -10
- package/dist/lib/navigation.js +0 -74
- package/dist/lib/render-utils.d.ts +0 -10
- package/dist/lib/render-utils.js +0 -12
- package/dist/lib/state.d.ts +0 -8
- package/dist/lib/state.js +0 -8
- package/dist/lib/types/action-map.model.d.ts +0 -14
- package/dist/lib/types/action-map.model.js +0 -4
- package/dist/lib/types/board.model.d.ts +0 -21
- package/dist/lib/types/board.model.js +0 -5
- package/dist/lib/types/navigation.model.d.ts +0 -9
- package/dist/lib/utils/array-utils.d.ts +0 -5
- package/dist/lib/utils/array-utils.js +0 -7
- package/dist/lib/utils/default-actions.js +0 -50
- package/dist/lib/utils/key-intent.d.ts +0 -16
- package/dist/lib/utils/key-intent.js +0 -65
- package/dist/lib/utils.d.ts +0 -10
- package/dist/lib/utils.js +0 -12
- package/dist/mock/board.d.ts +0 -2
- package/dist/mock/board.js +0 -139
- package/dist/navigation/actions/default-actions-routes.d.ts +0 -4
- package/dist/navigation/actions/default-actions-routes.js +0 -47
- package/dist/navigation/actions/default-actions.d.ts +0 -7
- /package/dist/navigation/actions/{default-actions.js → navigate/navigation-action-utils.js} +0 -0
- /package/dist/{lib/navigation-context.js → navigation/navigation-ctx.d.ts} +0 -0
- /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
|
|
8
|
-
const
|
|
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(
|
|
11
|
-
|
|
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
|
|
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, {
|
|
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,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
|
+
};
|
|
@@ -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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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, {
|
|
17
|
-
React.createElement(
|
|
18
|
-
|
|
19
|
-
React.createElement(
|
|
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
|
-
|
|
7
|
-
|
|
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(
|
|
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.
|
|
19
|
+
isTicketContext && navigationState.currentNode && (React.createElement(TicketUI, { width: width * items.length, item: navigationState.breadCrumb[navigationState.breadCrumb.length - 1] }))));
|
|
20
20
|
};
|
|
@@ -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 ===
|
|
7
|
-
? '
|
|
7
|
+
React.createElement(Text, { color: ticket.isSelected && navigationState.mode === Mode.MOVE
|
|
8
|
+
? 'cyan'
|
|
8
9
|
: ticket.isSelected
|
|
9
10
|
? 'cyan'
|
|
10
|
-
: navigationState.mode ===
|
|
11
|
+
: navigationState.mode === Mode.MOVE
|
|
11
12
|
? 'gray'
|
|
12
|
-
: 'white' }, truncateWithEllipsis(ticket.
|
|
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
|
-
|
|
5
|
-
React.createElement(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
};
|