epiq 0.0.3 → 0.0.5
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 +4 -5
- package/dist/board/components/Board.js +2 -2
- package/dist/board/components/CommandLine.js +11 -4
- package/dist/board/components/ContextBar.js +12 -3
- package/dist/board/components/Help.js +4 -4
- package/dist/board/components/Swimlane.d.ts +1 -0
- package/dist/board/components/Swimlane.js +3 -4
- package/dist/board/components/Swimlanes.js +8 -11
- package/dist/board/components/TicketListItem.js +3 -3
- package/dist/board/components/TicketUI.js +1 -1
- package/dist/board/hints/hints.d.ts +4 -4
- package/dist/board/hints/hints.js +7 -15
- package/dist/board/mock/board.js +500 -523
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +20 -61
- package/dist/debug-logger.d.ts +1 -1
- package/dist/debug-logger.js +5 -4
- package/dist/init-project.d.ts +1 -0
- package/dist/init-project.js +1 -0
- package/dist/navigation/actions/add-item/add-item-actions.js +21 -11
- package/dist/navigation/actions/board-action-map.js +3 -3
- package/dist/navigation/actions/default/default-action-utils.d.ts +8 -7
- package/dist/navigation/actions/default/default-action-utils.js +67 -17
- package/dist/navigation/actions/default/default-actions.js +30 -44
- package/dist/navigation/actions/default/navigation-action-utils.d.ts +16 -0
- package/dist/navigation/actions/default/navigation-action-utils.js +109 -0
- package/dist/navigation/actions/input/command-line-input.js +4 -4
- package/dist/navigation/actions/input/input-actions.js +13 -12
- package/dist/navigation/actions/move/move-actions-utils.d.ts +4 -5
- package/dist/navigation/actions/move/move-actions-utils.js +44 -31
- package/dist/navigation/actions/move/move-actions.js +17 -11
- package/dist/navigation/command-line/command-line-sequence-actions.d.ts +1 -1
- package/dist/navigation/command-line/command-line-sequence-actions.js +24 -11
- package/dist/navigation/command-line/command-line-sequence-intent.d.ts +3 -2
- package/dist/navigation/command-line/command-line-sequence-intent.js +13 -10
- package/dist/navigation/command-line/commands.d.ts +2 -0
- package/dist/navigation/command-line/commands.js +58 -0
- package/dist/navigation/keypress-listener.d.ts +1 -0
- package/dist/navigation/keypress-listener.js +33 -0
- package/dist/navigation/model/action-map.model.d.ts +4 -4
- package/dist/navigation/model/navigation-ctx.model.d.ts +1 -16
- package/dist/navigation/model/navigation-ctx.model.js +0 -1
- package/dist/navigation/model/navigation-tree.model.d.ts +2 -1
- package/dist/navigation/navigation.d.ts +3 -10
- package/dist/navigation/navigation.js +73 -79
- package/dist/navigation/state/command-line.state.d.ts +5 -0
- package/dist/navigation/state/command-line.state.js +21 -4
- package/dist/navigation/state/state.d.ts +17 -9
- package/dist/navigation/state/state.js +34 -35
- package/dist/navigation/utils/get-command-line-intent.d.ts +2 -2
- package/dist/navigation/utils/get-command-line-intent.js +7 -7
- package/dist/navigation/utils/key-intent.d.ts +5 -5
- package/dist/navigation/utils/key-intent.js +68 -74
- package/package.json +2 -2
- package/readme.md +54 -17
package/dist/app.js
CHANGED
|
@@ -4,7 +4,7 @@ import { BoardUI } from './board/components/Board.js';
|
|
|
4
4
|
import { ContextBar } from './board/components/ContextBar.js';
|
|
5
5
|
import { HelpUI } from './board/components/Help.js';
|
|
6
6
|
import { Mode } from './navigation/model/action-map.model.js';
|
|
7
|
-
import {
|
|
7
|
+
import { appState } from './navigation/state/state.js';
|
|
8
8
|
export default function App({ board }) {
|
|
9
9
|
const width = process.stdout.columns || 120;
|
|
10
10
|
const swimlaneMaxWidth = Math.floor(process.stdout.columns / 3);
|
|
@@ -12,8 +12,7 @@ export default function App({ board }) {
|
|
|
12
12
|
const renderedWidth = swimlaneDynamicWidth * board.children.length;
|
|
13
13
|
const swimlaneWidth = Math.min(renderedWidth, swimlaneMaxWidth);
|
|
14
14
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
15
|
-
!(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
navigationState.mode === Mode.HELP && React.createElement(HelpUI, { width: renderedWidth })));
|
|
15
|
+
!(appState.mode === Mode.HELP) && (React.createElement(BoardUI, { board: board, swimlaneWidth: swimlaneWidth })),
|
|
16
|
+
appState.mode === Mode.HELP && React.createElement(HelpUI, { width: renderedWidth }),
|
|
17
|
+
React.createElement(ContextBar, { width: width })));
|
|
19
18
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { appState } from '../../navigation/state/state.js';
|
|
4
4
|
import { BoardContentUI } from './Swimlanes.js';
|
|
5
5
|
export const BoardUI = ({ board, swimlaneWidth, }) => {
|
|
6
6
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
7
7
|
React.createElement(Box, { paddingLeft: 1 },
|
|
8
|
-
React.createElement(Text, null,
|
|
8
|
+
React.createElement(Text, null, appState.breadCrumb.map(b => ' > ' + b.name))),
|
|
9
9
|
React.createElement(Box, { flexDirection: "row" },
|
|
10
10
|
React.createElement(BoardContentUI, { items: board.children, width: swimlaneWidth }))));
|
|
11
11
|
};
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
|
-
import { getCommandLineInput } from '../../navigation/state/command-line.state.js';
|
|
3
|
+
import { getCommandLineInput, subscribeCommandLineState, } from '../../navigation/state/command-line.state.js';
|
|
4
4
|
const roleColors = {
|
|
5
5
|
command: 'cyan',
|
|
6
6
|
argument: 'white',
|
|
7
7
|
};
|
|
8
8
|
export const CommandLine = () => {
|
|
9
|
-
const input = getCommandLineInput();
|
|
10
|
-
|
|
9
|
+
const [input, setInput] = useState(getCommandLineInput());
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
const unsubscribe = subscribeCommandLineState(() => {
|
|
12
|
+
setInput(getCommandLineInput());
|
|
13
|
+
});
|
|
14
|
+
return () => {
|
|
15
|
+
unsubscribe();
|
|
16
|
+
};
|
|
17
|
+
}, []);
|
|
11
18
|
const [command, ...rest] = input.split(' ');
|
|
12
19
|
const argument = rest.join(' ');
|
|
13
20
|
return (React.createElement(Box, null,
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Mode } from '../../navigation/model/action-map.model.js';
|
|
4
|
-
import {
|
|
4
|
+
import { appState } from '../../navigation/state/state.js';
|
|
5
5
|
import { CommandLine } from './CommandLine.js';
|
|
6
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,
|
|
8
|
-
React.createElement(
|
|
7
|
+
React.createElement(Box, null, appState.mode === Mode.COMMAND_LINE ? (React.createElement(CommandLine, null)) : (React.createElement(Box, { flexDirection: "row", gap: 2 },
|
|
8
|
+
React.createElement(Text, null, "\uD83D\uDCA1"),
|
|
9
|
+
appState.availableHints.map((x, index) => {
|
|
10
|
+
const [command, ...rest] = x.split(' ');
|
|
11
|
+
const argument = rest.join(' ');
|
|
12
|
+
return (React.createElement(Box, { key: index },
|
|
13
|
+
React.createElement(Text, { color: "cyan" }, command),
|
|
14
|
+
argument && (React.createElement(React.Fragment, null,
|
|
15
|
+
React.createElement(Text, null, " "),
|
|
16
|
+
React.createElement(Text, { color: "gray" }, argument)))));
|
|
17
|
+
}))))));
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
|
-
import {
|
|
2
|
+
import { appState } from '../../navigation/state/state.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Mode } from '../../navigation/model/action-map.model.js';
|
|
5
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 },
|
|
6
|
+
React.createElement(Box, { flexDirection: "column", width: width }, appState.mode === Mode.HELP
|
|
7
7
|
? [
|
|
8
8
|
{
|
|
9
9
|
action: '',
|
|
10
10
|
description: '[COMMAND] DESCRIPTION',
|
|
11
|
-
mode:
|
|
11
|
+
mode: appState.mode,
|
|
12
12
|
},
|
|
13
|
-
...
|
|
13
|
+
...appState.availableActions,
|
|
14
14
|
]
|
|
15
15
|
.filter(action => Boolean(action.description))
|
|
16
16
|
// .filter(x => x.mode === navigationState.mode)
|
|
@@ -2,10 +2,9 @@ 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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return (React.createElement(Box, { flexDirection: "column", width: width, borderStyle: "round", borderColor: item.isSelected ? 'cyan' : 'gray', paddingRight: 1, paddingLeft: 1, minHeight: 15, height: 20 },
|
|
5
|
+
export const SwimlaneUI = ({ item, isSelected, width }) => {
|
|
6
|
+
const color = isSelected ? 'cyan' : 'gray';
|
|
7
|
+
return (React.createElement(Box, { flexDirection: "column", width: width, borderStyle: "round", borderColor: 'gray', paddingRight: 1, paddingLeft: 1, minHeight: 15, height: 20 },
|
|
9
8
|
React.createElement(Box, { borderStyle: "round", borderColor: color, justifyContent: "center" },
|
|
10
9
|
React.createElement(Text, { bold: true }, item.name)),
|
|
11
10
|
React.createElement(Box, { padding: 1 },
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Box } from 'ink';
|
|
3
|
-
import {
|
|
3
|
+
import { appState } from '../../navigation/state/state.js';
|
|
4
4
|
import { BoardItemTypes } from '../model/board.model.js';
|
|
5
5
|
import { SwimlaneUI } from './Swimlane.js';
|
|
6
6
|
import { TicketUI } from './TicketUI.js';
|
|
7
7
|
export const BoardContentUI = ({ items, width }) => {
|
|
8
|
-
const actionContext =
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
BoardItemTypes.
|
|
12
|
-
BoardItemTypes.SWIMLANE,
|
|
13
|
-
BoardItemTypes.TICKET_LIST_ITEM,
|
|
14
|
-
].includes(actionContext);
|
|
15
|
-
const isTicketContext = actionContext === BoardItemTypes.TICKET;
|
|
8
|
+
const actionContext = appState.currentNode.actionContext;
|
|
9
|
+
const isTicketContext = actionContext === BoardItemTypes.TICKET_LIST_ITEM;
|
|
10
|
+
const isSwimlaneContext = actionContext === BoardItemTypes.BOARD ||
|
|
11
|
+
actionContext === BoardItemTypes.SWIMLANE;
|
|
16
12
|
return (React.createElement(Box, { flexDirection: "row" },
|
|
17
13
|
isSwimlaneContext &&
|
|
18
|
-
items.map((lane, index) => (React.createElement(SwimlaneUI, { key: index, width: width,
|
|
19
|
-
|
|
14
|
+
items.map((lane, index) => (React.createElement(SwimlaneUI, { key: index, width: width, isSelected: appState.currentNode.actionContext === 'BOARD' &&
|
|
15
|
+
appState.selectedIndex === index, item: lane }))),
|
|
16
|
+
isTicketContext && appState.currentNode && (React.createElement(TicketUI, { width: width * items.length, item: appState.breadCrumb[appState.breadCrumb.length - 1] }))));
|
|
20
17
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Mode } from '../../navigation/model/action-map.model.js';
|
|
4
|
-
import {
|
|
4
|
+
import { appState } from '../../navigation/state/state.js';
|
|
5
5
|
const truncateWithEllipsis = (str, width) => str.length >= width ? str.slice(0, width - 3) + '...' : str;
|
|
6
6
|
export const TicketListItemUI = ({ width, ticket }) => (React.createElement(Box, { borderBottom: true },
|
|
7
|
-
React.createElement(Text, { color: ticket.isSelected &&
|
|
7
|
+
React.createElement(Text, { color: ticket.isSelected && appState.mode === Mode.MOVE
|
|
8
8
|
? 'cyan'
|
|
9
9
|
: ticket.isSelected
|
|
10
10
|
? 'cyan'
|
|
11
|
-
:
|
|
11
|
+
: appState.mode === Mode.MOVE
|
|
12
12
|
? 'gray'
|
|
13
13
|
: 'white' }, truncateWithEllipsis(ticket.name, width - 6))));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, Text } from 'ink';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
export const TicketUI = ({ item, width }) => (React.createElement(Box, { flexDirection: "column", padding: 1, paddingLeft: 2, borderStyle: "round", width: width, minHeight:
|
|
3
|
+
export const TicketUI = ({ item, width }) => (React.createElement(Box, { flexDirection: "column", padding: 1, paddingLeft: 2, borderStyle: "round", width: width, minHeight: 20, borderColor: "gray" }, item.children.map(child => (React.createElement(Box, { key: child.id, flexDirection: "row", borderStyle: 'round', borderColor: child.isSelected ? 'cyan' : 'gray', paddingLeft: 1 },
|
|
4
4
|
React.createElement(Box, { width: 30 },
|
|
5
5
|
React.createElement(Text, { color: "cyan" },
|
|
6
6
|
child.name,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const Hints: {
|
|
2
|
-
readonly [x: string]: readonly [] | readonly [":h Help", "hjkl:
|
|
2
|
+
readonly [x: string]: readonly [] | readonly [":h Help", "hjkl: navigate", "enter: confirm"] | readonly ["q: exit"] | readonly ["i: edit", "y: yank/move"] | readonly ["q: exit", "i: edit"] | readonly ["hjkl: move selection", "e/enter: confirm move/yank", "q: exit"] | readonly ["hjkl: move selection", "e/enter: confirm move/yank", "y: confirm move/yank", "q: exit"];
|
|
3
3
|
readonly BOARD: readonly [];
|
|
4
|
-
readonly SWIMLANE: readonly [":h Help", "hjkl:
|
|
5
|
-
readonly TICKET_LIST_ITEM: readonly ["
|
|
6
|
-
readonly TICKET: readonly ["q: exit", "
|
|
4
|
+
readonly SWIMLANE: readonly [":h Help", "hjkl: navigate", "enter: confirm"];
|
|
5
|
+
readonly TICKET_LIST_ITEM: readonly ["i: edit", "y: yank/move"];
|
|
6
|
+
readonly TICKET: readonly ["q: exit", "i: edit"];
|
|
7
7
|
};
|
|
@@ -2,27 +2,19 @@ import { Mode } from '../../navigation/model/action-map.model.js';
|
|
|
2
2
|
import { BoardItemTypes } from '../model/board.model.js';
|
|
3
3
|
export const Hints = {
|
|
4
4
|
[BoardItemTypes.BOARD]: [],
|
|
5
|
-
[BoardItemTypes.SWIMLANE]: [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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'],
|
|
5
|
+
[BoardItemTypes.SWIMLANE]: [':h Help', 'hjkl: navigate', 'enter: confirm'],
|
|
6
|
+
[BoardItemTypes.TICKET_LIST_ITEM + Mode.HELP]: ['q: exit'],
|
|
7
|
+
[BoardItemTypes.SWIMLANE + Mode.HELP]: ['q: exit'],
|
|
8
|
+
[BoardItemTypes.TICKET_LIST_ITEM]: ['i: edit', 'y: yank/move'],
|
|
9
|
+
[BoardItemTypes.TICKET]: ['q: exit', 'i: edit'],
|
|
19
10
|
[BoardItemTypes.SWIMLANE + Mode.MOVE]: [
|
|
20
11
|
'hjkl: move selection',
|
|
21
|
-
'
|
|
12
|
+
'e/enter: confirm move/yank',
|
|
22
13
|
'q: exit',
|
|
23
14
|
],
|
|
24
15
|
[BoardItemTypes.TICKET_LIST_ITEM + Mode.MOVE]: [
|
|
25
16
|
'hjkl: move selection',
|
|
17
|
+
'e/enter: confirm move/yank',
|
|
26
18
|
'y: confirm move/yank',
|
|
27
19
|
'q: exit',
|
|
28
20
|
],
|