@shell-shock/plugin-prompts 0.3.63 → 0.3.64
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/components/prompts-builtin.cjs +439 -441
- package/dist/components/prompts-builtin.d.cts +1 -2
- package/dist/components/prompts-builtin.d.cts.map +1 -1
- package/dist/components/prompts-builtin.d.mts +1 -2
- package/dist/components/prompts-builtin.mjs +7 -7
- package/dist/generator.cjs +32 -0
- package/dist/generator.d.cts +10 -0
- package/dist/generator.d.cts.map +1 -0
- package/dist/generator.d.mts +10 -0
- package/dist/generator.d.mts.map +1 -0
- package/dist/generator.mjs +31 -0
- package/dist/generator.mjs.map +1 -0
- package/dist/index.cjs +7 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +7 -9
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.mjs +2 -0
- package/dist/types/plugin.d.cts +0 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +0 -1
- package/package.json +27 -13
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
2
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
3
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
4
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
-
let
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
let
|
|
5
|
+
let _power_plant_alloy_js_core_components_spacing = require("@power-plant/alloy-js/core/components/spacing");
|
|
6
|
+
let _power_plant_alloy_js_typescript_components_class_declaration = require("@power-plant/alloy-js/typescript/components/class-declaration");
|
|
7
|
+
let _power_plant_alloy_js_typescript_components_interface_declaration = require("@power-plant/alloy-js/typescript/components/interface-declaration");
|
|
8
|
+
let _power_plant_alloy_js_typescript_components_tsdoc = require("@power-plant/alloy-js/typescript/components/tsdoc");
|
|
9
|
+
let _power_plant_alloy_js_typescript_components_type_declaration = require("@power-plant/alloy-js/typescript/components/type-declaration");
|
|
10
|
+
let _shell_shock_core_contexts_power_plant = require("@shell-shock/core/contexts/power-plant");
|
|
12
11
|
let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
|
|
13
12
|
let defu = require("defu");
|
|
14
|
-
defu = require_runtime.__toESM(defu, 1);
|
|
15
13
|
|
|
16
14
|
//#region src/components/prompts-builtin.tsx
|
|
17
15
|
/**
|
|
@@ -20,7 +18,7 @@ defu = require_runtime.__toESM(defu, 1);
|
|
|
20
18
|
function BasePromptDeclarations() {
|
|
21
19
|
const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
22
20
|
return [
|
|
23
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
21
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
24
22
|
"export": true,
|
|
25
23
|
name: "PromptParser",
|
|
26
24
|
typeParameters: [{
|
|
@@ -30,8 +28,8 @@ function BasePromptDeclarations() {
|
|
|
30
28
|
doc: "A type for a custom prompt input parser, which can be used to create custom input styles for prompts. The function should return the parsed value for the given input string.",
|
|
31
29
|
children: _alloy_js_core.code`(this: Prompt<TValue>, input: string) => TValue; `
|
|
32
30
|
}),
|
|
33
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
34
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
31
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
32
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
35
33
|
"export": true,
|
|
36
34
|
name: "PromptFormatter",
|
|
37
35
|
typeParameters: [{
|
|
@@ -41,7 +39,7 @@ function BasePromptDeclarations() {
|
|
|
41
39
|
doc: "A type for a custom prompt input formatter, which can be used to create custom display styles for prompts. The function should return the formatted string to display for the given input value.",
|
|
42
40
|
children: _alloy_js_core.code`(this: Prompt<TValue>, input: TValue) => string; `
|
|
43
41
|
}),
|
|
44
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
42
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
45
43
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
46
44
|
"export": true,
|
|
47
45
|
name: "noMask",
|
|
@@ -53,7 +51,7 @@ function BasePromptDeclarations() {
|
|
|
53
51
|
returnType: "string",
|
|
54
52
|
children: _alloy_js_core.code`return input; `
|
|
55
53
|
}),
|
|
56
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
54
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
57
55
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
58
56
|
"export": true,
|
|
59
57
|
name: "invisibleMask",
|
|
@@ -65,8 +63,8 @@ function BasePromptDeclarations() {
|
|
|
65
63
|
returnType: "string",
|
|
66
64
|
children: _alloy_js_core.code`return " ".repeat(input.length); `
|
|
67
65
|
}),
|
|
68
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
69
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
66
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
67
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
70
68
|
"export": true,
|
|
71
69
|
name: "PromptState",
|
|
72
70
|
doc: "The current state of a prompt",
|
|
@@ -76,48 +74,48 @@ function BasePromptDeclarations() {
|
|
|
76
74
|
}],
|
|
77
75
|
get children() {
|
|
78
76
|
return [
|
|
79
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
77
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
80
78
|
name: "value",
|
|
81
79
|
type: "TValue",
|
|
82
80
|
doc: "The current value of the prompt"
|
|
83
81
|
}),
|
|
84
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
85
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
82
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
83
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
86
84
|
name: "isError",
|
|
87
85
|
type: "boolean",
|
|
88
86
|
doc: "Indicates whether the prompt is in an error state"
|
|
89
87
|
}),
|
|
90
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
91
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
88
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
89
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
92
90
|
name: "errorMessage",
|
|
93
91
|
required: false,
|
|
94
92
|
type: "string",
|
|
95
93
|
doc: "If the prompt is in an error state, this will contain the error message to display"
|
|
96
94
|
}),
|
|
97
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
98
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
95
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
96
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
99
97
|
name: "isSubmitted",
|
|
100
98
|
type: "boolean",
|
|
101
99
|
doc: "Indicates whether the prompt is submitted"
|
|
102
100
|
}),
|
|
103
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
104
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
101
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
102
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
105
103
|
name: "isCancelled",
|
|
106
104
|
type: "boolean",
|
|
107
105
|
doc: "Indicates whether the prompt is cancelled"
|
|
108
106
|
}),
|
|
109
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
110
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
107
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
108
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
111
109
|
name: "isCompleted",
|
|
112
110
|
type: "boolean",
|
|
113
111
|
doc: "Indicates whether the prompt is completed, which can be used to indicate that the prompt interaction is finished regardless of whether it was submitted or cancelled"
|
|
114
112
|
}),
|
|
115
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
113
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {})
|
|
116
114
|
];
|
|
117
115
|
}
|
|
118
116
|
}),
|
|
119
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
120
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
117
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
118
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
121
119
|
name: "PromptConfig",
|
|
122
120
|
doc: "Configuration options for creating a prompt",
|
|
123
121
|
typeParameters: [{
|
|
@@ -126,83 +124,83 @@ function BasePromptDeclarations() {
|
|
|
126
124
|
}],
|
|
127
125
|
get children() {
|
|
128
126
|
return [
|
|
129
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
127
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
130
128
|
name: "input",
|
|
131
129
|
required: false,
|
|
132
130
|
type: "NodeJS.ReadStream",
|
|
133
131
|
doc: "The readable stream to use for prompt input, defaults to process.stdin"
|
|
134
132
|
}),
|
|
135
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
136
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
133
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
134
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
137
135
|
name: "output",
|
|
138
136
|
required: false,
|
|
139
137
|
type: "NodeJS.WriteStream",
|
|
140
138
|
doc: "The writable stream to use for prompt output, defaults to process.stdout"
|
|
141
139
|
}),
|
|
142
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
143
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
140
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
141
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
144
142
|
name: "message",
|
|
145
143
|
type: "string",
|
|
146
144
|
doc: "The prompt message to display"
|
|
147
145
|
}),
|
|
148
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
149
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
146
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
147
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
150
148
|
name: "description",
|
|
151
149
|
required: false,
|
|
152
150
|
type: "string",
|
|
153
151
|
doc: "The prompt description message to display"
|
|
154
152
|
}),
|
|
155
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
156
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
153
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
154
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
157
155
|
name: "initialValue",
|
|
158
156
|
required: false,
|
|
159
157
|
type: "TValue",
|
|
160
158
|
doc: "The initial value of the prompt"
|
|
161
159
|
}),
|
|
162
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
163
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
160
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
161
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
164
162
|
name: "validate",
|
|
165
163
|
required: false,
|
|
166
164
|
type: "(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>",
|
|
167
165
|
doc: "A validation function that returns true if the input is valid, false or a string error message if the input is invalid"
|
|
168
166
|
}),
|
|
169
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
170
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
167
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
168
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
171
169
|
name: "parse",
|
|
172
170
|
required: false,
|
|
173
171
|
type: "PromptParser<TValue>",
|
|
174
172
|
doc: "A function that parses the input value and returns the parsed result or throws an error if the input is invalid"
|
|
175
173
|
}),
|
|
176
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
177
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
174
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
175
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
178
176
|
name: "format",
|
|
179
177
|
required: false,
|
|
180
178
|
type: "PromptFormatter<TValue>",
|
|
181
179
|
doc: "A function that formats the input value and returns the formatted result or throws an error if the input is invalid"
|
|
182
180
|
}),
|
|
183
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
184
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
181
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
182
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
185
183
|
name: "mask",
|
|
186
184
|
required: false,
|
|
187
185
|
type: "(input: string) => string",
|
|
188
186
|
doc: "A function that masks the input value and returns the masked result. This can be used to create password inputs or other sensitive input types where the actual input value should not be displayed. If not provided, the prompt will display the input as is without masking."
|
|
189
187
|
}),
|
|
190
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
191
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
188
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
189
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
192
190
|
name: "maskCompleted",
|
|
193
191
|
required: false,
|
|
194
192
|
type: "(input: string) => string",
|
|
195
193
|
doc: "A function that masks the value submitted by the user so that it can then be used in the console output or elsewhere without exposing sensitive information. If not provided, the prompt will use the same mask function for both input and submitted value masking."
|
|
196
194
|
}),
|
|
197
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
198
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
195
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
196
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
199
197
|
name: "defaultErrorMessage",
|
|
200
198
|
required: false,
|
|
201
199
|
type: "string",
|
|
202
200
|
doc: "The default error message to display when validation fails"
|
|
203
201
|
}),
|
|
204
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
205
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
202
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
203
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
206
204
|
name: "timeout",
|
|
207
205
|
required: false,
|
|
208
206
|
type: "number",
|
|
@@ -211,8 +209,8 @@ function BasePromptDeclarations() {
|
|
|
211
209
|
];
|
|
212
210
|
}
|
|
213
211
|
}),
|
|
214
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
215
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
212
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
213
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
216
214
|
abstract: true,
|
|
217
215
|
name: "Prompt",
|
|
218
216
|
doc: "Base prompt class that other prompt types can extend from",
|
|
@@ -223,179 +221,179 @@ function BasePromptDeclarations() {
|
|
|
223
221
|
}],
|
|
224
222
|
get children() {
|
|
225
223
|
return [
|
|
226
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
224
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
227
225
|
name: "readline",
|
|
228
226
|
isPrivateMember: true,
|
|
229
227
|
type: "Interface"
|
|
230
228
|
}),
|
|
231
229
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
232
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
230
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
233
231
|
name: "value",
|
|
234
232
|
isPrivateMember: true,
|
|
235
233
|
type: "TValue | undefined"
|
|
236
234
|
}),
|
|
237
235
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
238
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
236
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
239
237
|
name: "isKeyPressed",
|
|
240
238
|
isPrivateMember: true,
|
|
241
239
|
type: "boolean",
|
|
242
240
|
children: _alloy_js_core.code`false; `
|
|
243
241
|
}),
|
|
244
242
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
245
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
243
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
246
244
|
name: "isDirty",
|
|
247
245
|
isPrivateMember: true,
|
|
248
246
|
type: "boolean",
|
|
249
247
|
children: _alloy_js_core.code`false; `
|
|
250
248
|
}),
|
|
251
249
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
252
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
250
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
253
251
|
name: "isClosed",
|
|
254
252
|
isPrivateMember: true,
|
|
255
253
|
type: "boolean",
|
|
256
254
|
children: _alloy_js_core.code`false; `
|
|
257
255
|
}),
|
|
258
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
259
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
256
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
257
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
260
258
|
name: "initialValue",
|
|
261
259
|
abstract: true,
|
|
262
260
|
"protected": true,
|
|
263
261
|
type: "TValue"
|
|
264
262
|
}),
|
|
265
263
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
266
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
264
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
267
265
|
name: "input",
|
|
268
266
|
"protected": true,
|
|
269
267
|
type: "NodeJS.ReadStream",
|
|
270
268
|
children: _alloy_js_core.code`process.stdin; `
|
|
271
269
|
}),
|
|
272
270
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
273
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
271
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
274
272
|
name: "output",
|
|
275
273
|
"protected": true,
|
|
276
274
|
type: "NodeJS.WriteStream",
|
|
277
275
|
children: _alloy_js_core.code`process.stdout; `
|
|
278
276
|
}),
|
|
279
277
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
280
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
278
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
281
279
|
name: "message",
|
|
282
280
|
"protected": true,
|
|
283
281
|
type: "string",
|
|
284
282
|
children: _alloy_js_core.code`""; `
|
|
285
283
|
}),
|
|
286
284
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
287
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
285
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
288
286
|
name: "description",
|
|
289
287
|
"protected": true,
|
|
290
288
|
type: "string",
|
|
291
289
|
children: _alloy_js_core.code`""; `
|
|
292
290
|
}),
|
|
293
291
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
294
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
292
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
295
293
|
name: "errorMessage",
|
|
296
294
|
"protected": true,
|
|
297
295
|
type: "string | null",
|
|
298
296
|
children: _alloy_js_core.code`null; `
|
|
299
297
|
}),
|
|
300
298
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
301
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
299
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
302
300
|
name: "defaultErrorMessage",
|
|
303
301
|
"protected": true,
|
|
304
302
|
type: "string",
|
|
305
303
|
children: _alloy_js_core.code`"An invalid value was provided"; `
|
|
306
304
|
}),
|
|
307
305
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
308
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
306
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
309
307
|
name: "isSubmitted",
|
|
310
308
|
"protected": true,
|
|
311
309
|
type: "boolean",
|
|
312
310
|
children: _alloy_js_core.code`false; `
|
|
313
311
|
}),
|
|
314
312
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
315
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
313
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
316
314
|
name: "isCancelled",
|
|
317
315
|
"protected": true,
|
|
318
316
|
type: "boolean",
|
|
319
317
|
children: _alloy_js_core.code`false; `
|
|
320
318
|
}),
|
|
321
319
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
322
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
320
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
323
321
|
name: "isInitial",
|
|
324
322
|
"protected": true,
|
|
325
323
|
type: "boolean",
|
|
326
324
|
children: _alloy_js_core.code`true; `
|
|
327
325
|
}),
|
|
328
326
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
329
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
327
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
330
328
|
name: "consoleOutput",
|
|
331
329
|
"protected": true,
|
|
332
330
|
type: "string",
|
|
333
331
|
children: _alloy_js_core.code`""; `
|
|
334
332
|
}),
|
|
335
333
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
336
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
334
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
337
335
|
name: "consoleStatus",
|
|
338
336
|
"protected": true,
|
|
339
337
|
type: "string",
|
|
340
338
|
children: _alloy_js_core.code`""; `
|
|
341
339
|
}),
|
|
342
340
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
343
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
341
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
344
342
|
name: "displayValue",
|
|
345
343
|
"protected": true,
|
|
346
344
|
type: "string",
|
|
347
345
|
children: _alloy_js_core.code`""; `
|
|
348
346
|
}),
|
|
349
347
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
350
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
348
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
351
349
|
name: "validate",
|
|
352
350
|
"protected": true,
|
|
353
351
|
type: "(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>",
|
|
354
352
|
children: _alloy_js_core.code`() => true; `
|
|
355
353
|
}),
|
|
356
354
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
357
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
355
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
358
356
|
name: "parse",
|
|
359
357
|
"protected": true,
|
|
360
358
|
type: "PromptParser<TValue>",
|
|
361
359
|
children: _alloy_js_core.code`(value: string) => value as TValue; `
|
|
362
360
|
}),
|
|
363
361
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
364
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
362
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
365
363
|
name: "format",
|
|
366
364
|
"protected": true,
|
|
367
365
|
type: "PromptFormatter<TValue>",
|
|
368
366
|
children: _alloy_js_core.code`(value: TValue) => String(value); `
|
|
369
367
|
}),
|
|
370
368
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
371
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
369
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
372
370
|
name: "mask",
|
|
373
371
|
"protected": true,
|
|
374
372
|
type: "(input: string) => string",
|
|
375
373
|
children: _alloy_js_core.code`noMask; `
|
|
376
374
|
}),
|
|
377
375
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
378
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
376
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
379
377
|
name: "maskCompleted",
|
|
380
378
|
"protected": true,
|
|
381
379
|
type: "(input: string) => string",
|
|
382
380
|
children: _alloy_js_core.code`this.mask; `
|
|
383
381
|
}),
|
|
384
382
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
385
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
383
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
386
384
|
name: "cursor",
|
|
387
385
|
"protected": true,
|
|
388
386
|
type: "number",
|
|
389
387
|
children: _alloy_js_core.code`0; `
|
|
390
388
|
}),
|
|
391
389
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
392
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
390
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
393
391
|
name: "cursorHidden",
|
|
394
392
|
"protected": true,
|
|
395
393
|
type: "boolean",
|
|
396
394
|
children: _alloy_js_core.code`false; `
|
|
397
395
|
}),
|
|
398
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
396
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
399
397
|
_alloy_js_core.code`constructor(protected config: PromptConfig<TValue>) {
|
|
400
398
|
super();
|
|
401
399
|
|
|
@@ -454,44 +452,44 @@ function BasePromptDeclarations() {
|
|
|
454
452
|
[Symbol.dispose]() {
|
|
455
453
|
this.close();
|
|
456
454
|
} `,
|
|
457
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
458
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
455
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
456
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
459
457
|
"public": true,
|
|
460
458
|
name: "value",
|
|
461
459
|
type: "TValue",
|
|
462
460
|
doc: "A getter for the prompt value that returns the current value or the initial value if the current value is not set",
|
|
463
461
|
children: _alloy_js_core.code`return this.#value || this.initialValue; `
|
|
464
462
|
}),
|
|
465
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
466
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
463
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
464
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
467
465
|
"public": true,
|
|
468
466
|
name: "isError",
|
|
469
467
|
type: "boolean",
|
|
470
468
|
children: _alloy_js_core.code`return !!this.errorMessage; `
|
|
471
469
|
}),
|
|
472
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
473
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
470
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
471
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
474
472
|
"protected": true,
|
|
475
473
|
name: "isSelect",
|
|
476
474
|
type: "boolean",
|
|
477
475
|
children: _alloy_js_core.code`return false; `
|
|
478
476
|
}),
|
|
479
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
480
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
477
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
478
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
481
479
|
"protected": true,
|
|
482
480
|
name: "isCompleted",
|
|
483
481
|
type: "boolean",
|
|
484
482
|
children: _alloy_js_core.code`return this.isCancelled || this.isSubmitted; `
|
|
485
483
|
}),
|
|
486
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
487
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
484
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
485
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
488
486
|
"protected": true,
|
|
489
487
|
name: "isPlaceholder",
|
|
490
488
|
type: "boolean",
|
|
491
489
|
children: _alloy_js_core.code`return (this.displayValue === this.format(this.initialValue) && !this.#isDirty) || !this.#isKeyPressed; `
|
|
492
490
|
}),
|
|
493
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
494
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
491
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
492
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
495
493
|
"protected": true,
|
|
496
494
|
name: "status",
|
|
497
495
|
type: "string",
|
|
@@ -507,24 +505,24 @@ function BasePromptDeclarations() {
|
|
|
507
505
|
)
|
|
508
506
|
}\`; `
|
|
509
507
|
}),
|
|
510
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
511
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
508
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
509
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
512
510
|
doc: "A property to check if the cursor is at the start",
|
|
513
511
|
name: "isCursorAtStart",
|
|
514
512
|
"protected": true,
|
|
515
513
|
type: "boolean",
|
|
516
514
|
children: _alloy_js_core.code`return this.cursor <= 0 || (this.isPlaceholder && this.cursor <= 1); `
|
|
517
515
|
}),
|
|
518
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
519
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
516
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
517
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
520
518
|
doc: "A property to check if the cursor is at the end",
|
|
521
519
|
name: "isCursorAtEnd",
|
|
522
520
|
"protected": true,
|
|
523
521
|
type: "boolean",
|
|
524
522
|
children: _alloy_js_core.code`return this.cursor >= this.displayValue.length || (this.isPlaceholder && this.cursor >= this.displayValue.length - 1); `
|
|
525
523
|
}),
|
|
526
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
527
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
524
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
525
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
528
526
|
doc: "A method to change the prompt value, which also updates the display value and fires a state update event. This method can be called by subclasses whenever the prompt value needs to be updated based on user input or other interactions.",
|
|
529
527
|
name: "changeValue",
|
|
530
528
|
"protected": true,
|
|
@@ -555,8 +553,8 @@ function BasePromptDeclarations() {
|
|
|
555
553
|
|
|
556
554
|
this.sync(); `
|
|
557
555
|
}),
|
|
558
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
559
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
556
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
557
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
560
558
|
doc: "A method to emit the current state",
|
|
561
559
|
name: "sync",
|
|
562
560
|
"protected": true,
|
|
@@ -570,15 +568,15 @@ function BasePromptDeclarations() {
|
|
|
570
568
|
});
|
|
571
569
|
this.render(); `
|
|
572
570
|
}),
|
|
573
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
574
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
571
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
572
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
575
573
|
doc: "A method to ring the bell",
|
|
576
574
|
name: "bell",
|
|
577
575
|
"protected": true,
|
|
578
576
|
children: _alloy_js_core.code`this.output.write(beep); `
|
|
579
577
|
}),
|
|
580
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
581
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
578
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
579
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
582
580
|
doc: "A method to render the prompt",
|
|
583
581
|
name: "onRender",
|
|
584
582
|
"protected": true,
|
|
@@ -593,8 +591,8 @@ function BasePromptDeclarations() {
|
|
|
593
591
|
? textColors.prompt.input.cancelled(this.maskCompleted(this.displayValue))
|
|
594
592
|
: bold(textColors.prompt.input.active(this.displayValue)); `
|
|
595
593
|
}),
|
|
596
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
597
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
594
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
595
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
598
596
|
doc: "A method to handle changes in the prompt value",
|
|
599
597
|
name: "onChange",
|
|
600
598
|
"protected": true,
|
|
@@ -604,8 +602,8 @@ function BasePromptDeclarations() {
|
|
|
604
602
|
}],
|
|
605
603
|
children: _alloy_js_core.code` // can be implemented by subclasses to handle value changes if needed, this method is called whenever the prompt value changes and receives the previous value as an argument for reference`
|
|
606
604
|
}),
|
|
607
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
608
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
605
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
606
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
609
607
|
doc: "A method to handle key press events and determine the corresponding action",
|
|
610
608
|
name: "onKeyPress",
|
|
611
609
|
"protected": true,
|
|
@@ -623,8 +621,8 @@ function BasePromptDeclarations() {
|
|
|
623
621
|
(this as any)[action](key);
|
|
624
622
|
} `
|
|
625
623
|
}),
|
|
626
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
627
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
624
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
625
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
628
626
|
doc: "A method to close the prompt and clean up resources, which also emits a submit or cancel event based on the prompt state. This method should be called when the prompt interaction is finished and the prompt needs to be closed.",
|
|
629
627
|
name: "close",
|
|
630
628
|
async: true,
|
|
@@ -644,8 +642,8 @@ function BasePromptDeclarations() {
|
|
|
644
642
|
this.emit(this.isSubmitted ? "submit" : "cancel", this.value);
|
|
645
643
|
this.#isClosed = true; `
|
|
646
644
|
}),
|
|
647
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
648
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
645
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
646
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
649
647
|
doc: "A method to validate the prompt input using the provided validator function, which updates the error message and error state based on the validation result. This method is called whenever the prompt value changes and needs to be validated.",
|
|
650
648
|
name: "checkValidations",
|
|
651
649
|
async: true,
|
|
@@ -663,8 +661,8 @@ function BasePromptDeclarations() {
|
|
|
663
661
|
this.errorMessage = null;
|
|
664
662
|
} `
|
|
665
663
|
}),
|
|
666
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
667
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
664
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
665
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
668
666
|
doc: "A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.",
|
|
669
667
|
name: "getAction",
|
|
670
668
|
"protected": true,
|
|
@@ -705,8 +703,8 @@ function BasePromptDeclarations() {
|
|
|
705
703
|
|
|
706
704
|
return action || false; `
|
|
707
705
|
}),
|
|
708
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
709
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
706
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
707
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
710
708
|
doc: "A method to move the cursor to the left or right by a \\`count\\` of positions",
|
|
711
709
|
name: "moveCursor",
|
|
712
710
|
parameters: [{
|
|
@@ -724,8 +722,8 @@ function BasePromptDeclarations() {
|
|
|
724
722
|
|
|
725
723
|
`
|
|
726
724
|
}),
|
|
727
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
728
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
725
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
726
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
729
727
|
doc: "A method to remove the character backward of the cursor",
|
|
730
728
|
name: "backspace",
|
|
731
729
|
"protected": true,
|
|
@@ -749,8 +747,8 @@ function BasePromptDeclarations() {
|
|
|
749
747
|
|
|
750
748
|
this.sync(); `
|
|
751
749
|
}),
|
|
752
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
753
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
750
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
751
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
754
752
|
doc: "A method to remove the character forward of the cursor",
|
|
755
753
|
name: "delete",
|
|
756
754
|
"protected": true,
|
|
@@ -770,8 +768,8 @@ function BasePromptDeclarations() {
|
|
|
770
768
|
|
|
771
769
|
this.sync(); `
|
|
772
770
|
}),
|
|
773
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
774
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
771
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
772
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
775
773
|
doc: "A method to reset the prompt input",
|
|
776
774
|
name: "reset",
|
|
777
775
|
"protected": true,
|
|
@@ -784,8 +782,8 @@ function BasePromptDeclarations() {
|
|
|
784
782
|
|
|
785
783
|
this.sync(); `
|
|
786
784
|
}),
|
|
787
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
788
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
785
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
786
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
789
787
|
doc: "A method to cancel the prompt input",
|
|
790
788
|
name: "cancel",
|
|
791
789
|
"protected": true,
|
|
@@ -797,8 +795,8 @@ function BasePromptDeclarations() {
|
|
|
797
795
|
this.output.write("\\n");
|
|
798
796
|
this.close(); `
|
|
799
797
|
}),
|
|
800
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
801
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
798
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
799
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
802
800
|
doc: "A method to submit the prompt input",
|
|
803
801
|
name: "submit",
|
|
804
802
|
async: true,
|
|
@@ -818,8 +816,8 @@ function BasePromptDeclarations() {
|
|
|
818
816
|
this.close();
|
|
819
817
|
} `
|
|
820
818
|
}),
|
|
821
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
822
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
819
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
820
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
823
821
|
doc: "A method to render the prompt",
|
|
824
822
|
name: "render",
|
|
825
823
|
"private": true,
|
|
@@ -876,8 +874,8 @@ function BasePromptDeclarations() {
|
|
|
876
874
|
} `;
|
|
877
875
|
}
|
|
878
876
|
}),
|
|
879
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
880
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
877
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
878
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
881
879
|
doc: "A method to handle key press events and determine the corresponding action",
|
|
882
880
|
name: "keypress",
|
|
883
881
|
"private": true,
|
|
@@ -901,8 +899,8 @@ function BasePromptDeclarations() {
|
|
|
901
899
|
];
|
|
902
900
|
}
|
|
903
901
|
}),
|
|
904
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
905
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
902
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
903
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
906
904
|
name: "PromptFactoryConfig",
|
|
907
905
|
"extends": "PromptConfig<TValue>",
|
|
908
906
|
doc: "Configuration options for creating a prompt with a prompt factory function",
|
|
@@ -912,21 +910,21 @@ function BasePromptDeclarations() {
|
|
|
912
910
|
}],
|
|
913
911
|
get children() {
|
|
914
912
|
return [
|
|
915
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
913
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
916
914
|
name: "onState",
|
|
917
915
|
required: false,
|
|
918
916
|
type: "(state: PromptState<TValue>) => any",
|
|
919
917
|
doc: "A function that is called when the prompt state changes, useful for updating the prompt message or other properties dynamically"
|
|
920
918
|
}),
|
|
921
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
922
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
919
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
920
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
923
921
|
name: "onSubmit",
|
|
924
922
|
required: false,
|
|
925
923
|
type: "(value: TValue) => any",
|
|
926
924
|
doc: "A function that is called when the prompt is submitted, useful for handling the submitted value or performing actions based on the prompt state"
|
|
927
925
|
}),
|
|
928
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
929
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
926
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
927
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
930
928
|
name: "onCancel",
|
|
931
929
|
required: false,
|
|
932
930
|
type: "(event: any) => any",
|
|
@@ -935,21 +933,21 @@ function BasePromptDeclarations() {
|
|
|
935
933
|
];
|
|
936
934
|
}
|
|
937
935
|
}),
|
|
938
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
939
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
936
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
937
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "A unique symbol used to indicate that a prompt was cancelled, which can be returned from a prompt function to signal that the prompt interaction should be cancelled and any pending promises should be rejected with this symbol. This allows for a consistent way to handle prompt cancellations across different prompt types and interactions." }),
|
|
940
938
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.VarDeclaration, {
|
|
941
939
|
"export": true,
|
|
942
940
|
name: "CANCEL_SYMBOL",
|
|
943
941
|
children: _alloy_js_core.code`Symbol("shell-shock:prompts:cancel"); `
|
|
944
942
|
}),
|
|
945
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
946
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
943
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
944
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
947
945
|
heading: "A utility function to check if a given value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled based on the value returned from a prompt factory function. This function checks if the provided value is strictly equal to the {@link CANCEL_SYMBOL | CANCEL_SYMBOL}, allowing for a consistent way to handle prompt cancellations across different prompt types and interactions.",
|
|
948
946
|
get children() {
|
|
949
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
947
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
950
948
|
name: "value",
|
|
951
949
|
children: `The value to check.`
|
|
952
|
-
}), (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
950
|
+
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A boolean indicating whether the provided value is the {@link CANCEL_SYMBOL | cancel symbol}, which can be used to determine if a prompt interaction was cancelled.` })];
|
|
953
951
|
}
|
|
954
952
|
}),
|
|
955
953
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
@@ -969,20 +967,20 @@ function BasePromptDeclarations() {
|
|
|
969
967
|
*/
|
|
970
968
|
function TextPromptDeclarations() {
|
|
971
969
|
return [
|
|
972
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
970
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
973
971
|
name: "StringPromptConfig",
|
|
974
972
|
"extends": "PromptConfig<string>",
|
|
975
973
|
doc: "Configuration options for creating a text-based prompt",
|
|
976
974
|
get children() {
|
|
977
975
|
return [
|
|
978
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
976
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
979
977
|
name: "initialValue",
|
|
980
978
|
required: false,
|
|
981
979
|
type: "string",
|
|
982
980
|
doc: "The initial value of the prompt"
|
|
983
981
|
}),
|
|
984
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
985
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
982
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
983
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
986
984
|
name: "mask",
|
|
987
985
|
required: false,
|
|
988
986
|
type: "(input: string) => string",
|
|
@@ -991,28 +989,28 @@ function TextPromptDeclarations() {
|
|
|
991
989
|
];
|
|
992
990
|
}
|
|
993
991
|
}),
|
|
994
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
995
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
992
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
993
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
996
994
|
name: "StringPrompt",
|
|
997
995
|
doc: "A prompt for text input",
|
|
998
996
|
"extends": "Prompt<string>",
|
|
999
997
|
get children() {
|
|
1000
998
|
return [
|
|
1001
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
999
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1002
1000
|
name: "isInvalid",
|
|
1003
1001
|
isPrivateMember: true,
|
|
1004
1002
|
type: "boolean",
|
|
1005
1003
|
children: _alloy_js_core.code`false; `
|
|
1006
1004
|
}),
|
|
1007
1005
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1008
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1006
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1009
1007
|
name: "initialValue",
|
|
1010
1008
|
"protected": true,
|
|
1011
1009
|
override: true,
|
|
1012
1010
|
type: "string",
|
|
1013
1011
|
children: _alloy_js_core.code`""; `
|
|
1014
1012
|
}),
|
|
1015
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1013
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1016
1014
|
_alloy_js_core.code`constructor(config: StringPromptConfig) {
|
|
1017
1015
|
super(config);
|
|
1018
1016
|
|
|
@@ -1028,8 +1026,8 @@ function TextPromptDeclarations() {
|
|
|
1028
1026
|
this.sync();
|
|
1029
1027
|
this.last();
|
|
1030
1028
|
} `,
|
|
1031
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1032
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1029
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1030
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1033
1031
|
doc: "A method to handle onKeyPress events and determine the corresponding action",
|
|
1034
1032
|
name: "onKeyPress",
|
|
1035
1033
|
override: true,
|
|
@@ -1057,8 +1055,8 @@ function TextPromptDeclarations() {
|
|
|
1057
1055
|
}\`);
|
|
1058
1056
|
this.sync(); `
|
|
1059
1057
|
}),
|
|
1060
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1061
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1058
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1059
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1062
1060
|
doc: "A method to handle changes in the prompt value",
|
|
1063
1061
|
name: "onChange",
|
|
1064
1062
|
override: true,
|
|
@@ -1070,8 +1068,8 @@ function TextPromptDeclarations() {
|
|
|
1070
1068
|
children: _alloy_js_core.code`this.#isInvalid = false;
|
|
1071
1069
|
this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `
|
|
1072
1070
|
}),
|
|
1073
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1074
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1071
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1072
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1075
1073
|
doc: "A method to reset the prompt input",
|
|
1076
1074
|
name: "reset",
|
|
1077
1075
|
override: true,
|
|
@@ -1079,8 +1077,8 @@ function TextPromptDeclarations() {
|
|
|
1079
1077
|
children: _alloy_js_core.code`this.cursor = Number(!!this.initialValue);
|
|
1080
1078
|
super.reset(); `
|
|
1081
1079
|
}),
|
|
1082
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1083
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1080
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1081
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1084
1082
|
doc: "A method to validate the prompt input",
|
|
1085
1083
|
name: "checkValidations",
|
|
1086
1084
|
override: true,
|
|
@@ -1089,8 +1087,8 @@ function TextPromptDeclarations() {
|
|
|
1089
1087
|
children: _alloy_js_core.code`await super.checkValidations(this.value);
|
|
1090
1088
|
this.#isInvalid = this.isError; `
|
|
1091
1089
|
}),
|
|
1092
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1093
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1090
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1091
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1094
1092
|
doc: "A method to move the cursor to the end of the input",
|
|
1095
1093
|
name: "next",
|
|
1096
1094
|
"protected": true,
|
|
@@ -1098,24 +1096,24 @@ function TextPromptDeclarations() {
|
|
|
1098
1096
|
this.cursor = this.displayValue.length;
|
|
1099
1097
|
this.sync(); `
|
|
1100
1098
|
}),
|
|
1101
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1102
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1099
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1100
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1103
1101
|
doc: "A method to move the cursor to the start",
|
|
1104
1102
|
name: "first",
|
|
1105
1103
|
"protected": true,
|
|
1106
1104
|
children: _alloy_js_core.code`this.cursor = 0;
|
|
1107
1105
|
this.sync(); `
|
|
1108
1106
|
}),
|
|
1109
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1110
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1107
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1108
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1111
1109
|
doc: "A method to move the cursor to the end",
|
|
1112
1110
|
name: "last",
|
|
1113
1111
|
"protected": true,
|
|
1114
1112
|
children: _alloy_js_core.code`this.cursor = this.displayValue.length;
|
|
1115
1113
|
this.sync(); `
|
|
1116
1114
|
}),
|
|
1117
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1118
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1115
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1119
1117
|
doc: "A method to move the cursor to the left",
|
|
1120
1118
|
name: "left",
|
|
1121
1119
|
"protected": true,
|
|
@@ -1126,8 +1124,8 @@ function TextPromptDeclarations() {
|
|
|
1126
1124
|
this.moveCursor(-1);
|
|
1127
1125
|
this.sync(); `
|
|
1128
1126
|
}),
|
|
1129
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1130
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1127
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1128
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1131
1129
|
doc: "A method to move the cursor to the right",
|
|
1132
1130
|
name: "right",
|
|
1133
1131
|
"protected": true,
|
|
@@ -1138,8 +1136,8 @@ function TextPromptDeclarations() {
|
|
|
1138
1136
|
this.moveCursor(1);
|
|
1139
1137
|
this.sync(); `
|
|
1140
1138
|
}),
|
|
1141
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1142
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1139
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1140
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1143
1141
|
doc: "A method to render the prompt",
|
|
1144
1142
|
name: "onRender",
|
|
1145
1143
|
override: true,
|
|
@@ -1158,20 +1156,20 @@ function TextPromptDeclarations() {
|
|
|
1158
1156
|
];
|
|
1159
1157
|
}
|
|
1160
1158
|
}),
|
|
1161
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1162
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1163
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1159
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1160
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "A type definition for the configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts. This type can be used when creating a text prompt using the {@link text | text prompt factory function} or when manually creating an instance of the TextPrompt class. The TextConfig type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, mask, etc., as well as any additional properties that are specific to text prompts." }),
|
|
1161
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
1164
1162
|
name: "TextConfig",
|
|
1165
1163
|
"export": true,
|
|
1166
1164
|
children: _alloy_js_core.code`PromptFactoryConfig<string> & StringPromptConfig; `
|
|
1167
1165
|
}),
|
|
1168
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1169
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1166
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1167
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
1170
1168
|
heading: "A function to create and run a text prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
1171
1169
|
get children() {
|
|
1172
1170
|
return [
|
|
1173
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1174
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1171
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`This function can be used to easily create and run a text prompt without needing to manually create an instance of the TextPrompt class and handle its events. The function accepts a configuration object that extends the base PromptFactoryConfig with additional options specific to text prompts, such as the initial value and mask function. The returned promise allows for easy handling of the prompt result using async/await syntax or traditional promise chaining.` }),
|
|
1172
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { text, isCancel } from "shell-shock:prompts";
|
|
1175
1173
|
|
|
1176
1174
|
async function run() {
|
|
1177
1175
|
const name = await text({
|
|
@@ -1188,12 +1186,12 @@ async function run() {
|
|
|
1188
1186
|
}
|
|
1189
1187
|
|
|
1190
1188
|
run(); ` }),
|
|
1191
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1192
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1189
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1190
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
1193
1191
|
name: "config",
|
|
1194
1192
|
children: `The configuration options to pass to the text prompt, which extends the base PromptConfig with additional options specific to text prompts`
|
|
1195
1193
|
}),
|
|
1196
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1194
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
1197
1195
|
];
|
|
1198
1196
|
}
|
|
1199
1197
|
}),
|
|
@@ -1220,7 +1218,7 @@ run(); ` }),
|
|
|
1220
1218
|
*/
|
|
1221
1219
|
function SelectPromptDeclarations() {
|
|
1222
1220
|
return [
|
|
1223
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1221
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
1224
1222
|
name: "PromptOptionConfig",
|
|
1225
1223
|
doc: "Configuration for an option the user can select from the select prompt",
|
|
1226
1224
|
typeParameters: [{
|
|
@@ -1229,41 +1227,41 @@ function SelectPromptDeclarations() {
|
|
|
1229
1227
|
}],
|
|
1230
1228
|
get children() {
|
|
1231
1229
|
return [
|
|
1232
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1230
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1233
1231
|
name: "label",
|
|
1234
1232
|
schema: { type: "string" },
|
|
1235
1233
|
required: false,
|
|
1236
1234
|
doc: "The message label for the option"
|
|
1237
1235
|
}),
|
|
1238
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1239
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1236
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1237
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1240
1238
|
name: "icon",
|
|
1241
1239
|
schema: { type: "string" },
|
|
1242
1240
|
required: false,
|
|
1243
1241
|
doc: "An icon for the option"
|
|
1244
1242
|
}),
|
|
1245
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1246
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1243
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1244
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1247
1245
|
name: "value",
|
|
1248
1246
|
type: "TValue",
|
|
1249
1247
|
doc: "The value of the option"
|
|
1250
1248
|
}),
|
|
1251
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1252
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1249
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1250
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1253
1251
|
name: "description",
|
|
1254
1252
|
schema: { type: "string" },
|
|
1255
1253
|
required: false,
|
|
1256
1254
|
doc: "The description of the option"
|
|
1257
1255
|
}),
|
|
1258
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1259
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1256
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1257
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1260
1258
|
name: "selected",
|
|
1261
1259
|
schema: { type: "boolean" },
|
|
1262
1260
|
required: false,
|
|
1263
1261
|
doc: "Whether the option is selected"
|
|
1264
1262
|
}),
|
|
1265
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1266
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1263
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1264
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1267
1265
|
name: "disabled",
|
|
1268
1266
|
schema: { type: "boolean" },
|
|
1269
1267
|
required: false,
|
|
@@ -1272,8 +1270,8 @@ function SelectPromptDeclarations() {
|
|
|
1272
1270
|
];
|
|
1273
1271
|
}
|
|
1274
1272
|
}),
|
|
1275
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1276
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1273
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1274
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
1277
1275
|
"export": true,
|
|
1278
1276
|
name: "PromptOption",
|
|
1279
1277
|
"extends": "PromptOptionConfig<TValue>",
|
|
@@ -1284,24 +1282,24 @@ function SelectPromptDeclarations() {
|
|
|
1284
1282
|
}],
|
|
1285
1283
|
get children() {
|
|
1286
1284
|
return [
|
|
1287
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1285
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1288
1286
|
name: "label",
|
|
1289
1287
|
type: "string",
|
|
1290
1288
|
doc: "The message label for the option"
|
|
1291
1289
|
}),
|
|
1292
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1290
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1293
1291
|
name: "index",
|
|
1294
1292
|
type: "number",
|
|
1295
1293
|
doc: "The index of the option"
|
|
1296
1294
|
}),
|
|
1297
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1298
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1295
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1296
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1299
1297
|
name: "selected",
|
|
1300
1298
|
type: "boolean",
|
|
1301
1299
|
doc: "Whether the option is selected"
|
|
1302
1300
|
}),
|
|
1303
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1304
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1301
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1302
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1305
1303
|
name: "disabled",
|
|
1306
1304
|
type: "boolean",
|
|
1307
1305
|
doc: "Whether the option is disabled"
|
|
@@ -1309,8 +1307,8 @@ function SelectPromptDeclarations() {
|
|
|
1309
1307
|
];
|
|
1310
1308
|
}
|
|
1311
1309
|
}),
|
|
1312
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1313
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1310
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1311
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
1314
1312
|
name: "SelectPromptConfig",
|
|
1315
1313
|
"extends": "PromptConfig<TValue>",
|
|
1316
1314
|
doc: "An options object for configuring a select prompt",
|
|
@@ -1320,20 +1318,20 @@ function SelectPromptDeclarations() {
|
|
|
1320
1318
|
}],
|
|
1321
1319
|
get children() {
|
|
1322
1320
|
return [
|
|
1323
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1321
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1324
1322
|
name: "hint",
|
|
1325
1323
|
required: false,
|
|
1326
1324
|
type: "string",
|
|
1327
1325
|
doc: "A hint to display to the user"
|
|
1328
1326
|
}),
|
|
1329
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1330
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1327
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1328
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1331
1329
|
name: "options",
|
|
1332
1330
|
type: "Array<string | PromptOptionConfig<TValue>>",
|
|
1333
1331
|
doc: "The options available for the select prompt"
|
|
1334
1332
|
}),
|
|
1335
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1336
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1333
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1334
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1337
1335
|
name: "optionsPerPage",
|
|
1338
1336
|
required: false,
|
|
1339
1337
|
type: "number",
|
|
@@ -1342,8 +1340,8 @@ function SelectPromptDeclarations() {
|
|
|
1342
1340
|
];
|
|
1343
1341
|
}
|
|
1344
1342
|
}),
|
|
1345
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1346
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1343
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1344
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
1347
1345
|
name: "SelectPrompt",
|
|
1348
1346
|
doc: "A prompt for selecting an option from a list",
|
|
1349
1347
|
"extends": "Prompt<TValue>",
|
|
@@ -1353,35 +1351,35 @@ function SelectPromptDeclarations() {
|
|
|
1353
1351
|
}],
|
|
1354
1352
|
get children() {
|
|
1355
1353
|
return [
|
|
1356
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1354
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1357
1355
|
name: "initialValue",
|
|
1358
1356
|
"protected": true,
|
|
1359
1357
|
override: true,
|
|
1360
1358
|
type: "TValue"
|
|
1361
1359
|
}),
|
|
1362
1360
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1363
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1361
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1364
1362
|
name: "optionsPerPage",
|
|
1365
1363
|
"protected": true,
|
|
1366
1364
|
type: "number",
|
|
1367
1365
|
children: _alloy_js_core.code`8; `
|
|
1368
1366
|
}),
|
|
1369
1367
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1370
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1368
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1371
1369
|
name: "options",
|
|
1372
1370
|
"protected": true,
|
|
1373
1371
|
type: "PromptOption<TValue>[]",
|
|
1374
1372
|
children: _alloy_js_core.code`[]; `
|
|
1375
1373
|
}),
|
|
1376
1374
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1377
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1375
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1378
1376
|
name: "cursorHidden",
|
|
1379
1377
|
"protected": true,
|
|
1380
1378
|
override: true,
|
|
1381
1379
|
type: "boolean",
|
|
1382
1380
|
children: _alloy_js_core.code`true; `
|
|
1383
1381
|
}),
|
|
1384
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1382
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1385
1383
|
_alloy_js_core.code`constructor(config: SelectPromptConfig<TValue>) {
|
|
1386
1384
|
super(config);
|
|
1387
1385
|
|
|
@@ -1428,16 +1426,16 @@ function SelectPromptDeclarations() {
|
|
|
1428
1426
|
|
|
1429
1427
|
this.sync();
|
|
1430
1428
|
} `,
|
|
1431
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1432
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1429
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1430
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassPropertyGet, {
|
|
1433
1431
|
doc: "Returns the currently selected option",
|
|
1434
1432
|
name: "selectedOption",
|
|
1435
1433
|
type: "PromptOption<TValue> | null",
|
|
1436
1434
|
"protected": true,
|
|
1437
1435
|
children: _alloy_js_core.code`return this.options.find(option => option.value === this.value) ?? null; `
|
|
1438
1436
|
}),
|
|
1439
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1440
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1437
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1438
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1441
1439
|
doc: "A method to route key press events to specific prompt actions based on the key pressed. This method maps various key combinations and keys to corresponding actions that can be handled by the prompt, such as submitting, cancelling, navigating, etc.",
|
|
1442
1440
|
name: "getAction",
|
|
1443
1441
|
override: true,
|
|
@@ -1455,8 +1453,8 @@ function SelectPromptDeclarations() {
|
|
|
1455
1453
|
|
|
1456
1454
|
return action || false; `
|
|
1457
1455
|
}),
|
|
1458
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1459
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1456
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1457
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1460
1458
|
doc: "A method to reset the prompt input",
|
|
1461
1459
|
name: "reset",
|
|
1462
1460
|
override: true,
|
|
@@ -1464,8 +1462,8 @@ function SelectPromptDeclarations() {
|
|
|
1464
1462
|
children: _alloy_js_core.code`this.moveCursor(0);
|
|
1465
1463
|
super.reset(); `
|
|
1466
1464
|
}),
|
|
1467
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1468
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1465
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1466
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1469
1467
|
doc: "A method to submit the prompt input",
|
|
1470
1468
|
name: "submit",
|
|
1471
1469
|
async: true,
|
|
@@ -1477,16 +1475,16 @@ function SelectPromptDeclarations() {
|
|
|
1477
1475
|
this.bell();
|
|
1478
1476
|
} `
|
|
1479
1477
|
}),
|
|
1480
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1481
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1478
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1479
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1482
1480
|
doc: "A method to move the cursor to the end of the input",
|
|
1483
1481
|
name: "next",
|
|
1484
1482
|
"protected": true,
|
|
1485
1483
|
children: _alloy_js_core.code`this.moveCursor((this.cursor + 1) % this.options.length);
|
|
1486
1484
|
this.sync(); `
|
|
1487
1485
|
}),
|
|
1488
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1489
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1486
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1487
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1490
1488
|
doc: "A method to move the cursor to the left or right by a \\`count\\` of positions",
|
|
1491
1489
|
name: "moveCursor",
|
|
1492
1490
|
parameters: [{
|
|
@@ -1500,32 +1498,32 @@ function SelectPromptDeclarations() {
|
|
|
1500
1498
|
this.changeValue(this.options[count]!.value);
|
|
1501
1499
|
this.sync(); `
|
|
1502
1500
|
}),
|
|
1503
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1504
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1501
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1502
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1505
1503
|
doc: "A method to move the cursor to the first option",
|
|
1506
1504
|
name: "first",
|
|
1507
1505
|
"protected": true,
|
|
1508
1506
|
children: _alloy_js_core.code`this.moveCursor(0);
|
|
1509
1507
|
this.sync(); `
|
|
1510
1508
|
}),
|
|
1511
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1512
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1509
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1510
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1513
1511
|
doc: "A method to move the cursor to the last option",
|
|
1514
1512
|
name: "last",
|
|
1515
1513
|
"protected": true,
|
|
1516
1514
|
children: _alloy_js_core.code`this.moveCursor(this.options.length - 1);
|
|
1517
1515
|
this.sync(); `
|
|
1518
1516
|
}),
|
|
1519
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1520
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1517
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1518
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1521
1519
|
doc: "A method to move the cursor to the start",
|
|
1522
1520
|
name: "first",
|
|
1523
1521
|
"protected": true,
|
|
1524
1522
|
children: _alloy_js_core.code`this.cursor = 0;
|
|
1525
1523
|
this.sync(); `
|
|
1526
1524
|
}),
|
|
1527
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1528
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1525
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1526
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1529
1527
|
doc: "A method to move the cursor to the up",
|
|
1530
1528
|
name: "up",
|
|
1531
1529
|
"protected": true,
|
|
@@ -1537,8 +1535,8 @@ function SelectPromptDeclarations() {
|
|
|
1537
1535
|
|
|
1538
1536
|
this.sync(); `
|
|
1539
1537
|
}),
|
|
1540
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1541
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1538
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1539
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1542
1540
|
doc: "A method to move the cursor to the down",
|
|
1543
1541
|
name: "down",
|
|
1544
1542
|
"protected": true,
|
|
@@ -1550,8 +1548,8 @@ function SelectPromptDeclarations() {
|
|
|
1550
1548
|
|
|
1551
1549
|
this.sync(); `
|
|
1552
1550
|
}),
|
|
1553
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1554
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1551
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1552
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
1555
1553
|
doc: "A method to render the prompt",
|
|
1556
1554
|
name: "onRender",
|
|
1557
1555
|
override: true,
|
|
@@ -1613,24 +1611,24 @@ function SelectPromptDeclarations() {
|
|
|
1613
1611
|
];
|
|
1614
1612
|
}
|
|
1615
1613
|
}),
|
|
1616
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1617
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1614
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1615
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
1618
1616
|
heading: "A type definition for the configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts. This type can be used when creating a select prompt using the {@link select | select prompt factory function}.",
|
|
1619
1617
|
get children() {
|
|
1620
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1618
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { children: `The Select Config type includes all the properties of the base PromptConfig, such as message, description, initialValue, validate, parse, format, etc., as well as any additional properties that are specific to select prompts, such as the list of options and pagination settings.` });
|
|
1621
1619
|
}
|
|
1622
1620
|
}),
|
|
1623
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1621
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
1624
1622
|
"export": true,
|
|
1625
1623
|
name: "SelectConfig",
|
|
1626
1624
|
children: _alloy_js_core.code`PromptFactoryConfig<string> & SelectPromptConfig; `
|
|
1627
1625
|
}),
|
|
1628
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1629
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1626
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1627
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
1630
1628
|
heading: "A function to create and run a select prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
1631
1629
|
get children() {
|
|
1632
1630
|
return [
|
|
1633
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1631
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { select, isCancel } from "shell-shock:prompts";
|
|
1634
1632
|
|
|
1635
1633
|
async function run() {
|
|
1636
1634
|
const color = await select({
|
|
@@ -1653,12 +1651,12 @@ async function run() {
|
|
|
1653
1651
|
}
|
|
1654
1652
|
|
|
1655
1653
|
run(); ` }),
|
|
1656
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1657
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1654
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1655
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
1658
1656
|
name: "config",
|
|
1659
1657
|
children: `The configuration options to pass to the select prompt, which extends the base PromptConfig with additional options specific to select prompts`
|
|
1660
1658
|
}),
|
|
1661
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1659
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
1662
1660
|
];
|
|
1663
1661
|
}
|
|
1664
1662
|
}),
|
|
@@ -1685,7 +1683,7 @@ run(); ` }),
|
|
|
1685
1683
|
*/
|
|
1686
1684
|
function MultiSelectPromptDeclarations() {
|
|
1687
1685
|
return [
|
|
1688
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1686
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
1689
1687
|
name: "MultiSelectPromptConfig",
|
|
1690
1688
|
"extends": "PromptConfig<TValue[]>",
|
|
1691
1689
|
doc: "An options object for configuring a multi-select prompt",
|
|
@@ -1695,34 +1693,34 @@ function MultiSelectPromptDeclarations() {
|
|
|
1695
1693
|
}],
|
|
1696
1694
|
get children() {
|
|
1697
1695
|
return [
|
|
1698
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1696
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1699
1697
|
name: "options",
|
|
1700
1698
|
type: "Array<string | PromptOptionConfig<TValue>>",
|
|
1701
1699
|
doc: "The options available for the multi-select prompt"
|
|
1702
1700
|
}),
|
|
1703
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1704
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1701
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1702
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1705
1703
|
name: "required",
|
|
1706
1704
|
required: false,
|
|
1707
1705
|
type: "boolean",
|
|
1708
1706
|
doc: "Whether at least one option must be selected, defaults to true"
|
|
1709
1707
|
}),
|
|
1710
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1711
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1708
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1709
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1712
1710
|
name: "initialValue",
|
|
1713
1711
|
required: false,
|
|
1714
1712
|
type: "TValue[]",
|
|
1715
1713
|
doc: "The initial selected values"
|
|
1716
1714
|
}),
|
|
1717
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1718
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1715
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1716
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1719
1717
|
name: "cursorAt",
|
|
1720
1718
|
required: false,
|
|
1721
1719
|
type: "TValue",
|
|
1722
1720
|
doc: "A value indicating which option should be focused initially"
|
|
1723
1721
|
}),
|
|
1724
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1725
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1722
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1723
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
1726
1724
|
name: "optionsPerPage",
|
|
1727
1725
|
required: false,
|
|
1728
1726
|
type: "number",
|
|
@@ -1731,8 +1729,8 @@ function MultiSelectPromptDeclarations() {
|
|
|
1731
1729
|
];
|
|
1732
1730
|
}
|
|
1733
1731
|
}),
|
|
1734
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1735
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1732
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1733
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
1736
1734
|
name: "MultiSelectPrompt",
|
|
1737
1735
|
doc: "A prompt for selecting multiple options from a list",
|
|
1738
1736
|
"extends": "Prompt<TValue[]>",
|
|
@@ -1742,7 +1740,7 @@ function MultiSelectPromptDeclarations() {
|
|
|
1742
1740
|
}],
|
|
1743
1741
|
get children() {
|
|
1744
1742
|
return [
|
|
1745
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1743
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1746
1744
|
name: "initialValue",
|
|
1747
1745
|
"protected": true,
|
|
1748
1746
|
override: true,
|
|
@@ -1750,35 +1748,35 @@ function MultiSelectPromptDeclarations() {
|
|
|
1750
1748
|
children: _alloy_js_core.code`[]; `
|
|
1751
1749
|
}),
|
|
1752
1750
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1753
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1751
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1754
1752
|
name: "required",
|
|
1755
1753
|
"protected": true,
|
|
1756
1754
|
type: "boolean",
|
|
1757
1755
|
children: _alloy_js_core.code`true; `
|
|
1758
1756
|
}),
|
|
1759
1757
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1760
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1758
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1761
1759
|
name: "optionsPerPage",
|
|
1762
1760
|
"protected": true,
|
|
1763
1761
|
type: "number",
|
|
1764
1762
|
children: _alloy_js_core.code`8; `
|
|
1765
1763
|
}),
|
|
1766
1764
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1767
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1765
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1768
1766
|
name: "options",
|
|
1769
1767
|
"protected": true,
|
|
1770
1768
|
type: "PromptOption<TValue>[]",
|
|
1771
1769
|
children: _alloy_js_core.code`[]; `
|
|
1772
1770
|
}),
|
|
1773
1771
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1774
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1772
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
1775
1773
|
name: "cursorHidden",
|
|
1776
1774
|
"protected": true,
|
|
1777
1775
|
override: true,
|
|
1778
1776
|
type: "boolean",
|
|
1779
1777
|
children: _alloy_js_core.code`true; `
|
|
1780
1778
|
}),
|
|
1781
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
1779
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
1782
1780
|
_alloy_js_core.code`constructor(config: MultiSelectPromptConfig<TValue>) {
|
|
1783
1781
|
super(config);
|
|
1784
1782
|
|
|
@@ -2030,19 +2028,19 @@ function MultiSelectPromptDeclarations() {
|
|
|
2030
2028
|
];
|
|
2031
2029
|
}
|
|
2032
2030
|
}),
|
|
2033
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2034
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2035
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2031
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2032
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "A type definition for the configuration options to pass to the multi-select prompt, which extends the base PromptConfig with additional options specific to multi-select prompts." }),
|
|
2033
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
2036
2034
|
"export": true,
|
|
2037
2035
|
name: "MultiSelectConfig",
|
|
2038
2036
|
children: _alloy_js_core.code`PromptFactoryConfig<string[]> & MultiSelectPromptConfig; `
|
|
2039
2037
|
}),
|
|
2040
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2041
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2038
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2039
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2042
2040
|
heading: "A function to create and run a multi-select prompt, which returns a promise that resolves with the submitted values or a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
2043
2041
|
get children() {
|
|
2044
2042
|
return [
|
|
2045
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2043
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { multiselect, isCancel } from "shell-shock:prompts";
|
|
2046
2044
|
|
|
2047
2045
|
async function run() {
|
|
2048
2046
|
const tools = await multiselect({
|
|
@@ -2063,12 +2061,12 @@ async function run() {
|
|
|
2063
2061
|
}
|
|
2064
2062
|
|
|
2065
2063
|
run(); ` }),
|
|
2066
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2067
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2064
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2065
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
2068
2066
|
name: "config",
|
|
2069
2067
|
children: `The configuration options to pass to the multi-select prompt`
|
|
2070
2068
|
}),
|
|
2071
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2069
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the selected values or a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
2072
2070
|
];
|
|
2073
2071
|
}
|
|
2074
2072
|
}),
|
|
@@ -2095,41 +2093,41 @@ run(); ` }),
|
|
|
2095
2093
|
*/
|
|
2096
2094
|
function NumericPromptDeclarations() {
|
|
2097
2095
|
return [
|
|
2098
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2096
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
2099
2097
|
name: "NumberPromptConfig",
|
|
2100
2098
|
"extends": "PromptConfig<number>",
|
|
2101
2099
|
doc: "Configuration options for creating a numeric prompt",
|
|
2102
2100
|
get children() {
|
|
2103
2101
|
return [
|
|
2104
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2102
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2105
2103
|
name: "isFloat",
|
|
2106
2104
|
required: false,
|
|
2107
2105
|
type: "boolean",
|
|
2108
2106
|
doc: "Whether the prompt should accept floating point numbers"
|
|
2109
2107
|
}),
|
|
2110
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2111
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2108
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2109
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2112
2110
|
name: "precision",
|
|
2113
2111
|
required: false,
|
|
2114
2112
|
type: "number",
|
|
2115
2113
|
doc: "The number of decimal places to round the input to, defaults to 2"
|
|
2116
2114
|
}),
|
|
2117
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2118
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2115
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2116
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2119
2117
|
name: "increment",
|
|
2120
2118
|
required: false,
|
|
2121
2119
|
type: "number",
|
|
2122
2120
|
doc: "The increment value for the number prompt, defaults to 1"
|
|
2123
2121
|
}),
|
|
2124
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2125
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2122
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2123
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2126
2124
|
name: "min",
|
|
2127
2125
|
required: false,
|
|
2128
2126
|
type: "number",
|
|
2129
2127
|
doc: "The minimum value for the number prompt, defaults to -Infinity"
|
|
2130
2128
|
}),
|
|
2131
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2132
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2129
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2130
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2133
2131
|
name: "max",
|
|
2134
2132
|
required: false,
|
|
2135
2133
|
type: "number",
|
|
@@ -2138,21 +2136,21 @@ function NumericPromptDeclarations() {
|
|
|
2138
2136
|
];
|
|
2139
2137
|
}
|
|
2140
2138
|
}),
|
|
2141
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2142
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2139
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2140
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
2143
2141
|
name: "NumberPrompt",
|
|
2144
2142
|
doc: "A prompt for selecting a number input",
|
|
2145
2143
|
"extends": "Prompt<number>",
|
|
2146
2144
|
get children() {
|
|
2147
2145
|
return [
|
|
2148
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2146
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2149
2147
|
name: "isInvalid",
|
|
2150
2148
|
isPrivateMember: true,
|
|
2151
2149
|
type: "boolean",
|
|
2152
2150
|
children: _alloy_js_core.code`false; `
|
|
2153
2151
|
}),
|
|
2154
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2155
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2152
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2153
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2156
2154
|
name: "initialValue",
|
|
2157
2155
|
"protected": true,
|
|
2158
2156
|
override: true,
|
|
@@ -2160,7 +2158,7 @@ function NumericPromptDeclarations() {
|
|
|
2160
2158
|
children: _alloy_js_core.code`0; `
|
|
2161
2159
|
}),
|
|
2162
2160
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2163
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2161
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2164
2162
|
name: "defaultErrorMessage",
|
|
2165
2163
|
"protected": true,
|
|
2166
2164
|
override: true,
|
|
@@ -2168,41 +2166,41 @@ function NumericPromptDeclarations() {
|
|
|
2168
2166
|
children: _alloy_js_core.code`"A valid numeric value must be provided"; `
|
|
2169
2167
|
}),
|
|
2170
2168
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2171
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2169
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2172
2170
|
name: "isFloat",
|
|
2173
2171
|
"protected": true,
|
|
2174
2172
|
type: "boolean",
|
|
2175
2173
|
children: _alloy_js_core.code`false; `
|
|
2176
2174
|
}),
|
|
2177
2175
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2178
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2176
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2179
2177
|
name: "precision",
|
|
2180
2178
|
"protected": true,
|
|
2181
2179
|
type: "number",
|
|
2182
2180
|
children: _alloy_js_core.code`2; `
|
|
2183
2181
|
}),
|
|
2184
2182
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2185
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2183
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2186
2184
|
name: "increment",
|
|
2187
2185
|
"protected": true,
|
|
2188
2186
|
type: "number",
|
|
2189
2187
|
children: _alloy_js_core.code`1; `
|
|
2190
2188
|
}),
|
|
2191
2189
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2192
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2190
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2193
2191
|
name: "min",
|
|
2194
2192
|
"protected": true,
|
|
2195
2193
|
type: "number",
|
|
2196
2194
|
children: _alloy_js_core.code`Number.NEGATIVE_INFINITY; `
|
|
2197
2195
|
}),
|
|
2198
2196
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2199
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2197
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2200
2198
|
name: "max",
|
|
2201
2199
|
"protected": true,
|
|
2202
2200
|
type: "number",
|
|
2203
2201
|
children: _alloy_js_core.code`Number.POSITIVE_INFINITY; `
|
|
2204
2202
|
}),
|
|
2205
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2203
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2206
2204
|
_alloy_js_core.code`constructor(config: NumberPromptConfig) {
|
|
2207
2205
|
super(config);
|
|
2208
2206
|
|
|
@@ -2244,8 +2242,8 @@ function NumericPromptDeclarations() {
|
|
|
2244
2242
|
this.sync();
|
|
2245
2243
|
this.last();
|
|
2246
2244
|
} `,
|
|
2247
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2248
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2245
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2246
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2249
2247
|
doc: "A method to handle key press events and determine the corresponding action",
|
|
2250
2248
|
name: "onKeyPress",
|
|
2251
2249
|
override: true,
|
|
@@ -2287,8 +2285,8 @@ function NumericPromptDeclarations() {
|
|
|
2287
2285
|
this.changeValue(value);
|
|
2288
2286
|
this.sync(); `
|
|
2289
2287
|
}),
|
|
2290
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2291
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2288
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2289
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2292
2290
|
doc: "A method to handle changes in the prompt value",
|
|
2293
2291
|
name: "onChange",
|
|
2294
2292
|
override: true,
|
|
@@ -2300,8 +2298,8 @@ function NumericPromptDeclarations() {
|
|
|
2300
2298
|
children: _alloy_js_core.code`this.#isInvalid = false;
|
|
2301
2299
|
this.cursor = this.displayValue.slice(0, this.cursor).length + 1; `
|
|
2302
2300
|
}),
|
|
2303
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2304
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2301
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2302
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2305
2303
|
doc: "A method to validate the prompt input",
|
|
2306
2304
|
name: "checkValidations",
|
|
2307
2305
|
override: true,
|
|
@@ -2310,16 +2308,16 @@ function NumericPromptDeclarations() {
|
|
|
2310
2308
|
children: _alloy_js_core.code`await super.checkValidations(this.value);
|
|
2311
2309
|
this.#isInvalid = this.isError; `
|
|
2312
2310
|
}),
|
|
2313
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2314
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2311
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2312
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2315
2313
|
doc: "A method to move the cursor to the end of the input",
|
|
2316
2314
|
name: "next",
|
|
2317
2315
|
"protected": true,
|
|
2318
2316
|
children: _alloy_js_core.code`this.changeValue(this.initialValue);
|
|
2319
2317
|
this.sync(); `
|
|
2320
2318
|
}),
|
|
2321
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2322
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2319
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2320
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2323
2321
|
doc: "A method to move the cursor to the up",
|
|
2324
2322
|
name: "up",
|
|
2325
2323
|
"protected": true,
|
|
@@ -2335,8 +2333,8 @@ function NumericPromptDeclarations() {
|
|
|
2335
2333
|
this.sync();
|
|
2336
2334
|
this.last(); `
|
|
2337
2335
|
}),
|
|
2338
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2339
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2336
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2337
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2340
2338
|
doc: "A method to move the cursor to the down",
|
|
2341
2339
|
name: "down",
|
|
2342
2340
|
"protected": true,
|
|
@@ -2351,8 +2349,8 @@ function NumericPromptDeclarations() {
|
|
|
2351
2349
|
this.sync();
|
|
2352
2350
|
this.last(); `
|
|
2353
2351
|
}),
|
|
2354
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2355
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2352
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2353
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2356
2354
|
doc: "A method to move the cursor to the left",
|
|
2357
2355
|
name: "left",
|
|
2358
2356
|
"protected": true,
|
|
@@ -2363,8 +2361,8 @@ function NumericPromptDeclarations() {
|
|
|
2363
2361
|
this.moveCursor(-1);
|
|
2364
2362
|
this.sync(); `
|
|
2365
2363
|
}),
|
|
2366
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2367
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2364
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2365
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2368
2366
|
doc: "A method to move the cursor to the right",
|
|
2369
2367
|
name: "right",
|
|
2370
2368
|
"protected": true,
|
|
@@ -2375,24 +2373,24 @@ function NumericPromptDeclarations() {
|
|
|
2375
2373
|
this.moveCursor(1);
|
|
2376
2374
|
this.sync(); `
|
|
2377
2375
|
}),
|
|
2378
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2379
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2376
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2377
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2380
2378
|
doc: "A method to move the cursor to the start",
|
|
2381
2379
|
name: "first",
|
|
2382
2380
|
"protected": true,
|
|
2383
2381
|
children: _alloy_js_core.code`this.cursor = 0;
|
|
2384
2382
|
this.sync(); `
|
|
2385
2383
|
}),
|
|
2386
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2387
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2384
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2385
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2388
2386
|
doc: "A method to move the cursor to the end",
|
|
2389
2387
|
name: "last",
|
|
2390
2388
|
"protected": true,
|
|
2391
2389
|
children: _alloy_js_core.code`this.cursor = this.displayValue.length;
|
|
2392
2390
|
this.sync(); `
|
|
2393
2391
|
}),
|
|
2394
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2395
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2392
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2393
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2396
2394
|
doc: "A method to render the prompt",
|
|
2397
2395
|
name: "onRender",
|
|
2398
2396
|
override: true,
|
|
@@ -2411,19 +2409,19 @@ function NumericPromptDeclarations() {
|
|
|
2411
2409
|
];
|
|
2412
2410
|
}
|
|
2413
2411
|
}),
|
|
2414
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2415
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2416
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2412
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2413
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "An object representing the configuration options for a numeric prompt." }),
|
|
2414
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
2417
2415
|
name: "NumericConfig",
|
|
2418
2416
|
"export": true,
|
|
2419
2417
|
children: _alloy_js_core.code`PromptFactoryConfig<number> & NumberPromptConfig; `
|
|
2420
2418
|
}),
|
|
2421
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2422
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2419
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2420
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2423
2421
|
heading: "A function to create and run a numeric prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
2424
2422
|
get children() {
|
|
2425
2423
|
return [
|
|
2426
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2424
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { numeric, isCancel } from "shell-shock:prompts";
|
|
2427
2425
|
|
|
2428
2426
|
async function run() {
|
|
2429
2427
|
const age = await numeric({
|
|
@@ -2440,12 +2438,12 @@ async function run() {
|
|
|
2440
2438
|
}
|
|
2441
2439
|
|
|
2442
2440
|
run(); ` }),
|
|
2443
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2444
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2441
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2442
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
2445
2443
|
name: "config",
|
|
2446
2444
|
children: `The configuration options to pass to the numeric prompt, which extends the base PromptFactoryConfig with additional options specific to numeric prompts`
|
|
2447
2445
|
}),
|
|
2448
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2446
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
2449
2447
|
];
|
|
2450
2448
|
}
|
|
2451
2449
|
}),
|
|
@@ -2472,39 +2470,39 @@ run(); ` }),
|
|
|
2472
2470
|
*/
|
|
2473
2471
|
function TogglePromptDeclarations() {
|
|
2474
2472
|
return [
|
|
2475
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2473
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
2476
2474
|
"export": true,
|
|
2477
2475
|
name: "TogglePromptConfig",
|
|
2478
2476
|
"extends": "PromptConfig<boolean>",
|
|
2479
2477
|
doc: "Configuration options for creating a boolean toggle prompt",
|
|
2480
2478
|
get children() {
|
|
2481
2479
|
return [
|
|
2482
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2480
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2483
2481
|
name: "trueMessage",
|
|
2484
2482
|
required: false,
|
|
2485
2483
|
type: "string",
|
|
2486
2484
|
doc: "The message for the true state of the prompt"
|
|
2487
2485
|
}),
|
|
2488
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2489
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2486
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2487
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2490
2488
|
name: "falseMessage",
|
|
2491
2489
|
required: false,
|
|
2492
2490
|
type: "string",
|
|
2493
2491
|
doc: "The message for the false state of the prompt"
|
|
2494
2492
|
}),
|
|
2495
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2493
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {})
|
|
2496
2494
|
];
|
|
2497
2495
|
}
|
|
2498
2496
|
}),
|
|
2499
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2500
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2497
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2498
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
2501
2499
|
"export": true,
|
|
2502
2500
|
name: "TogglePrompt",
|
|
2503
2501
|
doc: "A prompt for toggling a boolean input",
|
|
2504
2502
|
"extends": "Prompt<boolean>",
|
|
2505
2503
|
get children() {
|
|
2506
2504
|
return [
|
|
2507
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2505
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2508
2506
|
name: "initialValue",
|
|
2509
2507
|
"protected": true,
|
|
2510
2508
|
override: true,
|
|
@@ -2512,28 +2510,28 @@ function TogglePromptDeclarations() {
|
|
|
2512
2510
|
children: _alloy_js_core.code`false; `
|
|
2513
2511
|
}),
|
|
2514
2512
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2515
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2513
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2516
2514
|
name: "trueMessage",
|
|
2517
2515
|
"protected": true,
|
|
2518
2516
|
type: "string",
|
|
2519
2517
|
children: _alloy_js_core.code`"Yes"; `
|
|
2520
2518
|
}),
|
|
2521
2519
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2522
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2520
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2523
2521
|
name: "falseMessage",
|
|
2524
2522
|
"protected": true,
|
|
2525
2523
|
type: "string",
|
|
2526
2524
|
children: _alloy_js_core.code`"No"; `
|
|
2527
2525
|
}),
|
|
2528
2526
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2529
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2527
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2530
2528
|
name: "cursorHidden",
|
|
2531
2529
|
"protected": true,
|
|
2532
2530
|
override: true,
|
|
2533
2531
|
type: "boolean",
|
|
2534
2532
|
children: _alloy_js_core.code`true; `
|
|
2535
2533
|
}),
|
|
2536
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2534
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2537
2535
|
_alloy_js_core.code`constructor(config: TogglePromptConfig) {
|
|
2538
2536
|
super(config);
|
|
2539
2537
|
|
|
@@ -2550,8 +2548,8 @@ function TogglePromptDeclarations() {
|
|
|
2550
2548
|
|
|
2551
2549
|
this.sync();
|
|
2552
2550
|
} `,
|
|
2553
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2554
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2551
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2552
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2555
2553
|
doc: "Update the toggle value to a checked state based on user input",
|
|
2556
2554
|
name: "check",
|
|
2557
2555
|
"protected": true,
|
|
@@ -2562,8 +2560,8 @@ function TogglePromptDeclarations() {
|
|
|
2562
2560
|
this.changeValue(true);
|
|
2563
2561
|
this.sync(); `
|
|
2564
2562
|
}),
|
|
2565
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2566
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2563
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2564
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2567
2565
|
doc: "Update the toggle value to an unchecked state based on user input",
|
|
2568
2566
|
name: "uncheck",
|
|
2569
2567
|
"protected": true,
|
|
@@ -2574,8 +2572,8 @@ function TogglePromptDeclarations() {
|
|
|
2574
2572
|
this.changeValue(false);
|
|
2575
2573
|
this.sync(); `
|
|
2576
2574
|
}),
|
|
2577
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2578
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2575
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2576
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2579
2577
|
doc: "A method to handle key press events and determine the corresponding action",
|
|
2580
2578
|
name: "onKeyPress",
|
|
2581
2579
|
override: true,
|
|
@@ -2604,51 +2602,51 @@ function TogglePromptDeclarations() {
|
|
|
2604
2602
|
|
|
2605
2603
|
this.sync(); `
|
|
2606
2604
|
}),
|
|
2607
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2608
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2605
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2606
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2609
2607
|
doc: "A method to remove the character backward of the cursor",
|
|
2610
2608
|
name: "backspace",
|
|
2611
2609
|
"protected": true,
|
|
2612
2610
|
children: _alloy_js_core.code`this.uncheck(); `
|
|
2613
2611
|
}),
|
|
2614
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2615
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2612
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2613
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2616
2614
|
doc: "A method to move the cursor to the left",
|
|
2617
2615
|
name: "left",
|
|
2618
2616
|
"protected": true,
|
|
2619
2617
|
children: _alloy_js_core.code`this.uncheck(); `
|
|
2620
2618
|
}),
|
|
2621
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2622
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2619
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2620
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2623
2621
|
doc: "A method to move the cursor to the right",
|
|
2624
2622
|
name: "right",
|
|
2625
2623
|
"protected": true,
|
|
2626
2624
|
children: _alloy_js_core.code`this.check(); `
|
|
2627
2625
|
}),
|
|
2628
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2629
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2626
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2627
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2630
2628
|
doc: "A method to move the cursor to down",
|
|
2631
2629
|
name: "down",
|
|
2632
2630
|
"protected": true,
|
|
2633
2631
|
children: _alloy_js_core.code`this.uncheck(); `
|
|
2634
2632
|
}),
|
|
2635
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2636
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2633
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2634
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2637
2635
|
doc: "A method to move the cursor to up",
|
|
2638
2636
|
name: "up",
|
|
2639
2637
|
"protected": true,
|
|
2640
2638
|
children: _alloy_js_core.code`this.check(); `
|
|
2641
2639
|
}),
|
|
2642
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2643
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2640
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2641
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2644
2642
|
doc: "A method to move to the next value",
|
|
2645
2643
|
name: "next",
|
|
2646
2644
|
"protected": true,
|
|
2647
2645
|
children: _alloy_js_core.code`this.changeValue(!this.value);
|
|
2648
2646
|
this.sync(); `
|
|
2649
2647
|
}),
|
|
2650
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2651
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2648
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2649
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2652
2650
|
doc: "A method to render the prompt",
|
|
2653
2651
|
name: "onRender",
|
|
2654
2652
|
override: true,
|
|
@@ -2667,19 +2665,19 @@ function TogglePromptDeclarations() {
|
|
|
2667
2665
|
];
|
|
2668
2666
|
}
|
|
2669
2667
|
}),
|
|
2670
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2671
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2672
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2668
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2669
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "An object representing the configuration options for a toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt." }),
|
|
2670
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
2673
2671
|
name: "ToggleConfig",
|
|
2674
2672
|
"export": true,
|
|
2675
2673
|
children: _alloy_js_core.code`PromptFactoryConfig<boolean> & TogglePromptConfig; `
|
|
2676
2674
|
}),
|
|
2677
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2678
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2675
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2676
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2679
2677
|
heading: "A function to create and run a toggle prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
2680
2678
|
get children() {
|
|
2681
2679
|
return [
|
|
2682
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2680
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { toggle, isCancel } from "shell-shock:prompts";
|
|
2683
2681
|
|
|
2684
2682
|
async function run() {
|
|
2685
2683
|
const likesIceCream = await toggle({
|
|
@@ -2694,12 +2692,12 @@ async function run() {
|
|
|
2694
2692
|
}
|
|
2695
2693
|
|
|
2696
2694
|
run(); ` }),
|
|
2697
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2698
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2695
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2696
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
2699
2697
|
name: "config",
|
|
2700
2698
|
children: `The configuration options to pass to the toggle prompt, which extends the base PromptFactoryConfig with additional options specific to the toggle prompt`
|
|
2701
2699
|
}),
|
|
2702
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2700
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
2703
2701
|
];
|
|
2704
2702
|
}
|
|
2705
2703
|
}),
|
|
@@ -2726,68 +2724,68 @@ run(); ` }),
|
|
|
2726
2724
|
*/
|
|
2727
2725
|
function ConfirmPromptDeclarations() {
|
|
2728
2726
|
return [
|
|
2729
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2727
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
2730
2728
|
"export": true,
|
|
2731
2729
|
name: "ConfirmPromptConfig",
|
|
2732
2730
|
"extends": "PromptConfig<boolean>",
|
|
2733
2731
|
doc: "Configuration options for creating a boolean confirm prompt",
|
|
2734
2732
|
get children() {
|
|
2735
2733
|
return [
|
|
2736
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2734
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2737
2735
|
heading: "The message for the \\`Yes\\` state of the prompt",
|
|
2738
2736
|
get children() {
|
|
2739
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2737
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2740
2738
|
type: "string",
|
|
2741
2739
|
defaultValue: "Yes"
|
|
2742
2740
|
});
|
|
2743
2741
|
}
|
|
2744
2742
|
}),
|
|
2745
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2743
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2746
2744
|
name: "yesMessage",
|
|
2747
2745
|
required: false,
|
|
2748
2746
|
type: "string"
|
|
2749
2747
|
}),
|
|
2750
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2751
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2748
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2749
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2752
2750
|
heading: "The \\`Yes\\` option when choosing between yes/no",
|
|
2753
2751
|
get children() {
|
|
2754
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2752
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2755
2753
|
type: "string",
|
|
2756
2754
|
defaultValue: "1"
|
|
2757
2755
|
});
|
|
2758
2756
|
}
|
|
2759
2757
|
}),
|
|
2760
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2758
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2761
2759
|
name: "yesOption",
|
|
2762
2760
|
required: false,
|
|
2763
2761
|
type: "string"
|
|
2764
2762
|
}),
|
|
2765
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2766
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2763
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2764
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2767
2765
|
heading: "The message for the \\`No\\` state of the prompt",
|
|
2768
2766
|
get children() {
|
|
2769
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2767
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2770
2768
|
type: "string",
|
|
2771
2769
|
defaultValue: "(Y/n)"
|
|
2772
2770
|
});
|
|
2773
2771
|
}
|
|
2774
2772
|
}),
|
|
2775
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2773
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2776
2774
|
name: "noMessage",
|
|
2777
2775
|
required: false,
|
|
2778
2776
|
type: "string"
|
|
2779
2777
|
}),
|
|
2780
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2781
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2778
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2779
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2782
2780
|
heading: "The \\`No\\` option when choosing between yes/no",
|
|
2783
2781
|
get children() {
|
|
2784
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2782
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2785
2783
|
type: "string",
|
|
2786
2784
|
defaultValue: "(y/N)"
|
|
2787
2785
|
});
|
|
2788
2786
|
}
|
|
2789
2787
|
}),
|
|
2790
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2788
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_interface_declaration.InterfaceMember, {
|
|
2791
2789
|
name: "noOption",
|
|
2792
2790
|
required: false,
|
|
2793
2791
|
type: "string"
|
|
@@ -2795,15 +2793,15 @@ function ConfirmPromptDeclarations() {
|
|
|
2795
2793
|
];
|
|
2796
2794
|
}
|
|
2797
2795
|
}),
|
|
2798
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2799
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2796
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2797
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassDeclaration, {
|
|
2800
2798
|
"export": true,
|
|
2801
2799
|
name: "ConfirmPrompt",
|
|
2802
2800
|
doc: "A prompt for confirming a boolean input",
|
|
2803
2801
|
"extends": "Prompt<boolean>",
|
|
2804
2802
|
get children() {
|
|
2805
2803
|
return [
|
|
2806
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2804
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2807
2805
|
name: "initialValue",
|
|
2808
2806
|
"protected": true,
|
|
2809
2807
|
override: true,
|
|
@@ -2811,42 +2809,42 @@ function ConfirmPromptDeclarations() {
|
|
|
2811
2809
|
children: _alloy_js_core.code`false; `
|
|
2812
2810
|
}),
|
|
2813
2811
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2814
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2812
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2815
2813
|
name: "yesMessage",
|
|
2816
2814
|
"protected": true,
|
|
2817
2815
|
type: "string",
|
|
2818
2816
|
children: _alloy_js_core.code`"Yes"; `
|
|
2819
2817
|
}),
|
|
2820
2818
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2821
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2819
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2822
2820
|
name: "yesOption",
|
|
2823
2821
|
"protected": true,
|
|
2824
2822
|
type: "string",
|
|
2825
2823
|
children: _alloy_js_core.code`"(Y/n)"; `
|
|
2826
2824
|
}),
|
|
2827
2825
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2828
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2826
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2829
2827
|
name: "noMessage",
|
|
2830
2828
|
"protected": true,
|
|
2831
2829
|
type: "string",
|
|
2832
2830
|
children: _alloy_js_core.code`"No"; `
|
|
2833
2831
|
}),
|
|
2834
2832
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2835
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2833
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2836
2834
|
name: "noOption",
|
|
2837
2835
|
"protected": true,
|
|
2838
2836
|
type: "string",
|
|
2839
2837
|
children: _alloy_js_core.code`"(y/N)"; `
|
|
2840
2838
|
}),
|
|
2841
2839
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2842
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2840
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassField, {
|
|
2843
2841
|
name: "cursorHidden",
|
|
2844
2842
|
"protected": true,
|
|
2845
2843
|
override: true,
|
|
2846
2844
|
type: "boolean",
|
|
2847
2845
|
children: _alloy_js_core.code`true; `
|
|
2848
2846
|
}),
|
|
2849
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2847
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2850
2848
|
_alloy_js_core.code`constructor(config: ConfirmPromptConfig) {
|
|
2851
2849
|
super(config);
|
|
2852
2850
|
|
|
@@ -2869,8 +2867,8 @@ function ConfirmPromptDeclarations() {
|
|
|
2869
2867
|
|
|
2870
2868
|
this.sync();
|
|
2871
2869
|
} `,
|
|
2872
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2873
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2870
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2871
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2874
2872
|
doc: "A method to handle key press events and determine the corresponding action",
|
|
2875
2873
|
name: "onKeyPress",
|
|
2876
2874
|
override: true,
|
|
@@ -2897,8 +2895,8 @@ function ConfirmPromptDeclarations() {
|
|
|
2897
2895
|
return this.bell();
|
|
2898
2896
|
} `
|
|
2899
2897
|
}),
|
|
2900
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2901
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2898
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2899
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_class_declaration.ClassMethod, {
|
|
2902
2900
|
doc: "A method to render the prompt",
|
|
2903
2901
|
name: "onRender",
|
|
2904
2902
|
override: true,
|
|
@@ -2913,19 +2911,19 @@ function ConfirmPromptDeclarations() {
|
|
|
2913
2911
|
];
|
|
2914
2912
|
}
|
|
2915
2913
|
}),
|
|
2916
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2917
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2918
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2914
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2915
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "An object representing the configuration options for a confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt." }),
|
|
2916
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
2919
2917
|
name: "ConfirmConfig",
|
|
2920
2918
|
"export": true,
|
|
2921
2919
|
children: _alloy_js_core.code`PromptFactoryConfig<boolean> & ConfirmPromptConfig; `
|
|
2922
2920
|
}),
|
|
2923
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2924
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2921
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2922
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2925
2923
|
heading: "A function to create and run a confirm prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
2926
2924
|
get children() {
|
|
2927
2925
|
return [
|
|
2928
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2926
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { confirm, isCancel } from "shell-shock:prompts";
|
|
2929
2927
|
|
|
2930
2928
|
async function run() {
|
|
2931
2929
|
const likesIceCream = await confirm({
|
|
@@ -2940,12 +2938,12 @@ async function run() {
|
|
|
2940
2938
|
}
|
|
2941
2939
|
|
|
2942
2940
|
run(); ` }),
|
|
2943
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2944
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2941
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2942
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
2945
2943
|
name: "config",
|
|
2946
2944
|
children: `The configuration options to pass to the confirm prompt, which extends the base PromptFactoryConfig with additional options specific to the confirm prompt`
|
|
2947
2945
|
}),
|
|
2948
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2946
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
2949
2947
|
];
|
|
2950
2948
|
}
|
|
2951
2949
|
}),
|
|
@@ -2985,21 +2983,21 @@ function PasswordPromptDeclaration() {
|
|
|
2985
2983
|
returnType: "string",
|
|
2986
2984
|
children: _alloy_js_core.code`return "*".repeat(input.length); `
|
|
2987
2985
|
}),
|
|
2988
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2989
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2990
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2986
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2987
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, { heading: "An object representing the configuration options for a password prompt, which extends the base PromptFactoryConfig with additional options specific to password prompts." }),
|
|
2988
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_type_declaration.TypeDeclaration, {
|
|
2991
2989
|
name: "PasswordConfig",
|
|
2992
2990
|
"export": true,
|
|
2993
2991
|
children: _alloy_js_core.code`Omit<TextConfig, "mask" | "maskCompleted">; `
|
|
2994
2992
|
}),
|
|
2995
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2996
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2993
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
2994
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
2997
2995
|
heading: "A function to create and run a password prompt, which returns a promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
2998
2996
|
get children() {
|
|
2999
2997
|
return [
|
|
3000
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3001
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3002
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
2998
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`This function creates an instance of the TextPrompt class with the provided configuration options and a custom mask function to handle password input. It sets up event listeners for state updates, submission, and cancellation to handle the prompt interactions and return the appropriate results. The password prompt allows users to input text that is masked for privacy, making it suitable for scenarios like entering passwords or sensitive information.` }),
|
|
2999
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3000
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { password, isCancel } from "shell-shock:prompts";
|
|
3003
3001
|
|
|
3004
3002
|
async function run() {
|
|
3005
3003
|
const userPassword = await password({
|
|
@@ -3014,12 +3012,12 @@ async function run() {
|
|
|
3014
3012
|
}
|
|
3015
3013
|
|
|
3016
3014
|
run(); ` }),
|
|
3017
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3018
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3015
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3016
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
3019
3017
|
name: "config",
|
|
3020
3018
|
children: `The configuration options to pass to the password prompt, which extends the base PromptConfig with additional options specific to password prompts`
|
|
3021
3019
|
}),
|
|
3022
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3020
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves with the submitted value or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled` })
|
|
3023
3021
|
];
|
|
3024
3022
|
}
|
|
3025
3023
|
}),
|
|
@@ -3040,13 +3038,13 @@ run(); ` }),
|
|
|
3040
3038
|
];
|
|
3041
3039
|
}
|
|
3042
3040
|
function WaitForKeyPressDeclaration() {
|
|
3043
|
-
return [(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3041
|
+
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDoc, {
|
|
3044
3042
|
heading: "A function to create and run a wait-for-key-press prompt, which returns a promise that resolves when any key is pressed or rejects with a {@link CANCEL_SYMBOL | cancel symbol} if the prompt is cancelled.",
|
|
3045
3043
|
get children() {
|
|
3046
3044
|
return [
|
|
3047
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3048
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3049
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3045
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocRemarks, { children: _alloy_js_core.code`This function creates an instance of the Prompt class with a custom onKeyPress handler that resolves the promise when any key is pressed. It sets up event listeners for state updates and cancellation to handle the prompt interactions and return the appropriate results. The wait-for-key-press prompt is useful for scenarios where you want to pause execution until the user presses any key, such as waiting for user input before proceeding with a task.` }),
|
|
3046
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3047
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocExample, { children: `import { waitForKeyPress } from "shell-shock:prompts";
|
|
3050
3048
|
|
|
3051
3049
|
async function run() {
|
|
3052
3050
|
const result = await waitForKeyPress();
|
|
@@ -3054,12 +3052,12 @@ async function run() {
|
|
|
3054
3052
|
}
|
|
3055
3053
|
|
|
3056
3054
|
run(); ` }),
|
|
3057
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3058
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3055
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3056
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocParam, {
|
|
3059
3057
|
name: "timeout",
|
|
3060
3058
|
children: `The amount of time in milliseconds to wait before automatically resolving the prompt, defaults to 2 hours (7200000 ms)`
|
|
3061
3059
|
}),
|
|
3062
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3060
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_typescript_components_tsdoc.TSDocReturns, { children: `A promise that resolves when any key is pressed` })
|
|
3063
3061
|
];
|
|
3064
3062
|
}
|
|
3065
3063
|
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
@@ -3088,12 +3086,12 @@ run(); ` }),
|
|
|
3088
3086
|
*/
|
|
3089
3087
|
function PromptsBuiltin(props) {
|
|
3090
3088
|
const [{ children }, rest] = (0, _alloy_js_core.splitProps)(props, ["children"]);
|
|
3091
|
-
return (0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3089
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_shell_shock_core_contexts_power_plant.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
|
|
3092
3090
|
id: "prompts",
|
|
3093
3091
|
description: "A collection of prompts that allow for interactive input in command-line applications."
|
|
3094
3092
|
}, rest, {
|
|
3095
3093
|
get imports() {
|
|
3096
|
-
return (0, defu.
|
|
3094
|
+
return (0, defu.defu)(rest.imports ?? {}, {
|
|
3097
3095
|
"node:events": "EventEmitter",
|
|
3098
3096
|
"node:readline": [
|
|
3099
3097
|
"Interface",
|
|
@@ -3104,7 +3102,7 @@ function PromptsBuiltin(props) {
|
|
|
3104
3102
|
});
|
|
3105
3103
|
},
|
|
3106
3104
|
get builtinImports() {
|
|
3107
|
-
return (0, defu.
|
|
3105
|
+
return (0, defu.defu)(rest.builtinImports ?? {}, {
|
|
3108
3106
|
console: [
|
|
3109
3107
|
"erase",
|
|
3110
3108
|
"beep",
|
|
@@ -3133,25 +3131,25 @@ function PromptsBuiltin(props) {
|
|
|
3133
3131
|
},
|
|
3134
3132
|
get children() {
|
|
3135
3133
|
return [
|
|
3136
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3134
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3137
3135
|
(0, _alloy_js_core_jsx_runtime.createComponent)(BasePromptDeclarations, {}),
|
|
3138
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3136
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3139
3137
|
(0, _alloy_js_core_jsx_runtime.createComponent)(TextPromptDeclarations, {}),
|
|
3140
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3138
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3141
3139
|
(0, _alloy_js_core_jsx_runtime.createComponent)(SelectPromptDeclarations, {}),
|
|
3142
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3140
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3143
3141
|
(0, _alloy_js_core_jsx_runtime.createComponent)(MultiSelectPromptDeclarations, {}),
|
|
3144
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3142
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3145
3143
|
(0, _alloy_js_core_jsx_runtime.createComponent)(NumericPromptDeclarations, {}),
|
|
3146
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3144
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3147
3145
|
(0, _alloy_js_core_jsx_runtime.createComponent)(TogglePromptDeclarations, {}),
|
|
3148
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3146
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3149
3147
|
(0, _alloy_js_core_jsx_runtime.createComponent)(PasswordPromptDeclaration, {}),
|
|
3150
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3148
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3151
3149
|
(0, _alloy_js_core_jsx_runtime.createComponent)(ConfirmPromptDeclarations, {}),
|
|
3152
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3150
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3153
3151
|
(0, _alloy_js_core_jsx_runtime.createComponent)(WaitForKeyPressDeclaration, {}),
|
|
3154
|
-
(0, _alloy_js_core_jsx_runtime.createComponent)(
|
|
3152
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_power_plant_alloy_js_core_components_spacing.Spacing, {}),
|
|
3155
3153
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
3156
3154
|
get when() {
|
|
3157
3155
|
return Boolean(children);
|