@jakubmazanec/cli 0.2.1-unstable.f940d9d → 0.3.0-next.2fa8a2c
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 +1 -1
- package/build/constants.js +8 -0
- package/build/constants.js.map +7 -0
- package/build/main.js +4 -0
- package/build/main.js.map +7 -0
- package/{dist → build}/program/Command.d.ts +1 -1
- package/build/program/Command.js +70 -0
- package/build/program/Command.js.map +7 -0
- package/{dist → build}/program/CommandAction.d.ts +1 -1
- package/build/program/CommandAction.js +2 -0
- package/build/program/CommandAction.js.map +7 -0
- package/build/program/CommandArguments.js +2 -0
- package/build/program/CommandArguments.js.map +7 -0
- package/build/program/CommandOptions.js +2 -0
- package/build/program/CommandOptions.js.map +7 -0
- package/{dist → build}/program/Program.d.ts +1 -1
- package/build/program/Program.js +191 -0
- package/build/program/Program.js.map +7 -0
- package/build/program/ProgramCreateOptions.js +2 -0
- package/build/program/ProgramCreateOptions.js.map +7 -0
- package/build/program/ProgramDetail.js +2 -0
- package/build/program/ProgramDetail.js.map +7 -0
- package/{dist → build}/program/ProgramError.d.ts +1 -1
- package/build/program/ProgramError.js +6 -0
- package/build/program/ProgramError.js.map +7 -0
- package/build/program/ProgramOptions.js +2 -0
- package/build/program/ProgramOptions.js.map +7 -0
- package/build/program/ProgramStreams.js +2 -0
- package/build/program/ProgramStreams.js.map +7 -0
- package/build/program/getProgramDetail.js +25 -0
- package/build/program/getProgramDetail.js.map +7 -0
- package/build/program.js +13 -0
- package/build/program.js.map +7 -0
- package/build/ui/ErrorDetail.js +2 -0
- package/build/ui/ErrorDetail.js.map +7 -0
- package/build/ui/Failure.js +20 -0
- package/build/ui/Failure.js.map +7 -0
- package/build/ui/Header.js +19 -0
- package/build/ui/Header.js.map +7 -0
- package/build/ui/Help.js +38 -0
- package/build/ui/Help.js.map +7 -0
- package/build/ui/Spinner.js +24 -0
- package/build/ui/Spinner.js.map +7 -0
- package/build/ui/colors.js +12 -0
- package/build/ui/colors.js.map +7 -0
- package/build/ui/form/Form.js +2 -0
- package/build/ui/form/Form.js.map +7 -0
- package/build/ui/form/FormConfig.js +2 -0
- package/build/ui/form/FormConfig.js.map +7 -0
- package/build/ui/form/FormProps.js +2 -0
- package/build/ui/form/FormProps.js.map +7 -0
- package/build/ui/form/FormResult.js +2 -0
- package/build/ui/form/FormResult.js.map +7 -0
- package/build/ui/form/FormRow.js +71 -0
- package/build/ui/form/FormRow.js.map +7 -0
- package/build/ui/form/FormRowConfig.js +2 -0
- package/build/ui/form/FormRowConfig.js.map +7 -0
- package/build/ui/form/FormRowsConfig.js +2 -0
- package/build/ui/form/FormRowsConfig.js.map +7 -0
- package/build/ui/form/FormValue.js +2 -0
- package/build/ui/form/FormValue.js.map +7 -0
- package/build/ui/form/FormValues.js +2 -0
- package/build/ui/form/FormValues.js.map +7 -0
- package/{dist → build}/ui/form/SelectInput.d.ts +1 -1
- package/build/ui/form/SelectInput.js +86 -0
- package/build/ui/form/SelectInput.js.map +7 -0
- package/build/ui/form/SelectInputItem.js +2 -0
- package/build/ui/form/SelectInputItem.js.map +7 -0
- package/build/ui/form/TextInput.js +129 -0
- package/build/ui/form/TextInput.js.map +7 -0
- package/build/ui/form/createForm.js +73 -0
- package/build/ui/form/createForm.js.map +7 -0
- package/build/ui/form.js +15 -0
- package/build/ui/form.js.map +7 -0
- package/build/ui/getErrorDetail.js +65 -0
- package/build/ui/getErrorDetail.js.map +7 -0
- package/build/ui/icons.js +13 -0
- package/build/ui/icons.js.map +7 -0
- package/build/ui/internals/Wrapper.js +48 -0
- package/build/ui/internals/Wrapper.js.map +7 -0
- package/build/ui/internals/programContext.js +4 -0
- package/build/ui/internals/programContext.js.map +7 -0
- package/build/ui/internals/rotate.js +6 -0
- package/build/ui/internals/rotate.js.map +7 -0
- package/build/ui/internals.js +5 -0
- package/build/ui/internals.js.map +7 -0
- package/build/ui/useProgram.js +20 -0
- package/build/ui/useProgram.js.map +7 -0
- package/build/ui.js +12 -0
- package/build/ui.js.map +7 -0
- package/package.json +41 -36
- package/{src → source}/program/CommandAction.ts +1 -1
- package/{src → source}/program/Program.ts +4 -4
- package/{src → source}/ui/Failure.tsx +9 -9
- package/{src → source}/ui/Header.tsx +8 -4
- package/{src → source}/ui/Help.tsx +4 -4
- package/{src → source}/ui/Spinner.tsx +1 -1
- package/{src → source}/ui/form/FormProps.ts +12 -18
- package/{src → source}/ui/form/FormRow.tsx +9 -9
- package/{src → source}/ui/form/FormValue.ts +3 -4
- package/{src → source}/ui/form/SelectInput.tsx +11 -15
- package/{src → source}/ui/form/TextInput.tsx +13 -10
- package/{src → source}/ui/getErrorDetail.ts +1 -1
- package/{src → source}/ui/internals/Wrapper.tsx +4 -4
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/main.js +0 -4
- package/dist/main.js.map +0 -1
- package/dist/program/Command.js +0 -63
- package/dist/program/Command.js.map +0 -1
- package/dist/program/CommandAction.js +0 -3
- package/dist/program/CommandAction.js.map +0 -1
- package/dist/program/CommandArguments.js +0 -3
- package/dist/program/CommandArguments.js.map +0 -1
- package/dist/program/CommandOptions.js +0 -3
- package/dist/program/CommandOptions.js.map +0 -1
- package/dist/program/Program.js +0 -168
- package/dist/program/Program.js.map +0 -1
- package/dist/program/ProgramCreateOptions.js +0 -3
- package/dist/program/ProgramCreateOptions.js.map +0 -1
- package/dist/program/ProgramDetail.js +0 -5
- package/dist/program/ProgramDetail.js.map +0 -1
- package/dist/program/ProgramError.js +0 -8
- package/dist/program/ProgramError.js.map +0 -1
- package/dist/program/ProgramOptions.js +0 -3
- package/dist/program/ProgramOptions.js.map +0 -1
- package/dist/program/ProgramStreams.js +0 -5
- package/dist/program/ProgramStreams.js.map +0 -1
- package/dist/program/getProgramDetail.js +0 -27
- package/dist/program/getProgramDetail.js.map +0 -1
- package/dist/program.js +0 -13
- package/dist/program.js.map +0 -1
- package/dist/ui/ErrorDetail.js +0 -5
- package/dist/ui/ErrorDetail.js.map +0 -1
- package/dist/ui/Failure.js +0 -65
- package/dist/ui/Failure.js.map +0 -1
- package/dist/ui/Header.js +0 -26
- package/dist/ui/Header.js.map +0 -1
- package/dist/ui/Help.js +0 -64
- package/dist/ui/Help.js.map +0 -1
- package/dist/ui/Spinner.js +0 -39
- package/dist/ui/Spinner.js.map +0 -1
- package/dist/ui/colors.js +0 -12
- package/dist/ui/colors.js.map +0 -1
- package/dist/ui/form/Form.js +0 -3
- package/dist/ui/form/Form.js.map +0 -1
- package/dist/ui/form/FormConfig.js +0 -3
- package/dist/ui/form/FormConfig.js.map +0 -1
- package/dist/ui/form/FormProps.js +0 -3
- package/dist/ui/form/FormProps.js.map +0 -1
- package/dist/ui/form/FormResult.js +0 -3
- package/dist/ui/form/FormResult.js.map +0 -1
- package/dist/ui/form/FormRow.js +0 -59
- package/dist/ui/form/FormRow.js.map +0 -1
- package/dist/ui/form/FormRowConfig.js +0 -5
- package/dist/ui/form/FormRowConfig.js.map +0 -1
- package/dist/ui/form/FormRowsConfig.js +0 -3
- package/dist/ui/form/FormRowsConfig.js.map +0 -1
- package/dist/ui/form/FormValue.js +0 -3
- package/dist/ui/form/FormValue.js.map +0 -1
- package/dist/ui/form/FormValues.js +0 -3
- package/dist/ui/form/FormValues.js.map +0 -1
- package/dist/ui/form/SelectInput.js +0 -113
- package/dist/ui/form/SelectInput.js.map +0 -1
- package/dist/ui/form/SelectInputItem.js +0 -5
- package/dist/ui/form/SelectInputItem.js.map +0 -1
- package/dist/ui/form/TextInput.js +0 -152
- package/dist/ui/form/TextInput.js.map +0 -1
- package/dist/ui/form/createForm.js +0 -72
- package/dist/ui/form/createForm.js.map +0 -1
- package/dist/ui/form.js +0 -15
- package/dist/ui/form.js.map +0 -1
- package/dist/ui/getErrorDetail.js +0 -72
- package/dist/ui/getErrorDetail.js.map +0 -1
- package/dist/ui/icons.js +0 -13
- package/dist/ui/icons.js.map +0 -1
- package/dist/ui/internals/Wrapper.js +0 -66
- package/dist/ui/internals/Wrapper.js.map +0 -1
- package/dist/ui/internals/programContext.js +0 -6
- package/dist/ui/internals/programContext.js.map +0 -1
- package/dist/ui/internals/rotate.js +0 -17
- package/dist/ui/internals/rotate.js.map +0 -1
- package/dist/ui/internals.js +0 -5
- package/dist/ui/internals.js.map +0 -1
- package/dist/ui/useProgram.js +0 -25
- package/dist/ui/useProgram.js.map +0 -1
- package/dist/ui.js +0 -12
- package/dist/ui.js.map +0 -1
- package/{dist → build}/constants.d.ts +0 -0
- package/{dist → build}/main.d.ts +0 -0
- package/{dist → build}/program/CommandArguments.d.ts +0 -0
- package/{dist → build}/program/CommandOptions.d.ts +0 -0
- package/{dist → build}/program/ProgramCreateOptions.d.ts +0 -0
- package/{dist → build}/program/ProgramDetail.d.ts +0 -0
- package/{dist → build}/program/ProgramOptions.d.ts +0 -0
- package/{dist → build}/program/ProgramStreams.d.ts +0 -0
- package/{dist → build}/program/getProgramDetail.d.ts +0 -0
- package/{dist → build}/program.d.ts +0 -0
- package/{dist → build}/ui/ErrorDetail.d.ts +0 -0
- package/{dist → build}/ui/Failure.d.ts +0 -0
- package/{dist → build}/ui/Header.d.ts +0 -0
- package/{dist → build}/ui/Help.d.ts +0 -0
- package/{dist → build}/ui/Spinner.d.ts +0 -0
- package/{dist → build}/ui/colors.d.ts +0 -0
- package/{dist → build}/ui/form/Form.d.ts +0 -0
- package/{dist → build}/ui/form/FormConfig.d.ts +0 -0
- package/{dist → build}/ui/form/FormProps.d.ts +0 -0
- package/{dist → build}/ui/form/FormResult.d.ts +0 -0
- package/{dist → build}/ui/form/FormRow.d.ts +0 -0
- package/{dist → build}/ui/form/FormRowConfig.d.ts +0 -0
- package/{dist → build}/ui/form/FormRowsConfig.d.ts +0 -0
- package/{dist → build}/ui/form/FormValue.d.ts +0 -0
- package/{dist → build}/ui/form/FormValues.d.ts +0 -0
- package/{dist → build}/ui/form/SelectInputItem.d.ts +0 -0
- package/{dist → build}/ui/form/TextInput.d.ts +0 -0
- package/{dist → build}/ui/form/createForm.d.ts +0 -0
- package/{dist → build}/ui/form.d.ts +3 -3
- package/{dist → build}/ui/getErrorDetail.d.ts +0 -0
- package/{dist → build}/ui/icons.d.ts +0 -0
- package/{dist → build}/ui/internals/Wrapper.d.ts +0 -0
- package/{dist → build}/ui/internals/programContext.d.ts +0 -0
- package/{dist → build}/ui/internals/rotate.d.ts +0 -0
- package/{dist → build}/ui/internals.d.ts +0 -0
- package/{dist → build}/ui/useProgram.d.ts +0 -0
- package/{dist → build}/ui.d.ts +3 -3
- package/{src → source}/constants.ts +0 -0
- package/{src → source}/main.ts +0 -0
- package/{src → source}/program/Command.ts +2 -2
- package/{src → source}/program/CommandArguments.ts +0 -0
- package/{src → source}/program/CommandOptions.ts +0 -0
- package/{src → source}/program/ProgramCreateOptions.ts +0 -0
- package/{src → source}/program/ProgramDetail.ts +0 -0
- package/{src → source}/program/ProgramError.ts +0 -0
- package/{src → source}/program/ProgramOptions.ts +0 -0
- package/{src → source}/program/ProgramStreams.ts +0 -0
- package/{src → source}/program/getProgramDetail.ts +0 -0
- package/{src → source}/program.ts +0 -0
- package/{src → source}/ui/ErrorDetail.ts +0 -0
- package/{src → source}/ui/colors.ts +0 -0
- package/{src → source}/ui/form/Form.ts +0 -0
- package/{src → source}/ui/form/FormConfig.ts +0 -0
- package/{src → source}/ui/form/FormResult.ts +0 -0
- package/{src → source}/ui/form/FormRowConfig.ts +0 -0
- package/{src → source}/ui/form/FormRowsConfig.ts +0 -0
- package/{src → source}/ui/form/FormValues.ts +0 -0
- package/{src → source}/ui/form/SelectInputItem.ts +0 -0
- package/{src → source}/ui/form/createForm.tsx +0 -0
- package/{src → source}/ui/form.ts +3 -3
- package/{src → source}/ui/icons.ts +0 -0
- package/{src → source}/ui/internals/programContext.ts +0 -0
- package/{src → source}/ui/internals/rotate.ts +0 -0
- package/{src → source}/ui/internals.ts +0 -0
- package/{src → source}/ui/useProgram.ts +0 -0
- package/{src → source}/ui.ts +3 -3
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
// TODO: resolve
|
|
2
|
-
/* eslint-disable complexity -- TODO */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import { Box, Text, useInput } from 'ink';
|
|
5
|
-
import { useEffect, useState } from 'react';
|
|
6
|
-
import * as colors from '../colors.js';
|
|
7
|
-
import * as icons from '../icons.js';
|
|
8
|
-
/**
|
|
9
|
-
* Text input component.
|
|
10
|
-
*/ export function TextInput({ label, validate, isComplete, value: originalValue, placeholder = '', focus = true, mask, showCursor = true, onChange, onSubmit, ...boxProps }) {
|
|
11
|
-
let [validationError, setValidationError] = useState('');
|
|
12
|
-
let [state, setState] = useState({
|
|
13
|
-
cursorOffset: (originalValue || '').length,
|
|
14
|
-
cursorWidth: 0
|
|
15
|
-
});
|
|
16
|
-
useEffect(()=>{
|
|
17
|
-
setState((previousState)=>{
|
|
18
|
-
if (!focus || !showCursor) {
|
|
19
|
-
return previousState;
|
|
20
|
-
}
|
|
21
|
-
let newValue = originalValue || '';
|
|
22
|
-
if (previousState.cursorOffset > newValue.length - 1) {
|
|
23
|
-
return {
|
|
24
|
-
cursorOffset: newValue.length,
|
|
25
|
-
cursorWidth: 0
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
return previousState;
|
|
29
|
-
});
|
|
30
|
-
}, [
|
|
31
|
-
originalValue,
|
|
32
|
-
focus,
|
|
33
|
-
showCursor
|
|
34
|
-
]);
|
|
35
|
-
let value = mask ? mask.repeat(originalValue.length) : originalValue;
|
|
36
|
-
let renderedValue = value;
|
|
37
|
-
let renderedPlaceholder = placeholder ? chalk[colors.muted](placeholder) : undefined;
|
|
38
|
-
if (showCursor && focus) {
|
|
39
|
-
renderedPlaceholder = placeholder.length > 0 ? chalk.inverse(placeholder[0]) + chalk[colors.muted](placeholder.slice(1)) : chalk.inverse(' ');
|
|
40
|
-
renderedValue = value.length > 0 ? '' : chalk.inverse(' ');
|
|
41
|
-
for (let [i, character] of Object.entries(value)){
|
|
42
|
-
if (Number(i) >= state.cursorOffset && Number(i) <= state.cursorOffset) {
|
|
43
|
-
renderedValue += chalk.inverse(character);
|
|
44
|
-
} else {
|
|
45
|
-
renderedValue += character;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (value.length > 0 && state.cursorOffset === value.length) {
|
|
49
|
-
renderedValue += chalk.inverse(' ');
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
useInput((input, key)=>{
|
|
53
|
-
if (key.upArrow || key.downArrow || key.ctrl && input === 'c' || key.shift && key.tab || key.tab) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (key.return) {
|
|
57
|
-
if (onSubmit) {
|
|
58
|
-
if (validate) {
|
|
59
|
-
try {
|
|
60
|
-
validate(originalValue);
|
|
61
|
-
} catch (error) {
|
|
62
|
-
setValidationError(error.message);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if (validationError) {
|
|
67
|
-
setValidationError('');
|
|
68
|
-
} else {
|
|
69
|
-
onSubmit(originalValue);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
let nextCursorOffset = state.cursorOffset;
|
|
75
|
-
let nextValue = originalValue;
|
|
76
|
-
let nextCursorWidth = 0;
|
|
77
|
-
if (key.leftArrow) {
|
|
78
|
-
if (showCursor) {
|
|
79
|
-
nextCursorOffset -= 1;
|
|
80
|
-
}
|
|
81
|
-
} else if (key.rightArrow) {
|
|
82
|
-
if (showCursor) {
|
|
83
|
-
nextCursorOffset += 1;
|
|
84
|
-
}
|
|
85
|
-
} else if (key.backspace || key.delete) {
|
|
86
|
-
if (state.cursorOffset > 0) {
|
|
87
|
-
nextValue = originalValue.slice(0, state.cursorOffset - 1) + originalValue.slice(state.cursorOffset, originalValue.length);
|
|
88
|
-
nextCursorOffset -= 1;
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
nextValue = originalValue.slice(0, state.cursorOffset) + input + originalValue.slice(state.cursorOffset, originalValue.length);
|
|
92
|
-
nextCursorOffset += input.length;
|
|
93
|
-
if (input.length > 1) {
|
|
94
|
-
nextCursorWidth = input.length;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (state.cursorOffset < 0) {
|
|
98
|
-
nextCursorOffset = 0;
|
|
99
|
-
}
|
|
100
|
-
if (state.cursorOffset > originalValue.length) {
|
|
101
|
-
nextCursorOffset = originalValue.length;
|
|
102
|
-
}
|
|
103
|
-
setState({
|
|
104
|
-
cursorOffset: nextCursorOffset,
|
|
105
|
-
cursorWidth: nextCursorWidth
|
|
106
|
-
});
|
|
107
|
-
if (nextValue !== originalValue) {
|
|
108
|
-
onChange(nextValue);
|
|
109
|
-
}
|
|
110
|
-
}, {
|
|
111
|
-
isActive: focus
|
|
112
|
-
});
|
|
113
|
-
return /*#__PURE__*/ _jsxs(Box, {
|
|
114
|
-
...boxProps,
|
|
115
|
-
children: [
|
|
116
|
-
/*#__PURE__*/ _jsx(Box, {
|
|
117
|
-
marginRight: 1,
|
|
118
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
119
|
-
children: isComplete ? icons.success : icons.question
|
|
120
|
-
})
|
|
121
|
-
}),
|
|
122
|
-
/*#__PURE__*/ _jsxs(Box, {
|
|
123
|
-
flexDirection: "column",
|
|
124
|
-
children: [
|
|
125
|
-
/*#__PURE__*/ _jsx(Box, {
|
|
126
|
-
marginRight: 1,
|
|
127
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
128
|
-
color: colors.highlighted,
|
|
129
|
-
children: label
|
|
130
|
-
})
|
|
131
|
-
}),
|
|
132
|
-
isComplete ? /*#__PURE__*/ _jsx(Text, {
|
|
133
|
-
color: colors.body,
|
|
134
|
-
children: value
|
|
135
|
-
}) : /*#__PURE__*/ _jsx(Text, {
|
|
136
|
-
color: colors.highlighted,
|
|
137
|
-
children: placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue
|
|
138
|
-
}),
|
|
139
|
-
validationError ? /*#__PURE__*/ _jsx(Box, {
|
|
140
|
-
marginTop: 0,
|
|
141
|
-
children: /*#__PURE__*/ _jsx(Text, {
|
|
142
|
-
color: colors.warning,
|
|
143
|
-
children: validationError
|
|
144
|
-
})
|
|
145
|
-
}) : null
|
|
146
|
-
]
|
|
147
|
-
})
|
|
148
|
-
]
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/form/TextInput.tsx"],"sourcesContent":["// TODO: resolve\n/* eslint-disable complexity -- TODO */\nimport chalk from 'chalk';\nimport {Box, type BoxProps, Text, useInput} from 'ink';\nimport {useEffect, useState} from 'react';\n\nimport * as colors from '../colors.js';\nimport * as icons from '../icons.js';\n\n/**\n * Text input component props.\n */\nexport type TextInputProps = BoxProps & {\n /** Text to display as a label. */\n label: string;\n\n /** Text to display when `value` is empty. */\n placeholder?: string | undefined;\n\n /** Value. */\n value: string;\n\n /** Should component listen to Listen to user's input? Useful in case there are multiple input components at the same time and input must be handled only by a specific component. */\n focus?: boolean | undefined;\n\n /** Replace all chars and mask the value. Useful for password inputs. */\n mask?: string | undefined;\n\n /** Show cursor and allow navigation using arrow keys. */\n showCursor?: boolean | undefined;\n\n /** Validation function that is called when value changes. If this function throws an error*/\n validate?: ((value: string) => void) | undefined;\n\n /** Handler function that is called when value changes. */\n onChange: (value: string) => void;\n\n /** Handler function that is called when enter is pressed. */\n onSubmit?: ((value: string) => void) | undefined;\n\n /** Indicates whether value has been accepted. Component then doesn't accept more input. */\n isComplete?: boolean | undefined;\n};\n\n/**\n * Text input component.\n */\nexport function TextInput({\n label,\n validate,\n isComplete,\n value: originalValue,\n placeholder = '',\n focus = true,\n mask,\n showCursor = true,\n onChange,\n onSubmit,\n ...boxProps\n}: TextInputProps) {\n let [validationError, setValidationError] = useState('');\n let [state, setState] = useState({\n cursorOffset: (originalValue || '').length,\n cursorWidth: 0,\n });\n\n useEffect(() => {\n setState((previousState) => {\n if (!focus || !showCursor) {\n return previousState;\n }\n\n let newValue = originalValue || '';\n\n if (previousState.cursorOffset > newValue.length - 1) {\n return {\n cursorOffset: newValue.length,\n cursorWidth: 0,\n };\n }\n\n return previousState;\n });\n }, [originalValue, focus, showCursor]);\n\n let value = mask ? mask.repeat(originalValue.length) : originalValue;\n let renderedValue = value;\n let renderedPlaceholder = placeholder ? chalk[colors.muted](placeholder) : undefined;\n\n if (showCursor && focus) {\n renderedPlaceholder =\n placeholder.length > 0\n ? chalk.inverse(placeholder[0]) + chalk[colors.muted](placeholder.slice(1))\n : chalk.inverse(' ');\n\n renderedValue = value.length > 0 ? '' : chalk.inverse(' ');\n\n for (let [i, character] of Object.entries(value)) {\n if (Number(i) >= state.cursorOffset && Number(i) <= state.cursorOffset) {\n renderedValue += chalk.inverse(character);\n } else {\n renderedValue += character;\n }\n }\n\n if (value.length > 0 && state.cursorOffset === value.length) {\n renderedValue += chalk.inverse(' ');\n }\n }\n\n useInput(\n (input, key) => {\n if (\n key.upArrow ||\n key.downArrow ||\n (key.ctrl && input === 'c') ||\n (key.shift && key.tab) ||\n key.tab\n ) {\n return;\n }\n\n if (key.return) {\n if (onSubmit) {\n if (validate) {\n try {\n validate(originalValue);\n } catch (error: unknown) {\n setValidationError((error as Error).message);\n\n return;\n }\n }\n\n if (validationError) {\n setValidationError('');\n } else {\n onSubmit(originalValue);\n }\n }\n\n return;\n }\n\n let nextCursorOffset = state.cursorOffset;\n let nextValue = originalValue;\n let nextCursorWidth = 0;\n\n if (key.leftArrow) {\n if (showCursor) {\n nextCursorOffset -= 1;\n }\n } else if (key.rightArrow) {\n if (showCursor) {\n nextCursorOffset += 1;\n }\n } else if (key.backspace || key.delete) {\n if (state.cursorOffset > 0) {\n nextValue =\n originalValue.slice(0, state.cursorOffset - 1) +\n originalValue.slice(state.cursorOffset, originalValue.length);\n\n nextCursorOffset -= 1;\n }\n } else {\n nextValue =\n originalValue.slice(0, state.cursorOffset) +\n input +\n originalValue.slice(state.cursorOffset, originalValue.length);\n\n nextCursorOffset += input.length;\n\n if (input.length > 1) {\n nextCursorWidth = input.length;\n }\n }\n\n if (state.cursorOffset < 0) {\n nextCursorOffset = 0;\n }\n\n if (state.cursorOffset > originalValue.length) {\n nextCursorOffset = originalValue.length;\n }\n\n setState({\n cursorOffset: nextCursorOffset,\n cursorWidth: nextCursorWidth,\n });\n\n if (nextValue !== originalValue) {\n onChange(nextValue);\n }\n },\n {isActive: focus},\n );\n\n return (\n <Box {...boxProps}>\n <Box marginRight={1}>\n <Text>{isComplete ? icons.success : icons.question}</Text>\n </Box>\n\n <Box flexDirection=\"column\">\n <Box marginRight={1}>\n <Text color={colors.highlighted}>{label}</Text>\n </Box>\n {isComplete ? (\n <Text color={colors.body}>{value}</Text>\n ) : (\n <Text color={colors.highlighted}>\n {placeholder ? (value.length > 0 ? renderedValue : renderedPlaceholder) : renderedValue}\n </Text>\n )}\n {validationError ? (\n <Box marginTop={0}>\n <Text color={colors.warning}>{validationError}</Text>\n </Box>\n ) : null}\n </Box>\n </Box>\n );\n}\n"],"names":["chalk","Box","Text","useInput","useEffect","useState","colors","icons","TextInput","label","validate","isComplete","value","originalValue","placeholder","focus","mask","showCursor","onChange","onSubmit","boxProps","validationError","setValidationError","state","setState","cursorOffset","length","cursorWidth","previousState","newValue","repeat","renderedValue","renderedPlaceholder","muted","undefined","inverse","slice","i","character","Object","entries","Number","input","key","upArrow","downArrow","ctrl","shift","tab","return","error","message","nextCursorOffset","nextValue","nextCursorWidth","leftArrow","rightArrow","backspace","delete","isActive","marginRight","success","question","flexDirection","color","highlighted","body","marginTop","warning"],"mappings":"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"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from 'ink';
|
|
3
|
-
import { useCallback } from 'react';
|
|
4
|
-
import { FormRow } from './FormRow.js';
|
|
5
|
-
/**
|
|
6
|
-
* Creates form component that contains individual rows with inputs based on the provided config.
|
|
7
|
-
*
|
|
8
|
-
* @param formConfig Form configuration.
|
|
9
|
-
* @returns Form component.
|
|
10
|
-
*/ export function createForm(formConfig) {
|
|
11
|
-
let Form = ({ rows, values: results, onChange, onComplete: onFinish, ...boxProps })=>{
|
|
12
|
-
let handleChange = useCallback((value, rowName)=>{
|
|
13
|
-
if (onChange) {
|
|
14
|
-
onChange({
|
|
15
|
-
...results,
|
|
16
|
-
[rowName]: {
|
|
17
|
-
...results[rowName],
|
|
18
|
-
value
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}, [
|
|
23
|
-
onChange,
|
|
24
|
-
results
|
|
25
|
-
]);
|
|
26
|
-
let handleFinish = useCallback((value, rowName)=>{
|
|
27
|
-
onFinish({
|
|
28
|
-
...results,
|
|
29
|
-
[rowName]: {
|
|
30
|
-
value,
|
|
31
|
-
isComplete: true
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}, [
|
|
35
|
-
onFinish,
|
|
36
|
-
results
|
|
37
|
-
]);
|
|
38
|
-
let inputElements = [];
|
|
39
|
-
let activeInputName = null;
|
|
40
|
-
for (let [rowName] of Object.entries(formConfig.rows)){
|
|
41
|
-
if (!results[rowName].isComplete) {
|
|
42
|
-
activeInputName = String(rowName);
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
for (let [rowName, input] of Object.entries(formConfig.rows)){
|
|
47
|
-
if (results[rowName].isComplete || rowName === activeInputName) {
|
|
48
|
-
inputElements.push(/*#__PURE__*/ _jsx(FormRow, {
|
|
49
|
-
marginTop: inputElements.length === 0 ? 0 : 1,
|
|
50
|
-
focus: rowName === activeInputName,
|
|
51
|
-
isComplete: results[rowName].isComplete,
|
|
52
|
-
config: input,
|
|
53
|
-
rows: rows,
|
|
54
|
-
rowName: rowName,
|
|
55
|
-
value: results[rowName].value,
|
|
56
|
-
onChange: handleChange,
|
|
57
|
-
onComplete: handleFinish
|
|
58
|
-
}, rowName));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return /*#__PURE__*/ _jsx(Box, {
|
|
62
|
-
...boxProps,
|
|
63
|
-
flexDirection: "column",
|
|
64
|
-
children: inputElements
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
return Object.assign(Form, {
|
|
68
|
-
config: formConfig
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=createForm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/form/createForm.tsx"],"sourcesContent":["import {Box, type BoxProps} from 'ink';\nimport {useCallback} from 'react';\n\nimport {type Form} from './Form.js';\nimport {type FormConfig} from './FormConfig.js';\nimport {type FormProps} from './FormProps.js';\nimport {FormRow} from './FormRow.js';\n\n/**\n * Creates form component that contains individual rows with inputs based on the provided config.\n *\n * @param formConfig Form configuration.\n * @returns Form component.\n */\nexport function createForm<C extends FormConfig>(formConfig: C): Form<C> {\n let Form = ({\n rows,\n values: results,\n onChange,\n onComplete: onFinish,\n ...boxProps\n }: FormProps<C>) => {\n let handleChange = useCallback(\n (value: unknown, rowName: keyof C['rows']) => {\n if (onChange) {\n onChange({\n ...results,\n [rowName]: {\n ...results[rowName],\n value,\n },\n });\n }\n },\n [onChange, results],\n );\n\n let handleFinish = useCallback(\n (value: unknown, rowName: keyof C['rows']) => {\n onFinish({\n ...results,\n [rowName]: {\n value,\n isComplete: true,\n },\n });\n },\n [onFinish, results],\n );\n\n let inputElements = [];\n let activeInputName: string | null = null;\n\n for (let [rowName] of Object.entries(formConfig.rows)) {\n if (!results[rowName as keyof C['rows']].isComplete) {\n activeInputName = String(rowName);\n\n break;\n }\n }\n\n for (let [rowName, input] of Object.entries(formConfig.rows)) {\n if (results[rowName as keyof C['rows']].isComplete || rowName === activeInputName) {\n inputElements.push(\n <FormRow\n key={rowName}\n marginTop={inputElements.length === 0 ? 0 : 1}\n focus={rowName === activeInputName}\n isComplete={results[rowName as keyof C['rows']].isComplete}\n config={input}\n rows={rows}\n rowName={rowName}\n value={results[rowName as keyof C['rows']].value}\n onChange={handleChange}\n onComplete={handleFinish}\n />,\n );\n }\n }\n\n return (\n <Box {...(boxProps as BoxProps)} flexDirection=\"column\">\n {inputElements}\n </Box>\n );\n };\n\n return Object.assign(Form, {config: formConfig});\n}\n"],"names":["Box","useCallback","FormRow","createForm","formConfig","Form","rows","values","results","onChange","onComplete","onFinish","boxProps","handleChange","value","rowName","handleFinish","isComplete","inputElements","activeInputName","Object","entries","String","input","push","marginTop","length","focus","config","flexDirection","assign"],"mappings":";AAAA,SAAQA,GAAG,QAAsB,MAAM;AACvC,SAAQC,WAAW,QAAO,QAAQ;AAKlC,SAAQC,OAAO,QAAO,eAAe;AAErC;;;;;CAKC,GACD,OAAO,SAASC,WAAiCC,UAAa;IAC5D,IAAIC,OAAO,CAAC,EACVC,IAAI,EACJC,QAAQC,OAAO,EACfC,QAAQ,EACRC,YAAYC,QAAQ,EACpB,GAAGC,UACU;QACb,IAAIC,eAAeZ,YACjB,CAACa,OAAgBC;YACf,IAAIN,UAAU;gBACZA,SAAS;oBACP,GAAGD,OAAO;oBACV,CAACO,QAAQ,EAAE;wBACT,GAAGP,OAAO,CAACO,QAAQ;wBACnBD;oBACF;gBACF;YACF;QACF,GACA;YAACL;YAAUD;SAAQ;QAGrB,IAAIQ,eAAef,YACjB,CAACa,OAAgBC;YACfJ,SAAS;gBACP,GAAGH,OAAO;gBACV,CAACO,QAAQ,EAAE;oBACTD;oBACAG,YAAY;gBACd;YACF;QACF,GACA;YAACN;YAAUH;SAAQ;QAGrB,IAAIU,gBAAgB,EAAE;QACtB,IAAIC,kBAAiC;QAErC,KAAK,IAAI,CAACJ,QAAQ,IAAIK,OAAOC,OAAO,CAACjB,WAAWE,IAAI,EAAG;YACrD,IAAI,CAACE,OAAO,CAACO,QAA2B,CAACE,UAAU,EAAE;gBACnDE,kBAAkBG,OAAOP;gBAEzB;YACF;QACF;QAEA,KAAK,IAAI,CAACA,SAASQ,MAAM,IAAIH,OAAOC,OAAO,CAACjB,WAAWE,IAAI,EAAG;YAC5D,IAAIE,OAAO,CAACO,QAA2B,CAACE,UAAU,IAAIF,YAAYI,iBAAiB;gBACjFD,cAAcM,IAAI,eAChB,KAACtB;oBAECuB,WAAWP,cAAcQ,MAAM,KAAK,IAAI,IAAI;oBAC5CC,OAAOZ,YAAYI;oBACnBF,YAAYT,OAAO,CAACO,QAA2B,CAACE,UAAU;oBAC1DW,QAAQL;oBACRjB,MAAMA;oBACNS,SAASA;oBACTD,OAAON,OAAO,CAACO,QAA2B,CAACD,KAAK;oBAChDL,UAAUI;oBACVH,YAAYM;mBATPD;YAYX;QACF;QAEA,qBACE,KAACf;YAAK,GAAIY,QAAQ;YAAeiB,eAAc;sBAC5CX;;IAGP;IAEA,OAAOE,OAAOU,MAAM,CAACzB,MAAM;QAACuB,QAAQxB;IAAU;AAChD"}
|
package/dist/ui/form.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './form/Form.js';
|
|
2
|
-
export * from './form/FormConfig.js';
|
|
3
|
-
export * from './form/FormProps.js';
|
|
4
|
-
export * from './form/FormRowConfig.js';
|
|
5
|
-
export * from './form/FormRowsConfig.js';
|
|
6
|
-
export * from './form/FormValue.js';
|
|
7
|
-
export * from './form/FormValues.js';
|
|
8
|
-
export * from './form/FormResult.js';
|
|
9
|
-
export * from './form/createForm.js';
|
|
10
|
-
export * from './form/FormRow.js';
|
|
11
|
-
export * from './form/SelectInput.js';
|
|
12
|
-
export * from './form/SelectInputItem.js';
|
|
13
|
-
export * from './form/TextInput.js';
|
|
14
|
-
|
|
15
|
-
//# sourceMappingURL=form.js.map
|
package/dist/ui/form.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/form.ts"],"sourcesContent":["export * from './form/Form.js';\nexport * from './form/FormConfig.js';\nexport * from './form/FormProps.js';\nexport * from './form/FormRowConfig.js';\nexport * from './form/FormRowsConfig.js';\nexport * from './form/FormValue.js';\nexport * from './form/FormValues.js';\nexport * from './form/FormResult.js';\nexport * from './form/createForm.js';\nexport * from './form/FormRow.js';\nexport * from './form/SelectInput.js';\nexport * from './form/SelectInputItem.js';\nexport * from './form/TextInput.js';\n"],"names":[],"mappings":"AAAA,cAAc,iBAAiB;AAC/B,cAAc,uBAAuB;AACrC,cAAc,sBAAsB;AACpC,cAAc,0BAA0B;AACxC,cAAc,2BAA2B;AACzC,cAAc,sBAAsB;AACpC,cAAc,uBAAuB;AACrC,cAAc,uBAAuB;AACrC,cAAc,uBAAuB;AACrC,cAAc,oBAAoB;AAClC,cAAc,wBAAwB;AACtC,cAAc,4BAA4B;AAC1C,cAAc,sBAAsB"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ValidationError, ParsingError } from '@jakubmazanec/args';
|
|
2
|
-
import { zodIssuesToStrings } from '@jakubmazanec/zod-utils';
|
|
3
|
-
import { ZodError } from 'zod';
|
|
4
|
-
/**
|
|
5
|
-
* Creates detailed information about an error.
|
|
6
|
-
*/ export function getErrorDetail(error) {
|
|
7
|
-
// TODO: add all codes
|
|
8
|
-
if (error instanceof ParsingError) {
|
|
9
|
-
switch(error.code){
|
|
10
|
-
default:
|
|
11
|
-
{
|
|
12
|
-
return {
|
|
13
|
-
label: 'Parsing error',
|
|
14
|
-
description: error.message
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
// TODO: add all codes
|
|
20
|
-
if (error instanceof ValidationError) {
|
|
21
|
-
switch(error.code){
|
|
22
|
-
default:
|
|
23
|
-
{
|
|
24
|
-
return {
|
|
25
|
-
label: 'Validation error',
|
|
26
|
-
description: error.message
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
// TODO: add all built-in errors
|
|
32
|
-
if (error instanceof ReferenceError) {
|
|
33
|
-
let errorDetail = {
|
|
34
|
-
label: 'Error',
|
|
35
|
-
description: error.message
|
|
36
|
-
};
|
|
37
|
-
if (error.stack) {
|
|
38
|
-
errorDetail.stack = error.stack;
|
|
39
|
-
}
|
|
40
|
-
return errorDetail;
|
|
41
|
-
}
|
|
42
|
-
if (error instanceof ZodError) {
|
|
43
|
-
let errorDetail = {
|
|
44
|
-
label: 'Error',
|
|
45
|
-
description: zodIssuesToStrings(error.issues).join('\n')
|
|
46
|
-
};
|
|
47
|
-
return errorDetail;
|
|
48
|
-
}
|
|
49
|
-
if (error instanceof Error) {
|
|
50
|
-
let errorDetail = {
|
|
51
|
-
label: 'Error',
|
|
52
|
-
description: error.message
|
|
53
|
-
};
|
|
54
|
-
if (error.stack) {
|
|
55
|
-
errorDetail.stack = error.stack;
|
|
56
|
-
}
|
|
57
|
-
if (error.cause instanceof Error) {
|
|
58
|
-
errorDetail.cause = {
|
|
59
|
-
description: error.cause.message
|
|
60
|
-
};
|
|
61
|
-
if (error.cause.stack) {
|
|
62
|
-
errorDetail.cause.stack = error.cause.stack;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return errorDetail;
|
|
66
|
-
}
|
|
67
|
-
return {
|
|
68
|
-
label: 'Error'
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//# sourceMappingURL=getErrorDetail.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/getErrorDetail.ts"],"sourcesContent":["import {ValidationError, ParsingError} from '@jakubmazanec/args';\nimport {zodIssuesToStrings} from '@jakubmazanec/zod-utils';\nimport {ZodError} from 'zod';\n\nimport {type ErrorDetail} from './ErrorDetail.js';\n\n/**\n * Creates detailed information about an error.\n */\nexport function getErrorDetail(error: unknown): ErrorDetail {\n // TODO: add all codes\n if (error instanceof ParsingError) {\n switch (error.code) {\n default: {\n return {\n label: 'Parsing error',\n description: error.message,\n };\n }\n }\n }\n\n // TODO: add all codes\n if (error instanceof ValidationError) {\n switch (error.code) {\n default: {\n return {\n label: 'Validation error',\n description: error.message,\n };\n }\n }\n }\n\n // TODO: add all built-in errors\n if (error instanceof ReferenceError) {\n let errorDetail: ErrorDetail = {\n label: 'Error',\n description: error.message,\n };\n\n if (error.stack) {\n errorDetail.stack = error.stack;\n }\n\n return errorDetail;\n }\n\n if (error instanceof ZodError) {\n let errorDetail: ErrorDetail = {\n label: 'Error',\n description: zodIssuesToStrings(error.issues).join('\\n'),\n };\n\n return errorDetail;\n }\n\n if (error instanceof Error) {\n let errorDetail: ErrorDetail = {\n label: 'Error',\n description: error.message,\n };\n\n if (error.stack) {\n errorDetail.stack = error.stack;\n }\n\n if (error.cause instanceof Error) {\n errorDetail.cause = {\n description: error.cause.message,\n };\n\n if (error.cause.stack) {\n errorDetail.cause.stack = error.cause.stack;\n }\n }\n\n return errorDetail;\n }\n\n return {\n label: 'Error',\n };\n}\n"],"names":["ValidationError","ParsingError","zodIssuesToStrings","ZodError","getErrorDetail","error","code","label","description","message","ReferenceError","errorDetail","stack","issues","join","Error","cause"],"mappings":"AAAA,SAAQA,eAAe,EAAEC,YAAY,QAAO,qBAAqB;AACjE,SAAQC,kBAAkB,QAAO,0BAA0B;AAC3D,SAAQC,QAAQ,QAAO,MAAM;AAI7B;;CAEC,GACD,OAAO,SAASC,eAAeC,KAAc;IAC3C,sBAAsB;IACtB,IAAIA,iBAAiBJ,cAAc;QACjC,OAAQI,MAAMC,IAAI;YAChB;gBAAS;oBACP,OAAO;wBACLC,OAAO;wBACPC,aAAaH,MAAMI,OAAO;oBAC5B;gBACF;QACF;IACF;IAEA,sBAAsB;IACtB,IAAIJ,iBAAiBL,iBAAiB;QACpC,OAAQK,MAAMC,IAAI;YAChB;gBAAS;oBACP,OAAO;wBACLC,OAAO;wBACPC,aAAaH,MAAMI,OAAO;oBAC5B;gBACF;QACF;IACF;IAEA,gCAAgC;IAChC,IAAIJ,iBAAiBK,gBAAgB;QACnC,IAAIC,cAA2B;YAC7BJ,OAAO;YACPC,aAAaH,MAAMI,OAAO;QAC5B;QAEA,IAAIJ,MAAMO,KAAK,EAAE;YACfD,YAAYC,KAAK,GAAGP,MAAMO,KAAK;QACjC;QAEA,OAAOD;IACT;IAEA,IAAIN,iBAAiBF,UAAU;QAC7B,IAAIQ,cAA2B;YAC7BJ,OAAO;YACPC,aAAaN,mBAAmBG,MAAMQ,MAAM,EAAEC,IAAI,CAAC;QACrD;QAEA,OAAOH;IACT;IAEA,IAAIN,iBAAiBU,OAAO;QAC1B,IAAIJ,cAA2B;YAC7BJ,OAAO;YACPC,aAAaH,MAAMI,OAAO;QAC5B;QAEA,IAAIJ,MAAMO,KAAK,EAAE;YACfD,YAAYC,KAAK,GAAGP,MAAMO,KAAK;QACjC;QAEA,IAAIP,MAAMW,KAAK,YAAYD,OAAO;YAChCJ,YAAYK,KAAK,GAAG;gBAClBR,aAAaH,MAAMW,KAAK,CAACP,OAAO;YAClC;YAEA,IAAIJ,MAAMW,KAAK,CAACJ,KAAK,EAAE;gBACrBD,YAAYK,KAAK,CAACJ,KAAK,GAAGP,MAAMW,KAAK,CAACJ,KAAK;YAC7C;QACF;QAEA,OAAOD;IACT;IAEA,OAAO;QACLJ,OAAO;IACT;AACF"}
|
package/dist/ui/icons.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
import * as colors from './colors.js';
|
|
3
|
-
export const question = chalk[colors.notice]('?');
|
|
4
|
-
export const info = chalk[colors.info]('i');
|
|
5
|
-
export const success = chalk[colors.success]('✓');
|
|
6
|
-
export const warning = chalk[colors.warning]('▲');
|
|
7
|
-
export const error = chalk[colors.failure]('×');
|
|
8
|
-
export const unselectedSquare = chalk[colors.unselected]('◻');
|
|
9
|
-
export const selectedSquare = chalk[colors.selected]('◼');
|
|
10
|
-
export const unselectedCircle = chalk[colors.unselected]('○');
|
|
11
|
-
export const selectedCircle = chalk[colors.selected]('●');
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=icons.js.map
|
package/dist/ui/icons.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/icons.ts"],"sourcesContent":["import chalk from 'chalk';\n\nimport * as colors from './colors.js';\n\nexport const question = chalk[colors.notice]('?');\nexport const info = chalk[colors.info]('i');\nexport const success = chalk[colors.success]('✓');\nexport const warning = chalk[colors.warning]('▲');\nexport const error = chalk[colors.failure]('×');\nexport const unselectedSquare = chalk[colors.unselected]('◻');\nexport const selectedSquare = chalk[colors.selected]('◼');\nexport const unselectedCircle = chalk[colors.unselected]('○');\nexport const selectedCircle = chalk[colors.selected]('●');\n"],"names":["chalk","colors","question","notice","info","success","warning","error","failure","unselectedSquare","unselected","selectedSquare","selected","unselectedCircle","selectedCircle"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAE1B,YAAYC,YAAY,cAAc;AAEtC,OAAO,MAAMC,WAAWF,KAAK,CAACC,OAAOE,MAAM,CAAC,CAAC,KAAK;AAClD,OAAO,MAAMC,OAAOJ,KAAK,CAACC,OAAOG,IAAI,CAAC,CAAC,KAAK;AAC5C,OAAO,MAAMC,UAAUL,KAAK,CAACC,OAAOI,OAAO,CAAC,CAAC,KAAK;AAClD,OAAO,MAAMC,UAAUN,KAAK,CAACC,OAAOK,OAAO,CAAC,CAAC,KAAK;AAClD,OAAO,MAAMC,QAAQP,KAAK,CAACC,OAAOO,OAAO,CAAC,CAAC,KAAK;AAChD,OAAO,MAAMC,mBAAmBT,KAAK,CAACC,OAAOS,UAAU,CAAC,CAAC,KAAK;AAC9D,OAAO,MAAMC,iBAAiBX,KAAK,CAACC,OAAOW,QAAQ,CAAC,CAAC,KAAK;AAC1D,OAAO,MAAMC,mBAAmBb,KAAK,CAACC,OAAOS,UAAU,CAAC,CAAC,KAAK;AAC9D,OAAO,MAAMI,iBAAiBd,KAAK,CAACC,OAAOW,QAAQ,CAAC,CAAC,KAAK"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Spacer, Text } from 'ink';
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
import { ErrorBoundary } from 'react-error-boundary';
|
|
5
|
-
import { programContext } from './programContext.js';
|
|
6
|
-
import { highlighted, notice } from '../colors.js';
|
|
7
|
-
import { Failure } from '../Failure.js';
|
|
8
|
-
/**
|
|
9
|
-
* A component that wraps anything {@link Program} tries to render with an error boundary and all neccessary providers.
|
|
10
|
-
*/ export const Wrapper = ({ program, children })=>{
|
|
11
|
-
let programContextValue = useMemo(()=>({
|
|
12
|
-
program
|
|
13
|
-
}), [
|
|
14
|
-
program
|
|
15
|
-
]);
|
|
16
|
-
return /*#__PURE__*/ _jsx(ErrorBoundary, {
|
|
17
|
-
FallbackComponent: Failure,
|
|
18
|
-
children: /*#__PURE__*/ _jsxs(programContext.Provider, {
|
|
19
|
-
value: programContextValue,
|
|
20
|
-
children: [
|
|
21
|
-
program.latestVersion && program.latestVersion !== program.version ? /*#__PURE__*/ _jsxs(Box, {
|
|
22
|
-
children: [
|
|
23
|
-
/*#__PURE__*/ _jsxs(Box, {
|
|
24
|
-
flexDirection: "column",
|
|
25
|
-
borderColor: notice,
|
|
26
|
-
borderStyle: "round",
|
|
27
|
-
margin: 1,
|
|
28
|
-
paddingTop: 1,
|
|
29
|
-
paddingRight: 4,
|
|
30
|
-
paddingBottom: 1,
|
|
31
|
-
paddingLeft: 4,
|
|
32
|
-
children: [
|
|
33
|
-
/*#__PURE__*/ _jsxs(Text, {
|
|
34
|
-
children: [
|
|
35
|
-
"New version ",
|
|
36
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
37
|
-
color: highlighted,
|
|
38
|
-
children: program.latestVersion
|
|
39
|
-
}),
|
|
40
|
-
" is available!"
|
|
41
|
-
]
|
|
42
|
-
}),
|
|
43
|
-
/*#__PURE__*/ _jsxs(Text, {
|
|
44
|
-
children: [
|
|
45
|
-
"Run ",
|
|
46
|
-
/*#__PURE__*/ _jsx(Text, {
|
|
47
|
-
color: highlighted,
|
|
48
|
-
children: `npm install ${program.name} -D`
|
|
49
|
-
}),
|
|
50
|
-
" to update."
|
|
51
|
-
]
|
|
52
|
-
})
|
|
53
|
-
]
|
|
54
|
-
}),
|
|
55
|
-
/*#__PURE__*/ _jsx(Spacer, {})
|
|
56
|
-
]
|
|
57
|
-
}) : null,
|
|
58
|
-
/*#__PURE__*/ _jsx(Box, {
|
|
59
|
-
children: children
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
})
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=Wrapper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/internals/Wrapper.tsx"],"sourcesContent":["import {Box, Spacer, Text} from 'ink';\nimport {useMemo, type FC, type PropsWithChildren} from 'react';\nimport {ErrorBoundary} from 'react-error-boundary';\n\nimport {programContext} from './programContext.js';\nimport {type Program} from '../../program.js';\nimport {highlighted, notice} from '../colors.js';\nimport {Failure} from '../Failure.js';\n\n/**\n * {@link Wrapper} component props.\n */\nexport type WrapperProps = {\n program: Program;\n};\n\n/**\n * A component that wraps anything {@link Program} tries to render with an error boundary and all neccessary providers.\n */\nexport const Wrapper: FC<PropsWithChildren<WrapperProps>> = ({program, children}) => {\n let programContextValue = useMemo(\n () => ({\n program,\n }),\n [program],\n );\n\n return (\n <ErrorBoundary FallbackComponent={Failure}>\n <programContext.Provider value={programContextValue}>\n {program.latestVersion && program.latestVersion !== program.version ? (\n <Box>\n <Box\n flexDirection=\"column\"\n borderColor={notice}\n borderStyle=\"round\"\n margin={1}\n paddingTop={1}\n paddingRight={4}\n paddingBottom={1}\n paddingLeft={4}\n >\n <Text>\n New version <Text color={highlighted}>{program.latestVersion}</Text> is available!\n </Text>\n <Text>\n Run <Text color={highlighted}>{`npm install ${program.name} -D`}</Text> to update.\n </Text>\n </Box>\n <Spacer />\n </Box>\n ) : null}\n <Box>{children}</Box>\n </programContext.Provider>\n </ErrorBoundary>\n );\n};\n"],"names":["Box","Spacer","Text","useMemo","ErrorBoundary","programContext","highlighted","notice","Failure","Wrapper","program","children","programContextValue","FallbackComponent","Provider","value","latestVersion","version","flexDirection","borderColor","borderStyle","margin","paddingTop","paddingRight","paddingBottom","paddingLeft","color","name"],"mappings":";AAAA,SAAQA,GAAG,EAAEC,MAAM,EAAEC,IAAI,QAAO,MAAM;AACtC,SAAQC,OAAO,QAAwC,QAAQ;AAC/D,SAAQC,aAAa,QAAO,uBAAuB;AAEnD,SAAQC,cAAc,QAAO,sBAAsB;AAEnD,SAAQC,WAAW,EAAEC,MAAM,QAAO,eAAe;AACjD,SAAQC,OAAO,QAAO,gBAAgB;AAStC;;CAEC,GACD,OAAO,MAAMC,UAA+C,CAAC,EAACC,OAAO,EAAEC,QAAQ,EAAC;IAC9E,IAAIC,sBAAsBT,QACxB,IAAO,CAAA;YACLO;QACF,CAAA,GACA;QAACA;KAAQ;IAGX,qBACE,KAACN;QAAcS,mBAAmBL;kBAChC,cAAA,MAACH,eAAeS,QAAQ;YAACC,OAAOH;;gBAC7BF,QAAQM,aAAa,IAAIN,QAAQM,aAAa,KAAKN,QAAQO,OAAO,iBACjE,MAACjB;;sCACC,MAACA;4BACCkB,eAAc;4BACdC,aAAaZ;4BACba,aAAY;4BACZC,QAAQ;4BACRC,YAAY;4BACZC,cAAc;4BACdC,eAAe;4BACfC,aAAa;;8CAEb,MAACvB;;wCAAK;sDACQ,KAACA;4CAAKwB,OAAOpB;sDAAcI,QAAQM,aAAa;;wCAAQ;;;8CAEtE,MAACd;;wCAAK;sDACA,KAACA;4CAAKwB,OAAOpB;sDAAc,CAAC,YAAY,EAAEI,QAAQiB,IAAI,CAAC,GAAG,CAAC;;wCAAQ;;;;;sCAG3E,KAAC1B;;qBAED;8BACJ,KAACD;8BAAKW;;;;;AAId,EAAE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/internals/programContext.ts"],"sourcesContent":["import React from 'react';\n\nimport {type Program} from '../../program/Program.js';\n\nexport type ProgramContext = {\n program: Program;\n};\n\n/**\n * A React context that stores {@link Program} instance.\n */\nexport const programContext = React.createContext<ProgramContext>({} as ProgramContext);\n"],"names":["React","programContext","createContext"],"mappings":"AAAA,OAAOA,WAAW,QAAQ;AAQ1B;;CAEC,GACD,OAAO,MAAMC,iBAAiBD,MAAME,aAAa,CAAiB,CAAC,GAAqB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rotate an array by `n` places.
|
|
3
|
-
*
|
|
4
|
-
* @param value An array to rotate.
|
|
5
|
-
* @param n By how many places the items should move.
|
|
6
|
-
* @returns The new item with items rotated.
|
|
7
|
-
*/ export function rotate(value, n) {
|
|
8
|
-
let x = [
|
|
9
|
-
...value
|
|
10
|
-
];
|
|
11
|
-
return [
|
|
12
|
-
...x.splice(-n % x.length),
|
|
13
|
-
...x
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=rotate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/ui/internals/rotate.ts"],"sourcesContent":["/**\n * Rotate an array by `n` places.\n *\n * @param value An array to rotate.\n * @param n By how many places the items should move.\n * @returns The new item with items rotated.\n */\nexport function rotate<T>(value: T[], n: number) {\n let x = [...value];\n\n return [...x.splice(-n % x.length), ...x];\n}\n"],"names":["rotate","value","n","x","splice","length"],"mappings":"AAAA;;;;;;CAMC,GACD,OAAO,SAASA,OAAUC,KAAU,EAAEC,CAAS;IAC7C,IAAIC,IAAI;WAAIF;KAAM;IAElB,OAAO;WAAIE,EAAEC,MAAM,CAAC,CAACF,IAAIC,EAAEE,MAAM;WAAMF;KAAE;AAC3C"}
|
package/dist/ui/internals.js
DELETED
package/dist/ui/internals.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/internals.ts"],"sourcesContent":["export * from './internals/programContext.js';\nexport * from './internals/rotate.js';\nexport * from './internals/Wrapper.js';\n"],"names":[],"mappings":"AAAA,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB;AACtC,cAAc,yBAAyB"}
|
package/dist/ui/useProgram.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useApp } from 'ink';
|
|
2
|
-
import { useCallback, useContext } from 'react';
|
|
3
|
-
import { useErrorBoundary } from 'react-error-boundary';
|
|
4
|
-
import { programContext } from './internals.js';
|
|
5
|
-
/**
|
|
6
|
-
* A React hook for accessing {@link Program} instance and `exit` function that is used for showing an error (via an error boundary) and exiting.
|
|
7
|
-
*/ export function useProgram() {
|
|
8
|
-
let { showBoundary } = useErrorBoundary();
|
|
9
|
-
let { exit: appExit } = useApp();
|
|
10
|
-
let { program } = useContext(programContext);
|
|
11
|
-
let exit = useCallback((error)=>{
|
|
12
|
-
process.exitCode = 1;
|
|
13
|
-
showBoundary(error);
|
|
14
|
-
appExit(error);
|
|
15
|
-
}, [
|
|
16
|
-
appExit,
|
|
17
|
-
showBoundary
|
|
18
|
-
]);
|
|
19
|
-
return {
|
|
20
|
-
program,
|
|
21
|
-
exit
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=useProgram.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ui/useProgram.ts"],"sourcesContent":["import {useApp} from 'ink';\nimport {useCallback, useContext} from 'react';\nimport {useErrorBoundary} from 'react-error-boundary';\n\nimport {programContext} from './internals.js';\n\n/**\n * A React hook for accessing {@link Program} instance and `exit` function that is used for showing an error (via an error boundary) and exiting.\n */\nexport function useProgram() {\n let {showBoundary} = useErrorBoundary();\n let {exit: appExit} = useApp();\n let {program} = useContext(programContext);\n\n let exit = useCallback(\n (error: unknown) => {\n process.exitCode = 1;\n\n showBoundary(error);\n appExit(error as Error);\n },\n [appExit, showBoundary],\n );\n\n return {program, exit};\n}\n"],"names":["useApp","useCallback","useContext","useErrorBoundary","programContext","useProgram","showBoundary","exit","appExit","program","error","process","exitCode"],"mappings":"AAAA,SAAQA,MAAM,QAAO,MAAM;AAC3B,SAAQC,WAAW,EAAEC,UAAU,QAAO,QAAQ;AAC9C,SAAQC,gBAAgB,QAAO,uBAAuB;AAEtD,SAAQC,cAAc,QAAO,iBAAiB;AAE9C;;CAEC,GACD,OAAO,SAASC;IACd,IAAI,EAACC,YAAY,EAAC,GAAGH;IACrB,IAAI,EAACI,MAAMC,OAAO,EAAC,GAAGR;IACtB,IAAI,EAACS,OAAO,EAAC,GAAGP,WAAWE;IAE3B,IAAIG,OAAON,YACT,CAACS;QACCC,QAAQC,QAAQ,GAAG;QAEnBN,aAAaI;QACbF,QAAQE;IACV,GACA;QAACF;QAASF;KAAa;IAGzB,OAAO;QAACG;QAASF;IAAI;AACvB"}
|
package/dist/ui.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * as colors from './ui/colors.js';
|
|
2
|
-
export * from './ui/ErrorDetail.js';
|
|
3
|
-
export * from './ui/form.js';
|
|
4
|
-
export * from './ui/getErrorDetail.js';
|
|
5
|
-
export * as icons from './ui/icons.js';
|
|
6
|
-
export * from './ui/useProgram.js';
|
|
7
|
-
export * from './ui/Failure.js';
|
|
8
|
-
export * from './ui/Header.js';
|
|
9
|
-
export * from './ui/Help.js';
|
|
10
|
-
export * from './ui/Spinner.js';
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui.ts"],"sourcesContent":["export * as colors from './ui/colors.js';\nexport * from './ui/ErrorDetail.js';\nexport * from './ui/form.js';\nexport * from './ui/getErrorDetail.js';\nexport * as icons from './ui/icons.js';\nexport * from './ui/useProgram.js';\nexport * from './ui/Failure.js';\nexport * from './ui/Header.js';\nexport * from './ui/Help.js';\nexport * from './ui/Spinner.js';\n"],"names":["colors","icons"],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,iBAAiB;AACzC,cAAc,sBAAsB;AACpC,cAAc,eAAe;AAC7B,cAAc,yBAAyB;AACvC,OAAO,KAAKC,KAAK,MAAM,gBAAgB;AACvC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB;AAChC,cAAc,iBAAiB;AAC/B,cAAc,eAAe;AAC7B,cAAc,kBAAkB"}
|
|
File without changes
|
package/{dist → build}/main.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|