@shell-shock/plugin-prompts 0.3.51 → 0.3.52
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/index.cjs +1 -0
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.mjs +2 -2
- package/dist/components/prompts-builtin.cjs +459 -55
- package/dist/components/prompts-builtin.d.cts +14 -11
- package/dist/components/prompts-builtin.d.cts.map +1 -1
- package/dist/components/prompts-builtin.d.mts +14 -11
- package/dist/components/prompts-builtin.d.mts.map +1 -1
- package/dist/components/prompts-builtin.mjs +459 -56
- package/dist/components/prompts-builtin.mjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +12 -12
|
@@ -3,7 +3,6 @@ const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
|
3
3
|
let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
4
|
let _alloy_js_core = require("@alloy-js/core");
|
|
5
5
|
let _alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
-
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
6
|
let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
|
|
8
7
|
let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
9
8
|
let _powerlines_plugin_alloy_typescript_components_class_declaration = require("@powerlines/plugin-alloy/typescript/components/class-declaration");
|
|
@@ -91,7 +90,7 @@ function BasePromptDeclarations() {
|
|
|
91
90
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
92
91
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
93
92
|
name: "errorMessage",
|
|
94
|
-
|
|
93
|
+
required: false,
|
|
95
94
|
type: "string",
|
|
96
95
|
doc: "If the prompt is in an error state, this will contain the error message to display"
|
|
97
96
|
}),
|
|
@@ -129,14 +128,14 @@ function BasePromptDeclarations() {
|
|
|
129
128
|
return [
|
|
130
129
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
131
130
|
name: "input",
|
|
132
|
-
|
|
131
|
+
required: false,
|
|
133
132
|
type: "NodeJS.ReadStream",
|
|
134
133
|
doc: "The readable stream to use for prompt input, defaults to process.stdin"
|
|
135
134
|
}),
|
|
136
135
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
137
136
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
138
137
|
name: "output",
|
|
139
|
-
|
|
138
|
+
required: false,
|
|
140
139
|
type: "NodeJS.WriteStream",
|
|
141
140
|
doc: "The writable stream to use for prompt output, defaults to process.stdout"
|
|
142
141
|
}),
|
|
@@ -149,63 +148,63 @@ function BasePromptDeclarations() {
|
|
|
149
148
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
150
149
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
151
150
|
name: "description",
|
|
152
|
-
|
|
151
|
+
required: false,
|
|
153
152
|
type: "string",
|
|
154
153
|
doc: "The prompt description message to display"
|
|
155
154
|
}),
|
|
156
155
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
157
156
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
158
157
|
name: "initialValue",
|
|
159
|
-
|
|
158
|
+
required: false,
|
|
160
159
|
type: "TValue",
|
|
161
160
|
doc: "The initial value of the prompt"
|
|
162
161
|
}),
|
|
163
162
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
164
163
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
165
164
|
name: "validate",
|
|
166
|
-
|
|
165
|
+
required: false,
|
|
167
166
|
type: "(value: TValue) => boolean | string | null | undefined | Promise<boolean | string | null | undefined>",
|
|
168
167
|
doc: "A validation function that returns true if the input is valid, false or a string error message if the input is invalid"
|
|
169
168
|
}),
|
|
170
169
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
171
170
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
172
171
|
name: "parse",
|
|
173
|
-
|
|
172
|
+
required: false,
|
|
174
173
|
type: "PromptParser<TValue>",
|
|
175
174
|
doc: "A function that parses the input value and returns the parsed result or throws an error if the input is invalid"
|
|
176
175
|
}),
|
|
177
176
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
178
177
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
179
178
|
name: "format",
|
|
180
|
-
|
|
179
|
+
required: false,
|
|
181
180
|
type: "PromptFormatter<TValue>",
|
|
182
181
|
doc: "A function that formats the input value and returns the formatted result or throws an error if the input is invalid"
|
|
183
182
|
}),
|
|
184
183
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
185
184
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
186
185
|
name: "mask",
|
|
187
|
-
|
|
186
|
+
required: false,
|
|
188
187
|
type: "(input: string) => string",
|
|
189
188
|
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."
|
|
190
189
|
}),
|
|
191
190
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
192
191
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
193
192
|
name: "maskCompleted",
|
|
194
|
-
|
|
193
|
+
required: false,
|
|
195
194
|
type: "(input: string) => string",
|
|
196
195
|
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."
|
|
197
196
|
}),
|
|
198
197
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
199
198
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
200
199
|
name: "defaultErrorMessage",
|
|
201
|
-
|
|
200
|
+
required: false,
|
|
202
201
|
type: "string",
|
|
203
202
|
doc: "The default error message to display when validation fails"
|
|
204
203
|
}),
|
|
205
204
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
206
205
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
207
206
|
name: "timeout",
|
|
208
|
-
|
|
207
|
+
required: false,
|
|
209
208
|
type: "number",
|
|
210
209
|
doc: "The timeout duration in milliseconds for the prompt. If none is provided, the prompt will not time out."
|
|
211
210
|
})
|
|
@@ -233,8 +232,7 @@ function BasePromptDeclarations() {
|
|
|
233
232
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
234
233
|
name: "value",
|
|
235
234
|
isPrivateMember: true,
|
|
236
|
-
|
|
237
|
-
type: "TValue"
|
|
235
|
+
type: "TValue | undefined"
|
|
238
236
|
}),
|
|
239
237
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
240
238
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
@@ -916,21 +914,21 @@ function BasePromptDeclarations() {
|
|
|
916
914
|
return [
|
|
917
915
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
918
916
|
name: "onState",
|
|
919
|
-
|
|
917
|
+
required: false,
|
|
920
918
|
type: "(state: PromptState<TValue>) => any",
|
|
921
919
|
doc: "A function that is called when the prompt state changes, useful for updating the prompt message or other properties dynamically"
|
|
922
920
|
}),
|
|
923
921
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
924
922
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
925
923
|
name: "onSubmit",
|
|
926
|
-
|
|
924
|
+
required: false,
|
|
927
925
|
type: "(value: TValue) => any",
|
|
928
926
|
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"
|
|
929
927
|
}),
|
|
930
928
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
931
929
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
932
930
|
name: "onCancel",
|
|
933
|
-
|
|
931
|
+
required: false,
|
|
934
932
|
type: "(event: any) => any",
|
|
935
933
|
doc: "A function that is called when the prompt is canceled, useful for handling the canceled value or performing actions based on the prompt state"
|
|
936
934
|
})
|
|
@@ -979,14 +977,14 @@ function TextPromptDeclarations() {
|
|
|
979
977
|
return [
|
|
980
978
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
981
979
|
name: "initialValue",
|
|
982
|
-
|
|
980
|
+
required: false,
|
|
983
981
|
type: "string",
|
|
984
982
|
doc: "The initial value of the prompt"
|
|
985
983
|
}),
|
|
986
984
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
987
985
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
988
986
|
name: "mask",
|
|
989
|
-
|
|
987
|
+
required: false,
|
|
990
988
|
type: "(input: string) => string",
|
|
991
989
|
doc: "A function that masks the input value and returns the masked result"
|
|
992
990
|
})
|
|
@@ -1233,15 +1231,15 @@ function SelectPromptDeclarations() {
|
|
|
1233
1231
|
return [
|
|
1234
1232
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1235
1233
|
name: "label",
|
|
1236
|
-
|
|
1237
|
-
|
|
1234
|
+
schema: { type: "string" },
|
|
1235
|
+
required: false,
|
|
1238
1236
|
doc: "The message label for the option"
|
|
1239
1237
|
}),
|
|
1240
1238
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1241
1239
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1242
1240
|
name: "icon",
|
|
1243
|
-
|
|
1244
|
-
|
|
1241
|
+
schema: { type: "string" },
|
|
1242
|
+
required: false,
|
|
1245
1243
|
doc: "An icon for the option"
|
|
1246
1244
|
}),
|
|
1247
1245
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
@@ -1253,22 +1251,22 @@ function SelectPromptDeclarations() {
|
|
|
1253
1251
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1254
1252
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1255
1253
|
name: "description",
|
|
1256
|
-
|
|
1257
|
-
|
|
1254
|
+
schema: { type: "string" },
|
|
1255
|
+
required: false,
|
|
1258
1256
|
doc: "The description of the option"
|
|
1259
1257
|
}),
|
|
1260
1258
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1261
1259
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1262
1260
|
name: "selected",
|
|
1263
|
-
|
|
1264
|
-
|
|
1261
|
+
schema: { type: "boolean" },
|
|
1262
|
+
required: false,
|
|
1265
1263
|
doc: "Whether the option is selected"
|
|
1266
1264
|
}),
|
|
1267
1265
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1268
1266
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1269
1267
|
name: "disabled",
|
|
1270
|
-
|
|
1271
|
-
|
|
1268
|
+
schema: { type: "boolean" },
|
|
1269
|
+
required: false,
|
|
1272
1270
|
doc: "Whether the option is disabled"
|
|
1273
1271
|
})
|
|
1274
1272
|
];
|
|
@@ -1324,7 +1322,7 @@ function SelectPromptDeclarations() {
|
|
|
1324
1322
|
return [
|
|
1325
1323
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1326
1324
|
name: "hint",
|
|
1327
|
-
|
|
1325
|
+
required: false,
|
|
1328
1326
|
type: "string",
|
|
1329
1327
|
doc: "A hint to display to the user"
|
|
1330
1328
|
}),
|
|
@@ -1337,7 +1335,7 @@ function SelectPromptDeclarations() {
|
|
|
1337
1335
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1338
1336
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1339
1337
|
name: "optionsPerPage",
|
|
1340
|
-
|
|
1338
|
+
required: false,
|
|
1341
1339
|
type: "number",
|
|
1342
1340
|
doc: "The number of options to display per page, defaults to 8"
|
|
1343
1341
|
})
|
|
@@ -1683,6 +1681,416 @@ run(); ` }),
|
|
|
1683
1681
|
];
|
|
1684
1682
|
}
|
|
1685
1683
|
/**
|
|
1684
|
+
* Declarations for a multi-select prompt that allows users to choose multiple options from a list, with support for disabled options, bulk selection shortcuts, and required validation. This prompt type is useful for scenarios where users need to select one or more values from a predefined set.
|
|
1685
|
+
*/
|
|
1686
|
+
function MultiSelectPromptDeclarations() {
|
|
1687
|
+
return [
|
|
1688
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceDeclaration, {
|
|
1689
|
+
name: "MultiSelectPromptConfig",
|
|
1690
|
+
"extends": "PromptConfig<TValue[]>",
|
|
1691
|
+
doc: "An options object for configuring a multi-select prompt",
|
|
1692
|
+
typeParameters: [{
|
|
1693
|
+
name: "TValue",
|
|
1694
|
+
default: "string"
|
|
1695
|
+
}],
|
|
1696
|
+
get children() {
|
|
1697
|
+
return [
|
|
1698
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1699
|
+
name: "options",
|
|
1700
|
+
type: "Array<string | PromptOptionConfig<TValue>>",
|
|
1701
|
+
doc: "The options available for the multi-select prompt"
|
|
1702
|
+
}),
|
|
1703
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1704
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1705
|
+
name: "required",
|
|
1706
|
+
required: false,
|
|
1707
|
+
type: "boolean",
|
|
1708
|
+
doc: "Whether at least one option must be selected, defaults to true"
|
|
1709
|
+
}),
|
|
1710
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1711
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1712
|
+
name: "initialValue",
|
|
1713
|
+
required: false,
|
|
1714
|
+
type: "TValue[]",
|
|
1715
|
+
doc: "The initial selected values"
|
|
1716
|
+
}),
|
|
1717
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1718
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1719
|
+
name: "cursorAt",
|
|
1720
|
+
required: false,
|
|
1721
|
+
type: "TValue",
|
|
1722
|
+
doc: "A value indicating which option should be focused initially"
|
|
1723
|
+
}),
|
|
1724
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1725
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1726
|
+
name: "optionsPerPage",
|
|
1727
|
+
required: false,
|
|
1728
|
+
type: "number",
|
|
1729
|
+
doc: "The number of options to display per page, defaults to 8"
|
|
1730
|
+
})
|
|
1731
|
+
];
|
|
1732
|
+
}
|
|
1733
|
+
}),
|
|
1734
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1735
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassDeclaration, {
|
|
1736
|
+
name: "MultiSelectPrompt",
|
|
1737
|
+
doc: "A prompt for selecting multiple options from a list",
|
|
1738
|
+
"extends": "Prompt<TValue[]>",
|
|
1739
|
+
typeParameters: [{
|
|
1740
|
+
name: "TValue",
|
|
1741
|
+
default: "string"
|
|
1742
|
+
}],
|
|
1743
|
+
get children() {
|
|
1744
|
+
return [
|
|
1745
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
1746
|
+
name: "initialValue",
|
|
1747
|
+
"protected": true,
|
|
1748
|
+
override: true,
|
|
1749
|
+
type: "TValue[]",
|
|
1750
|
+
children: _alloy_js_core.code`[]; `
|
|
1751
|
+
}),
|
|
1752
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1753
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
1754
|
+
name: "required",
|
|
1755
|
+
"protected": true,
|
|
1756
|
+
type: "boolean",
|
|
1757
|
+
children: _alloy_js_core.code`true; `
|
|
1758
|
+
}),
|
|
1759
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1760
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
1761
|
+
name: "optionsPerPage",
|
|
1762
|
+
"protected": true,
|
|
1763
|
+
type: "number",
|
|
1764
|
+
children: _alloy_js_core.code`8; `
|
|
1765
|
+
}),
|
|
1766
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1767
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
1768
|
+
name: "options",
|
|
1769
|
+
"protected": true,
|
|
1770
|
+
type: "PromptOption<TValue>[]",
|
|
1771
|
+
children: _alloy_js_core.code`[]; `
|
|
1772
|
+
}),
|
|
1773
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1774
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_class_declaration.ClassField, {
|
|
1775
|
+
name: "cursorHidden",
|
|
1776
|
+
"protected": true,
|
|
1777
|
+
override: true,
|
|
1778
|
+
type: "boolean",
|
|
1779
|
+
children: _alloy_js_core.code`true; `
|
|
1780
|
+
}),
|
|
1781
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1782
|
+
_alloy_js_core.code`constructor(config: MultiSelectPromptConfig<TValue>) {
|
|
1783
|
+
super(config);
|
|
1784
|
+
|
|
1785
|
+
this.required = config.required ?? true;
|
|
1786
|
+
this.initialValue = Array.isArray(config.initialValue) ? [...config.initialValue] : [];
|
|
1787
|
+
|
|
1788
|
+
if (config.optionsPerPage) {
|
|
1789
|
+
this.optionsPerPage = config.optionsPerPage;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
this.options = config.options.map((opt, index) => {
|
|
1793
|
+
let option = {} as Partial<PromptOption<TValue>>;
|
|
1794
|
+
if (typeof opt === "string") {
|
|
1795
|
+
option = {
|
|
1796
|
+
label: opt,
|
|
1797
|
+
value: opt as TValue,
|
|
1798
|
+
selected: this.initialValue.includes(opt as TValue),
|
|
1799
|
+
disabled: false
|
|
1800
|
+
};
|
|
1801
|
+
} else if (typeof opt === "object" && opt !== null) {
|
|
1802
|
+
option = {
|
|
1803
|
+
...opt,
|
|
1804
|
+
selected: this.initialValue.includes(opt.value as TValue) || !!opt.selected
|
|
1805
|
+
};
|
|
1806
|
+
} else {
|
|
1807
|
+
throw new Error("Invalid option provided to MultiSelectPrompt at index #" + index);
|
|
1808
|
+
}
|
|
1809
|
+
|
|
1810
|
+
return {
|
|
1811
|
+
label: option.label || String(option.value),
|
|
1812
|
+
...option,
|
|
1813
|
+
description: option.description,
|
|
1814
|
+
selected: !!option.selected,
|
|
1815
|
+
disabled: !!option.disabled,
|
|
1816
|
+
index
|
|
1817
|
+
} as PromptOption<TValue>;
|
|
1818
|
+
});
|
|
1819
|
+
|
|
1820
|
+
if (config.cursorAt !== undefined) {
|
|
1821
|
+
const index = this.options.findIndex(option => option.value === config.cursorAt);
|
|
1822
|
+
if (index > -1) {
|
|
1823
|
+
this.cursor = index;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
|
|
1827
|
+
if (this.options[this.cursor]?.disabled) {
|
|
1828
|
+
this.moveCursor(this.findNextEnabled(this.cursor, 1));
|
|
1829
|
+
} else {
|
|
1830
|
+
this.changeValue(this.getSelectedValues());
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
this.sync();
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
protected getAction(key: Key): string | false {
|
|
1837
|
+
let action = super.getAction(key);
|
|
1838
|
+
if (!action) {
|
|
1839
|
+
if (key.name === "j") action = "down";
|
|
1840
|
+
if (key.name === "k") action = "up";
|
|
1841
|
+
if (key.name === "a") action = "toggleAll";
|
|
1842
|
+
if (key.name === "i") action = "toggleInvert";
|
|
1843
|
+
if (key.name === "space") action = "toggleCurrent";
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
return action || false;
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
protected override async submit() {
|
|
1850
|
+
const selectedValues = this.getSelectedValues();
|
|
1851
|
+
if (this.required && selectedValues.length === 0) {
|
|
1852
|
+
this.error(
|
|
1853
|
+
"Please select at least one option. Press <space> to toggle and <enter> to submit."
|
|
1854
|
+
);
|
|
1855
|
+
this.bell();
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
this.changeValue(selectedValues);
|
|
1860
|
+
await super.submit();
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
protected toggleCurrent() {
|
|
1864
|
+
const option = this.options[this.cursor];
|
|
1865
|
+
if (!option || option.disabled) {
|
|
1866
|
+
this.bell();
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
option.selected = !option.selected;
|
|
1871
|
+
this.changeValue(this.getSelectedValues());
|
|
1872
|
+
this.sync();
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
protected toggleAll() {
|
|
1876
|
+
const enabled = this.options.filter(option => !option.disabled);
|
|
1877
|
+
const areAllSelected = enabled.every(option => option.selected);
|
|
1878
|
+
for (const option of enabled) {
|
|
1879
|
+
option.selected = !areAllSelected;
|
|
1880
|
+
}
|
|
1881
|
+
|
|
1882
|
+
this.changeValue(this.getSelectedValues());
|
|
1883
|
+
this.sync();
|
|
1884
|
+
}
|
|
1885
|
+
|
|
1886
|
+
protected toggleInvert() {
|
|
1887
|
+
for (const option of this.options) {
|
|
1888
|
+
if (!option.disabled) {
|
|
1889
|
+
option.selected = !option.selected;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
this.changeValue(this.getSelectedValues());
|
|
1894
|
+
this.sync();
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
protected findNextEnabled(from: number, direction: 1 | -1): number {
|
|
1898
|
+
if (this.options.length === 0) {
|
|
1899
|
+
return 0;
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
let index = from;
|
|
1903
|
+
for (let i = 0; i < this.options.length; i++) {
|
|
1904
|
+
index = (index + direction + this.options.length) % this.options.length;
|
|
1905
|
+
if (!this.options[index]?.disabled) {
|
|
1906
|
+
return index;
|
|
1907
|
+
}
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
return from;
|
|
1911
|
+
}
|
|
1912
|
+
|
|
1913
|
+
protected getSelectedValues(): TValue[] {
|
|
1914
|
+
return this.options
|
|
1915
|
+
.filter(option => option.selected)
|
|
1916
|
+
.map(option => option.value as TValue);
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
protected next() {
|
|
1920
|
+
this.moveCursor(this.findNextEnabled(this.cursor, 1));
|
|
1921
|
+
this.sync();
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
protected up() {
|
|
1925
|
+
this.moveCursor(this.findNextEnabled(this.cursor, -1));
|
|
1926
|
+
this.sync();
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
protected down() {
|
|
1930
|
+
this.moveCursor(this.findNextEnabled(this.cursor, 1));
|
|
1931
|
+
this.sync();
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
protected first() {
|
|
1935
|
+
this.moveCursor(this.findNextEnabled(0, 1));
|
|
1936
|
+
this.sync();
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
protected last() {
|
|
1940
|
+
this.moveCursor(this.findNextEnabled(this.options.length - 1, -1));
|
|
1941
|
+
this.sync();
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
protected override moveCursor(count: number) {
|
|
1945
|
+
this.cursor = count;
|
|
1946
|
+
this.changeValue(this.getSelectedValues());
|
|
1947
|
+
this.sync();
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
protected override onRender() {
|
|
1951
|
+
const spacing = Math.max(...this.options.map(option => option.label?.length || 0), 0) + 2;
|
|
1952
|
+
const startIndex = Math.max(
|
|
1953
|
+
Math.min(
|
|
1954
|
+
this.options.length - this.optionsPerPage,
|
|
1955
|
+
this.cursor - Math.floor(this.optionsPerPage / 2)
|
|
1956
|
+
),
|
|
1957
|
+
0
|
|
1958
|
+
);
|
|
1959
|
+
const endIndex = Math.min(startIndex + this.optionsPerPage, this.options.length);
|
|
1960
|
+
|
|
1961
|
+
let output = "";
|
|
1962
|
+
if (!this.isCompleted) {
|
|
1963
|
+
output += " \\\n";
|
|
1964
|
+
|
|
1965
|
+
for (let index = startIndex; index < endIndex; index++) {
|
|
1966
|
+
const option = this.options[index]!;
|
|
1967
|
+
const active = this.cursor === index;
|
|
1968
|
+
const selected = !!option.selected;
|
|
1969
|
+
const disabled = !!option.disabled;
|
|
1970
|
+
|
|
1971
|
+
const pointer = disabled
|
|
1972
|
+
? active
|
|
1973
|
+
? bold(textColors.prompt.input.disabled(">"))
|
|
1974
|
+
: index === startIndex
|
|
1975
|
+
? borderColors.app.divider.tertiary("↑")
|
|
1976
|
+
: index === endIndex - 1
|
|
1977
|
+
? borderColors.app.divider.tertiary("↓")
|
|
1978
|
+
: " "
|
|
1979
|
+
: active
|
|
1980
|
+
? bold(textColors.prompt.input.active(">"))
|
|
1981
|
+
: index === startIndex
|
|
1982
|
+
? borderColors.app.divider.tertiary("↑")
|
|
1983
|
+
: index === endIndex - 1
|
|
1984
|
+
? borderColors.app.divider.tertiary("↓")
|
|
1985
|
+
: " ";
|
|
1986
|
+
|
|
1987
|
+
const marker = isUnicodeSupported ? (selected ? "🗹" : "☐") : (selected ? "[x]" : "[ ]");
|
|
1988
|
+
const markerText = disabled
|
|
1989
|
+
? active
|
|
1990
|
+
? bold(textColors.prompt.input.disabled(marker))
|
|
1991
|
+
: textColors.prompt.input.disabled(marker)
|
|
1992
|
+
: active
|
|
1993
|
+
? bold(textColors.prompt.input.active(marker))
|
|
1994
|
+
: textColors.prompt.input.inactive(marker);
|
|
1995
|
+
|
|
1996
|
+
const labelText = disabled
|
|
1997
|
+
? active
|
|
1998
|
+
? bold(underline(textColors.prompt.input.disabled(option.label)))
|
|
1999
|
+
: strikethrough(textColors.prompt.input.disabled(option.label))
|
|
2000
|
+
: active
|
|
2001
|
+
? bold(underline(textColors.prompt.input.active(option.label)))
|
|
2002
|
+
: selected
|
|
2003
|
+
? textColors.prompt.input.active(option.label)
|
|
2004
|
+
: textColors.prompt.input.inactive(option.label);
|
|
2005
|
+
|
|
2006
|
+
output +=
|
|
2007
|
+
pointer +
|
|
2008
|
+
" " +
|
|
2009
|
+
markerText +
|
|
2010
|
+
" " +
|
|
2011
|
+
labelText +
|
|
2012
|
+
" " +
|
|
2013
|
+
" ".repeat(Math.max(0, spacing - option.label.length)) +
|
|
2014
|
+
(option.description && active
|
|
2015
|
+
? italic(textColors.prompt.description.active(option.description))
|
|
2016
|
+
: "") +
|
|
2017
|
+
" \\\n";
|
|
2018
|
+
}
|
|
2019
|
+
} else {
|
|
2020
|
+
const selected = this.options.filter(option => option.selected);
|
|
2021
|
+
this.displayValue =
|
|
2022
|
+
selected.length > 0
|
|
2023
|
+
? selected.map(option => option.label).join(", ")
|
|
2024
|
+
: "(none)";
|
|
2025
|
+
output += super.onRender();
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
return output;
|
|
2029
|
+
}`
|
|
2030
|
+
];
|
|
2031
|
+
}
|
|
2032
|
+
}),
|
|
2033
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2034
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_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." }),
|
|
2035
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_type_declaration.TypeDeclaration, {
|
|
2036
|
+
"export": true,
|
|
2037
|
+
name: "MultiSelectConfig",
|
|
2038
|
+
children: _alloy_js_core.code`PromptFactoryConfig<string[]> & MultiSelectPromptConfig; `
|
|
2039
|
+
}),
|
|
2040
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2041
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
2042
|
+
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
|
+
get children() {
|
|
2044
|
+
return [
|
|
2045
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `import { multiselect, isCancel } from "shell-shock:prompts";
|
|
2046
|
+
|
|
2047
|
+
async function run() {
|
|
2048
|
+
const tools = await multiselect({
|
|
2049
|
+
message: "Select tools",
|
|
2050
|
+
options: [
|
|
2051
|
+
{ value: "eslint", label: "ESLint" },
|
|
2052
|
+
{ value: "prettier", label: "Prettier" },
|
|
2053
|
+
{ value: "vitest", label: "Vitest", disabled: true }
|
|
2054
|
+
]
|
|
2055
|
+
});
|
|
2056
|
+
|
|
2057
|
+
if (isCancel(tools)) {
|
|
2058
|
+
console.log("Prompt was cancelled");
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
console.log("Selected tools:", tools.join(", "));
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
run(); ` }),
|
|
2066
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2067
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
2068
|
+
name: "config",
|
|
2069
|
+
children: `The configuration options to pass to the multi-select prompt`
|
|
2070
|
+
}),
|
|
2071
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_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
|
+
];
|
|
2073
|
+
}
|
|
2074
|
+
}),
|
|
2075
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
2076
|
+
name: "multiselect",
|
|
2077
|
+
"export": true,
|
|
2078
|
+
parameters: [{
|
|
2079
|
+
name: "config",
|
|
2080
|
+
type: "MultiSelectConfig"
|
|
2081
|
+
}],
|
|
2082
|
+
returnType: "Promise<string[] | symbol>",
|
|
2083
|
+
children: _alloy_js_core.code`return new Promise<string[] | symbol>((response, reject) => {
|
|
2084
|
+
const prompt = new MultiSelectPrompt(config);
|
|
2085
|
+
|
|
2086
|
+
prompt.on("state", state => config.onState?.(state));
|
|
2087
|
+
prompt.on("submit", value => response(value));
|
|
2088
|
+
prompt.on("cancel", event => response(CANCEL_SYMBOL));
|
|
2089
|
+
});`
|
|
2090
|
+
})
|
|
2091
|
+
];
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
1686
2094
|
* A component that renders the declarations for the built-in numeric prompt, which allows users to input and select numeric values with various configuration options such as floating point support, precision, increment, and min/max values.
|
|
1687
2095
|
*/
|
|
1688
2096
|
function NumericPromptDeclarations() {
|
|
@@ -1695,35 +2103,35 @@ function NumericPromptDeclarations() {
|
|
|
1695
2103
|
return [
|
|
1696
2104
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1697
2105
|
name: "isFloat",
|
|
1698
|
-
|
|
2106
|
+
required: false,
|
|
1699
2107
|
type: "boolean",
|
|
1700
2108
|
doc: "Whether the prompt should accept floating point numbers"
|
|
1701
2109
|
}),
|
|
1702
2110
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1703
2111
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1704
2112
|
name: "precision",
|
|
1705
|
-
|
|
2113
|
+
required: false,
|
|
1706
2114
|
type: "number",
|
|
1707
2115
|
doc: "The number of decimal places to round the input to, defaults to 2"
|
|
1708
2116
|
}),
|
|
1709
2117
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1710
2118
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1711
2119
|
name: "increment",
|
|
1712
|
-
|
|
2120
|
+
required: false,
|
|
1713
2121
|
type: "number",
|
|
1714
2122
|
doc: "The increment value for the number prompt, defaults to 1"
|
|
1715
2123
|
}),
|
|
1716
2124
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1717
2125
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1718
2126
|
name: "min",
|
|
1719
|
-
|
|
2127
|
+
required: false,
|
|
1720
2128
|
type: "number",
|
|
1721
2129
|
doc: "The minimum value for the number prompt, defaults to -Infinity"
|
|
1722
2130
|
}),
|
|
1723
2131
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
1724
2132
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
1725
2133
|
name: "max",
|
|
1726
|
-
|
|
2134
|
+
required: false,
|
|
1727
2135
|
type: "number",
|
|
1728
2136
|
doc: "The maximum value for the number prompt, defaults to Infinity"
|
|
1729
2137
|
})
|
|
@@ -2073,14 +2481,14 @@ function TogglePromptDeclarations() {
|
|
|
2073
2481
|
return [
|
|
2074
2482
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2075
2483
|
name: "trueMessage",
|
|
2076
|
-
|
|
2484
|
+
required: false,
|
|
2077
2485
|
type: "string",
|
|
2078
2486
|
doc: "The message for the true state of the prompt"
|
|
2079
2487
|
}),
|
|
2080
2488
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2081
2489
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2082
2490
|
name: "falseMessage",
|
|
2083
|
-
|
|
2491
|
+
required: false,
|
|
2084
2492
|
type: "string",
|
|
2085
2493
|
doc: "The message for the false state of the prompt"
|
|
2086
2494
|
}),
|
|
@@ -2329,16 +2737,14 @@ function ConfirmPromptDeclarations() {
|
|
|
2329
2737
|
heading: "The message for the \\`Yes\\` state of the prompt",
|
|
2330
2738
|
get children() {
|
|
2331
2739
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2332
|
-
|
|
2333
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
2334
|
-
},
|
|
2740
|
+
type: "string",
|
|
2335
2741
|
defaultValue: "Yes"
|
|
2336
2742
|
});
|
|
2337
2743
|
}
|
|
2338
2744
|
}),
|
|
2339
2745
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2340
2746
|
name: "yesMessage",
|
|
2341
|
-
|
|
2747
|
+
required: false,
|
|
2342
2748
|
type: "string"
|
|
2343
2749
|
}),
|
|
2344
2750
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
@@ -2346,16 +2752,14 @@ function ConfirmPromptDeclarations() {
|
|
|
2346
2752
|
heading: "The \\`Yes\\` option when choosing between yes/no",
|
|
2347
2753
|
get children() {
|
|
2348
2754
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2349
|
-
|
|
2350
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
2351
|
-
},
|
|
2755
|
+
type: "string",
|
|
2352
2756
|
defaultValue: "1"
|
|
2353
2757
|
});
|
|
2354
2758
|
}
|
|
2355
2759
|
}),
|
|
2356
2760
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2357
2761
|
name: "yesOption",
|
|
2358
|
-
|
|
2762
|
+
required: false,
|
|
2359
2763
|
type: "string"
|
|
2360
2764
|
}),
|
|
2361
2765
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
@@ -2363,16 +2767,14 @@ function ConfirmPromptDeclarations() {
|
|
|
2363
2767
|
heading: "The message for the \\`No\\` state of the prompt",
|
|
2364
2768
|
get children() {
|
|
2365
2769
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2366
|
-
|
|
2367
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
2368
|
-
},
|
|
2770
|
+
type: "string",
|
|
2369
2771
|
defaultValue: "(Y/n)"
|
|
2370
2772
|
});
|
|
2371
2773
|
}
|
|
2372
2774
|
}),
|
|
2373
2775
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2374
2776
|
name: "noMessage",
|
|
2375
|
-
|
|
2777
|
+
required: false,
|
|
2376
2778
|
type: "string"
|
|
2377
2779
|
}),
|
|
2378
2780
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
@@ -2380,16 +2782,14 @@ function ConfirmPromptDeclarations() {
|
|
|
2380
2782
|
heading: "The \\`No\\` option when choosing between yes/no",
|
|
2381
2783
|
get children() {
|
|
2382
2784
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
2383
|
-
|
|
2384
|
-
return _powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
2385
|
-
},
|
|
2785
|
+
type: "string",
|
|
2386
2786
|
defaultValue: "(y/N)"
|
|
2387
2787
|
});
|
|
2388
2788
|
}
|
|
2389
2789
|
}),
|
|
2390
2790
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_interface_declaration.InterfaceMember, {
|
|
2391
2791
|
name: "noOption",
|
|
2392
|
-
|
|
2792
|
+
required: false,
|
|
2393
2793
|
type: "string"
|
|
2394
2794
|
})
|
|
2395
2795
|
];
|
|
@@ -2718,6 +3118,7 @@ function PromptsBuiltin(props) {
|
|
|
2718
3118
|
"splitText",
|
|
2719
3119
|
"error"
|
|
2720
3120
|
],
|
|
3121
|
+
utils: ["isUnicodeSupported"],
|
|
2721
3122
|
env: [
|
|
2722
3123
|
"env",
|
|
2723
3124
|
"isCI",
|
|
@@ -2737,6 +3138,8 @@ function PromptsBuiltin(props) {
|
|
|
2737
3138
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2738
3139
|
(0, _alloy_js_core_jsx_runtime.createComponent)(SelectPromptDeclarations, {}),
|
|
2739
3140
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
3141
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(MultiSelectPromptDeclarations, {}),
|
|
3142
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2740
3143
|
(0, _alloy_js_core_jsx_runtime.createComponent)(NumericPromptDeclarations, {}),
|
|
2741
3144
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
|
|
2742
3145
|
(0, _alloy_js_core_jsx_runtime.createComponent)(TogglePromptDeclarations, {}),
|
|
@@ -2761,6 +3164,7 @@ function PromptsBuiltin(props) {
|
|
|
2761
3164
|
//#endregion
|
|
2762
3165
|
exports.BasePromptDeclarations = BasePromptDeclarations;
|
|
2763
3166
|
exports.ConfirmPromptDeclarations = ConfirmPromptDeclarations;
|
|
3167
|
+
exports.MultiSelectPromptDeclarations = MultiSelectPromptDeclarations;
|
|
2764
3168
|
exports.NumericPromptDeclarations = NumericPromptDeclarations;
|
|
2765
3169
|
exports.PasswordPromptDeclaration = PasswordPromptDeclaration;
|
|
2766
3170
|
exports.PromptsBuiltin = PromptsBuiltin;
|