mepcli 1.3.2 → 2.0.0-beta.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/README.md +11 -2
- package/dist/{ansi.js → src/ansi.js} +17 -9
- package/dist/src/ansi.js.map +1 -0
- package/dist/{base.js → src/base.js} +82 -70
- package/dist/src/base.js.map +1 -0
- package/dist/{core.js → src/core.js} +266 -320
- package/dist/src/core.js.map +1 -0
- package/dist/src/data/countries.js +569 -0
- package/dist/src/data/countries.js.map +1 -0
- package/dist/src/data/licenses.js +480 -0
- package/dist/src/data/licenses.js.map +1 -0
- package/dist/{highlight.js → src/highlight.js} +77 -69
- package/dist/src/highlight.js.map +1 -0
- package/dist/src/index.js +66 -0
- package/dist/src/index.js.map +1 -0
- package/dist/{input.js → src/input.js} +47 -41
- package/dist/src/input.js.map +1 -0
- package/dist/src/pipeline.js +273 -0
- package/dist/src/pipeline.js.map +1 -0
- package/dist/{prompts → src/prompts}/autocomplete.js +58 -57
- package/dist/src/prompts/autocomplete.js.map +1 -0
- package/dist/{prompts → src/prompts}/box.js +86 -53
- package/dist/src/prompts/box.js.map +1 -0
- package/dist/{prompts → src/prompts}/breadcrumb-search.js +110 -98
- package/dist/src/prompts/breadcrumb-search.js.map +1 -0
- package/dist/{prompts → src/prompts}/breadcrumb.js +126 -121
- package/dist/src/prompts/breadcrumb.js.map +1 -0
- package/dist/{prompts → src/prompts}/byte.js +69 -52
- package/dist/src/prompts/byte.js.map +1 -0
- package/dist/{prompts → src/prompts}/calculator.js +79 -56
- package/dist/src/prompts/calculator.js.map +1 -0
- package/dist/{prompts → src/prompts}/calendar.js +167 -127
- package/dist/src/prompts/calendar.js.map +1 -0
- package/dist/{prompts → src/prompts}/checkbox.js +53 -49
- package/dist/src/prompts/checkbox.js.map +1 -0
- package/dist/{prompts → src/prompts}/code.js +88 -76
- package/dist/src/prompts/code.js.map +1 -0
- package/dist/{prompts → src/prompts}/color.js +68 -50
- package/dist/src/prompts/color.js.map +1 -0
- package/dist/{prompts → src/prompts}/confirm.js +22 -15
- package/dist/src/prompts/confirm.js.map +1 -0
- package/dist/{prompts → src/prompts}/connection-string.js +59 -36
- package/dist/src/prompts/connection-string.js.map +1 -0
- package/dist/{prompts → src/prompts}/cron.js +90 -59
- package/dist/src/prompts/cron.js.map +1 -0
- package/dist/src/prompts/curl-utils.js +71 -0
- package/dist/src/prompts/curl-utils.js.map +1 -0
- package/dist/{prompts → src/prompts}/curl.js +153 -132
- package/dist/src/prompts/curl.js.map +1 -0
- package/dist/{prompts → src/prompts}/data-inspector.js +96 -91
- package/dist/src/prompts/data-inspector.js.map +1 -0
- package/dist/{prompts → src/prompts}/date.js +64 -57
- package/dist/src/prompts/date.js.map +1 -0
- package/dist/{prompts → src/prompts}/dependency.js +84 -80
- package/dist/src/prompts/dependency.js.map +1 -0
- package/dist/{prompts → src/prompts}/dial.js +49 -35
- package/dist/src/prompts/dial.js.map +1 -0
- package/dist/src/prompts/diff.js +118 -0
- package/dist/src/prompts/diff.js.map +1 -0
- package/dist/{prompts → src/prompts}/draw.js +83 -80
- package/dist/src/prompts/draw.js.map +1 -0
- package/dist/src/prompts/editor.js +234 -0
- package/dist/src/prompts/editor.js.map +1 -0
- package/dist/{prompts → src/prompts}/emoji.js +80 -82
- package/dist/src/prompts/emoji.js.map +1 -0
- package/dist/{prompts → src/prompts}/exec.js +60 -46
- package/dist/src/prompts/exec.js.map +1 -0
- package/dist/src/prompts/file.js +217 -0
- package/dist/src/prompts/file.js.map +1 -0
- package/dist/{prompts → src/prompts}/form.js +63 -54
- package/dist/src/prompts/form.js.map +1 -0
- package/dist/{prompts → src/prompts}/fuzzy-multi-column.js +65 -53
- package/dist/src/prompts/fuzzy-multi-column.js.map +1 -0
- package/dist/{prompts → src/prompts}/fuzzy.js +66 -55
- package/dist/src/prompts/fuzzy.js.map +1 -0
- package/dist/src/prompts/gauge.js +137 -0
- package/dist/src/prompts/gauge.js.map +1 -0
- package/dist/{prompts → src/prompts}/grid.js +70 -57
- package/dist/src/prompts/grid.js.map +1 -0
- package/dist/{prompts → src/prompts}/heatmap.js +70 -64
- package/dist/src/prompts/heatmap.js.map +1 -0
- package/dist/{prompts → src/prompts}/ip.js +56 -36
- package/dist/src/prompts/ip.js.map +1 -0
- package/dist/{prompts → src/prompts}/kanban.js +63 -58
- package/dist/src/prompts/kanban.js.map +1 -0
- package/dist/src/prompts/keypress.js +54 -0
- package/dist/src/prompts/keypress.js.map +1 -0
- package/dist/src/prompts/license.js +144 -0
- package/dist/src/prompts/license.js.map +1 -0
- package/dist/{prompts → src/prompts}/list.js +46 -31
- package/dist/src/prompts/list.js.map +1 -0
- package/dist/{prompts → src/prompts}/map.js +93 -77
- package/dist/src/prompts/map.js.map +1 -0
- package/dist/{prompts → src/prompts}/match.js +91 -95
- package/dist/src/prompts/match.js.map +1 -0
- package/dist/{prompts → src/prompts}/miller.js +74 -67
- package/dist/src/prompts/miller.js.map +1 -0
- package/dist/{prompts → src/prompts}/multi-column-select.js +54 -44
- package/dist/src/prompts/multi-column-select.js.map +1 -0
- package/dist/{prompts → src/prompts}/multi-range.js +70 -52
- package/dist/src/prompts/multi-range.js.map +1 -0
- package/dist/{prompts → src/prompts}/multi-select.js +67 -58
- package/dist/src/prompts/multi-select.js.map +1 -0
- package/dist/{prompts → src/prompts}/number.js +51 -39
- package/dist/src/prompts/number.js.map +1 -0
- package/dist/{prompts → src/prompts}/otp.js +43 -27
- package/dist/src/prompts/otp.js.map +1 -0
- package/dist/{prompts → src/prompts}/pattern.js +74 -71
- package/dist/src/prompts/pattern.js.map +1 -0
- package/dist/{prompts → src/prompts}/phone.js +107 -118
- package/dist/src/prompts/phone.js.map +1 -0
- package/dist/src/prompts/quiz-select.js +114 -0
- package/dist/src/prompts/quiz-select.js.map +1 -0
- package/dist/src/prompts/quiz-text.js +98 -0
- package/dist/src/prompts/quiz-text.js.map +1 -0
- package/dist/{prompts → src/prompts}/range.js +85 -61
- package/dist/src/prompts/range.js.map +1 -0
- package/dist/{prompts → src/prompts}/rating.js +29 -24
- package/dist/src/prompts/rating.js.map +1 -0
- package/dist/{prompts → src/prompts}/regex.js +50 -36
- package/dist/src/prompts/regex.js.map +1 -0
- package/dist/{prompts → src/prompts}/region.js +62 -56
- package/dist/src/prompts/region.js.map +1 -0
- package/dist/{prompts → src/prompts}/schedule.js +82 -75
- package/dist/src/prompts/schedule.js.map +1 -0
- package/dist/{prompts → src/prompts}/scroll.js +61 -58
- package/dist/src/prompts/scroll.js.map +1 -0
- package/dist/src/prompts/seat.js +164 -0
- package/dist/src/prompts/seat.js.map +1 -0
- package/dist/{prompts → src/prompts}/select-range.js +58 -46
- package/dist/src/prompts/select-range.js.map +1 -0
- package/dist/{prompts → src/prompts}/select.js +65 -66
- package/dist/src/prompts/select.js.map +1 -0
- package/dist/{prompts → src/prompts}/semver.js +24 -13
- package/dist/src/prompts/semver.js.map +1 -0
- package/dist/src/prompts/shortcut.js +133 -0
- package/dist/src/prompts/shortcut.js.map +1 -0
- package/dist/{prompts → src/prompts}/slider.js +28 -23
- package/dist/src/prompts/slider.js.map +1 -0
- package/dist/src/prompts/slot.js +117 -0
- package/dist/src/prompts/slot.js.map +1 -0
- package/dist/{prompts → src/prompts}/snippet.js +82 -61
- package/dist/src/prompts/snippet.js.map +1 -0
- package/dist/{prompts → src/prompts}/sort-grid.js +64 -59
- package/dist/src/prompts/sort-grid.js.map +1 -0
- package/dist/{prompts → src/prompts}/sort.js +59 -49
- package/dist/src/prompts/sort.js.map +1 -0
- package/dist/src/prompts/spam.js +80 -0
- package/dist/src/prompts/spam.js.map +1 -0
- package/dist/{prompts → src/prompts}/spreadsheet.js +71 -70
- package/dist/src/prompts/spreadsheet.js.map +1 -0
- package/dist/{prompts → src/prompts}/table.js +52 -38
- package/dist/src/prompts/table.js.map +1 -0
- package/dist/{prompts → src/prompts}/text.js +74 -70
- package/dist/src/prompts/text.js.map +1 -0
- package/dist/{prompts → src/prompts}/time.js +105 -96
- package/dist/src/prompts/time.js.map +1 -0
- package/dist/src/prompts/toggle.js +53 -0
- package/dist/src/prompts/toggle.js.map +1 -0
- package/dist/{prompts → src/prompts}/transfer.js +71 -67
- package/dist/src/prompts/transfer.js.map +1 -0
- package/dist/{prompts → src/prompts}/tree-select.js +83 -86
- package/dist/src/prompts/tree-select.js.map +1 -0
- package/dist/{prompts → src/prompts}/tree.js +69 -67
- package/dist/src/prompts/tree.js.map +1 -0
- package/dist/src/prompts/wait.js +79 -0
- package/dist/src/prompts/wait.js.map +1 -0
- package/dist/src/spinner.js +105 -0
- package/dist/src/spinner.js.map +1 -0
- package/dist/{symbols.js → src/symbols.js} +32 -7
- package/dist/src/symbols.js.map +1 -0
- package/dist/{tasks.js → src/tasks.js} +104 -79
- package/dist/src/tasks.js.map +1 -0
- package/dist/src/theme.js +29 -0
- package/dist/src/theme.js.map +1 -0
- package/dist/src/types.js +8 -0
- package/dist/src/types.js.map +1 -0
- package/dist/{utils.js → src/utils.js} +196 -152
- package/dist/src/utils.js.map +1 -0
- package/package.json +16 -13
- package/dist/ansi.d.ts +0 -36
- package/dist/base.d.ts +0 -60
- package/dist/core.d.ts +0 -1072
- package/dist/data/countries.d.ts +0 -2
- package/dist/data/countries.js +0 -105
- package/dist/data/licenses.d.ts +0 -2
- package/dist/data/licenses.js +0 -109
- package/dist/highlight.d.ts +0 -7
- package/dist/index.d.ts +0 -48
- package/dist/index.js +0 -64
- package/dist/input.d.ts +0 -14
- package/dist/pipeline.d.ts +0 -39
- package/dist/pipeline.js +0 -54
- package/dist/prompts/autocomplete.d.ts +0 -22
- package/dist/prompts/box.d.ts +0 -21
- package/dist/prompts/breadcrumb-search.d.ts +0 -14
- package/dist/prompts/breadcrumb.d.ts +0 -32
- package/dist/prompts/byte.d.ts +0 -13
- package/dist/prompts/calculator.d.ts +0 -17
- package/dist/prompts/calendar.d.ts +0 -33
- package/dist/prompts/checkbox.d.ts +0 -13
- package/dist/prompts/code.d.ts +0 -19
- package/dist/prompts/color.d.ts +0 -14
- package/dist/prompts/confirm.d.ts +0 -8
- package/dist/prompts/connection-string.d.ts +0 -18
- package/dist/prompts/cron.d.ts +0 -13
- package/dist/prompts/curl-utils.d.ts +0 -25
- package/dist/prompts/curl-utils.js +0 -41
- package/dist/prompts/curl.d.ts +0 -41
- package/dist/prompts/data-inspector.d.ts +0 -22
- package/dist/prompts/date.d.ts +0 -12
- package/dist/prompts/dependency.d.ts +0 -16
- package/dist/prompts/dial.d.ts +0 -10
- package/dist/prompts/diff.d.ts +0 -10
- package/dist/prompts/diff.js +0 -101
- package/dist/prompts/draw.d.ts +0 -20
- package/dist/prompts/editor.d.ts +0 -14
- package/dist/prompts/editor.js +0 -203
- package/dist/prompts/emoji.d.ts +0 -18
- package/dist/prompts/exec.d.ts +0 -17
- package/dist/prompts/file.d.ts +0 -21
- package/dist/prompts/file.js +0 -210
- package/dist/prompts/form.d.ts +0 -18
- package/dist/prompts/fuzzy-multi-column.d.ts +0 -12
- package/dist/prompts/fuzzy.d.ts +0 -12
- package/dist/prompts/gauge.d.ts +0 -21
- package/dist/prompts/gauge.js +0 -130
- package/dist/prompts/grid.d.ts +0 -14
- package/dist/prompts/heatmap.d.ts +0 -13
- package/dist/prompts/ip.d.ts +0 -11
- package/dist/prompts/kanban.d.ts +0 -17
- package/dist/prompts/keypress.d.ts +0 -7
- package/dist/prompts/keypress.js +0 -55
- package/dist/prompts/license.d.ts +0 -9
- package/dist/prompts/license.js +0 -105
- package/dist/prompts/list.d.ts +0 -9
- package/dist/prompts/map.d.ts +0 -17
- package/dist/prompts/match.d.ts +0 -19
- package/dist/prompts/miller.d.ts +0 -15
- package/dist/prompts/multi-column-select.d.ts +0 -10
- package/dist/prompts/multi-range.d.ts +0 -9
- package/dist/prompts/multi-select.d.ts +0 -15
- package/dist/prompts/number.d.ts +0 -11
- package/dist/prompts/otp.d.ts +0 -10
- package/dist/prompts/pattern.d.ts +0 -22
- package/dist/prompts/phone.d.ts +0 -41
- package/dist/prompts/quiz-select.d.ts +0 -10
- package/dist/prompts/quiz-select.js +0 -104
- package/dist/prompts/quiz-text.d.ts +0 -11
- package/dist/prompts/quiz-text.js +0 -82
- package/dist/prompts/range.d.ts +0 -9
- package/dist/prompts/rating.d.ts +0 -8
- package/dist/prompts/regex.d.ts +0 -13
- package/dist/prompts/region.d.ts +0 -11
- package/dist/prompts/schedule.d.ts +0 -20
- package/dist/prompts/scroll.d.ts +0 -13
- package/dist/prompts/seat.d.ts +0 -17
- package/dist/prompts/seat.js +0 -165
- package/dist/prompts/select-range.d.ts +0 -8
- package/dist/prompts/select.d.ts +0 -15
- package/dist/prompts/semver.d.ts +0 -6
- package/dist/prompts/shortcut.d.ts +0 -9
- package/dist/prompts/shortcut.js +0 -135
- package/dist/prompts/slider.d.ts +0 -8
- package/dist/prompts/slot.d.ts +0 -16
- package/dist/prompts/slot.js +0 -107
- package/dist/prompts/snippet.d.ts +0 -19
- package/dist/prompts/sort-grid.d.ts +0 -16
- package/dist/prompts/sort.d.ts +0 -14
- package/dist/prompts/spam.d.ts +0 -17
- package/dist/prompts/spam.js +0 -62
- package/dist/prompts/spreadsheet.d.ts +0 -21
- package/dist/prompts/table.d.ts +0 -14
- package/dist/prompts/text.d.ts +0 -17
- package/dist/prompts/time.d.ts +0 -12
- package/dist/prompts/toggle.d.ts +0 -8
- package/dist/prompts/toggle.js +0 -47
- package/dist/prompts/transfer.d.ts +0 -18
- package/dist/prompts/tree-select.d.ts +0 -31
- package/dist/prompts/tree.d.ts +0 -20
- package/dist/prompts/wait.d.ts +0 -18
- package/dist/prompts/wait.js +0 -62
- package/dist/spinner.d.ts +0 -33
- package/dist/spinner.js +0 -89
- package/dist/symbols.d.ts +0 -33
- package/dist/tasks.d.ts +0 -57
- package/dist/theme.d.ts +0 -2
- package/dist/theme.js +0 -20
- package/dist/types.d.ts +0 -503
- package/dist/types.js +0 -5
- package/dist/utils.d.ts +0 -81
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
super(options);
|
|
10
|
-
this.path = [];
|
|
11
|
-
this.cursor = { r: 0, c: 0 };
|
|
12
|
-
this.isDragging = false;
|
|
13
|
-
this.errorMsg = '';
|
|
14
|
-
// Layout
|
|
15
|
-
this.nodeSpacingX = 4;
|
|
16
|
-
this.nodeSpacingY = 2;
|
|
17
|
-
this.lastMouse = null;
|
|
18
|
-
this.rows = options.rows || 3;
|
|
19
|
-
this.cols = options.cols || 3;
|
|
20
|
-
this.nodeChar = options.nodeChar || '●';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "PatternPrompt", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return PatternPrompt;
|
|
21
9
|
}
|
|
10
|
+
});
|
|
11
|
+
const _ansi = require("../ansi");
|
|
12
|
+
const _base = require("../base");
|
|
13
|
+
const _theme = require("../theme");
|
|
14
|
+
function _define_property(obj, key, value) {
|
|
15
|
+
if (key in obj) {
|
|
16
|
+
Object.defineProperty(obj, key, {
|
|
17
|
+
value: value,
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
obj[key] = value;
|
|
24
|
+
}
|
|
25
|
+
return obj;
|
|
26
|
+
}
|
|
27
|
+
let PatternPrompt = class PatternPrompt extends _base.Prompt {
|
|
22
28
|
getIndex(r, c) {
|
|
23
29
|
return r * this.cols + c;
|
|
24
30
|
}
|
|
@@ -31,25 +37,25 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
31
37
|
render(firstRender) {
|
|
32
38
|
let output = '';
|
|
33
39
|
// Title
|
|
34
|
-
const icon = this.errorMsg ? `${
|
|
35
|
-
output += `${icon} ${
|
|
40
|
+
const icon = this.errorMsg ? `${_theme.theme.error}✖` : `${_theme.theme.success}?`;
|
|
41
|
+
output += `${icon} ${_ansi.ANSI.BOLD}${_theme.theme.title}${this.options.message}${_ansi.ANSI.RESET}\n`;
|
|
36
42
|
// Instructions
|
|
37
43
|
if (firstRender) {
|
|
38
|
-
output += `${
|
|
44
|
+
output += `${_ansi.ANSI.DIM}(Draw pattern with mouse or use Arrows + Space)${_ansi.ANSI.RESET}\n`;
|
|
39
45
|
}
|
|
40
46
|
// Render Grid
|
|
41
47
|
// Initialize buffer with spaces
|
|
42
48
|
// Adjust height/width slightly to ensure we cover full lines
|
|
43
49
|
const bufferHeight = this.rows * this.nodeSpacingY + 1;
|
|
44
50
|
const bufferWidth = this.cols * this.nodeSpacingX + 1;
|
|
45
|
-
const buffer = Array(bufferHeight).fill(null).map(()
|
|
51
|
+
const buffer = Array(bufferHeight).fill(null).map(()=>Array(bufferWidth).fill(' '));
|
|
46
52
|
// Draw connections
|
|
47
|
-
for
|
|
53
|
+
for(let i = 0; i < this.path.length - 1; i++){
|
|
48
54
|
this.drawLine(buffer, this.path[i], this.path[i + 1]);
|
|
49
55
|
}
|
|
50
56
|
// Draw nodes
|
|
51
|
-
for
|
|
52
|
-
for
|
|
57
|
+
for(let r = 0; r < this.rows; r++){
|
|
58
|
+
for(let c = 0; c < this.cols; c++){
|
|
53
59
|
const index = this.getIndex(r, c);
|
|
54
60
|
const isSelected = this.path.includes(index);
|
|
55
61
|
// Calculate buffer position
|
|
@@ -63,9 +69,9 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
63
69
|
// Limit loop to actual grid dimensions to avoid trailing empty lines
|
|
64
70
|
const displayHeight = (this.rows - 1) * this.nodeSpacingY + 1;
|
|
65
71
|
const displayWidth = (this.cols - 1) * this.nodeSpacingX + 1;
|
|
66
|
-
for
|
|
72
|
+
for(let y = 0; y < displayHeight; y++){
|
|
67
73
|
output += ' '; // Indent
|
|
68
|
-
for
|
|
74
|
+
for(let x = 0; x < displayWidth; x++){
|
|
69
75
|
const char = buffer[y][x];
|
|
70
76
|
// Determine coloring context
|
|
71
77
|
const isNodeRow = y % this.nodeSpacingY === 0;
|
|
@@ -78,24 +84,19 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
78
84
|
const isLast = this.path.length > 0 && this.path[this.path.length - 1] === idx;
|
|
79
85
|
const isCursor = this.cursor.r === r && this.cursor.c === c;
|
|
80
86
|
let styledChar = this.nodeChar;
|
|
81
|
-
if (isSelected)
|
|
82
|
-
|
|
83
|
-
if (isLast)
|
|
84
|
-
styledChar = theme_1.theme.success + this.nodeChar + ansi_1.ANSI.RESET;
|
|
87
|
+
if (isSelected) styledChar = _theme.theme.main + this.nodeChar + _ansi.ANSI.RESET;
|
|
88
|
+
if (isLast) styledChar = _theme.theme.success + this.nodeChar + _ansi.ANSI.RESET;
|
|
85
89
|
if (isCursor) {
|
|
86
|
-
styledChar =
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
styledChar = theme_1.theme.muted + '○' + ansi_1.ANSI.RESET;
|
|
90
|
+
styledChar = _ansi.ANSI.REVERSE + styledChar + _ansi.ANSI.RESET;
|
|
91
|
+
} else if (!isSelected) {
|
|
92
|
+
styledChar = _theme.theme.muted + '○' + _ansi.ANSI.RESET;
|
|
90
93
|
}
|
|
91
94
|
output += styledChar;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
95
|
+
} else {
|
|
94
96
|
// It's a line or space
|
|
95
97
|
if (char !== ' ' && char !== '○' && char !== '●') {
|
|
96
|
-
output +=
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
98
|
+
output += _theme.theme.main + char + _ansi.ANSI.RESET;
|
|
99
|
+
} else {
|
|
99
100
|
output += ' ';
|
|
100
101
|
}
|
|
101
102
|
}
|
|
@@ -103,7 +104,7 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
103
104
|
output += '\n';
|
|
104
105
|
}
|
|
105
106
|
if (this.errorMsg) {
|
|
106
|
-
output += `\n${
|
|
107
|
+
output += `\n${_theme.theme.error}>> ${this.errorMsg}${_ansi.ANSI.RESET}`;
|
|
107
108
|
}
|
|
108
109
|
this.renderFrame(output);
|
|
109
110
|
}
|
|
@@ -117,31 +118,24 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
117
118
|
const dy = y2 - y1;
|
|
118
119
|
const dx = x2 - x1;
|
|
119
120
|
const steps = Math.max(Math.abs(dx), Math.abs(dy));
|
|
120
|
-
if (steps === 0)
|
|
121
|
-
return;
|
|
121
|
+
if (steps === 0) return;
|
|
122
122
|
const yInc = dy / steps;
|
|
123
123
|
const xInc = dx / steps;
|
|
124
124
|
let y = y1;
|
|
125
125
|
let x = x1;
|
|
126
|
-
for
|
|
126
|
+
for(let i = 0; i <= steps; i++){
|
|
127
127
|
const ry = Math.round(y);
|
|
128
128
|
const rx = Math.round(x);
|
|
129
129
|
// Check bounds
|
|
130
130
|
if (ry >= 0 && ry < buffer.length && rx >= 0 && rx < buffer[0].length) {
|
|
131
|
-
const isNode =
|
|
131
|
+
const isNode = ry % this.nodeSpacingY === 0 && rx % this.nodeSpacingX === 0;
|
|
132
132
|
if (!isNode) {
|
|
133
133
|
// Determine char based on slope
|
|
134
134
|
// Flat horizontal
|
|
135
|
-
if (dy === 0)
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
else
|
|
139
|
-
buffer[ry][rx] = '│';
|
|
140
|
-
// Diagonal
|
|
141
|
-
else if ((dx > 0 && dy > 0) || (dx < 0 && dy < 0))
|
|
142
|
-
buffer[ry][rx] = '╲';
|
|
143
|
-
else
|
|
144
|
-
buffer[ry][rx] = '╱';
|
|
135
|
+
if (dy === 0) buffer[ry][rx] = '─';
|
|
136
|
+
else if (dx === 0) buffer[ry][rx] = '│';
|
|
137
|
+
else if (dx > 0 && dy > 0 || dx < 0 && dy < 0) buffer[ry][rx] = '╲';
|
|
138
|
+
else buffer[ry][rx] = '╱';
|
|
145
139
|
}
|
|
146
140
|
}
|
|
147
141
|
y += yInc;
|
|
@@ -215,16 +209,11 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
215
209
|
// Sensitivity threshold
|
|
216
210
|
if (dx !== 0 || dy !== 0) {
|
|
217
211
|
if (Math.abs(dx) > Math.abs(dy)) {
|
|
218
|
-
if (dx > 0)
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
else {
|
|
224
|
-
if (dy > 0)
|
|
225
|
-
this.cursor.r = Math.min(this.rows - 1, this.cursor.r + 1);
|
|
226
|
-
else if (dy < 0)
|
|
227
|
-
this.cursor.r = Math.max(0, this.cursor.r - 1);
|
|
212
|
+
if (dx > 0) this.cursor.c = Math.min(this.cols - 1, this.cursor.c + 1);
|
|
213
|
+
else if (dx < 0) this.cursor.c = Math.max(0, this.cursor.c - 1);
|
|
214
|
+
} else {
|
|
215
|
+
if (dy > 0) this.cursor.r = Math.min(this.rows - 1, this.cursor.r + 1);
|
|
216
|
+
else if (dy < 0) this.cursor.r = Math.max(0, this.cursor.r - 1);
|
|
228
217
|
}
|
|
229
218
|
if (this.isDragging) {
|
|
230
219
|
const idx = this.getIndex(this.cursor.r, this.cursor.c);
|
|
@@ -232,8 +221,7 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
232
221
|
}
|
|
233
222
|
this.render(false);
|
|
234
223
|
}
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
224
|
+
} else {
|
|
237
225
|
// Mouse Down
|
|
238
226
|
if (event.action === 'press' && event.button === 0) {
|
|
239
227
|
this.isDragging = true;
|
|
@@ -243,7 +231,22 @@ class PatternPrompt extends base_1.Prompt {
|
|
|
243
231
|
this.render(false);
|
|
244
232
|
}
|
|
245
233
|
}
|
|
246
|
-
this.lastMouse = {
|
|
234
|
+
this.lastMouse = {
|
|
235
|
+
x: event.x,
|
|
236
|
+
y: event.y
|
|
237
|
+
};
|
|
247
238
|
}
|
|
248
|
-
|
|
249
|
-
|
|
239
|
+
constructor(options){
|
|
240
|
+
super(options), _define_property(this, "path", []), _define_property(this, "cursor", {
|
|
241
|
+
r: 0,
|
|
242
|
+
c: 0
|
|
243
|
+
}), _define_property(this, "isDragging", false), _define_property(this, "errorMsg", ''), // Grid configuration
|
|
244
|
+
_define_property(this, "rows", void 0), _define_property(this, "cols", void 0), _define_property(this, "nodeChar", void 0), // Layout
|
|
245
|
+
_define_property(this, "nodeSpacingX", 4), _define_property(this, "nodeSpacingY", 2), _define_property(this, "lastMouse", null);
|
|
246
|
+
this.rows = options.rows || 3;
|
|
247
|
+
this.cols = options.cols || 3;
|
|
248
|
+
this.nodeChar = options.nodeChar || '●';
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
//# sourceMappingURL=pattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/prompts/pattern.ts"],"sourcesContent":["import { ANSI } from '../ansi';\nimport { Prompt } from '../base';\nimport { theme } from '../theme';\nimport { PatternOptions, MouseEvent } from '../types';\n\ninterface Point {\n r: number;\n c: number;\n}\n\nexport class PatternPrompt extends Prompt<number[], PatternOptions> {\n private path: number[] = [];\n private cursor: Point = { r: 0, c: 0 };\n private isDragging: boolean = false;\n private errorMsg: string = '';\n\n // Grid configuration\n private rows: number;\n private cols: number;\n private nodeChar: string;\n\n // Layout\n private nodeSpacingX: number = 4;\n private nodeSpacingY: number = 2;\n\n private lastMouse: { x: number, y: number } | null = null;\n\n constructor(options: PatternOptions) {\n super(options);\n this.rows = options.rows || 3;\n this.cols = options.cols || 3;\n this.nodeChar = options.nodeChar || '●';\n }\n\n private getIndex(r: number, c: number): number {\n return r * this.cols + c;\n }\n\n private getPoint(index: number): Point {\n return {\n r: Math.floor(index / this.cols),\n c: index % this.cols\n };\n }\n\n protected render(firstRender: boolean) {\n let output = '';\n\n // Title\n const icon = this.errorMsg ? `${theme.error}✖` : `${theme.success}?`;\n output += `${icon} ${ANSI.BOLD}${theme.title}${this.options.message}${ANSI.RESET}\\n`;\n\n // Instructions\n if (firstRender) {\n output += `${ANSI.DIM}(Draw pattern with mouse or use Arrows + Space)${ANSI.RESET}\\n`;\n }\n\n // Render Grid\n // Initialize buffer with spaces\n // Adjust height/width slightly to ensure we cover full lines\n const bufferHeight = this.rows * this.nodeSpacingY + 1;\n const bufferWidth = this.cols * this.nodeSpacingX + 1;\n const buffer: string[][] = Array(bufferHeight).fill(null).map(() => Array(bufferWidth).fill(' '));\n\n // Draw connections\n for (let i = 0; i < this.path.length - 1; i++) {\n this.drawLine(buffer, this.path[i], this.path[i + 1]);\n }\n\n // Draw nodes\n for (let r = 0; r < this.rows; r++) {\n for (let c = 0; c < this.cols; c++) {\n const index = this.getIndex(r, c);\n const isSelected = this.path.includes(index);\n\n // Calculate buffer position\n const by = r * this.nodeSpacingY;\n const bx = c * this.nodeSpacingX;\n\n // Mark node in buffer (will be stylized later)\n buffer[by][bx] = isSelected ? '●' : '○';\n }\n }\n\n // Build string from buffer\n // Limit loop to actual grid dimensions to avoid trailing empty lines\n const displayHeight = (this.rows - 1) * this.nodeSpacingY + 1;\n const displayWidth = (this.cols - 1) * this.nodeSpacingX + 1;\n\n for (let y = 0; y < displayHeight; y++) {\n output += ' '; // Indent\n for (let x = 0; x < displayWidth; x++) {\n const char = buffer[y][x];\n\n // Determine coloring context\n const isNodeRow = y % this.nodeSpacingY === 0;\n const isNodeCol = x % this.nodeSpacingX === 0;\n\n if (isNodeRow && isNodeCol) {\n const r = y / this.nodeSpacingY;\n const c = x / this.nodeSpacingX;\n const idx = this.getIndex(r, c);\n\n const isSelected = this.path.includes(idx);\n const isLast = this.path.length > 0 && this.path[this.path.length - 1] === idx;\n const isCursor = this.cursor.r === r && this.cursor.c === c;\n\n let styledChar = this.nodeChar;\n if (isSelected) styledChar = theme.main + this.nodeChar + ANSI.RESET;\n if (isLast) styledChar = theme.success + this.nodeChar + ANSI.RESET;\n\n if (isCursor) {\n styledChar = ANSI.REVERSE + styledChar + ANSI.RESET;\n } else if (!isSelected) {\n styledChar = theme.muted + '○' + ANSI.RESET;\n }\n output += styledChar;\n } else {\n // It's a line or space\n if (char !== ' ' && char !== '○' && char !== '●') {\n output += theme.main + char + ANSI.RESET;\n } else {\n output += ' ';\n }\n }\n }\n output += '\\n';\n }\n\n if (this.errorMsg) {\n output += `\\n${theme.error}>> ${this.errorMsg}${ANSI.RESET}`;\n }\n\n this.renderFrame(output);\n }\n\n private drawLine(buffer: string[][], fromIdx: number, toIdx: number) {\n const p1 = this.getPoint(fromIdx);\n const p2 = this.getPoint(toIdx);\n\n const y1 = p1.r * this.nodeSpacingY;\n const x1 = p1.c * this.nodeSpacingX;\n const y2 = p2.r * this.nodeSpacingY;\n const x2 = p2.c * this.nodeSpacingX;\n\n const dy = y2 - y1;\n const dx = x2 - x1;\n\n const steps = Math.max(Math.abs(dx), Math.abs(dy));\n if (steps === 0) return;\n\n const yInc = dy / steps;\n const xInc = dx / steps;\n\n let y = y1;\n let x = x1;\n\n for (let i = 0; i <= steps; i++) {\n const ry = Math.round(y);\n const rx = Math.round(x);\n\n // Check bounds\n if (ry >= 0 && ry < buffer.length && rx >= 0 && rx < buffer[0].length) {\n const isNode = (ry % this.nodeSpacingY === 0) && (rx % this.nodeSpacingX === 0);\n\n if (!isNode) {\n // Determine char based on slope\n // Flat horizontal\n if (dy === 0) buffer[ry][rx] = '─';\n // Flat vertical\n else if (dx === 0) buffer[ry][rx] = '│';\n // Diagonal\n else if ((dx > 0 && dy > 0) || (dx < 0 && dy < 0)) buffer[ry][rx] = '╲';\n else buffer[ry][rx] = '╱';\n }\n }\n\n y += yInc;\n x += xInc;\n }\n }\n\n protected handleInput(char: string, _key: Buffer) {\n // Navigation\n if (this.isUp(char)) {\n this.cursor.r = Math.max(0, this.cursor.r - 1);\n this.render(false);\n return;\n }\n if (this.isDown(char)) {\n this.cursor.r = Math.min(this.rows - 1, this.cursor.r + 1);\n this.render(false);\n return;\n }\n if (this.isLeft(char)) {\n this.cursor.c = Math.max(0, this.cursor.c - 1);\n this.render(false);\n return;\n }\n if (this.isRight(char)) {\n this.cursor.c = Math.min(this.cols - 1, this.cursor.c + 1);\n this.render(false);\n return;\n }\n\n // Selection (Space)\n if (char === ' ') {\n const index = this.getIndex(this.cursor.r, this.cursor.c);\n this.addToPath(index);\n this.render(false);\n return;\n }\n\n // Submit (Enter)\n if (char === '\\r' || char === '\\n') {\n if (this.path.length < 2) {\n this.errorMsg = 'Pattern too short';\n this.render(false);\n return;\n }\n this.submit(this.path);\n return;\n }\n\n // Backspace / Reset\n if (char === '\\x7f' || char === '\\b') {\n this.path.pop();\n this.render(false);\n return;\n }\n }\n\n private addToPath(index: number) {\n if (this.path.includes(index)) {\n return;\n }\n this.path.push(index);\n }\n\n protected handleMouse(event: MouseEvent) {\n if (event.action === 'release') {\n this.isDragging = false;\n this.lastMouse = null;\n if (this.path.length >= 2) {\n this.submit(this.path);\n }\n return;\n }\n\n if (this.lastMouse) {\n const dx = event.x - this.lastMouse.x;\n const dy = event.y - this.lastMouse.y;\n\n // Sensitivity threshold\n if (dx !== 0 || dy !== 0) {\n if (Math.abs(dx) > Math.abs(dy)) {\n if (dx > 0) this.cursor.c = Math.min(this.cols - 1, this.cursor.c + 1);\n else if (dx < 0) this.cursor.c = Math.max(0, this.cursor.c - 1);\n } else {\n if (dy > 0) this.cursor.r = Math.min(this.rows - 1, this.cursor.r + 1);\n else if (dy < 0) this.cursor.r = Math.max(0, this.cursor.r - 1);\n }\n\n if (this.isDragging) {\n const idx = this.getIndex(this.cursor.r, this.cursor.c);\n this.addToPath(idx);\n }\n\n this.render(false);\n }\n } else {\n // Mouse Down\n if (event.action === 'press' && event.button === 0) {\n this.isDragging = true;\n this.path = []; // Reset\n const idx = this.getIndex(this.cursor.r, this.cursor.c);\n this.addToPath(idx);\n this.render(false);\n }\n }\n\n this.lastMouse = { x: event.x, y: event.y };\n }\n}\n"],"names":["PatternPrompt","Prompt","getIndex","r","c","cols","getPoint","index","Math","floor","render","firstRender","output","icon","errorMsg","theme","error","success","ANSI","BOLD","title","options","message","RESET","DIM","bufferHeight","rows","nodeSpacingY","bufferWidth","nodeSpacingX","buffer","Array","fill","map","i","path","length","drawLine","isSelected","includes","by","bx","displayHeight","displayWidth","y","x","char","isNodeRow","isNodeCol","idx","isLast","isCursor","cursor","styledChar","nodeChar","main","REVERSE","muted","renderFrame","fromIdx","toIdx","p1","p2","y1","x1","y2","x2","dy","dx","steps","max","abs","yInc","xInc","ry","round","rx","isNode","handleInput","_key","isUp","isDown","min","isLeft","isRight","addToPath","submit","pop","push","handleMouse","event","action","isDragging","lastMouse","button"],"mappings":";;;;+BAUaA;;;eAAAA;;;sBAVQ;sBACE;uBACD;;;;;;;;;;;;;;AAQf,IAAA,AAAMA,gBAAN,MAAMA,sBAAsBC,YAAM;IAwB7BC,SAASC,CAAS,EAAEC,CAAS,EAAU;QAC3C,OAAOD,IAAI,IAAI,CAACE,IAAI,GAAGD;IAC3B;IAEQE,SAASC,KAAa,EAAS;QACnC,OAAO;YACHJ,GAAGK,KAAKC,KAAK,CAACF,QAAQ,IAAI,CAACF,IAAI;YAC/BD,GAAGG,QAAQ,IAAI,CAACF,IAAI;QACxB;IACJ;IAEUK,OAAOC,WAAoB,EAAE;QACnC,IAAIC,SAAS;QAEb,QAAQ;QACR,MAAMC,OAAO,IAAI,CAACC,QAAQ,GAAG,GAAGC,YAAK,CAACC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAGD,YAAK,CAACE,OAAO,CAAC,CAAC,CAAC;QACpEL,UAAU,GAAGC,KAAK,CAAC,EAAEK,UAAI,CAACC,IAAI,GAAGJ,YAAK,CAACK,KAAK,GAAG,IAAI,CAACC,OAAO,CAACC,OAAO,GAAGJ,UAAI,CAACK,KAAK,CAAC,EAAE,CAAC;QAEpF,eAAe;QACf,IAAIZ,aAAa;YACbC,UAAU,GAAGM,UAAI,CAACM,GAAG,CAAC,+CAA+C,EAAEN,UAAI,CAACK,KAAK,CAAC,EAAE,CAAC;QACzF;QAEA,cAAc;QACd,gCAAgC;QAChC,6DAA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