@maizzle/framework 6.0.0-rc.24 → 6.0.0-rc.25
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/build.js.map +1 -1
- package/dist/components/Body.vue +12 -0
- package/dist/components/Button.vue +16 -29
- package/dist/components/CodeBlock.vue +5 -4
- package/dist/components/CodeInline.vue +9 -8
- package/dist/components/Column.vue +17 -4
- package/dist/components/Container.vue +7 -11
- package/dist/components/Hr.vue +1 -1
- package/dist/components/Img.vue +39 -22
- package/dist/components/Layout.vue +1 -1
- package/dist/components/Markdown.vue +9 -14
- package/dist/components/QrCode.vue +2 -2
- package/dist/components/Section.vue +9 -6
- package/dist/components/Text.vue +2 -2
- package/dist/components/utils.d.ts +25 -1
- package/dist/components/utils.d.ts.map +1 -1
- package/dist/components/utils.js +29 -1
- package/dist/components/utils.js.map +1 -1
- package/dist/components/utils.ts +46 -0
- package/dist/composables/useConfig.d.ts.map +1 -1
- package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
- package/dist/composables/useEvent.d.ts.map +1 -1
- package/dist/composables/useFont.js.map +1 -1
- package/dist/config/index.js.map +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/plaintext.js.map +1 -1
- package/dist/plugins/postcss/mergeMediaQueries.js.map +1 -1
- package/dist/plugins/postcss/pruneVars.js.map +1 -1
- package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
- package/dist/plugins/postcss/quoteFontFamilies.js.map +1 -1
- package/dist/plugins/postcss/removeDeclarations.js.map +1 -1
- package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
- package/dist/plugins/postcss/resolveProps.js +0 -3
- package/dist/plugins/postcss/resolveProps.js.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.js.map +1 -1
- package/dist/prepare.js +1 -1
- package/dist/prepare.js.map +1 -1
- package/dist/render/active.d.ts.map +1 -1
- package/dist/render/createRenderer.d.ts.map +1 -1
- package/dist/render/createRenderer.js +3 -7
- package/dist/render/createRenderer.js.map +1 -1
- package/dist/render/index.js.map +1 -1
- package/dist/render/injectFonts.js.map +1 -1
- package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
- package/dist/render/plugins/codeBlockExtract.js.map +1 -1
- package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
- package/dist/render/plugins/markdownExtract.js.map +1 -1
- package/dist/render/plugins/rawExtract.d.ts.map +1 -1
- package/dist/render/plugins/rawExtract.js.map +1 -1
- package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
- package/dist/render/plugins/rowSourceLocation.js.map +1 -1
- package/dist/serve.js.map +1 -1
- package/dist/server/compatibility.d.ts.map +1 -1
- package/dist/server/compatibility.js.map +1 -1
- package/dist/server/linter.js.map +1 -1
- package/dist/server/sfc-utils.js.map +1 -1
- package/dist/tests/render/_helpers.d.ts.map +1 -1
- package/dist/tests/render/_helpers.js.map +1 -1
- package/dist/transformers/addAttributes.js +2 -3
- package/dist/transformers/addAttributes.js.map +1 -1
- package/dist/transformers/base.d.ts +1 -1
- package/dist/transformers/base.d.ts.map +1 -1
- package/dist/transformers/base.js +5 -10
- package/dist/transformers/base.js.map +1 -1
- package/dist/transformers/columnWidth.d.ts.map +1 -1
- package/dist/transformers/columnWidth.js +2 -7
- package/dist/transformers/columnWidth.js.map +1 -1
- package/dist/transformers/entities.js.map +1 -1
- package/dist/transformers/filters/defaults.js.map +1 -1
- package/dist/transformers/filters/index.js.map +1 -1
- package/dist/transformers/format.js.map +1 -1
- package/dist/transformers/imgWidth.d.ts +20 -0
- package/dist/transformers/imgWidth.d.ts.map +1 -0
- package/dist/transformers/imgWidth.js +76 -0
- package/dist/transformers/imgWidth.js.map +1 -0
- package/dist/transformers/index.d.ts.map +1 -1
- package/dist/transformers/index.js +2 -0
- package/dist/transformers/index.js.map +1 -1
- package/dist/transformers/inlineCss.d.ts +3 -2
- package/dist/transformers/inlineCss.d.ts.map +1 -1
- package/dist/transformers/inlineCss.js.map +1 -1
- package/dist/transformers/inlineLink.js +1 -1
- package/dist/transformers/inlineLink.js.map +1 -1
- package/dist/transformers/minify.js.map +1 -1
- package/dist/transformers/minifyCodeInline.js.map +1 -1
- package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
- package/dist/transformers/msoPlaceholders.js +2 -7
- package/dist/transformers/msoPlaceholders.js.map +1 -1
- package/dist/transformers/purgeCss.js.map +1 -1
- package/dist/transformers/replaceStrings.js.map +1 -1
- package/dist/transformers/safeSelectors.js.map +1 -1
- package/dist/transformers/shorthandCss.js.map +1 -1
- package/dist/transformers/tailwindComponent.js.map +1 -1
- package/dist/transformers/tailwindcss.js +1 -1
- package/dist/transformers/tailwindcss.js.map +1 -1
- package/dist/transformers/urlQuery.js.map +1 -1
- package/dist/types/config.d.ts +5 -4
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/ast/serializer.js.map +1 -1
- package/dist/utils/compileTailwindCss.js.map +1 -1
- package/dist/utils/componentSources.js.map +1 -1
- package/dist/utils/cssBox.d.ts.map +1 -1
- package/dist/utils/cssBox.js +2 -7
- package/dist/utils/cssBox.js.map +1 -1
- package/dist/utils/decodeStyleEntities.js.map +1 -1
- package/dist/utils/url.js.map +1 -1
- package/dist/utils/watchPaths.js.map +1 -1
- package/node_modules/@clack/core/CHANGELOG.md +30 -0
- package/node_modules/@clack/core/dist/index.d.mts +109 -3
- package/node_modules/@clack/core/dist/index.mjs +972 -17
- package/node_modules/@clack/core/package.json +2 -1
- package/node_modules/@clack/prompts/CHANGELOG.md +42 -0
- package/node_modules/@clack/prompts/README.md +30 -9
- package/node_modules/@clack/prompts/dist/index.d.mts +458 -27
- package/node_modules/@clack/prompts/dist/index.mjs +1378 -141
- package/node_modules/@clack/prompts/package.json +2 -2
- package/node_modules/tinyexec/package.json +4 -4
- package/package.json +8 -7
- package/dist/components/Overlap.vue +0 -156
- package/node_modules/@clack/core/dist/index.mjs.map +0 -1
- package/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
|
@@ -1,145 +1,1382 @@
|
|
|
1
|
-
import{getColumns
|
|
2
|
-
|
|
1
|
+
import { getColumns, getRows, AutocompletePrompt, settings, ConfirmPrompt, wrapTextWithPrefix, DatePrompt, runValidation, isCancel, GroupMultiSelectPrompt, MultiLinePrompt, MultiSelectPrompt, PasswordPrompt, block, SelectPrompt, SelectKeyPrompt, TextPrompt } from '@clack/core';
|
|
2
|
+
export { isCancel, settings, updateSettings } from '@clack/core';
|
|
3
|
+
import { styleText, stripVTControlCharacters } from 'node:util';
|
|
4
|
+
import process$1 from 'node:process';
|
|
5
|
+
import { wrapAnsi } from 'fast-wrap-ansi';
|
|
6
|
+
import l from 'fast-string-width';
|
|
7
|
+
import { existsSync, lstatSync, readdirSync } from 'node:fs';
|
|
8
|
+
import { dirname, join } from 'node:path';
|
|
9
|
+
import { cursor, erase } from 'sisteransi';
|
|
10
|
+
|
|
11
|
+
function isUnicodeSupported() {
|
|
12
|
+
if (process$1.platform !== 'win32') {
|
|
13
|
+
return process$1.env.TERM !== 'linux'; // Linux console (kernel)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return Boolean(process$1.env.CI)
|
|
17
|
+
|| Boolean(process$1.env.WT_SESSION) // Windows Terminal
|
|
18
|
+
|| Boolean(process$1.env.TERMINUS_SUBLIME) // Terminus (<0.2.27)
|
|
19
|
+
|| process$1.env.ConEmuTask === '{cmd::Cmder}' // ConEmu and cmder
|
|
20
|
+
|| process$1.env.TERM_PROGRAM === 'Terminus-Sublime'
|
|
21
|
+
|| process$1.env.TERM_PROGRAM === 'vscode'
|
|
22
|
+
|| process$1.env.TERM === 'xterm-256color'
|
|
23
|
+
|| process$1.env.TERM === 'alacritty'
|
|
24
|
+
|| process$1.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const unicode = isUnicodeSupported(), isCI = () => process.env.CI === "true", isTTY = (e) => e.isTTY === true, unicodeOr = (e, o) => unicode ? e : o, S_STEP_ACTIVE = unicodeOr("\u25C6", "*"), S_STEP_CANCEL = unicodeOr("\u25A0", "x"), S_STEP_ERROR = unicodeOr("\u25B2", "x"), S_STEP_SUBMIT = unicodeOr("\u25C7", "o"), S_BAR_START = unicodeOr("\u250C", "T"), S_BAR = unicodeOr("\u2502", "|"), S_BAR_END = unicodeOr("\u2514", "\u2014"), S_BAR_START_RIGHT = unicodeOr("\u2510", "T"), S_BAR_END_RIGHT = unicodeOr("\u2518", "\u2014"), S_RADIO_ACTIVE = unicodeOr("\u25CF", ">"), S_RADIO_INACTIVE = unicodeOr("\u25CB", " "), S_CHECKBOX_ACTIVE = unicodeOr("\u25FB", "[\u2022]"), S_CHECKBOX_SELECTED = unicodeOr("\u25FC", "[+]"), S_CHECKBOX_INACTIVE = unicodeOr("\u25FB", "[ ]"), S_PASSWORD_MASK = unicodeOr("\u25AA", "\u2022"), S_BAR_H = unicodeOr("\u2500", "-"), S_CORNER_TOP_RIGHT = unicodeOr("\u256E", "+"), S_CONNECT_LEFT = unicodeOr("\u251C", "+"), S_CORNER_BOTTOM_RIGHT = unicodeOr("\u256F", "+"), S_CORNER_BOTTOM_LEFT = unicodeOr("\u2570", "+"), S_CORNER_TOP_LEFT = unicodeOr("\u256D", "+"), S_INFO = unicodeOr("\u25CF", "\u2022"), S_SUCCESS = unicodeOr("\u25C6", "*"), S_WARN = unicodeOr("\u25B2", "!"), S_ERROR = unicodeOr("\u25A0", "x"), symbol = (e) => {
|
|
28
|
+
switch (e) {
|
|
29
|
+
case "initial":
|
|
30
|
+
case "active":
|
|
31
|
+
return styleText("cyan", S_STEP_ACTIVE);
|
|
32
|
+
case "cancel":
|
|
33
|
+
return styleText("red", S_STEP_CANCEL);
|
|
34
|
+
case "error":
|
|
35
|
+
return styleText("yellow", S_STEP_ERROR);
|
|
36
|
+
case "submit":
|
|
37
|
+
return styleText("green", S_STEP_SUBMIT);
|
|
38
|
+
}
|
|
39
|
+
}, symbolBar = (e) => {
|
|
40
|
+
switch (e) {
|
|
41
|
+
case "initial":
|
|
42
|
+
case "active":
|
|
43
|
+
return styleText("cyan", S_BAR);
|
|
44
|
+
case "cancel":
|
|
45
|
+
return styleText("red", S_BAR);
|
|
46
|
+
case "error":
|
|
47
|
+
return styleText("yellow", S_BAR);
|
|
48
|
+
case "submit":
|
|
49
|
+
return styleText("green", S_BAR);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const E$1 = (l, o, g, c, h, O = false) => {
|
|
54
|
+
let r = o, w = 0;
|
|
55
|
+
if (O)
|
|
56
|
+
for (let i = c - 1; i >= g && (r -= l[i].length, w++, !(r <= h)); i--)
|
|
57
|
+
;
|
|
58
|
+
else
|
|
59
|
+
for (let i = g; i < c && (r -= l[i].length, w++, !(r <= h)); i++)
|
|
60
|
+
;
|
|
61
|
+
return { lineCount: r, removals: w };
|
|
62
|
+
};
|
|
63
|
+
const limitOptions = ({
|
|
64
|
+
cursor: l,
|
|
65
|
+
options: o,
|
|
66
|
+
style: g,
|
|
67
|
+
output: c = process.stdout,
|
|
68
|
+
maxItems: h = Number.POSITIVE_INFINITY,
|
|
69
|
+
columnPadding: O = 0,
|
|
70
|
+
rowPadding: r = 4
|
|
71
|
+
}) => {
|
|
72
|
+
const i = getColumns(c) - O, I = getRows(c), C = styleText("dim", "..."), x = Math.max(I - r, 0), m = Math.max(Math.min(h, x), 5);
|
|
73
|
+
let p = 0;
|
|
74
|
+
l >= m - 3 && (p = Math.max(
|
|
75
|
+
Math.min(l - m + 3, o.length - m),
|
|
76
|
+
0
|
|
77
|
+
));
|
|
78
|
+
let f = m < o.length && p > 0, u = m < o.length && p + m < o.length;
|
|
79
|
+
const W = Math.min(
|
|
80
|
+
p + m,
|
|
81
|
+
o.length
|
|
82
|
+
), e = [];
|
|
83
|
+
let d = 0;
|
|
84
|
+
f && d++, u && d++;
|
|
85
|
+
const v = p + (f ? 1 : 0), P = W - (u ? 1 : 0);
|
|
86
|
+
for (let t = v; t < P; t++) {
|
|
87
|
+
const n = wrapAnsi(g(o[t], t === l), i, {
|
|
88
|
+
hard: true,
|
|
89
|
+
trim: false
|
|
90
|
+
}).split(`
|
|
91
|
+
`);
|
|
92
|
+
e.push(n), d += n.length;
|
|
93
|
+
}
|
|
94
|
+
if (d > x) {
|
|
95
|
+
let t = 0, n = 0, s = d;
|
|
96
|
+
const M = l - v;
|
|
97
|
+
let a = x;
|
|
98
|
+
const T = () => E$1(e, s, 0, M, a), L = () => E$1(
|
|
99
|
+
e,
|
|
100
|
+
s,
|
|
101
|
+
M + 1,
|
|
102
|
+
e.length,
|
|
103
|
+
a,
|
|
104
|
+
true
|
|
105
|
+
);
|
|
106
|
+
f ? ({ lineCount: s, removals: t } = T(), s > a && (u || (a -= 1), { lineCount: s, removals: n } = L())) : (u || (a -= 1), { lineCount: s, removals: n } = L(), s > a && (a -= 1, { lineCount: s, removals: t } = T())), t > 0 && (f = true, e.splice(0, t)), n > 0 && (u = true, e.splice(e.length - n, n));
|
|
107
|
+
}
|
|
108
|
+
const b = [];
|
|
109
|
+
f && b.push(C);
|
|
110
|
+
for (const t of e)
|
|
111
|
+
for (const n of t)
|
|
112
|
+
b.push(n);
|
|
113
|
+
return u && b.push(C), b;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
function P(t) {
|
|
117
|
+
return t.label ?? String(t.value ?? "");
|
|
118
|
+
}
|
|
119
|
+
function E(t, c) {
|
|
120
|
+
if (!t)
|
|
121
|
+
return true;
|
|
122
|
+
const n = (c.label ?? String(c.value ?? "")).toLowerCase(), i = (c.hint ?? "").toLowerCase(), l = String(c.value).toLowerCase(), o = t.toLowerCase();
|
|
123
|
+
return n.includes(o) || i.includes(o) || l.includes(o);
|
|
124
|
+
}
|
|
125
|
+
function N(t, c) {
|
|
126
|
+
const n = [];
|
|
127
|
+
for (const i of c)
|
|
128
|
+
t.includes(i.value) && n.push(i);
|
|
129
|
+
return n;
|
|
130
|
+
}
|
|
131
|
+
const autocomplete = (t) => new AutocompletePrompt({
|
|
132
|
+
options: t.options,
|
|
133
|
+
initialValue: t.initialValue ? [t.initialValue] : void 0,
|
|
134
|
+
initialUserInput: t.initialUserInput,
|
|
135
|
+
placeholder: t.placeholder,
|
|
136
|
+
filter: t.filter ?? ((n, i) => E(n, i)),
|
|
137
|
+
signal: t.signal,
|
|
138
|
+
input: t.input,
|
|
139
|
+
output: t.output,
|
|
140
|
+
validate: t.validate,
|
|
141
|
+
render() {
|
|
142
|
+
const n = t.withGuide ?? settings.withGuide, i = n ? [`${styleText("gray", S_BAR)}`, `${symbol(this.state)} ${t.message}`] : [`${symbol(this.state)} ${t.message}`], l = this.userInput, o = this.options, m = t.placeholder, p = l === "" && m !== void 0, $ = (r, s) => {
|
|
143
|
+
const a = P(r), u = r.hint && r.value === this.focusedValue ? styleText("dim", ` (${r.hint})`) : "";
|
|
144
|
+
switch (s) {
|
|
145
|
+
case "active":
|
|
146
|
+
return `${styleText("green", S_RADIO_ACTIVE)} ${a}${u}`;
|
|
147
|
+
case "inactive":
|
|
148
|
+
return `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`;
|
|
149
|
+
case "disabled":
|
|
150
|
+
return `${styleText("gray", S_RADIO_INACTIVE)} ${styleText(["strikethrough", "gray"], a)}`;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
switch (this.state) {
|
|
154
|
+
case "submit": {
|
|
155
|
+
const r = N(this.selectedValues, o), s = r.length > 0 ? ` ${styleText("dim", r.map(P).join(", "))}` : "", a = n ? styleText("gray", S_BAR) : "";
|
|
156
|
+
return `${i.join(`
|
|
3
157
|
`)}
|
|
4
|
-
${
|
|
158
|
+
${a}${s}`;
|
|
159
|
+
}
|
|
160
|
+
case "cancel": {
|
|
161
|
+
const r = l ? ` ${styleText(["strikethrough", "dim"], l)}` : "", s = n ? styleText("gray", S_BAR) : "";
|
|
162
|
+
return `${i.join(`
|
|
5
163
|
`)}
|
|
6
|
-
${
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`
|
|
14
|
-
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
164
|
+
${s}${r}`;
|
|
165
|
+
}
|
|
166
|
+
default: {
|
|
167
|
+
const r = this.state === "error" ? "yellow" : "cyan", s = n ? `${styleText(r, S_BAR)} ` : "", a = n ? styleText(r, S_BAR_END) : "";
|
|
168
|
+
let u = "";
|
|
169
|
+
if (this.isNavigating || p) {
|
|
170
|
+
const d = p ? m : l;
|
|
171
|
+
u = d !== "" ? ` ${styleText("dim", d)}` : "";
|
|
172
|
+
} else
|
|
173
|
+
u = ` ${this.userInputWithCursor}`;
|
|
174
|
+
const V = this.filteredOptions.length !== o.length ? styleText(
|
|
175
|
+
"dim",
|
|
176
|
+
` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`
|
|
177
|
+
) : "", y = this.filteredOptions.length === 0 && l ? [`${s}${styleText("yellow", "No matches found")}`] : [], b = this.state === "error" ? [`${s}${styleText("yellow", this.error)}`] : [];
|
|
178
|
+
n && i.push(`${s.trimEnd()}`), i.push(
|
|
179
|
+
`${s}${styleText("dim", "Search:")}${u}${V}`,
|
|
180
|
+
...y,
|
|
181
|
+
...b
|
|
182
|
+
);
|
|
183
|
+
const v = [
|
|
184
|
+
`${styleText("dim", "\u2191/\u2193")} to select`,
|
|
185
|
+
`${styleText("dim", "Enter:")} confirm`,
|
|
186
|
+
`${styleText("dim", "Type:")} to search`
|
|
187
|
+
], g = [`${s}${v.join(" \u2022 ")}`, a], O = this.filteredOptions.length === 0 ? [] : limitOptions({
|
|
188
|
+
cursor: this.cursor,
|
|
189
|
+
options: this.filteredOptions,
|
|
190
|
+
columnPadding: n ? 3 : 0,
|
|
191
|
+
// for `| ` when guide is shown
|
|
192
|
+
rowPadding: i.length + g.length,
|
|
193
|
+
style: (d, f) => $(
|
|
194
|
+
d,
|
|
195
|
+
d.disabled ? "disabled" : f ? "active" : "inactive"
|
|
196
|
+
),
|
|
197
|
+
maxItems: t.maxItems,
|
|
198
|
+
output: t.output
|
|
199
|
+
});
|
|
200
|
+
return [
|
|
201
|
+
...i,
|
|
202
|
+
...O.map((d) => `${s}${d}`),
|
|
203
|
+
...g
|
|
204
|
+
].join(`
|
|
205
|
+
`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}).prompt(), autocompleteMultiselect = (t) => {
|
|
210
|
+
const c = (i, l, o, m) => {
|
|
211
|
+
const p = o.includes(i.value), $ = i.label ?? String(i.value ?? ""), r = i.hint && m !== void 0 && i.value === m ? styleText("dim", ` (${i.hint})`) : "", s = p ? styleText("green", S_CHECKBOX_SELECTED) : styleText("dim", S_CHECKBOX_INACTIVE);
|
|
212
|
+
return i.disabled ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${styleText(["strikethrough", "gray"], $)}` : l ? `${s} ${$}${r}` : `${s} ${styleText("dim", $)}`;
|
|
213
|
+
}, n = new AutocompletePrompt({
|
|
214
|
+
options: t.options,
|
|
215
|
+
multiple: true,
|
|
216
|
+
placeholder: t.placeholder,
|
|
217
|
+
filter: t.filter ?? ((i, l) => E(i, l)),
|
|
218
|
+
validate: () => {
|
|
219
|
+
if (t.required && n.selectedValues.length === 0)
|
|
220
|
+
return "Please select at least one item";
|
|
221
|
+
},
|
|
222
|
+
initialValue: t.initialValues,
|
|
223
|
+
signal: t.signal,
|
|
224
|
+
input: t.input,
|
|
225
|
+
output: t.output,
|
|
226
|
+
render() {
|
|
227
|
+
const i = t.withGuide ?? settings.withGuide, l = `${i ? `${styleText("gray", S_BAR)}
|
|
228
|
+
` : ""}${symbol(this.state)} ${t.message}
|
|
229
|
+
`, o = this.userInput, m = t.placeholder, p = o === "" && m !== void 0, $ = this.isNavigating || p ? styleText("dim", p ? m : o) : this.userInputWithCursor, r = this.options, s = this.filteredOptions.length !== r.length ? styleText(
|
|
230
|
+
"dim",
|
|
231
|
+
` (${this.filteredOptions.length} match${this.filteredOptions.length === 1 ? "" : "es"})`
|
|
232
|
+
) : "";
|
|
233
|
+
switch (this.state) {
|
|
234
|
+
case "submit":
|
|
235
|
+
return `${l}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText(
|
|
236
|
+
"dim",
|
|
237
|
+
`${this.selectedValues.length} items selected`
|
|
238
|
+
)}`;
|
|
239
|
+
case "cancel":
|
|
240
|
+
return `${l}${i ? `${styleText("gray", S_BAR)} ` : ""}${styleText(
|
|
241
|
+
["strikethrough", "dim"],
|
|
242
|
+
o
|
|
243
|
+
)}`;
|
|
244
|
+
default: {
|
|
245
|
+
const a = this.state === "error" ? "yellow" : "cyan", u = i ? `${styleText(a, S_BAR)} ` : "", V = i ? styleText(a, S_BAR_END) : "", y = [
|
|
246
|
+
`${styleText("dim", "\u2191/\u2193")} to navigate`,
|
|
247
|
+
`${styleText("dim", this.isNavigating ? "Space/Tab:" : "Tab:")} select`,
|
|
248
|
+
`${styleText("dim", "Enter:")} confirm`,
|
|
249
|
+
`${styleText("dim", "Type:")} to search`
|
|
250
|
+
], b = this.filteredOptions.length === 0 && o ? [`${u}${styleText("yellow", "No matches found")}`] : [], v = this.state === "error" ? [`${u}${styleText("yellow", this.error)}`] : [], g = [
|
|
251
|
+
...`${l}${i ? styleText(a, S_BAR) : ""}`.split(`
|
|
252
|
+
`),
|
|
253
|
+
`${u}${styleText("dim", "Search:")} ${$}${s}`,
|
|
254
|
+
...b,
|
|
255
|
+
...v
|
|
256
|
+
], O = [`${u}${y.join(" \u2022 ")}`, V], d = limitOptions({
|
|
257
|
+
cursor: this.cursor,
|
|
258
|
+
options: this.filteredOptions,
|
|
259
|
+
style: (f, _) => c(f, _, this.selectedValues, this.focusedValue),
|
|
260
|
+
maxItems: t.maxItems,
|
|
261
|
+
output: t.output,
|
|
262
|
+
rowPadding: g.length + O.length
|
|
263
|
+
});
|
|
264
|
+
return [
|
|
265
|
+
...g,
|
|
266
|
+
...d.map((f) => `${u}${f}`),
|
|
267
|
+
...O
|
|
268
|
+
].join(`
|
|
269
|
+
`);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
return n.prompt();
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
const J = [
|
|
278
|
+
S_CORNER_TOP_LEFT,
|
|
279
|
+
S_CORNER_TOP_RIGHT,
|
|
280
|
+
S_CORNER_BOTTOM_LEFT,
|
|
281
|
+
S_CORNER_BOTTOM_RIGHT
|
|
282
|
+
], K = [S_BAR_START, S_BAR_START_RIGHT, S_BAR_END, S_BAR_END_RIGHT];
|
|
283
|
+
function A$1(n, e, t, o) {
|
|
284
|
+
let i = t, f = t;
|
|
285
|
+
return o === "center" ? i = Math.floor((e - n) / 2) : o === "right" && (i = e - n - t), f = e - i - n, [i, f];
|
|
286
|
+
}
|
|
287
|
+
const Q = (n) => n;
|
|
288
|
+
const box = (n = "", e = "", t) => {
|
|
289
|
+
const o = t?.output ?? process.stdout, i = getColumns(o), R = 1 * 2, u = t?.titlePadding ?? 1, h = t?.contentPadding ?? 2, w = t?.width === void 0 || t.width === "auto" ? 1 : Math.min(1, t.width), m = t?.withGuide ?? settings.withGuide ? `${S_BAR} ` : "", b = t?.formatBorder ?? Q, a = (t?.rounded ? J : K).map(b), _ = b(S_BAR_H), B = b(S_BAR), p = l(m), x = l(e), O = i - p;
|
|
290
|
+
let r = Math.floor(i * w) - p;
|
|
291
|
+
if (t?.width === "auto") {
|
|
292
|
+
const c = n.split(`
|
|
293
|
+
`);
|
|
294
|
+
let s = x + u * 2;
|
|
295
|
+
for (const G of c) {
|
|
296
|
+
const P = l(G) + h * 2;
|
|
297
|
+
P > s && (s = P);
|
|
298
|
+
}
|
|
299
|
+
const g = s + R;
|
|
300
|
+
g < r && (r = g);
|
|
301
|
+
}
|
|
302
|
+
r % 2 !== 0 && (r < O ? r++ : r--);
|
|
303
|
+
const d = r - R, S = d - u * 2, T = x > S ? `${e.slice(0, S - 3)}...` : e, [y, W] = A$1(
|
|
304
|
+
l(T),
|
|
305
|
+
d,
|
|
306
|
+
u,
|
|
307
|
+
t?.titleAlign
|
|
308
|
+
), L = wrapAnsi(n, d - h * 2, {
|
|
309
|
+
hard: true,
|
|
310
|
+
trim: false
|
|
311
|
+
});
|
|
312
|
+
o.write(
|
|
313
|
+
`${m}${a[0]}${_.repeat(y)}${T}${_.repeat(W)}${a[1]}
|
|
314
|
+
`
|
|
315
|
+
);
|
|
316
|
+
const E = L.split(`
|
|
317
|
+
`);
|
|
318
|
+
for (const c of E) {
|
|
319
|
+
const [s, g] = A$1(
|
|
320
|
+
l(c),
|
|
321
|
+
d,
|
|
322
|
+
h,
|
|
323
|
+
t?.contentAlign
|
|
324
|
+
);
|
|
325
|
+
o.write(
|
|
326
|
+
`${m}${B}${" ".repeat(s)}${c}${" ".repeat(g)}${B}
|
|
327
|
+
`
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
o.write(`${m}${a[2]}${_.repeat(d)}${a[3]}
|
|
331
|
+
`);
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
const confirm = (i) => {
|
|
335
|
+
const a = i.active ?? "Yes", s = i.inactive ?? "No";
|
|
336
|
+
return new ConfirmPrompt({
|
|
337
|
+
active: a,
|
|
338
|
+
inactive: s,
|
|
339
|
+
signal: i.signal,
|
|
340
|
+
input: i.input,
|
|
341
|
+
output: i.output,
|
|
342
|
+
initialValue: i.initialValue ?? true,
|
|
343
|
+
render() {
|
|
344
|
+
const e = i.withGuide ?? settings.withGuide, u = `${symbol(this.state)} `, l = e ? `${styleText("gray", S_BAR)} ` : "", f = wrapTextWithPrefix(
|
|
345
|
+
i.output,
|
|
346
|
+
i.message,
|
|
347
|
+
l,
|
|
348
|
+
u
|
|
349
|
+
), o = `${e ? `${styleText("gray", S_BAR)}
|
|
350
|
+
` : ""}${f}
|
|
351
|
+
`, c = this.value ? a : s;
|
|
352
|
+
switch (this.state) {
|
|
353
|
+
case "submit": {
|
|
354
|
+
const r = e ? `${styleText("gray", S_BAR)} ` : "";
|
|
355
|
+
return `${o}${r}${styleText("dim", c)}`;
|
|
356
|
+
}
|
|
357
|
+
case "cancel": {
|
|
358
|
+
const r = e ? `${styleText("gray", S_BAR)} ` : "";
|
|
359
|
+
return `${o}${r}${styleText(["strikethrough", "dim"], c)}${e ? `
|
|
360
|
+
${styleText("gray", S_BAR)}` : ""}`;
|
|
361
|
+
}
|
|
362
|
+
default: {
|
|
363
|
+
const r = e ? `${styleText("cyan", S_BAR)} ` : "", g = e ? styleText("cyan", S_BAR_END) : "";
|
|
364
|
+
return `${o}${r}${this.value ? `${styleText("green", S_RADIO_ACTIVE)} ${a}` : `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", a)}`}${i.vertical ? e ? `
|
|
365
|
+
${styleText("cyan", S_BAR)} ` : `
|
|
366
|
+
` : ` ${styleText("dim", "/")} `}${this.value ? `${styleText("dim", S_RADIO_INACTIVE)} ${styleText("dim", s)}` : `${styleText("green", S_RADIO_ACTIVE)} ${s}`}
|
|
367
|
+
${g}
|
|
368
|
+
`;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}).prompt();
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
const date = (e) => {
|
|
376
|
+
const r = e.validate;
|
|
377
|
+
return new DatePrompt({
|
|
378
|
+
...e,
|
|
379
|
+
validate(t) {
|
|
380
|
+
if (t === void 0)
|
|
381
|
+
return e.defaultValue !== void 0 ? void 0 : r ? runValidation(r, t) : settings.date.messages.required;
|
|
382
|
+
const o = (i) => i.toISOString().slice(0, 10);
|
|
383
|
+
if (e.minDate && o(t) < o(e.minDate))
|
|
384
|
+
return settings.date.messages.afterMin(e.minDate);
|
|
385
|
+
if (e.maxDate && o(t) > o(e.maxDate))
|
|
386
|
+
return settings.date.messages.beforeMax(e.maxDate);
|
|
387
|
+
if (r) return runValidation(r, t);
|
|
388
|
+
},
|
|
389
|
+
render() {
|
|
390
|
+
const t = (e?.withGuide ?? settings.withGuide) !== false, i = `${`${t ? `${styleText("gray", S_BAR)}
|
|
391
|
+
` : ""}${symbol(this.state)} `}${e.message}
|
|
392
|
+
`, l = this.state !== "initial" ? this.state : "active", d = b(this, l), c = this.value instanceof Date ? this.formattedValue : "";
|
|
393
|
+
switch (this.state) {
|
|
394
|
+
case "error": {
|
|
395
|
+
const a = this.error ? ` ${styleText("yellow", this.error)}` : "", s = t ? `${styleText("yellow", S_BAR)} ` : "", f = t ? styleText("yellow", S_BAR_END) : "";
|
|
396
|
+
return `${i.trim()}
|
|
397
|
+
${s}${d}
|
|
398
|
+
${f}${a}
|
|
399
|
+
`;
|
|
400
|
+
}
|
|
401
|
+
case "submit": {
|
|
402
|
+
const a = c ? ` ${styleText("dim", c)}` : "", s = t ? styleText("gray", S_BAR) : "";
|
|
403
|
+
return `${i}${s}${a}`;
|
|
404
|
+
}
|
|
405
|
+
case "cancel": {
|
|
406
|
+
const a = c ? ` ${styleText(["strikethrough", "dim"], c)}` : "", s = t ? styleText("gray", S_BAR) : "";
|
|
407
|
+
return `${i}${s}${a}${c.trim() ? `
|
|
408
|
+
${s}` : ""}`;
|
|
409
|
+
}
|
|
410
|
+
default: {
|
|
411
|
+
const a = t ? `${styleText("cyan", S_BAR)} ` : "", s = t ? styleText("cyan", S_BAR_END) : "", f = t ? `${styleText("cyan", S_BAR)} ` : "", g = this.inlineError ? `
|
|
412
|
+
${f}${styleText("yellow", this.inlineError)}` : "";
|
|
413
|
+
return `${i}${a}${d}${g}
|
|
414
|
+
${s}
|
|
415
|
+
`;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}).prompt();
|
|
420
|
+
};
|
|
421
|
+
function b(e, r) {
|
|
422
|
+
const t = e.segmentValues, o = e.segmentCursor;
|
|
423
|
+
if (r === "submit" || r === "cancel")
|
|
424
|
+
return e.formattedValue;
|
|
425
|
+
const i = styleText("gray", e.separator);
|
|
426
|
+
return e.segments.map((l, d) => {
|
|
427
|
+
const c = d === o.segmentIndex && !["submit", "cancel"].includes(r), a = p[l.type];
|
|
428
|
+
return x(t[l.type], { isActive: c, label: a });
|
|
429
|
+
}).join(i);
|
|
430
|
+
}
|
|
431
|
+
function x(e, r) {
|
|
432
|
+
const t = !e || e.replace(/_/g, "") === "";
|
|
433
|
+
return r.isActive ? styleText("inverse", t ? r.label : e.replace(/_/g, " ")) : t ? styleText("dim", r.label) : e.replace(/_/g, styleText("dim", " "));
|
|
434
|
+
}
|
|
435
|
+
const p = {
|
|
436
|
+
year: "yyyy",
|
|
437
|
+
month: "mm",
|
|
438
|
+
day: "dd"
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
const group = async (o, r) => {
|
|
442
|
+
const t = {}, p = Object.keys(o);
|
|
443
|
+
for (const e of p) {
|
|
444
|
+
const i = o[e], n = await i({ results: t })?.catch((a) => {
|
|
445
|
+
throw a;
|
|
446
|
+
});
|
|
447
|
+
if (typeof r?.onCancel == "function" && isCancel(n)) {
|
|
448
|
+
t[e] = "canceled", r.onCancel({ results: t });
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
451
|
+
t[e] = n;
|
|
452
|
+
}
|
|
453
|
+
return t;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const groupMultiselect = (u) => {
|
|
457
|
+
const { selectableGroups: h = true, groupSpacing: x = 0 } = u, m = (i, l, g = []) => {
|
|
458
|
+
const c = i.label ?? String(i.value), t = typeof i.group == "string", s = t && (g[g.indexOf(i) + 1] ?? { group: true }), o = t && s && s.group === true;
|
|
459
|
+
let n = "", a = "";
|
|
460
|
+
t && (h ? (n = o ? `${S_BAR_END} ` : `${S_BAR} `, a = o ? " " : `${S_BAR} `) : n = " ");
|
|
461
|
+
let r = "";
|
|
462
|
+
if (x > 0 && !t && (r = `
|
|
463
|
+
`.repeat(x)), l === "active")
|
|
464
|
+
return wrapTextWithPrefix(
|
|
465
|
+
u.output,
|
|
466
|
+
`${c}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}`,
|
|
467
|
+
`${r}${styleText("dim", n)} `,
|
|
468
|
+
`${r}${styleText("dim", n)}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
|
|
469
|
+
`${r}${styleText("dim", a)} `
|
|
470
|
+
);
|
|
471
|
+
if (l === "group-active")
|
|
472
|
+
return wrapTextWithPrefix(
|
|
473
|
+
u.output,
|
|
474
|
+
c,
|
|
475
|
+
`${r}${n} `,
|
|
476
|
+
`${r}${n}${styleText("cyan", S_CHECKBOX_ACTIVE)} `,
|
|
477
|
+
`${r}${a} `,
|
|
478
|
+
(d) => styleText("dim", d)
|
|
479
|
+
);
|
|
480
|
+
if (l === "group-active-selected")
|
|
481
|
+
return wrapTextWithPrefix(
|
|
482
|
+
u.output,
|
|
483
|
+
c,
|
|
484
|
+
`${r}${n} `,
|
|
485
|
+
`${r}${n}${styleText("green", S_CHECKBOX_SELECTED)} `,
|
|
486
|
+
`${r}${a} `,
|
|
487
|
+
(d) => styleText("dim", d)
|
|
488
|
+
);
|
|
489
|
+
if (l === "selected") {
|
|
490
|
+
const d = t || h ? styleText("green", S_CHECKBOX_SELECTED) : "";
|
|
491
|
+
return wrapTextWithPrefix(
|
|
492
|
+
u.output,
|
|
493
|
+
`${c}${i.hint ? ` (${i.hint})` : ""}`,
|
|
494
|
+
`${r}${styleText("dim", n)} `,
|
|
495
|
+
`${r}${styleText("dim", n)}${d} `,
|
|
496
|
+
`${r}${styleText("dim", a)} `,
|
|
497
|
+
(V) => styleText("dim", V)
|
|
498
|
+
);
|
|
499
|
+
}
|
|
500
|
+
if (l === "cancelled")
|
|
501
|
+
return `${styleText(["strikethrough", "dim"], c)}`;
|
|
502
|
+
if (l === "active-selected")
|
|
503
|
+
return wrapTextWithPrefix(
|
|
504
|
+
u.output,
|
|
505
|
+
`${c}${i.hint ? ` ${styleText("dim", `(${i.hint})`)}` : ""}`,
|
|
506
|
+
`${r}${styleText("dim", n)} `,
|
|
507
|
+
`${r}${styleText("dim", n)}${styleText("green", S_CHECKBOX_SELECTED)} `,
|
|
508
|
+
`${r}${styleText("dim", a)} `
|
|
509
|
+
);
|
|
510
|
+
if (l === "submitted")
|
|
511
|
+
return `${styleText("dim", c)}`;
|
|
512
|
+
const f = t || h ? styleText("dim", S_CHECKBOX_INACTIVE) : "";
|
|
513
|
+
return wrapTextWithPrefix(
|
|
514
|
+
u.output,
|
|
515
|
+
c,
|
|
516
|
+
`${r}${styleText("dim", n)} `,
|
|
517
|
+
`${r}${styleText("dim", n)}${f} `,
|
|
518
|
+
`${r}${styleText("dim", a)} `,
|
|
519
|
+
(d) => styleText("dim", d)
|
|
520
|
+
);
|
|
521
|
+
}, y = u.required ?? true;
|
|
522
|
+
return new GroupMultiSelectPrompt({
|
|
523
|
+
options: u.options,
|
|
524
|
+
signal: u.signal,
|
|
525
|
+
input: u.input,
|
|
526
|
+
output: u.output,
|
|
527
|
+
initialValues: u.initialValues,
|
|
528
|
+
required: y,
|
|
529
|
+
cursorAt: u.cursorAt,
|
|
530
|
+
selectableGroups: h,
|
|
531
|
+
validate(i) {
|
|
532
|
+
if (y && (i === void 0 || i.length === 0))
|
|
533
|
+
return `Please select at least one option.
|
|
534
|
+
${styleText(
|
|
535
|
+
"reset",
|
|
536
|
+
styleText(
|
|
537
|
+
"dim",
|
|
538
|
+
`Press ${styleText(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText(
|
|
539
|
+
"gray",
|
|
540
|
+
styleText(["bgWhite", "inverse"], " enter ")
|
|
541
|
+
)} to submit`
|
|
542
|
+
)
|
|
543
|
+
)}`;
|
|
544
|
+
},
|
|
545
|
+
render() {
|
|
546
|
+
const i = u.withGuide ?? settings.withGuide, l = `${i ? `${styleText("gray", S_BAR)}
|
|
547
|
+
` : ""}${symbol(this.state)} ${u.message}
|
|
548
|
+
`, g = this.value ?? [], c = (t, s) => {
|
|
549
|
+
const o = this.options, n = g.includes(t.value) || t.group === true && this.isGroupSelected(`${t.value}`);
|
|
550
|
+
return !s && typeof t.group == "string" && this.options[this.cursor].value === t.group ? m(t, n ? "group-active-selected" : "group-active", o) : s && n ? m(t, "active-selected", o) : n ? m(t, "selected", o) : m(t, s ? "active" : "inactive", o);
|
|
551
|
+
};
|
|
552
|
+
switch (this.state) {
|
|
553
|
+
case "submit": {
|
|
554
|
+
const t = this.options.filter(({ value: o }) => g.includes(o)).map((o) => m(o, "submitted")), s = t.length === 0 ? "" : ` ${t.join(styleText("dim", ", "))}`;
|
|
555
|
+
return `${l}${i ? styleText("gray", S_BAR) : ""}${s}`;
|
|
556
|
+
}
|
|
557
|
+
case "cancel": {
|
|
558
|
+
const t = this.options.filter(({ value: s }) => g.includes(s)).map((s) => m(s, "cancelled")).join(styleText("dim", ", "));
|
|
559
|
+
return `${l}${i ? `${styleText("gray", S_BAR)} ` : ""}${t.trim() ? `${t}${i ? `
|
|
560
|
+
${styleText("gray", S_BAR)}` : ""}` : ""}`;
|
|
561
|
+
}
|
|
562
|
+
case "error": {
|
|
563
|
+
const t = i ? `${styleText("yellow", S_BAR)} ` : "", s = this.error.split(`
|
|
564
|
+
`).map(
|
|
565
|
+
(r, f) => f === 0 ? `${i ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", r)}` : ` ${r}`
|
|
566
|
+
).join(`
|
|
567
|
+
`), o = l.split(`
|
|
568
|
+
`).length, n = s.split(`
|
|
569
|
+
`).length + 1, a = limitOptions({
|
|
570
|
+
output: u.output,
|
|
571
|
+
options: this.options,
|
|
572
|
+
cursor: this.cursor,
|
|
573
|
+
maxItems: u.maxItems,
|
|
574
|
+
columnPadding: t.length,
|
|
575
|
+
rowPadding: o + n,
|
|
576
|
+
style: c
|
|
577
|
+
}).join(`
|
|
578
|
+
${t}`);
|
|
579
|
+
return `${l}${t}${a}
|
|
580
|
+
${s}
|
|
581
|
+
`;
|
|
582
|
+
}
|
|
583
|
+
default: {
|
|
584
|
+
const t = i ? `${styleText("cyan", S_BAR)} ` : "", s = l.split(`
|
|
585
|
+
`).length, o = (i ? 1 : 0) + 1, n = limitOptions({
|
|
586
|
+
output: u.output,
|
|
587
|
+
options: this.options,
|
|
588
|
+
cursor: this.cursor,
|
|
589
|
+
maxItems: u.maxItems,
|
|
590
|
+
columnPadding: t.length,
|
|
591
|
+
rowPadding: s + o,
|
|
592
|
+
style: c
|
|
593
|
+
}).join(`
|
|
594
|
+
${t}`);
|
|
595
|
+
return `${l}${t}${n}
|
|
596
|
+
${i ? styleText("cyan", S_BAR_END) : ""}
|
|
597
|
+
`;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
}).prompt();
|
|
602
|
+
};
|
|
603
|
+
|
|
604
|
+
const log = {
|
|
605
|
+
message: (s = [], {
|
|
606
|
+
symbol: e = styleText("gray", S_BAR),
|
|
607
|
+
secondarySymbol: r = styleText("gray", S_BAR),
|
|
608
|
+
output: m = process.stdout,
|
|
609
|
+
spacing: l = 1,
|
|
610
|
+
withGuide: c
|
|
611
|
+
} = {}) => {
|
|
612
|
+
const t = [], o = c ?? settings.withGuide, f = o ? r : "", O = o ? `${e} ` : "", u = o ? `${r} ` : "";
|
|
613
|
+
for (let i = 0; i < l; i++)
|
|
614
|
+
t.push(f);
|
|
615
|
+
const g = Array.isArray(s) ? s : s.split(`
|
|
616
|
+
`);
|
|
617
|
+
if (g.length > 0) {
|
|
618
|
+
const [i, ...y] = g;
|
|
619
|
+
i.length > 0 ? t.push(`${O}${i}`) : t.push(o ? e : "");
|
|
620
|
+
for (const p of y)
|
|
621
|
+
p.length > 0 ? t.push(`${u}${p}`) : t.push(o ? r : "");
|
|
622
|
+
}
|
|
623
|
+
m.write(`${t.join(`
|
|
50
624
|
`)}
|
|
51
|
-
`)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
`
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
${
|
|
77
|
-
|
|
78
|
-
`)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
${
|
|
87
|
-
|
|
88
|
-
`)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
${
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
625
|
+
`);
|
|
626
|
+
},
|
|
627
|
+
info: (s, e) => {
|
|
628
|
+
log.message(s, { ...e, symbol: styleText("blue", S_INFO) });
|
|
629
|
+
},
|
|
630
|
+
success: (s, e) => {
|
|
631
|
+
log.message(s, { ...e, symbol: styleText("green", S_SUCCESS) });
|
|
632
|
+
},
|
|
633
|
+
step: (s, e) => {
|
|
634
|
+
log.message(s, { ...e, symbol: styleText("green", S_STEP_SUBMIT) });
|
|
635
|
+
},
|
|
636
|
+
warn: (s, e) => {
|
|
637
|
+
log.message(s, { ...e, symbol: styleText("yellow", S_WARN) });
|
|
638
|
+
},
|
|
639
|
+
/** alias for `log.warn()`. */
|
|
640
|
+
warning: (s, e) => {
|
|
641
|
+
log.warn(s, e);
|
|
642
|
+
},
|
|
643
|
+
error: (s, e) => {
|
|
644
|
+
log.message(s, { ...e, symbol: styleText("red", S_ERROR) });
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const cancel = (o = "", t) => {
|
|
649
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_END)} ` : "";
|
|
650
|
+
i.write(`${e}${styleText("red", o)}
|
|
651
|
+
|
|
652
|
+
`);
|
|
653
|
+
}, intro = (o = "", t) => {
|
|
654
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR_START)} ` : "";
|
|
655
|
+
i.write(`${e}${o}
|
|
656
|
+
`);
|
|
657
|
+
}, outro = (o = "", t) => {
|
|
658
|
+
const i = t?.output ?? process.stdout, e = t?.withGuide ?? settings.withGuide ? `${styleText("gray", S_BAR)}
|
|
659
|
+
${styleText("gray", S_BAR_END)} ` : "";
|
|
660
|
+
i.write(`${e}${o}
|
|
661
|
+
|
|
662
|
+
`);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
const multiline = (e) => new MultiLinePrompt({
|
|
666
|
+
validate: e.validate,
|
|
667
|
+
placeholder: e.placeholder,
|
|
668
|
+
defaultValue: e.defaultValue,
|
|
669
|
+
initialValue: e.initialValue,
|
|
670
|
+
showSubmit: e.showSubmit,
|
|
671
|
+
output: e.output,
|
|
672
|
+
signal: e.signal,
|
|
673
|
+
input: e.input,
|
|
674
|
+
render() {
|
|
675
|
+
const i = e?.withGuide ?? settings.withGuide, o = `${`${i ? `${styleText("gray", S_BAR)}
|
|
676
|
+
` : ""}${symbol(this.state)} `}${e.message}
|
|
677
|
+
`, h = e.placeholder ? styleText("inverse", e.placeholder[0]) + styleText("dim", e.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), a = this.userInput ? this.userInputWithCursor : h, s = this.value ?? "", c = e.showSubmit ? `
|
|
678
|
+
${styleText(this.focused === "submit" ? "cyan" : "dim", "[ submit ]")}` : "";
|
|
679
|
+
switch (this.state) {
|
|
680
|
+
case "error": {
|
|
681
|
+
const n = `${styleText("yellow", S_BAR)} `, r = i ? wrapTextWithPrefix(e.output, a, n, void 0) : a, u = styleText("yellow", S_BAR_END);
|
|
682
|
+
return `${o}${r}
|
|
683
|
+
${u} ${styleText("yellow", this.error)}${c}
|
|
684
|
+
`;
|
|
685
|
+
}
|
|
686
|
+
case "submit": {
|
|
687
|
+
const n = `${styleText("gray", S_BAR)} `, r = i ? wrapTextWithPrefix(
|
|
688
|
+
e.output,
|
|
689
|
+
s,
|
|
690
|
+
n,
|
|
691
|
+
void 0,
|
|
692
|
+
void 0,
|
|
693
|
+
(u) => styleText("dim", u)
|
|
694
|
+
) : s ? styleText("dim", s) : "";
|
|
695
|
+
return `${o}${r}`;
|
|
696
|
+
}
|
|
697
|
+
case "cancel": {
|
|
698
|
+
const n = `${styleText("gray", S_BAR)} `, r = i ? wrapTextWithPrefix(
|
|
699
|
+
e.output,
|
|
700
|
+
s,
|
|
701
|
+
n,
|
|
702
|
+
void 0,
|
|
703
|
+
void 0,
|
|
704
|
+
(u) => styleText(["strikethrough", "dim"], u)
|
|
705
|
+
) : s ? styleText(["strikethrough", "dim"], s) : "";
|
|
706
|
+
return `${o}${r}`;
|
|
707
|
+
}
|
|
708
|
+
default: {
|
|
709
|
+
const n = i ? `${styleText("cyan", S_BAR)} ` : "", r = i ? styleText("cyan", S_BAR_END) : "", u = i ? wrapTextWithPrefix(e.output, a, n) : a;
|
|
710
|
+
return `${o}${u}
|
|
711
|
+
${r}${c}
|
|
712
|
+
`;
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}).prompt();
|
|
717
|
+
|
|
718
|
+
const d = (n, a) => n.split(`
|
|
719
|
+
`).map((m) => a(m)).join(`
|
|
720
|
+
`);
|
|
721
|
+
const multiselect = (n) => {
|
|
722
|
+
const a = (t, o) => {
|
|
723
|
+
const r = t.label ?? String(t.value);
|
|
724
|
+
return o === "disabled" ? `${styleText("gray", S_CHECKBOX_INACTIVE)} ${d(r, (l) => styleText(["strikethrough", "gray"], l))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}` : o === "active" ? `${styleText("cyan", S_CHECKBOX_ACTIVE)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : o === "selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${d(r, (l) => styleText("dim", l))}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : o === "cancelled" ? `${d(r, (l) => styleText(["strikethrough", "dim"], l))}` : o === "active-selected" ? `${styleText("green", S_CHECKBOX_SELECTED)} ${r}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}` : o === "submitted" ? `${d(r, (l) => styleText("dim", l))}` : `${styleText("dim", S_CHECKBOX_INACTIVE)} ${d(r, (l) => styleText("dim", l))}`;
|
|
725
|
+
}, m = n.required ?? true;
|
|
726
|
+
return new MultiSelectPrompt({
|
|
727
|
+
options: n.options,
|
|
728
|
+
signal: n.signal,
|
|
729
|
+
input: n.input,
|
|
730
|
+
output: n.output,
|
|
731
|
+
initialValues: n.initialValues,
|
|
732
|
+
required: m,
|
|
733
|
+
cursorAt: n.cursorAt,
|
|
734
|
+
validate(t) {
|
|
735
|
+
if (m && (t === void 0 || t.length === 0))
|
|
736
|
+
return `Please select at least one option.
|
|
737
|
+
${styleText(
|
|
738
|
+
"reset",
|
|
739
|
+
styleText(
|
|
740
|
+
"dim",
|
|
741
|
+
`Press ${styleText(["gray", "bgWhite", "inverse"], " space ")} to select, ${styleText(
|
|
742
|
+
"gray",
|
|
743
|
+
styleText("bgWhite", styleText("inverse", " enter "))
|
|
744
|
+
)} to submit`
|
|
745
|
+
)
|
|
746
|
+
)}`;
|
|
747
|
+
},
|
|
748
|
+
render() {
|
|
749
|
+
const t = n.withGuide ?? settings.withGuide, o = wrapTextWithPrefix(
|
|
750
|
+
n.output,
|
|
751
|
+
n.message,
|
|
752
|
+
t ? `${symbolBar(this.state)} ` : "",
|
|
753
|
+
`${symbol(this.state)} `
|
|
754
|
+
), r = `${t ? `${styleText("gray", S_BAR)}
|
|
755
|
+
` : ""}${o}
|
|
756
|
+
`, l = this.value ?? [], g = (i, u) => {
|
|
757
|
+
if (i.disabled)
|
|
758
|
+
return a(i, "disabled");
|
|
759
|
+
const s = l.includes(i.value);
|
|
760
|
+
return u && s ? a(i, "active-selected") : s ? a(i, "selected") : a(i, u ? "active" : "inactive");
|
|
761
|
+
};
|
|
762
|
+
switch (this.state) {
|
|
763
|
+
case "submit": {
|
|
764
|
+
const i = this.options.filter(({ value: s }) => l.includes(s)).map((s) => a(s, "submitted")).join(styleText("dim", ", ")) || styleText("dim", "none"), u = wrapTextWithPrefix(
|
|
765
|
+
n.output,
|
|
766
|
+
i,
|
|
767
|
+
t ? `${styleText("gray", S_BAR)} ` : ""
|
|
768
|
+
);
|
|
769
|
+
return `${r}${u}`;
|
|
770
|
+
}
|
|
771
|
+
case "cancel": {
|
|
772
|
+
const i = this.options.filter(({ value: s }) => l.includes(s)).map((s) => a(s, "cancelled")).join(styleText("dim", ", "));
|
|
773
|
+
if (i.trim() === "")
|
|
774
|
+
return `${r}${styleText("gray", S_BAR)}`;
|
|
775
|
+
const u = wrapTextWithPrefix(
|
|
776
|
+
n.output,
|
|
777
|
+
i,
|
|
778
|
+
t ? `${styleText("gray", S_BAR)} ` : ""
|
|
779
|
+
);
|
|
780
|
+
return `${r}${u}${t ? `
|
|
781
|
+
${styleText("gray", S_BAR)}` : ""}`;
|
|
782
|
+
}
|
|
783
|
+
case "error": {
|
|
784
|
+
const i = t ? `${styleText("yellow", S_BAR)} ` : "", u = this.error.split(`
|
|
785
|
+
`).map(
|
|
786
|
+
(h, x) => x === 0 ? `${t ? `${styleText("yellow", S_BAR_END)} ` : ""}${styleText("yellow", h)}` : ` ${h}`
|
|
787
|
+
).join(`
|
|
788
|
+
`), s = r.split(`
|
|
789
|
+
`).length, v = u.split(`
|
|
790
|
+
`).length + 1;
|
|
791
|
+
return `${r}${i}${limitOptions({
|
|
792
|
+
output: n.output,
|
|
793
|
+
options: this.options,
|
|
794
|
+
cursor: this.cursor,
|
|
795
|
+
maxItems: n.maxItems,
|
|
796
|
+
columnPadding: i.length,
|
|
797
|
+
rowPadding: s + v,
|
|
798
|
+
style: g
|
|
799
|
+
}).join(`
|
|
800
|
+
${i}`)}
|
|
801
|
+
${u}
|
|
802
|
+
`;
|
|
803
|
+
}
|
|
804
|
+
default: {
|
|
805
|
+
const i = t ? `${styleText("cyan", S_BAR)} ` : "", u = r.split(`
|
|
806
|
+
`).length, s = t ? 2 : 1;
|
|
807
|
+
return `${r}${i}${limitOptions({
|
|
808
|
+
output: n.output,
|
|
809
|
+
options: this.options,
|
|
810
|
+
cursor: this.cursor,
|
|
811
|
+
maxItems: n.maxItems,
|
|
812
|
+
columnPadding: i.length,
|
|
813
|
+
rowPadding: u + s,
|
|
814
|
+
style: g
|
|
815
|
+
}).join(`
|
|
816
|
+
${i}`)}
|
|
817
|
+
${t ? styleText("cyan", S_BAR_END) : ""}
|
|
818
|
+
`;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
}).prompt();
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
const W$1 = (o) => styleText("dim", o), C = (o, e, s) => {
|
|
826
|
+
const a = {
|
|
827
|
+
hard: true,
|
|
828
|
+
trim: false
|
|
829
|
+
}, i = wrapAnsi(o, e, a).split(`
|
|
830
|
+
`), c = i.reduce((n, r) => Math.max(l(r), n), 0), u = i.map(s).reduce((n, r) => Math.max(l(r), n), 0), g = e - (u - c);
|
|
831
|
+
return wrapAnsi(o, g, a);
|
|
832
|
+
};
|
|
833
|
+
const note = (o = "", e = "", s) => {
|
|
834
|
+
const a = s?.output ?? process$1.stdout, i = s?.withGuide ?? settings.withGuide, c = s?.format ?? W$1, g = ["", ...C(o, getColumns(a) - 6, c).split(`
|
|
835
|
+
`).map(c), ""], n = l(e), r = Math.max(
|
|
836
|
+
g.reduce((m, F) => {
|
|
837
|
+
const O = l(F);
|
|
838
|
+
return O > m ? O : m;
|
|
839
|
+
}, 0),
|
|
840
|
+
n
|
|
841
|
+
) + 2, h = g.map(
|
|
842
|
+
(m) => `${styleText("gray", S_BAR)} ${m}${" ".repeat(r - l(m))}${styleText("gray", S_BAR)}`
|
|
843
|
+
).join(`
|
|
844
|
+
`), T = i ? `${styleText("gray", S_BAR)}
|
|
845
|
+
` : "", l$1 = i ? S_CONNECT_LEFT : S_CORNER_BOTTOM_LEFT;
|
|
846
|
+
a.write(
|
|
847
|
+
`${T}${styleText("green", S_STEP_SUBMIT)} ${styleText("reset", e)} ${styleText(
|
|
848
|
+
"gray",
|
|
849
|
+
S_BAR_H.repeat(Math.max(r - n - 1, 1)) + S_CORNER_TOP_RIGHT
|
|
850
|
+
)}
|
|
851
|
+
${h}
|
|
852
|
+
${styleText("gray", l$1 + S_BAR_H.repeat(r + 2) + S_CORNER_BOTTOM_RIGHT)}
|
|
853
|
+
`
|
|
854
|
+
);
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
const password = (r) => new PasswordPrompt({
|
|
858
|
+
validate: r.validate,
|
|
859
|
+
mask: r.mask ?? S_PASSWORD_MASK,
|
|
860
|
+
signal: r.signal,
|
|
861
|
+
input: r.input,
|
|
862
|
+
output: r.output,
|
|
863
|
+
render() {
|
|
864
|
+
const e = r.withGuide ?? settings.withGuide, o = `${e ? `${styleText("gray", S_BAR)}
|
|
865
|
+
` : ""}${symbol(this.state)} ${r.message}
|
|
866
|
+
`, c = this.userInputWithCursor, i = this.masked;
|
|
867
|
+
switch (this.state) {
|
|
868
|
+
case "error": {
|
|
869
|
+
const s = e ? `${styleText("yellow", S_BAR)} ` : "", n = e ? `${styleText("yellow", S_BAR_END)} ` : "", l = i ?? "";
|
|
870
|
+
return r.clearOnError && this.clear(), `${o.trim()}
|
|
871
|
+
${s}${l}
|
|
872
|
+
${n}${styleText("yellow", this.error)}
|
|
873
|
+
`;
|
|
874
|
+
}
|
|
875
|
+
case "submit": {
|
|
876
|
+
const s = e ? `${styleText("gray", S_BAR)} ` : "", n = i ? styleText("dim", i) : "";
|
|
877
|
+
return `${o}${s}${n}`;
|
|
878
|
+
}
|
|
879
|
+
case "cancel": {
|
|
880
|
+
const s = e ? `${styleText("gray", S_BAR)} ` : "", n = i ? styleText(["strikethrough", "dim"], i) : "";
|
|
881
|
+
return `${o}${s}${n}${i && e ? `
|
|
882
|
+
${styleText("gray", S_BAR)}` : ""}`;
|
|
883
|
+
}
|
|
884
|
+
default: {
|
|
885
|
+
const s = e ? `${styleText("cyan", S_BAR)} ` : "", n = e ? styleText("cyan", S_BAR_END) : "";
|
|
886
|
+
return `${o}${s}${c}
|
|
116
887
|
${n}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
888
|
+
`;
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
}).prompt();
|
|
893
|
+
|
|
894
|
+
const path = (e) => {
|
|
895
|
+
const a = e.validate;
|
|
896
|
+
return autocomplete({
|
|
897
|
+
...e,
|
|
898
|
+
initialUserInput: e.initialValue ?? e.root ?? process.cwd(),
|
|
899
|
+
maxItems: 5,
|
|
900
|
+
validate(t) {
|
|
901
|
+
if (!Array.isArray(t)) {
|
|
902
|
+
if (!t)
|
|
903
|
+
return "Please select a path";
|
|
904
|
+
if (a)
|
|
905
|
+
return runValidation(a, t);
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
options() {
|
|
909
|
+
const t = this.userInput;
|
|
910
|
+
if (t === "")
|
|
911
|
+
return [];
|
|
912
|
+
try {
|
|
913
|
+
let i;
|
|
914
|
+
existsSync(t) ? lstatSync(t).isDirectory() && (!e.directory || t.endsWith("/")) ? i = t : i = dirname(t) : i = dirname(t);
|
|
915
|
+
const c = t.length > 1 && t.endsWith("/") ? t.slice(0, -1) : t;
|
|
916
|
+
return readdirSync(i).map((r) => {
|
|
917
|
+
const n = join(i, r), m = lstatSync(n);
|
|
918
|
+
return {
|
|
919
|
+
name: r,
|
|
920
|
+
path: n,
|
|
921
|
+
isDirectory: m.isDirectory()
|
|
922
|
+
};
|
|
923
|
+
}).filter(
|
|
924
|
+
({ path: r, isDirectory: n }) => r.startsWith(c) && (n || !e.directory)
|
|
925
|
+
).map((r) => ({
|
|
926
|
+
value: r.path
|
|
927
|
+
}));
|
|
928
|
+
} catch {
|
|
929
|
+
return [];
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
};
|
|
934
|
+
|
|
935
|
+
const W = (l) => styleText("magenta", l);
|
|
936
|
+
const spinner = ({
|
|
937
|
+
indicator: l = "dots",
|
|
938
|
+
onCancel: h,
|
|
939
|
+
output: n = process.stdout,
|
|
940
|
+
cancelMessage: G,
|
|
941
|
+
errorMessage: O,
|
|
942
|
+
frames: E = unicode ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"],
|
|
943
|
+
delay: F = unicode ? 80 : 120,
|
|
944
|
+
signal: m,
|
|
945
|
+
...I
|
|
946
|
+
} = {}) => {
|
|
947
|
+
const u = isCI();
|
|
948
|
+
let M, T, d = false, S = false, s = "", p, w = performance.now();
|
|
949
|
+
const x = getColumns(n), k = I?.styleFrame ?? W, g = (e) => {
|
|
950
|
+
const r = e > 1 ? O ?? settings.messages.error : G ?? settings.messages.cancel;
|
|
951
|
+
S = e === 1, d && (a(r, e), S && typeof h == "function" && h());
|
|
952
|
+
}, f = () => g(2), i = () => g(1), A = () => {
|
|
953
|
+
process.on("uncaughtExceptionMonitor", f), process.on("unhandledRejection", f), process.on("SIGINT", i), process.on("SIGTERM", i), process.on("exit", g), m && m.addEventListener("abort", i);
|
|
954
|
+
}, H = () => {
|
|
955
|
+
process.removeListener("uncaughtExceptionMonitor", f), process.removeListener("unhandledRejection", f), process.removeListener("SIGINT", i), process.removeListener("SIGTERM", i), process.removeListener("exit", g), m && m.removeEventListener("abort", i);
|
|
956
|
+
}, y = () => {
|
|
957
|
+
if (p === void 0) return;
|
|
958
|
+
u && n.write(`
|
|
959
|
+
`);
|
|
960
|
+
const r = wrapAnsi(p, x, {
|
|
961
|
+
hard: true,
|
|
962
|
+
trim: false
|
|
963
|
+
}).split(`
|
|
964
|
+
`);
|
|
965
|
+
r.length > 1 && n.write(cursor.up(r.length - 1)), n.write(cursor.to(0)), n.write(erase.down());
|
|
966
|
+
}, C = (e) => e.replace(/\.+$/, ""), _ = (e) => {
|
|
967
|
+
const r = (performance.now() - e) / 1e3, t = Math.floor(r / 60), o = Math.floor(r % 60);
|
|
968
|
+
return t > 0 ? `[${t}m ${o}s]` : `[${o}s]`;
|
|
969
|
+
}, N = I.withGuide ?? settings.withGuide, P = (e = "") => {
|
|
970
|
+
d = true, M = block({ output: n }), s = C(e), w = performance.now(), N && n.write(`${styleText("gray", S_BAR)}
|
|
971
|
+
`);
|
|
972
|
+
let r = 0, t = 0;
|
|
973
|
+
A(), T = setInterval(() => {
|
|
974
|
+
if (u && s === p)
|
|
975
|
+
return;
|
|
976
|
+
y(), p = s;
|
|
977
|
+
const o = k(E[r]);
|
|
978
|
+
let v;
|
|
979
|
+
if (u)
|
|
980
|
+
v = `${o} ${s}...`;
|
|
981
|
+
else if (l === "timer")
|
|
982
|
+
v = `${o} ${s} ${_(w)}`;
|
|
983
|
+
else {
|
|
984
|
+
const B = ".".repeat(Math.floor(t)).slice(0, 3);
|
|
985
|
+
v = `${o} ${s}${B}`;
|
|
986
|
+
}
|
|
987
|
+
const j = wrapAnsi(v, x, {
|
|
988
|
+
hard: true,
|
|
989
|
+
trim: false
|
|
990
|
+
});
|
|
991
|
+
n.write(j), r = r + 1 < E.length ? r + 1 : 0, t = t < 4 ? t + 0.125 : 0;
|
|
992
|
+
}, F);
|
|
993
|
+
}, a = (e = "", r = 0, t = false) => {
|
|
994
|
+
if (!d) return;
|
|
995
|
+
d = false, clearInterval(T), y();
|
|
996
|
+
const o = r === 0 ? styleText("green", S_STEP_SUBMIT) : r === 1 ? styleText("red", S_STEP_CANCEL) : styleText("red", S_STEP_ERROR);
|
|
997
|
+
s = e ?? s, t || (l === "timer" ? n.write(`${o} ${s} ${_(w)}
|
|
998
|
+
`) : n.write(`${o} ${s}
|
|
999
|
+
`)), H(), M();
|
|
1000
|
+
};
|
|
1001
|
+
return {
|
|
1002
|
+
start: P,
|
|
1003
|
+
stop: (e = "") => a(e, 0),
|
|
1004
|
+
message: (e = "") => {
|
|
1005
|
+
s = C(e ?? s);
|
|
1006
|
+
},
|
|
1007
|
+
cancel: (e = "") => a(e, 1),
|
|
1008
|
+
error: (e = "") => a(e, 2),
|
|
1009
|
+
clear: () => a("", 0, true),
|
|
1010
|
+
get isCancelled() {
|
|
1011
|
+
return S;
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
const u = {
|
|
1017
|
+
light: unicodeOr("\u2500", "-"),
|
|
1018
|
+
heavy: unicodeOr("\u2501", "="),
|
|
1019
|
+
block: unicodeOr("\u2588", "#")
|
|
1020
|
+
};
|
|
1021
|
+
function progress({
|
|
1022
|
+
style: o = "heavy",
|
|
1023
|
+
max: d = 100,
|
|
1024
|
+
size: v = 40,
|
|
1025
|
+
...x
|
|
1026
|
+
} = {}) {
|
|
1027
|
+
const r = spinner(x);
|
|
1028
|
+
let a = 0, n = "";
|
|
1029
|
+
const c = Math.max(1, d), l = Math.max(1, v), S = (t) => {
|
|
1030
|
+
switch (t) {
|
|
1031
|
+
case "initial":
|
|
1032
|
+
case "active":
|
|
1033
|
+
return (e) => styleText("magenta", e);
|
|
1034
|
+
case "error":
|
|
1035
|
+
case "cancel":
|
|
1036
|
+
return (e) => styleText("red", e);
|
|
1037
|
+
case "submit":
|
|
1038
|
+
return (e) => styleText("green", e);
|
|
1039
|
+
default:
|
|
1040
|
+
return (e) => styleText("magenta", e);
|
|
1041
|
+
}
|
|
1042
|
+
}, p = (t, e) => {
|
|
1043
|
+
const m = Math.floor(a / c * l);
|
|
1044
|
+
return `${S(t)(u[o].repeat(m))}${styleText("dim", u[o].repeat(l - m))} ${e}`;
|
|
1045
|
+
}, h = (t = "") => {
|
|
1046
|
+
n = t, r.start(p("initial", t));
|
|
1047
|
+
}, g = (t = 1, e) => {
|
|
1048
|
+
a = Math.min(c, t + a), r.message(p("active", e ?? n)), n = e ?? n;
|
|
1049
|
+
};
|
|
1050
|
+
return {
|
|
1051
|
+
start: h,
|
|
1052
|
+
stop: r.stop,
|
|
1053
|
+
cancel: r.cancel,
|
|
1054
|
+
error: r.error,
|
|
1055
|
+
clear: r.clear,
|
|
1056
|
+
advance: g,
|
|
1057
|
+
isCancelled: r.isCancelled,
|
|
1058
|
+
message: (t) => g(0, t)
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
const c = (e, a) => e.includes(`
|
|
1063
|
+
`) ? e.split(`
|
|
1064
|
+
`).map((t) => a(t)).join(`
|
|
1065
|
+
`) : a(e);
|
|
1066
|
+
const select = (e) => {
|
|
1067
|
+
const a = (t, d) => {
|
|
1068
|
+
const s = t.label ?? String(t.value);
|
|
1069
|
+
switch (d) {
|
|
1070
|
+
case "disabled":
|
|
1071
|
+
return `${styleText("gray", S_RADIO_INACTIVE)} ${c(s, (n) => styleText("gray", n))}${t.hint ? ` ${styleText("dim", `(${t.hint ?? "disabled"})`)}` : ""}`;
|
|
1072
|
+
case "selected":
|
|
1073
|
+
return `${c(s, (n) => styleText("dim", n))}`;
|
|
1074
|
+
case "active":
|
|
1075
|
+
return `${styleText("green", S_RADIO_ACTIVE)} ${s}${t.hint ? ` ${styleText("dim", `(${t.hint})`)}` : ""}`;
|
|
1076
|
+
case "cancelled":
|
|
1077
|
+
return `${c(s, (n) => styleText(["strikethrough", "dim"], n))}`;
|
|
1078
|
+
default:
|
|
1079
|
+
return `${styleText("dim", S_RADIO_INACTIVE)} ${c(s, (n) => styleText("dim", n))}`;
|
|
1080
|
+
}
|
|
1081
|
+
};
|
|
1082
|
+
return new SelectPrompt({
|
|
1083
|
+
options: e.options,
|
|
1084
|
+
signal: e.signal,
|
|
1085
|
+
input: e.input,
|
|
1086
|
+
output: e.output,
|
|
1087
|
+
initialValue: e.initialValue,
|
|
1088
|
+
render() {
|
|
1089
|
+
const t = e.withGuide ?? settings.withGuide, d = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, n = wrapTextWithPrefix(
|
|
1090
|
+
e.output,
|
|
1091
|
+
e.message,
|
|
1092
|
+
s,
|
|
1093
|
+
d
|
|
1094
|
+
), u = `${t ? `${styleText("gray", S_BAR)}
|
|
1095
|
+
` : ""}${n}
|
|
1096
|
+
`;
|
|
1097
|
+
switch (this.state) {
|
|
1098
|
+
case "submit": {
|
|
1099
|
+
const r = t ? `${styleText("gray", S_BAR)} ` : "", l = wrapTextWithPrefix(
|
|
1100
|
+
e.output,
|
|
1101
|
+
a(this.options[this.cursor], "selected"),
|
|
1102
|
+
r
|
|
1103
|
+
);
|
|
1104
|
+
return `${u}${l}`;
|
|
1105
|
+
}
|
|
1106
|
+
case "cancel": {
|
|
1107
|
+
const r = t ? `${styleText("gray", S_BAR)} ` : "", l = wrapTextWithPrefix(
|
|
1108
|
+
e.output,
|
|
1109
|
+
a(this.options[this.cursor], "cancelled"),
|
|
1110
|
+
r
|
|
1111
|
+
);
|
|
1112
|
+
return `${u}${l}${t ? `
|
|
1113
|
+
${styleText("gray", S_BAR)}` : ""}`;
|
|
1114
|
+
}
|
|
1115
|
+
default: {
|
|
1116
|
+
const r = t ? `${styleText("cyan", S_BAR)} ` : "", l = t ? styleText("cyan", S_BAR_END) : "", g = u.split(`
|
|
1117
|
+
`).length, h = t ? 2 : 1;
|
|
1118
|
+
return `${u}${r}${limitOptions({
|
|
1119
|
+
output: e.output,
|
|
1120
|
+
cursor: this.cursor,
|
|
1121
|
+
options: this.options,
|
|
1122
|
+
maxItems: e.maxItems,
|
|
1123
|
+
columnPadding: r.length,
|
|
1124
|
+
rowPadding: g + h,
|
|
1125
|
+
style: (p, b) => a(p, p.disabled ? "disabled" : b ? "active" : "inactive")
|
|
1126
|
+
}).join(`
|
|
1127
|
+
${r}`)}
|
|
1128
|
+
${l}
|
|
1129
|
+
`;
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
}
|
|
1133
|
+
}).prompt();
|
|
1134
|
+
};
|
|
1135
|
+
|
|
1136
|
+
const selectKey = (t) => {
|
|
1137
|
+
const l = (e, a = "inactive") => {
|
|
1138
|
+
const n = e.label ?? String(e.value);
|
|
1139
|
+
return a === "selected" ? `${styleText("dim", n)}` : a === "cancelled" ? `${styleText(["strikethrough", "dim"], n)}` : a === "active" ? `${styleText(["bgCyan", "gray"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}` : `${styleText(["gray", "bgWhite", "inverse"], ` ${e.value} `)} ${n}${e.hint ? ` ${styleText("dim", `(${e.hint})`)}` : ""}`;
|
|
1140
|
+
};
|
|
1141
|
+
return new SelectKeyPrompt({
|
|
1142
|
+
options: t.options,
|
|
1143
|
+
signal: t.signal,
|
|
1144
|
+
input: t.input,
|
|
1145
|
+
output: t.output,
|
|
1146
|
+
initialValue: t.initialValue,
|
|
1147
|
+
caseSensitive: t.caseSensitive,
|
|
1148
|
+
render() {
|
|
1149
|
+
const e = t.withGuide ?? settings.withGuide, a = `${e ? `${styleText("gray", S_BAR)}
|
|
1150
|
+
` : ""}${symbol(this.state)} ${t.message}
|
|
1151
|
+
`;
|
|
1152
|
+
switch (this.state) {
|
|
1153
|
+
case "submit": {
|
|
1154
|
+
const n = e ? `${styleText("gray", S_BAR)} ` : "", s = this.options.find((u) => u.value === this.value) ?? t.options[0], c = wrapTextWithPrefix(
|
|
1155
|
+
t.output,
|
|
1156
|
+
l(s, "selected"),
|
|
1157
|
+
n
|
|
1158
|
+
);
|
|
1159
|
+
return `${a}${c}`;
|
|
1160
|
+
}
|
|
1161
|
+
case "cancel": {
|
|
1162
|
+
const n = e ? `${styleText("gray", S_BAR)} ` : "", s = wrapTextWithPrefix(
|
|
1163
|
+
t.output,
|
|
1164
|
+
l(this.options[0], "cancelled"),
|
|
1165
|
+
n
|
|
1166
|
+
);
|
|
1167
|
+
return `${a}${s}${e ? `
|
|
1168
|
+
${styleText("gray", S_BAR)}` : ""}`;
|
|
1169
|
+
}
|
|
1170
|
+
default: {
|
|
1171
|
+
const n = e ? `${styleText("cyan", S_BAR)} ` : "", s = e ? styleText("cyan", S_BAR_END) : "", c = this.options.map(
|
|
1172
|
+
(u, $) => wrapTextWithPrefix(
|
|
1173
|
+
t.output,
|
|
1174
|
+
l(u, $ === this.cursor ? "active" : "inactive"),
|
|
1175
|
+
n
|
|
1176
|
+
)
|
|
1177
|
+
).join(`
|
|
1178
|
+
`);
|
|
1179
|
+
return `${a}${c}
|
|
1180
|
+
${s}
|
|
1181
|
+
`;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}).prompt();
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
const i = `${styleText("gray", S_BAR)} `;
|
|
1189
|
+
const stream = {
|
|
1190
|
+
message: async (e, { symbol: l = styleText("gray", S_BAR) } = {}) => {
|
|
1191
|
+
process.stdout.write(`${styleText("gray", S_BAR)}
|
|
1192
|
+
${l} `);
|
|
1193
|
+
let s = 3;
|
|
1194
|
+
for await (let r of e) {
|
|
1195
|
+
r = r.replace(/\n/g, `
|
|
1196
|
+
${i}`), r.includes(`
|
|
1197
|
+
`) && (s = 3 + stripVTControlCharacters(r.slice(r.lastIndexOf(`
|
|
1198
|
+
`))).length);
|
|
1199
|
+
const o = stripVTControlCharacters(r).length;
|
|
1200
|
+
s + o < process.stdout.columns ? (s += o, process.stdout.write(r)) : (process.stdout.write(`
|
|
1201
|
+
${i}${r.trimStart()}`), s = 3 + stripVTControlCharacters(r.trimStart()).length);
|
|
1202
|
+
}
|
|
1203
|
+
process.stdout.write(`
|
|
1204
|
+
`);
|
|
1205
|
+
},
|
|
1206
|
+
info: (e) => stream.message(e, { symbol: styleText("blue", S_INFO) }),
|
|
1207
|
+
success: (e) => stream.message(e, { symbol: styleText("green", S_SUCCESS) }),
|
|
1208
|
+
step: (e) => stream.message(e, { symbol: styleText("green", S_STEP_SUBMIT) }),
|
|
1209
|
+
warn: (e) => stream.message(e, { symbol: styleText("yellow", S_WARN) }),
|
|
1210
|
+
/** alias for `log.warn()`. */
|
|
1211
|
+
warning: (e) => stream.warn(e),
|
|
1212
|
+
error: (e) => stream.message(e, { symbol: styleText("red", S_ERROR) })
|
|
1213
|
+
};
|
|
1214
|
+
|
|
1215
|
+
const tasks = async (o, e) => {
|
|
1216
|
+
for (const t of o) {
|
|
1217
|
+
if (t.enabled === false) continue;
|
|
1218
|
+
const s = spinner(e);
|
|
1219
|
+
s.start(t.title);
|
|
1220
|
+
const n = await t.task(s.message);
|
|
1221
|
+
s.stop(n || t.title);
|
|
1222
|
+
}
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
const A = (l) => l.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g, "");
|
|
1226
|
+
const taskLog = (l) => {
|
|
1227
|
+
const r = l.output ?? process.stdout, O = getColumns(r), i = styleText("gray", S_BAR), p = l.spacing ?? 1, k = 3, m = l.retainLog === true, d = !isCI() && isTTY(r);
|
|
1228
|
+
r.write(`${i}
|
|
1229
|
+
`), r.write(`${styleText("green", S_STEP_SUBMIT)} ${l.title}
|
|
1230
|
+
`);
|
|
1231
|
+
for (let e = 0; e < p; e++)
|
|
1232
|
+
r.write(`${i}
|
|
1233
|
+
`);
|
|
1234
|
+
const n = [
|
|
1235
|
+
{
|
|
1236
|
+
value: "",
|
|
1237
|
+
full: ""
|
|
1238
|
+
}
|
|
1239
|
+
];
|
|
1240
|
+
let v = false;
|
|
1241
|
+
const f = (e) => {
|
|
1242
|
+
if (n.length === 0)
|
|
1243
|
+
return;
|
|
1244
|
+
let s = 0;
|
|
1245
|
+
e && (s += p + 2);
|
|
1246
|
+
for (const t of n) {
|
|
1247
|
+
const { value: o, result: a } = t;
|
|
1248
|
+
let g = a?.message ?? o;
|
|
1249
|
+
if (g.length === 0)
|
|
1250
|
+
continue;
|
|
1251
|
+
a === void 0 && t.header !== void 0 && t.header !== "" && (g += `
|
|
1252
|
+
${t.header}`);
|
|
1253
|
+
const x = g.split(`
|
|
1254
|
+
`).reduce((b, w) => w === "" ? b + 1 : b + Math.ceil((w.length + k) / O), 0);
|
|
1255
|
+
s += x;
|
|
1256
|
+
}
|
|
1257
|
+
s > 0 && (s += 1, r.write(erase.lines(s)));
|
|
1258
|
+
}, h = (e, s, t) => {
|
|
1259
|
+
const o = t ? `${e.full}
|
|
1260
|
+
${e.value}` : e.value;
|
|
1261
|
+
e.header !== void 0 && e.header !== "" && log.message(
|
|
1262
|
+
e.header.split(`
|
|
1263
|
+
`).map((a) => styleText("bold", a)),
|
|
1264
|
+
{
|
|
1265
|
+
output: r,
|
|
1266
|
+
secondarySymbol: i,
|
|
1267
|
+
symbol: i,
|
|
1268
|
+
spacing: 0
|
|
1269
|
+
}
|
|
1270
|
+
), log.message(
|
|
1271
|
+
o.split(`
|
|
1272
|
+
`).map((a) => styleText("dim", a)),
|
|
1273
|
+
{
|
|
1274
|
+
output: r,
|
|
1275
|
+
secondarySymbol: i,
|
|
1276
|
+
symbol: i,
|
|
1277
|
+
spacing: s ?? p
|
|
1278
|
+
}
|
|
1279
|
+
);
|
|
1280
|
+
}, T = () => {
|
|
1281
|
+
for (const e of n) {
|
|
1282
|
+
const { header: s, value: t, full: o } = e;
|
|
1283
|
+
(s === void 0 || s.length === 0) && t.length === 0 || h(e, void 0, m === true && o.length > 0);
|
|
1284
|
+
}
|
|
1285
|
+
}, L = (e, s, t) => {
|
|
1286
|
+
if (f(false), (t?.raw !== true || !v) && e.value !== "" && (e.value += `
|
|
1287
|
+
`), e.value += A(s), v = t?.raw === true, l.limit !== void 0) {
|
|
1288
|
+
const o = e.value.split(`
|
|
1289
|
+
`), a = o.length - l.limit;
|
|
1290
|
+
if (a > 0) {
|
|
1291
|
+
const g = o.splice(0, a);
|
|
1292
|
+
m && (e.full += (e.full === "" ? "" : `
|
|
1293
|
+
`) + g.join(`
|
|
1294
|
+
`));
|
|
1295
|
+
}
|
|
1296
|
+
e.value = o.join(`
|
|
1297
|
+
`);
|
|
1298
|
+
}
|
|
1299
|
+
d && y();
|
|
1300
|
+
}, y = () => {
|
|
1301
|
+
for (const e of n)
|
|
1302
|
+
e.result ? e.result.status === "error" ? log.error(e.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : log.success(e.result.message, { output: r, secondarySymbol: i, spacing: 0 }) : e.value !== "" && h(e, 0);
|
|
1303
|
+
}, B = (e, s) => {
|
|
1304
|
+
f(false), e.result = s, d && y();
|
|
1305
|
+
};
|
|
1306
|
+
return {
|
|
1307
|
+
message(e, s) {
|
|
1308
|
+
L(n[0], e, s);
|
|
1309
|
+
},
|
|
1310
|
+
group(e) {
|
|
1311
|
+
const s = {
|
|
1312
|
+
header: e,
|
|
1313
|
+
value: "",
|
|
1314
|
+
full: ""
|
|
1315
|
+
};
|
|
1316
|
+
return n.push(s), {
|
|
1317
|
+
message(t, o) {
|
|
1318
|
+
L(s, t, o);
|
|
1319
|
+
},
|
|
1320
|
+
error(t) {
|
|
1321
|
+
B(s, {
|
|
1322
|
+
status: "error",
|
|
1323
|
+
message: t
|
|
1324
|
+
});
|
|
1325
|
+
},
|
|
1326
|
+
success(t) {
|
|
1327
|
+
B(s, {
|
|
1328
|
+
status: "success",
|
|
1329
|
+
message: t
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
},
|
|
1334
|
+
error(e, s) {
|
|
1335
|
+
f(true), log.error(e, { output: r, secondarySymbol: i, spacing: 1 }), s?.showLog !== false && T(), n.splice(1, n.length - 1), n[0].value = "", n[0].full = "";
|
|
1336
|
+
},
|
|
1337
|
+
success(e, s) {
|
|
1338
|
+
f(true), log.success(e, { output: r, secondarySymbol: i, spacing: 1 }), s?.showLog === true && T(), n.splice(1, n.length - 1), n[0].value = "", n[0].full = "";
|
|
1339
|
+
}
|
|
1340
|
+
};
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
const text = (t) => new TextPrompt({
|
|
1344
|
+
validate: t.validate,
|
|
1345
|
+
placeholder: t.placeholder,
|
|
1346
|
+
defaultValue: t.defaultValue,
|
|
1347
|
+
initialValue: t.initialValue,
|
|
1348
|
+
output: t.output,
|
|
1349
|
+
signal: t.signal,
|
|
1350
|
+
input: t.input,
|
|
1351
|
+
render() {
|
|
1352
|
+
const i = t?.withGuide ?? settings.withGuide, s = `${`${i ? `${styleText("gray", S_BAR)}
|
|
1353
|
+
` : ""}${symbol(this.state)} `}${t.message}
|
|
1354
|
+
`, c = t.placeholder ? styleText("inverse", t.placeholder[0]) + styleText("dim", t.placeholder.slice(1)) : styleText(["inverse", "hidden"], "_"), o = this.userInput ? this.userInputWithCursor : c, a = this.value ?? "";
|
|
1355
|
+
switch (this.state) {
|
|
1356
|
+
case "error": {
|
|
1357
|
+
const n = this.error ? ` ${styleText("yellow", this.error)}` : "", r = i ? `${styleText("yellow", S_BAR)} ` : "", d = i ? styleText("yellow", S_BAR_END) : "";
|
|
1358
|
+
return `${s.trim()}
|
|
1359
|
+
${r}${o}
|
|
1360
|
+
${d}${n}
|
|
1361
|
+
`;
|
|
1362
|
+
}
|
|
1363
|
+
case "submit": {
|
|
1364
|
+
const n = a ? ` ${styleText("dim", a)}` : "", r = i ? styleText("gray", S_BAR) : "";
|
|
1365
|
+
return `${s}${r}${n}`;
|
|
1366
|
+
}
|
|
1367
|
+
case "cancel": {
|
|
1368
|
+
const n = a ? ` ${styleText(["strikethrough", "dim"], a)}` : "", r = i ? styleText("gray", S_BAR) : "";
|
|
1369
|
+
return `${s}${r}${n}${a.trim() ? `
|
|
1370
|
+
${r}` : ""}`;
|
|
1371
|
+
}
|
|
1372
|
+
default: {
|
|
1373
|
+
const n = i ? `${styleText("cyan", S_BAR)} ` : "", r = i ? styleText("cyan", S_BAR_END) : "";
|
|
1374
|
+
return `${s}${n}${o}
|
|
1375
|
+
${r}
|
|
1376
|
+
`;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
}).prompt();
|
|
1381
|
+
|
|
1382
|
+
export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
|