epiq 0.0.2 → 0.0.4
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 +10 -4
- package/dist/board/components/Board.js +4 -12
- package/dist/board/components/CommandLine.d.ts +2 -0
- package/dist/board/components/CommandLine.js +26 -0
- package/dist/{components/Help.d.ts → board/components/ContextBar.d.ts} +1 -1
- package/dist/board/components/ContextBar.js +17 -0
- package/dist/board/components/Help.js +19 -12
- package/dist/board/components/Swimlane.d.ts +1 -0
- package/dist/board/components/Swimlane.js +6 -4
- package/dist/board/components/Swimlanes.js +8 -11
- package/dist/board/components/TextInput.d.ts +6 -0
- package/dist/board/components/TextInput.js +9 -0
- package/dist/board/components/TicketListItem.js +6 -5
- package/dist/board/components/TicketUI.js +6 -7
- package/dist/board/hints/hints.d.ts +7 -0
- package/dist/board/hints/hints.js +21 -0
- package/dist/board/mock/board.js +73 -27
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +21 -39
- package/dist/debug-logger.d.ts +2 -0
- package/dist/debug-logger.js +16 -0
- package/dist/init-project.d.ts +1 -0
- package/dist/init-project.js +1 -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 +45 -0
- package/dist/navigation/actions/board-action-map.d.ts +10 -0
- package/dist/navigation/actions/board-action-map.js +12 -0
- package/dist/navigation/actions/default/default-action-utils.d.ts +8 -0
- package/dist/navigation/actions/default/default-action-utils.js +101 -0
- package/dist/navigation/actions/default/default-actions.d.ts +2 -0
- package/dist/navigation/actions/default/default-actions.js +64 -0
- 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.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 +44 -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/navigation/actions/move/move-actions-utils.d.ts +4 -0
- package/dist/navigation/actions/move/move-actions-utils.js +66 -0
- package/dist/navigation/actions/move/move-actions.d.ts +4 -0
- package/dist/navigation/actions/move/move-actions.js +59 -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 +44 -0
- package/dist/navigation/command-line/command-line-sequence-intent.d.ts +8 -0
- package/dist/navigation/command-line/command-line-sequence-intent.js +32 -0
- 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 +17 -5
- package/dist/navigation/model/action-map.model.js +2 -0
- 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 +3 -1
- package/dist/navigation/navigation.d.ts +3 -10
- package/dist/navigation/navigation.js +74 -66
- package/dist/navigation/state/command-line.state.d.ts +18 -0
- package/dist/navigation/state/command-line.state.js +60 -0
- package/dist/navigation/state/state.d.ts +18 -9
- package/dist/navigation/state/state.js +36 -8
- 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 +21 -12
- package/dist/navigation/utils/key-intent.js +104 -50
- package/package.json +3 -3
- 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/actions/move-actions.js +0 -49
- 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.d.ts +0 -5
- 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-action-utils.js +0 -50
- package/dist/lib/utils/default-actions.d.ts +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/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "epiq",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"bin": "dist/cli.js",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"description": "CLI based issue
|
|
7
|
+
"description": "EPIQ - CLI based issue tracker",
|
|
8
8
|
"engines": {
|
|
9
9
|
"node": ">=16"
|
|
10
10
|
},
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"dev": "tsc --watch",
|
|
14
14
|
"test": "prettier --check . && xo && ava",
|
|
15
|
-
"
|
|
15
|
+
"start": "node dist/cli.js"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"dist"
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionMap } from '../../navigation/model/action-map.model.js';
|
|
2
|
-
import { NavigateCtx } from '../../navigation/model/navigation-ctx.model.js';
|
|
3
|
-
import { BoardItemTypes } from '../model/board.model.js';
|
|
4
|
-
type BoardActionMap = ActionMap<{
|
|
5
|
-
[BoardItemTypes.BOARD]: [NavigateCtx];
|
|
6
|
-
[BoardItemTypes.SWIMLANE]: [NavigateCtx];
|
|
7
|
-
[BoardItemTypes.TICKET_LIST_ITEM]: [NavigateCtx];
|
|
8
|
-
[BoardItemTypes.TICKET]: [NavigateCtx];
|
|
9
|
-
}>;
|
|
10
|
-
export declare const BoardActions: BoardActionMap;
|
|
11
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BoardItemTypes } from '../model/board.model.js';
|
|
2
|
-
import { moveAcrossParents, moveWithinParent } from './move-actions-routes.js';
|
|
3
|
-
export const BoardActions = {
|
|
4
|
-
[BoardItemTypes.BOARD]: [],
|
|
5
|
-
[BoardItemTypes.SWIMLANE]: [...moveWithinParent],
|
|
6
|
-
[BoardItemTypes.TICKET_LIST_ITEM]: [
|
|
7
|
-
...moveWithinParent,
|
|
8
|
-
...moveAcrossParents,
|
|
9
|
-
],
|
|
10
|
-
[BoardItemTypes.TICKET]: [],
|
|
11
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ActionEntry } from '../../navigation/model/action-map.model.js';
|
|
2
|
-
import { NavigateCtx } from '../../navigation/model/navigation-ctx.model.js';
|
|
3
|
-
export declare const moveWithinParent: ActionEntry<[NavigateCtx]>[];
|
|
4
|
-
export declare const moveAcrossParents: ActionEntry<[NavigateCtx]>[];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Mode } from '../../navigation/model/action-map.model.js';
|
|
2
|
-
import { KeyIntent } from '../../navigation/utils/key-intent.js';
|
|
3
|
-
import { moveChildNextWithinParent, moveChildPreviousWithinParent, moveChildToNextParent, moveChildToPreviousParent, } from './move-actions.js';
|
|
4
|
-
export const moveWithinParent = [
|
|
5
|
-
{
|
|
6
|
-
mode: Mode.DEFAULT,
|
|
7
|
-
description: '[SHIFT + ARROW KEYS] Move item',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
intent: KeyIntent.MovePreviousItem,
|
|
11
|
-
mode: Mode.DEFAULT,
|
|
12
|
-
action: moveChildPreviousWithinParent,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
intent: KeyIntent.MoveNextItem,
|
|
16
|
-
mode: Mode.DEFAULT,
|
|
17
|
-
action: moveChildNextWithinParent,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
export const moveAcrossParents = [
|
|
21
|
-
{
|
|
22
|
-
intent: KeyIntent.MoveToNextContainer,
|
|
23
|
-
mode: Mode.DEFAULT,
|
|
24
|
-
action: moveChildToNextParent,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
intent: KeyIntent.MoveToPreviousContainer,
|
|
28
|
-
mode: Mode.DEFAULT,
|
|
29
|
-
action: moveChildToPreviousParent,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../../navigation/model/navigation-ctx.model.js';
|
|
2
|
-
export declare const moveChildToNextParent: (ctx: NavigateCtx) => void;
|
|
3
|
-
export declare const moveChildToPreviousParent: (ctx: NavigateCtx) => void;
|
|
4
|
-
export declare const moveChildPreviousWithinParent: (ctx: NavigateCtx) => void;
|
|
5
|
-
export declare const moveChildNextWithinParent: (ctx: NavigateCtx) => void;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
function moveItemInArray({ array, from, to, }) {
|
|
2
|
-
if (from < 0 || from >= array.length || to < 0 || to >= array.length)
|
|
3
|
-
return;
|
|
4
|
-
const [item] = array.splice(from, 1);
|
|
5
|
-
if (item)
|
|
6
|
-
array.splice(to, 0, item);
|
|
7
|
-
}
|
|
8
|
-
function moveNodeToSiblingContainer(ctx, direction) {
|
|
9
|
-
const ancestors = ctx.breadCrumb;
|
|
10
|
-
const parent = ancestors.at(-1);
|
|
11
|
-
const grandParent = ancestors.at(-2);
|
|
12
|
-
if (!parent || !grandParent)
|
|
13
|
-
return;
|
|
14
|
-
const parentIndex = grandParent.children.findIndex(x => x.id === parent.id);
|
|
15
|
-
const targetIndex = parentIndex + direction;
|
|
16
|
-
if (parentIndex < 0 ||
|
|
17
|
-
targetIndex < 0 ||
|
|
18
|
-
targetIndex >= grandParent.children.length)
|
|
19
|
-
return;
|
|
20
|
-
const sibling = grandParent.children[targetIndex];
|
|
21
|
-
if (!sibling)
|
|
22
|
-
return;
|
|
23
|
-
if (!sibling?.children?.length && !Array.isArray(sibling.children))
|
|
24
|
-
return;
|
|
25
|
-
const currentIndex = ctx._selectedIndex;
|
|
26
|
-
if (currentIndex < 0 || currentIndex >= parent.children.length)
|
|
27
|
-
return;
|
|
28
|
-
const [node] = parent.children.splice(currentIndex, 1);
|
|
29
|
-
sibling.children.push(node);
|
|
30
|
-
const newBreadCrumb = [...ctx.breadCrumb.slice(0, -1), sibling];
|
|
31
|
-
const newIndex = sibling.children.length - 1;
|
|
32
|
-
ctx.reInvokeNavigate(newIndex, newBreadCrumb);
|
|
33
|
-
}
|
|
34
|
-
export const moveChildToNextParent = (ctx) => moveNodeToSiblingContainer(ctx, 1);
|
|
35
|
-
export const moveChildToPreviousParent = (ctx) => moveNodeToSiblingContainer(ctx, -1);
|
|
36
|
-
function moveChildWithinParent(ctx, direction) {
|
|
37
|
-
const from = ctx._selectedIndex;
|
|
38
|
-
const to = from + direction;
|
|
39
|
-
if (to < 0 || to >= ctx.navigationNode.children.length)
|
|
40
|
-
return;
|
|
41
|
-
moveItemInArray({
|
|
42
|
-
array: ctx.navigationNode.children,
|
|
43
|
-
from,
|
|
44
|
-
to,
|
|
45
|
-
});
|
|
46
|
-
ctx.select(to);
|
|
47
|
-
}
|
|
48
|
-
export const moveChildPreviousWithinParent = (ctx) => moveChildWithinParent(ctx, -1);
|
|
49
|
-
export const moveChildNextWithinParent = (ctx) => moveChildWithinParent(ctx, 1);
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ActionMap } from '../navigation/model/action-map.model.js';
|
|
2
|
-
import { NavigateCtx } from '../navigation/model/navigation-ctx.model.js';
|
|
3
|
-
type BoardActionMap = ActionMap<{
|
|
4
|
-
BOARD: [NavigateCtx];
|
|
5
|
-
SWIMLANE: [NavigateCtx];
|
|
6
|
-
TICKET: [NavigateCtx];
|
|
7
|
-
}>;
|
|
8
|
-
export declare const BoardActions: BoardActionMap;
|
|
9
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BoardItemTypes } from './model/board.model.js';
|
|
2
|
-
import { moveAcrossParents, moveWithinParent, } from './actions/move-actions-routes.js';
|
|
3
|
-
export const BoardActions = {
|
|
4
|
-
[BoardItemTypes.BOARD]: [],
|
|
5
|
-
[BoardItemTypes.SWIMLANE]: [...moveWithinParent],
|
|
6
|
-
[BoardItemTypes.TICKET]: [...moveWithinParent, ...moveAcrossParents],
|
|
7
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ActionEntry } from '../navigation/model/action-map.model.js';
|
|
2
|
-
import { NavigateCtx } from '../navigation/model/navigation-ctx.model.js';
|
|
3
|
-
export declare const moveWithinParent: ActionEntry<[NavigateCtx]>[];
|
|
4
|
-
export declare const moveAcrossParents: ActionEntry<[NavigateCtx]>[];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Mode } from '../navigation/model/action-map.model.js';
|
|
2
|
-
import { KeyIntent } from '../navigation/utils/key-intent.js';
|
|
3
|
-
import { moveChildNextWithinParent, moveChildPreviousWithinParent, moveChildToNextParent, moveChildToPreviousParent, } from './move-actions.js';
|
|
4
|
-
export const moveWithinParent = [
|
|
5
|
-
{
|
|
6
|
-
mode: Mode.DEFAULT,
|
|
7
|
-
description: '[SHIFT + ARROW KEYS] Move item',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
intent: KeyIntent.MovePreviousItem,
|
|
11
|
-
mode: Mode.DEFAULT,
|
|
12
|
-
action: moveChildPreviousWithinParent,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
intent: KeyIntent.MoveNextItem,
|
|
16
|
-
mode: Mode.DEFAULT,
|
|
17
|
-
action: moveChildNextWithinParent,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
export const moveAcrossParents = [
|
|
21
|
-
{
|
|
22
|
-
intent: KeyIntent.MoveToNextContainer,
|
|
23
|
-
mode: Mode.DEFAULT,
|
|
24
|
-
action: moveChildToNextParent,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
intent: KeyIntent.MoveToPreviousContainer,
|
|
28
|
-
mode: Mode.DEFAULT,
|
|
29
|
-
action: moveChildToPreviousParent,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../navigation/model/navigation-ctx.model.js';
|
|
2
|
-
export declare const moveChildToNextParent: (ctx: NavigateCtx) => void;
|
|
3
|
-
export declare const moveChildToPreviousParent: (ctx: NavigateCtx) => void;
|
|
4
|
-
export declare const moveChildPreviousWithinParent: (ctx: NavigateCtx) => void;
|
|
5
|
-
export declare const moveChildNextWithinParent: (ctx: NavigateCtx) => void;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
function moveItemInArray({ array, from, to, }) {
|
|
2
|
-
if (from < 0 || from >= array.length || to < 0 || to >= array.length)
|
|
3
|
-
return;
|
|
4
|
-
const [item] = array.splice(from, 1);
|
|
5
|
-
if (item)
|
|
6
|
-
array.splice(to, 0, item);
|
|
7
|
-
}
|
|
8
|
-
function moveNodeToSiblingContainer(ctx, direction) {
|
|
9
|
-
const ancestors = ctx.breadCrumb;
|
|
10
|
-
const parent = ancestors.at(-1);
|
|
11
|
-
const grandParent = ancestors.at(-2);
|
|
12
|
-
if (!parent || !grandParent)
|
|
13
|
-
return;
|
|
14
|
-
const parentIndex = grandParent.children.findIndex(x => x.id === parent.id);
|
|
15
|
-
const targetIndex = parentIndex + direction;
|
|
16
|
-
if (parentIndex < 0 ||
|
|
17
|
-
targetIndex < 0 ||
|
|
18
|
-
targetIndex >= grandParent.children.length)
|
|
19
|
-
return;
|
|
20
|
-
const sibling = grandParent.children[targetIndex];
|
|
21
|
-
if (!sibling)
|
|
22
|
-
return;
|
|
23
|
-
if (!sibling?.children?.length && !Array.isArray(sibling.children))
|
|
24
|
-
return;
|
|
25
|
-
const currentIndex = ctx._selectedIndex;
|
|
26
|
-
if (currentIndex < 0 || currentIndex >= parent.children.length)
|
|
27
|
-
return;
|
|
28
|
-
const [node] = parent.children.splice(currentIndex, 1);
|
|
29
|
-
sibling.children.push(node);
|
|
30
|
-
const newBreadCrumb = [...ctx.breadCrumb.slice(0, -1), sibling];
|
|
31
|
-
const newIndex = sibling.children.length - 1;
|
|
32
|
-
ctx.reInvokeNavigate(newIndex, newBreadCrumb);
|
|
33
|
-
}
|
|
34
|
-
export const moveChildToNextParent = (ctx) => moveNodeToSiblingContainer(ctx, 1);
|
|
35
|
-
export const moveChildToPreviousParent = (ctx) => moveNodeToSiblingContainer(ctx, -1);
|
|
36
|
-
function moveChildWithinParent(ctx, direction) {
|
|
37
|
-
const from = ctx._selectedIndex;
|
|
38
|
-
const to = from + direction;
|
|
39
|
-
if (to < 0 || to >= ctx.navigationNode.children.length)
|
|
40
|
-
return;
|
|
41
|
-
moveItemInArray({
|
|
42
|
-
array: ctx.navigationNode.children,
|
|
43
|
-
from,
|
|
44
|
-
to,
|
|
45
|
-
});
|
|
46
|
-
ctx.select(to);
|
|
47
|
-
}
|
|
48
|
-
export const moveChildPreviousWithinParent = (ctx) => moveChildWithinParent(ctx, -1);
|
|
49
|
-
export const moveChildNextWithinParent = (ctx) => moveChildWithinParent(ctx, 1);
|
package/dist/components/Board.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Box, Text, useApp, useInput } from 'ink';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { SwimlaneUI } from './Swimlane.js';
|
|
4
|
-
export const BoardUI = ({ board, swimlaneWidth, }) => {
|
|
5
|
-
const { exit } = useApp();
|
|
6
|
-
useInput((input, key) => {
|
|
7
|
-
if (key.escape || input === 'q') {
|
|
8
|
-
exit();
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
return (React.createElement(Box, { flexDirection: "column" },
|
|
12
|
-
React.createElement(Text, null, board.name.toUpperCase()),
|
|
13
|
-
React.createElement(Box, { flexDirection: "row" },
|
|
14
|
-
React.createElement(SwimlaneUI, { items: board.children, width: swimlaneWidth }))));
|
|
15
|
-
};
|
package/dist/components/Help.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from 'ink';
|
|
2
|
-
import { navigationState } from '../lib/state.js';
|
|
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" }, "Toggle help with \"H\"")),
|
|
7
|
-
navigationState.viewHelp
|
|
8
|
-
? navigationState.availableActions
|
|
9
|
-
.filter(action => Boolean(action.description))
|
|
10
|
-
.filter(x => x.mode === navigationState.mode)
|
|
11
|
-
.map((action, index) => {
|
|
12
|
-
const [leftRaw, rightRaw] = action.description.split(']');
|
|
13
|
-
const left = leftRaw?.replace('[', '');
|
|
14
|
-
const right = rightRaw?.trim(); // no extra space
|
|
15
|
-
return (React.createElement(Box, { paddingLeft: 1, key: index, flexDirection: "row" },
|
|
16
|
-
React.createElement(Box, { width: 20 },
|
|
17
|
-
React.createElement(Text, { color: "gray" }, right)),
|
|
18
|
-
React.createElement(Box, { flexGrow: 1 },
|
|
19
|
-
React.createElement(Text, { color: "gray" }, left))));
|
|
20
|
-
})
|
|
21
|
-
: null));
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Box, Text } from 'ink';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { TicketListItemUI } from './TicketListItem.js';
|
|
4
|
-
export const SwimlaneUI = ({ items, width }) => {
|
|
5
|
-
return (React.createElement(Box, { flexDirection: "row" }, items.map((lane, index) => (React.createElement(React.Fragment, { key: index },
|
|
6
|
-
React.createElement(Box, { flexDirection: "column", width: width, borderStyle: "round", borderColor: lane.isSelected ? 'green' : 'gray', paddingRight: 1, paddingLeft: 1, paddingBottom: 1, minHeight: 15 },
|
|
7
|
-
React.createElement(Box, { borderStyle: "round", borderColor: 'gray', justifyContent: "center" },
|
|
8
|
-
React.createElement(Text, { bold: true }, lane.name)),
|
|
9
|
-
lane.children.map((ticket, index) => (React.createElement(TicketListItemUI, { key: index, width: width, ticket: ticket })))))))));
|
|
10
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Box, Text } from 'ink';
|
|
3
|
-
import { navigationState } from '../lib/state.js';
|
|
4
|
-
const truncateWithEllipsis = (str, width) => str.length >= width ? str.slice(0, width - 3) + '...' : str;
|
|
5
|
-
export const TicketListItemUI = ({ width, ticket: { name, id, isSelected }, }) => (React.createElement(Box, { borderBottom: true },
|
|
6
|
-
React.createElement(Text, { color: isSelected && navigationState.mode === 'move'
|
|
7
|
-
? 'white'
|
|
8
|
-
: isSelected
|
|
9
|
-
? 'green'
|
|
10
|
-
: navigationState.mode === 'move'
|
|
11
|
-
? 'gray'
|
|
12
|
-
: 'white' }, truncateWithEllipsis(id + ' - ' + name, width - 5))));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../navigation-context.js';
|
|
2
|
-
import { ActionMap } from '../types/action-map.model.js';
|
|
3
|
-
type BoardActionMap = ActionMap<{
|
|
4
|
-
BOARD: [NavigateCtx];
|
|
5
|
-
SWIMLANE: [NavigateCtx];
|
|
6
|
-
TICKET: [NavigateCtx];
|
|
7
|
-
}>;
|
|
8
|
-
export declare const BoardActions: BoardActionMap;
|
|
9
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BoardItemTypes } from '../types/board.model.js';
|
|
2
|
-
import { moveAcrossParents, moveWithinParent } from './move-actions.js';
|
|
3
|
-
export const BoardActions = {
|
|
4
|
-
[BoardItemTypes.BOARD]: [],
|
|
5
|
-
[BoardItemTypes.SWIMLANE]: [...moveWithinParent],
|
|
6
|
-
[BoardItemTypes.TICKET]: [...moveWithinParent, ...moveAcrossParents],
|
|
7
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../navigation-context.js';
|
|
2
|
-
export declare const moveChildToNextParent: (ctx: NavigateCtx) => void;
|
|
3
|
-
export declare const moveChildToPreviousParent: (ctx: NavigateCtx) => void;
|
|
4
|
-
export declare const moveChildPreviousWithinParent: (ctx: NavigateCtx) => void;
|
|
5
|
-
export declare const moveChildNextWithinParent: (ctx: NavigateCtx) => void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { moveItemInArray } from '../utils/array-utils.js';
|
|
2
|
-
function moveNodeToSiblingContainer(ctx, direction) {
|
|
3
|
-
const ancestors = ctx.breadCrumb;
|
|
4
|
-
const parent = ancestors.at(-1);
|
|
5
|
-
const grandParent = ancestors.at(-2);
|
|
6
|
-
if (!parent || !grandParent)
|
|
7
|
-
return;
|
|
8
|
-
const parentIndex = grandParent.children.findIndex(x => x.id === parent.id);
|
|
9
|
-
const targetIndex = parentIndex + direction;
|
|
10
|
-
if (parentIndex < 0 ||
|
|
11
|
-
targetIndex < 0 ||
|
|
12
|
-
targetIndex >= grandParent.children.length)
|
|
13
|
-
return;
|
|
14
|
-
const sibling = grandParent.children[targetIndex];
|
|
15
|
-
if (!sibling)
|
|
16
|
-
return;
|
|
17
|
-
if (!sibling?.children?.length && !Array.isArray(sibling.children))
|
|
18
|
-
return;
|
|
19
|
-
const currentIndex = ctx._selectedIndex;
|
|
20
|
-
if (currentIndex < 0 || currentIndex >= parent.children.length)
|
|
21
|
-
return;
|
|
22
|
-
const [node] = parent.children.splice(currentIndex, 1);
|
|
23
|
-
sibling.children.push(node);
|
|
24
|
-
const newBreadCrumb = [...ctx.breadCrumb.slice(0, -1), sibling];
|
|
25
|
-
const newIndex = sibling.children.length - 1;
|
|
26
|
-
ctx.reInvokeNavigate(newIndex, newBreadCrumb);
|
|
27
|
-
}
|
|
28
|
-
export const moveChildToNextParent = (ctx) => moveNodeToSiblingContainer(ctx, 1);
|
|
29
|
-
export const moveChildToPreviousParent = (ctx) => moveNodeToSiblingContainer(ctx, -1);
|
|
30
|
-
function moveChildWithinParent(ctx, direction) {
|
|
31
|
-
const from = ctx._selectedIndex;
|
|
32
|
-
const to = from + direction;
|
|
33
|
-
if (to < 0 || to >= ctx.navigationNode.children.length)
|
|
34
|
-
return;
|
|
35
|
-
moveItemInArray({
|
|
36
|
-
array: ctx.navigationNode.children,
|
|
37
|
-
from,
|
|
38
|
-
to,
|
|
39
|
-
});
|
|
40
|
-
ctx.select(to);
|
|
41
|
-
}
|
|
42
|
-
export const moveChildPreviousWithinParent = (ctx) => moveChildWithinParent(ctx, -1);
|
|
43
|
-
export const moveChildNextWithinParent = (ctx) => moveChildWithinParent(ctx, 1);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Mode } from '../types/action-map.model.js';
|
|
2
|
-
import { KeyIntent } from '../utils/key-intent.js';
|
|
3
|
-
import { moveChildNextWithinParent, moveChildPreviousWithinParent, moveChildToNextParent, moveChildToPreviousParent, } from './move-actions-utils.js';
|
|
4
|
-
export const moveWithinParent = [
|
|
5
|
-
{
|
|
6
|
-
mode: Mode.DEFAULT,
|
|
7
|
-
description: '[Shift + direction] Move item',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
intent: KeyIntent.MovePreviousItem,
|
|
11
|
-
mode: Mode.DEFAULT,
|
|
12
|
-
action: moveChildPreviousWithinParent,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
intent: KeyIntent.MoveNextItem,
|
|
16
|
-
mode: Mode.DEFAULT,
|
|
17
|
-
action: moveChildNextWithinParent,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
export const moveAcrossParents = [
|
|
21
|
-
{
|
|
22
|
-
intent: KeyIntent.MoveToNextContainer,
|
|
23
|
-
mode: Mode.DEFAULT,
|
|
24
|
-
action: moveChildToNextParent,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
intent: KeyIntent.MoveToPreviousContainer,
|
|
28
|
-
mode: Mode.DEFAULT,
|
|
29
|
-
action: moveChildToPreviousParent,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../navigation-context.js';
|
|
2
|
-
import { ActionMap } from '../types/action-map.model.js';
|
|
3
|
-
type BoardActionMap = ActionMap<{
|
|
4
|
-
BOARD: [NavigateCtx];
|
|
5
|
-
SWIMLANE: [NavigateCtx];
|
|
6
|
-
TICKET: [NavigateCtx];
|
|
7
|
-
}>;
|
|
8
|
-
export declare const BoardActions: BoardActionMap;
|
|
9
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BoardItemTypes } from '../types/board.model.js';
|
|
2
|
-
import { moveAcrossParents, moveWithinParent } from './move-actions-routes.js';
|
|
3
|
-
export const BoardActions = {
|
|
4
|
-
[BoardItemTypes.BOARD]: [],
|
|
5
|
-
[BoardItemTypes.SWIMLANE]: [...moveWithinParent],
|
|
6
|
-
[BoardItemTypes.TICKET]: [...moveWithinParent, ...moveAcrossParents],
|
|
7
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Mode } from '../types/action-map.model.js';
|
|
2
|
-
import { KeyIntent } from '../utils/key-intent.js';
|
|
3
|
-
import { moveChildNextWithinParent, moveChildPreviousWithinParent, moveChildToNextParent, moveChildToPreviousParent, } from './move-actions.js';
|
|
4
|
-
export const moveWithinParent = [
|
|
5
|
-
{
|
|
6
|
-
mode: Mode.DEFAULT,
|
|
7
|
-
description: '[Shift + direction] Move item',
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
intent: KeyIntent.MovePreviousItem,
|
|
11
|
-
mode: Mode.DEFAULT,
|
|
12
|
-
action: moveChildPreviousWithinParent,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
intent: KeyIntent.MoveNextItem,
|
|
16
|
-
mode: Mode.DEFAULT,
|
|
17
|
-
action: moveChildNextWithinParent,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
export const moveAcrossParents = [
|
|
21
|
-
{
|
|
22
|
-
intent: KeyIntent.MoveToNextContainer,
|
|
23
|
-
mode: Mode.DEFAULT,
|
|
24
|
-
action: moveChildToNextParent,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
intent: KeyIntent.MoveToPreviousContainer,
|
|
28
|
-
mode: Mode.DEFAULT,
|
|
29
|
-
action: moveChildToPreviousParent,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { NavigateCtx } from '../navigation-context.js';
|
|
2
|
-
export declare const moveChildToNextParent: (ctx: NavigateCtx) => void;
|
|
3
|
-
export declare const moveChildToPreviousParent: (ctx: NavigateCtx) => void;
|
|
4
|
-
export declare const moveChildPreviousWithinParent: (ctx: NavigateCtx) => void;
|
|
5
|
-
export declare const moveChildNextWithinParent: (ctx: NavigateCtx) => void;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { moveItemInArray } from '../utils/array-utils.js';
|
|
2
|
-
function moveNodeToSiblingContainer(ctx, direction) {
|
|
3
|
-
const ancestors = ctx.breadCrumb;
|
|
4
|
-
const parent = ancestors.at(-1);
|
|
5
|
-
const grandParent = ancestors.at(-2);
|
|
6
|
-
if (!parent || !grandParent)
|
|
7
|
-
return;
|
|
8
|
-
const parentIndex = grandParent.children.findIndex(x => x.id === parent.id);
|
|
9
|
-
const targetIndex = parentIndex + direction;
|
|
10
|
-
if (parentIndex < 0 ||
|
|
11
|
-
targetIndex < 0 ||
|
|
12
|
-
targetIndex >= grandParent.children.length)
|
|
13
|
-
return;
|
|
14
|
-
const sibling = grandParent.children[targetIndex];
|
|
15
|
-
if (!sibling)
|
|
16
|
-
return;
|
|
17
|
-
if (!sibling?.children?.length && !Array.isArray(sibling.children))
|
|
18
|
-
return;
|
|
19
|
-
const currentIndex = ctx._selectedIndex;
|
|
20
|
-
if (currentIndex < 0 || currentIndex >= parent.children.length)
|
|
21
|
-
return;
|
|
22
|
-
const [node] = parent.children.splice(currentIndex, 1);
|
|
23
|
-
sibling.children.push(node);
|
|
24
|
-
const newBreadCrumb = [...ctx.breadCrumb.slice(0, -1), sibling];
|
|
25
|
-
const newIndex = sibling.children.length - 1;
|
|
26
|
-
ctx.reInvokeNavigate(newIndex, newBreadCrumb);
|
|
27
|
-
}
|
|
28
|
-
export const moveChildToNextParent = (ctx) => moveNodeToSiblingContainer(ctx, 1);
|
|
29
|
-
export const moveChildToPreviousParent = (ctx) => moveNodeToSiblingContainer(ctx, -1);
|
|
30
|
-
function moveChildWithinParent(ctx, direction) {
|
|
31
|
-
const from = ctx._selectedIndex;
|
|
32
|
-
const to = from + direction;
|
|
33
|
-
if (to < 0 || to >= ctx.navigationNode.children.length)
|
|
34
|
-
return;
|
|
35
|
-
moveItemInArray({
|
|
36
|
-
array: ctx.navigationNode.children,
|
|
37
|
-
from,
|
|
38
|
-
to,
|
|
39
|
-
});
|
|
40
|
-
ctx.select(to);
|
|
41
|
-
}
|
|
42
|
-
export const moveChildPreviousWithinParent = (ctx) => moveChildWithinParent(ctx, -1);
|
|
43
|
-
export const moveChildNextWithinParent = (ctx) => moveChildWithinParent(ctx, 1);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Swimlane, Ticket } from './types/board.model.js';
|
|
2
|
-
import { NavigationTree } from './types/navigation.model.js';
|
|
3
|
-
/**
|
|
4
|
-
* Move a ticket to a new swimlane.
|
|
5
|
-
*/
|
|
6
|
-
export declare function moveTicket(ticket: Ticket, destination: Swimlane): void;
|
|
7
|
-
export declare function findNodeById(tree: NavigationTree, id: string): NavigationTree | null;
|
package/dist/lib/board-utils.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { board } from '../mock/board.js';
|
|
2
|
-
/**
|
|
3
|
-
* Move a ticket to a new swimlane.
|
|
4
|
-
*/
|
|
5
|
-
export function moveTicket(ticket, destination) {
|
|
6
|
-
let realTicket;
|
|
7
|
-
// Step 1: Find and remove the real ticket from the current swimlane
|
|
8
|
-
for (const swimlane of board.children) {
|
|
9
|
-
const index = swimlane.children.findIndex(t => t.id === ticket.id);
|
|
10
|
-
if (index !== -1) {
|
|
11
|
-
realTicket = swimlane.children[index];
|
|
12
|
-
swimlane.children.splice(index, 1);
|
|
13
|
-
break;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
// Step 2: Add it to the destination swimlane
|
|
17
|
-
if (realTicket && destination.actionContext === 'SWIMLANE') {
|
|
18
|
-
destination.children.push(realTicket);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
console.warn('Ticket not found or destination invalid. No move performed.');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export function findNodeById(tree, id) {
|
|
25
|
-
if (tree.id === id)
|
|
26
|
-
return tree;
|
|
27
|
-
for (const child of tree.children) {
|
|
28
|
-
const found = findNodeById(child, id);
|
|
29
|
-
if (found)
|
|
30
|
-
return found;
|
|
31
|
-
}
|
|
32
|
-
return null;
|
|
33
|
-
}
|