@shopify/cli-kit 3.47.4 → 3.48.0

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.
Files changed (138) hide show
  1. package/assets/cli-ruby/lib/project_types/extension/messages/messages.rb +18 -1
  2. package/assets/cli-ruby/lib/shopify_cli/constants.rb +1 -0
  3. package/assets/cli-ruby/lib/shopify_cli/environment.rb +7 -0
  4. package/assets/cli-ruby/lib/shopify_cli/theme/extension/dev_server.rb +8 -2
  5. package/dist/private/node/ui/alert.js +3 -1
  6. package/dist/private/node/ui/alert.js.map +1 -1
  7. package/dist/private/node/ui/components/Alert.d.ts +1 -1
  8. package/dist/private/node/ui/components/Alert.js.map +1 -1
  9. package/dist/private/node/ui/components/AutocompletePrompt.d.ts +7 -2
  10. package/dist/private/node/ui/components/AutocompletePrompt.js +28 -91
  11. package/dist/private/node/ui/components/AutocompletePrompt.js.map +1 -1
  12. package/dist/private/node/ui/components/AutocompletePrompt.test.js +317 -257
  13. package/dist/private/node/ui/components/AutocompletePrompt.test.js.map +1 -1
  14. package/dist/private/node/ui/components/ConcurrentOutput.d.ts +1 -0
  15. package/dist/private/node/ui/components/ConcurrentOutput.js +59 -32
  16. package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
  17. package/dist/private/node/ui/components/ConcurrentOutput.test.js +62 -22
  18. package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -1
  19. package/dist/private/node/ui/components/DangerousConfirmationPrompt.d.ts +12 -0
  20. package/dist/private/node/ui/components/DangerousConfirmationPrompt.js +77 -0
  21. package/dist/private/node/ui/components/DangerousConfirmationPrompt.js.map +1 -0
  22. package/dist/private/node/ui/components/DangerousConfirmationPrompt.test.js +101 -0
  23. package/dist/private/node/ui/components/DangerousConfirmationPrompt.test.js.map +1 -0
  24. package/dist/private/node/ui/components/List.d.ts +1 -0
  25. package/dist/private/node/ui/components/List.js +2 -2
  26. package/dist/private/node/ui/components/List.js.map +1 -1
  27. package/dist/private/node/ui/components/{GitDiff.d.ts → Prompts/GitDiff.d.ts} +4 -2
  28. package/dist/private/node/ui/components/{GitDiff.js → Prompts/GitDiff.js} +3 -2
  29. package/dist/private/node/ui/components/Prompts/GitDiff.js.map +1 -0
  30. package/dist/private/node/ui/components/Prompts/GitDiff.test.d.ts +1 -0
  31. package/dist/private/node/ui/components/{GitDiff.test.js → Prompts/GitDiff.test.js} +50 -28
  32. package/dist/private/node/ui/components/Prompts/GitDiff.test.js.map +1 -0
  33. package/dist/private/node/ui/components/Prompts/InfoMessage.d.ts +14 -0
  34. package/dist/private/node/ui/components/Prompts/InfoMessage.js +11 -0
  35. package/dist/private/node/ui/components/Prompts/InfoMessage.js.map +1 -0
  36. package/dist/private/node/ui/components/Prompts/InfoMessage.test.d.ts +1 -0
  37. package/dist/private/node/ui/components/Prompts/InfoMessage.test.js +21 -0
  38. package/dist/private/node/ui/components/Prompts/InfoMessage.test.js.map +1 -0
  39. package/dist/private/node/ui/components/Prompts/InfoTable.d.ts +1 -0
  40. package/dist/private/node/ui/components/Prompts/InfoTable.js +11 -7
  41. package/dist/private/node/ui/components/Prompts/InfoTable.js.map +1 -1
  42. package/dist/private/node/ui/components/Prompts/InfoTable.test.js +6 -4
  43. package/dist/private/node/ui/components/Prompts/InfoTable.test.js.map +1 -1
  44. package/dist/private/node/ui/components/Prompts/PromptLayout.d.ts +21 -0
  45. package/dist/private/node/ui/components/Prompts/PromptLayout.js +73 -0
  46. package/dist/private/node/ui/components/Prompts/PromptLayout.js.map +1 -0
  47. package/dist/private/node/ui/components/Prompts/PromptLayout.test.d.ts +1 -0
  48. package/dist/private/node/ui/components/Prompts/PromptLayout.test.js +129 -0
  49. package/dist/private/node/ui/components/Prompts/PromptLayout.test.js.map +1 -0
  50. package/dist/private/node/ui/components/Scrollbar.d.ts +10 -0
  51. package/dist/private/node/ui/components/Scrollbar.js +44 -0
  52. package/dist/private/node/ui/components/Scrollbar.js.map +1 -0
  53. package/dist/private/node/ui/components/Scrollbar.test.d.ts +1 -0
  54. package/dist/private/node/ui/components/Scrollbar.test.js +96 -0
  55. package/dist/private/node/ui/components/Scrollbar.test.js.map +1 -0
  56. package/dist/private/node/ui/components/SelectInput.d.ts +3 -6
  57. package/dist/private/node/ui/components/SelectInput.js +57 -41
  58. package/dist/private/node/ui/components/SelectInput.js.map +1 -1
  59. package/dist/private/node/ui/components/SelectInput.test.js +120 -192
  60. package/dist/private/node/ui/components/SelectInput.test.js.map +1 -1
  61. package/dist/private/node/ui/components/SelectPrompt.d.ts +7 -6
  62. package/dist/private/node/ui/components/SelectPrompt.js +11 -68
  63. package/dist/private/node/ui/components/SelectPrompt.js.map +1 -1
  64. package/dist/private/node/ui/components/SelectPrompt.test.js +135 -65
  65. package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -1
  66. package/dist/private/node/ui/components/Table/Row.js +2 -1
  67. package/dist/private/node/ui/components/Table/Row.js.map +1 -1
  68. package/dist/private/node/ui/components/Table/Table.js +2 -1
  69. package/dist/private/node/ui/components/Table/Table.js.map +1 -1
  70. package/dist/private/node/ui/components/Tasks.js +1 -8
  71. package/dist/private/node/ui/components/Tasks.js.map +1 -1
  72. package/dist/private/node/ui/components/TextInput.d.ts +1 -0
  73. package/dist/private/node/ui/components/TextInput.js +10 -4
  74. package/dist/private/node/ui/components/TextInput.js.map +1 -1
  75. package/dist/private/node/ui/components/TextInput.test.js +27 -18
  76. package/dist/private/node/ui/components/TextInput.test.js.map +1 -1
  77. package/dist/private/node/ui/components/TextPrompt.d.ts +2 -3
  78. package/dist/private/node/ui/components/TextPrompt.js +18 -16
  79. package/dist/private/node/ui/components/TextPrompt.js.map +1 -1
  80. package/dist/private/node/ui/components/TextPrompt.test.js +25 -11
  81. package/dist/private/node/ui/components/TextPrompt.test.js.map +1 -1
  82. package/dist/private/node/ui/hooks/use-prompt.d.ts +18 -0
  83. package/dist/private/node/ui/hooks/use-prompt.js +20 -0
  84. package/dist/private/node/ui/hooks/use-prompt.js.map +1 -0
  85. package/dist/private/node/ui/hooks/use-select-state.d.ts +4 -4
  86. package/dist/private/node/ui/hooks/use-select-state.js +9 -9
  87. package/dist/private/node/ui/hooks/use-select-state.js.map +1 -1
  88. package/dist/public/common/object.d.ts +16 -0
  89. package/dist/public/common/object.js +26 -0
  90. package/dist/public/common/object.js.map +1 -1
  91. package/dist/public/common/string.d.ts +16 -0
  92. package/dist/public/common/string.js +30 -0
  93. package/dist/public/common/string.js.map +1 -1
  94. package/dist/public/common/version.d.ts +1 -1
  95. package/dist/public/common/version.js +1 -1
  96. package/dist/public/common/version.js.map +1 -1
  97. package/dist/public/node/analytics.js +3 -1
  98. package/dist/public/node/analytics.js.map +1 -1
  99. package/dist/public/node/base-command.d.ts +1 -0
  100. package/dist/public/node/base-command.js +21 -1
  101. package/dist/public/node/base-command.js.map +1 -1
  102. package/dist/public/node/figures.d.ts +2 -0
  103. package/dist/public/node/figures.js +3 -0
  104. package/dist/public/node/figures.js.map +1 -0
  105. package/dist/public/node/metadata.d.ts +2 -1
  106. package/dist/public/node/metadata.js +5 -2
  107. package/dist/public/node/metadata.js.map +1 -1
  108. package/dist/public/node/monorail.d.ts +22 -1
  109. package/dist/public/node/monorail.js +1 -1
  110. package/dist/public/node/monorail.js.map +1 -1
  111. package/dist/public/node/output.d.ts +1 -1
  112. package/dist/public/node/output.js +1 -1
  113. package/dist/public/node/output.js.map +1 -1
  114. package/dist/public/node/ruby.d.ts +1 -0
  115. package/dist/public/node/ruby.js +1 -0
  116. package/dist/public/node/ruby.js.map +1 -1
  117. package/dist/public/node/system.js +2 -2
  118. package/dist/public/node/system.js.map +1 -1
  119. package/dist/public/node/themes/models/theme.d.ts +2 -1
  120. package/dist/public/node/themes/models/theme.js +2 -1
  121. package/dist/public/node/themes/models/theme.js.map +1 -1
  122. package/dist/public/node/themes/theme-urls.d.ts +1 -0
  123. package/dist/public/node/themes/theme-urls.js +4 -0
  124. package/dist/public/node/themes/theme-urls.js.map +1 -1
  125. package/dist/public/node/themes/themes-api.d.ts +9 -1
  126. package/dist/public/node/themes/themes-api.js +14 -3
  127. package/dist/public/node/themes/themes-api.js.map +1 -1
  128. package/dist/public/node/toml.d.ts +3 -2
  129. package/dist/public/node/toml.js +5 -2
  130. package/dist/public/node/toml.js.map +1 -1
  131. package/dist/public/node/ui.d.ts +82 -27
  132. package/dist/public/node/ui.js +97 -32
  133. package/dist/public/node/ui.js.map +1 -1
  134. package/dist/tsconfig.tsbuildinfo +1 -1
  135. package/package.json +14 -14
  136. package/dist/private/node/ui/components/GitDiff.js.map +0 -1
  137. package/dist/private/node/ui/components/GitDiff.test.js.map +0 -1
  138. /package/dist/private/node/ui/components/{GitDiff.test.d.ts → DangerousConfirmationPrompt.test.d.ts} +0 -0
@@ -87,14 +87,14 @@ describe('AutocompletePrompt', async () => {
87
87
  { label: 'third', value: 'third' },
88
88
  ];
89
89
  const infoTable = { Add: ['new-ext'], Remove: ['integrated-demand-ext', 'order-discount'] };
90
- const renderInstance = render(React.createElement(AutocompletePrompt, { message: "Associate your project with the org Castile Ventures?", choices: items, infoTable: infoTable, onSubmit: onEnter, search: () => Promise.resolve({
90
+ const renderInstance = render(React.createElement(AutocompletePrompt, { message: ['Associate your project with the org', { userInput: 'Castile Ventures' }, { char: '?' }], choices: items, infoTable: infoTable, onSubmit: onEnter, search: () => Promise.resolve({
91
91
  data: [],
92
92
  }) }));
93
93
  await waitForInputsToBeReady();
94
94
  await sendInputAndWaitForChange(renderInstance, ARROW_DOWN);
95
95
  await sendInputAndWaitForChange(renderInstance, ENTER);
96
96
  expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot(`
97
- "? Associate your project with the org Castile Ventures?
97
+ "? Associate your project with the org Castile Ventures?
98
98
  ✔ second
99
99
  "
100
100
  `);
@@ -102,11 +102,11 @@ describe('AutocompletePrompt', async () => {
102
102
  });
103
103
  test('renders groups', async () => {
104
104
  const items = [
105
- { label: 'first', value: 'first', group: 'Automations', key: 'f' },
106
- { label: 'second', value: 'second', group: 'Automations', key: 's' },
105
+ { label: 'first', value: 'first', group: 'Automations' },
106
+ { label: 'second', value: 'second', group: 'Automations' },
107
107
  { label: 'third', value: 'third', group: 'Merchant Admin' },
108
108
  { label: 'fourth', value: 'fourth', group: 'Merchant Admin' },
109
- { label: 'fifth', value: 'fifth', key: 'a' },
109
+ { label: 'fifth', value: 'fifth' },
110
110
  { label: 'sixth', value: 'sixth' },
111
111
  { label: 'seventh', value: 'seventh' },
112
112
  { label: 'eighth', value: 'eighth' },
@@ -117,25 +117,25 @@ describe('AutocompletePrompt', async () => {
117
117
  data: [],
118
118
  }) }));
119
119
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
120
- "? Associate your project with the org Castile Ventures?
120
+ "? Associate your project with the org Castile Ventures? Type to search...
121
121
 
122
122
  Automations
123
- > first
124
- second
123
+ > first
124
+ second
125
125
 
126
126
  Merchant Admin
127
- third
128
- fourth
127
+ third
128
+ fourth
129
129
 
130
130
  Other
131
- fifth
132
- sixth
133
- seventh
134
- eighth
135
- ninth
136
- tenth
137
-
138
- Press ↑↓ arrows to select, enter to confirm
131
+ fifth
132
+ sixth
133
+ seventh
134
+ eighth
135
+ ninth
136
+ tenth
137
+
138
+ Press ↑↓ arrows to select, enter to confirm.
139
139
  "
140
140
  `);
141
141
  });
@@ -154,17 +154,77 @@ describe('AutocompletePrompt', async () => {
154
154
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
155
155
  "? Associate your project with the org Castile Ventures?
156
156
 
157
- Add: • new-ext
157
+ ┃ \u001b[1mAdd\u001b[22m
158
+ ┃ • new-ext
159
+
160
+ ┃ \u001b[1mRemove\u001b[22m
161
+ ┃ • integrated-demand-ext
162
+ ┃ • order-discount
163
+
164
+ > first
165
+ second
166
+ third
167
+ fourth
168
+
169
+ Press ↑↓ arrows to select, enter to confirm.
170
+ "
171
+ `);
172
+ });
173
+ test('supports a git diff', async () => {
174
+ const items = [
175
+ { label: 'first', value: 'first' },
176
+ { label: 'second', value: 'second' },
177
+ { label: 'third', value: 'third' },
178
+ { label: 'fourth', value: 'fourth' },
179
+ ];
180
+ const gitDiff = {
181
+ baselineContent: 'hello\n',
182
+ updatedContent: 'world\n',
183
+ };
184
+ const renderInstance = render(React.createElement(AutocompletePrompt, { message: "Associate your project with the org Castile Ventures?", choices: items, gitDiff: gitDiff, onSubmit: () => { }, search: () => Promise.resolve({ data: [] }) }));
185
+ expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
186
+ "? Associate your project with the org Castile Ventures?
187
+
188
+ ┃ - hello
189
+ ┃ + world
190
+
191
+ > first
192
+ second
193
+ third
194
+ fourth
195
+
196
+ Press ↑↓ arrows to select, enter to confirm.
197
+ "
198
+ `);
199
+ });
200
+ test('supports an info message', async () => {
201
+ const items = [
202
+ { label: 'first', value: 'first' },
203
+ { label: 'second', value: 'second' },
204
+ { label: 'third', value: 'third' },
205
+ { label: 'fourth', value: 'fourth' },
206
+ ];
207
+ const infoMessage = {
208
+ title: {
209
+ color: 'red',
210
+ text: 'Info message title',
211
+ },
212
+ body: 'Info message body',
213
+ };
214
+ const renderInstance = render(React.createElement(AutocompletePrompt, { message: "Associate your project with the org Castile Ventures?", choices: items, infoMessage: infoMessage, onSubmit: () => { }, search: () => Promise.resolve({ data: [] }) }));
215
+ expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
216
+ "? Associate your project with the org Castile Ventures?
158
217
 
159
- Remove: integrated-demand-ext
160
- • order-discount
218
+ Info message title
219
+
220
+ ┃ Info message body
161
221
 
162
222
  > first
163
223
  second
164
224
  third
165
225
  fourth
166
226
 
167
- Press ↑↓ arrows to select, enter to confirm
227
+ Press ↑↓ arrows to select, enter to confirm.
168
228
  "
169
229
  `);
170
230
  });
@@ -182,9 +242,35 @@ describe('AutocompletePrompt', async () => {
182
242
  // prompt doesn't change when enter is pressed
183
243
  await sendInputAndWait(renderInstance, 100, ENTER);
184
244
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
185
- "? Associate your project with the org Castile Ventures? a 
245
+ "? Associate your project with the org Castile Ventures? a█
186
246
 
187
247
  No results found.
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+ Try again with a different keyword.
188
274
  "
189
275
  `);
190
276
  expect(onEnter).not.toHaveBeenCalled();
@@ -205,7 +291,7 @@ describe('AutocompletePrompt', async () => {
205
291
  await new Promise((resolve) => setTimeout(resolve, 100));
206
292
  await sendInputAndWait(renderInstance, 100, ENTER);
207
293
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
208
- "? Associate your project with the org Castile Ventures? a 
294
+ "? Associate your project with the org Castile Ventures? a█
209
295
 
210
296
  Loading...
211
297
  "
@@ -223,171 +309,144 @@ describe('AutocompletePrompt', async () => {
223
309
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
224
310
  "? Associate your project with the org Castile Ventures? Type to search...
225
311
 
226
- > first
227
- second
228
- third
229
- fourth
230
- fifth
231
- sixth
232
- seventh
233
- eighth
234
- ninth
235
- tenth
236
- eleventh
237
- twelfth
238
- thirteenth
239
- fourteenth
240
- fifteenth
241
- sixteenth
242
- seventeenth
243
- eighteenth
244
- nineteenth
245
- twentieth
246
- twenty-first
247
- twenty-second
248
- twenty-third
249
- twenty-fourth
250
- twenty-fifth
251
-
252
- Press ↑↓ arrows to select, enter to confirm
312
+ > first  
313
+ second  
314
+ third  
315
+ fourth  
316
+ fifth  
317
+ sixth  
318
+ seventh  
319
+ eighth  
320
+ ninth  
321
+ tenth  
322
+ eleventh  
323
+ twelfth  
324
+ thirteenth  
325
+ fourteenth  
326
+ fifteenth  
327
+ sixteenth  
328
+ seventeenth  
329
+ eighteenth  
330
+ nineteenth  
331
+ twentieth  
332
+ twenty-first  
333
+ twenty-second  
334
+ twenty-third  
335
+ twenty-fourth  
336
+ twenty-fifth  
337
+
338
+ Press ↑↓ arrows to select, enter to confirm.
253
339
  "
254
340
  `);
255
341
  await waitForInputsToBeReady();
256
342
  await sendInputAndWaitForContent(renderInstance, 'thirty-sixth', 'i');
257
343
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
258
- "? Associate your project with the org Castile Ventures? i 
259
-
260
- > first
261
- third
262
- fifth
263
- sixth
264
- eighth
265
- ninth
266
- thirteenth
267
- fifteenth
268
- sixteenth
269
- eighteenth
270
- nineteenth
271
- twentieth
272
- twenty-first
273
- twenty-third
274
- twenty-fifth
275
- twenty-sixth
276
- twenty-eighth
277
- twenty-ninth
278
- thirtieth
279
- thirty-first
280
- thirty-second
281
- thirty-third
282
- thirty-fourth
283
- thirty-fifth
284
- thirty-sixth
285
-
286
- Press ↑↓ arrows to select, enter to confirm
344
+ "? Associate your project with the org Castile Ventures? i█
345
+
346
+ > first  
347
+ third  
348
+ fifth  
349
+ sixth  
350
+ eighth  
351
+ ninth  
352
+ thirteenth  
353
+ fifteenth  
354
+ sixteenth  
355
+ eighteenth  
356
+ nineteenth  
357
+ twentieth  
358
+ twenty-first  
359
+ twenty-third  
360
+ twenty-fifth  
361
+ twenty-sixth  
362
+ twenty-eighth  
363
+ twenty-ninth  
364
+ thirtieth  
365
+ thirty-first  
366
+ thirty-second  
367
+ thirty-third  
368
+ thirty-fourth  
369
+ thirty-fifth  
370
+ thirty-sixth  
371
+
372
+ Press ↑↓ arrows to select, enter to confirm.
287
373
  "
288
374
  `);
289
375
  await sendInputAndWaitForChange(renderInstance, DELETE);
290
376
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
291
377
  "? Associate your project with the org Castile Ventures? Type to search...
292
378
 
293
- > first
294
- second
295
- third
296
- fourth
297
- fifth
298
- sixth
299
- seventh
300
- eighth
301
- ninth
302
- tenth
303
- eleventh
304
- twelfth
305
- thirteenth
306
- fourteenth
307
- fifteenth
308
- sixteenth
309
- seventeenth
310
- eighteenth
311
- nineteenth
312
- twentieth
313
- twenty-first
314
- twenty-second
315
- twenty-third
316
- twenty-fourth
317
- twenty-fifth
318
-
319
- Press ↑↓ arrows to select, enter to confirm
379
+ > first  
380
+ second  
381
+ third  
382
+ fourth  
383
+ fifth  
384
+ sixth  
385
+ seventh  
386
+ eighth  
387
+ ninth  
388
+ tenth  
389
+ eleventh  
390
+ twelfth  
391
+ thirteenth  
392
+ fourteenth  
393
+ fifteenth  
394
+ sixteenth  
395
+ seventeenth  
396
+ eighteenth  
397
+ nineteenth  
398
+ twentieth  
399
+ twenty-first  
400
+ twenty-second  
401
+ twenty-third  
402
+ twenty-fourth  
403
+ twenty-fifth  
404
+
405
+ Press ↑↓ arrows to select, enter to confirm.
320
406
  "
321
407
  `);
322
408
  await sendInputAndWaitForContent(renderInstance, 'thirty-sixth', 'i');
323
409
  await sendInputAndWaitForChange(renderInstance, ARROW_DOWN);
324
410
  await sendInputAndWaitForChange(renderInstance, ARROW_DOWN);
325
411
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
326
- "? Associate your project with the org Castile Ventures? i 
327
-
328
- first
329
- third
330
- > fifth
331
- sixth
332
- eighth
333
- ninth
334
- thirteenth
335
- fifteenth
336
- sixteenth
337
- eighteenth
338
- nineteenth
339
- twentieth
340
- twenty-first
341
- twenty-third
342
- twenty-fifth
343
- twenty-sixth
344
- twenty-eighth
345
- twenty-ninth
346
- thirtieth
347
- thirty-first
348
- thirty-second
349
- thirty-third
350
- thirty-fourth
351
- thirty-fifth
352
- thirty-sixth
353
-
354
- Press ↑↓ arrows to select, enter to confirm
355
- "
356
- `);
357
- await sendInputAndWaitForChange(renderInstance, ENTER);
358
- expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot(`
359
- "? Associate your project with the org Castile Ventures?
360
- ✔ fifth
361
- "
362
- `);
363
- expect(onEnter).toHaveBeenCalledWith('fifth');
364
- });
365
- test('allows selecting the first item after searching', async () => {
366
- const onEnter = vi.fn();
367
- const search = async (term) => {
368
- await new Promise((resolve) => setTimeout(resolve, 300));
369
- return {
370
- data: DATABASE.filter((item) => item.label.includes(term)),
371
- };
372
- };
373
- const renderInstance = render(React.createElement(AutocompletePrompt, { message: "Associate your project with the org Castile Ventures?", choices: DATABASE, onSubmit: onEnter, search: search }));
374
- await waitForInputsToBeReady();
375
- await sendInputAndWaitForContent(renderInstance, 'fiftieth', 'fiftieth');
376
- expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
377
- "? Associate your project with the org Castile Ventures? fiftieth 
412
+ "? Associate your project with the org Castile Ventures? i█
378
413
 
379
- > fiftieth
414
+ first  
415
+ third  
416
+ > fifth  
417
+ sixth  
418
+ eighth  
419
+ ninth  
420
+ thirteenth  
421
+ fifteenth  
422
+ sixteenth  
423
+ eighteenth  
424
+ nineteenth  
425
+ twentieth  
426
+ twenty-first  
427
+ twenty-third  
428
+ twenty-fifth  
429
+ twenty-sixth  
430
+ twenty-eighth  
431
+ twenty-ninth  
432
+ thirtieth  
433
+ thirty-first  
434
+ thirty-second  
435
+ thirty-third  
436
+ thirty-fourth  
437
+ thirty-fifth  
438
+ thirty-sixth  
380
439
 
381
- Press ↑↓ arrows to select, enter to confirm
440
+ Press ↑↓ arrows to select, enter to confirm.
382
441
  "
383
442
  `);
384
443
  await sendInputAndWaitForChange(renderInstance, ENTER);
385
444
  expect(getLastFrameAfterUnmount(renderInstance)).toMatchInlineSnapshot(`
386
445
  "? Associate your project with the org Castile Ventures?
387
- ✔ fiftieth
446
+ ✔ fifth
388
447
  "
389
448
  `);
390
- expect(onEnter).toHaveBeenCalledWith('fiftieth');
449
+ expect(onEnter).toHaveBeenCalledWith('fifth');
391
450
  });
392
451
  test('displays an error message if the search fails', async () => {
393
452
  const search = (_term) => {
@@ -397,7 +456,7 @@ describe('AutocompletePrompt', async () => {
397
456
  await waitForInputsToBeReady();
398
457
  await sendInputAndWaitForContent(renderInstance, 'There has been an error', 'i');
399
458
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
400
- "? Associate your project with the org Castile Ventures? i 
459
+ "? Associate your project with the org Castile Ventures? i█
401
460
 
402
461
  There has been an error while searching. Please try again later.
403
462
  "
@@ -413,68 +472,68 @@ describe('AutocompletePrompt', async () => {
413
472
  await waitForInputsToBeReady();
414
473
  await sendInputAndWaitForContent(renderInstance, 'thirty-sixth', 'i');
415
474
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
416
- "? Associate your project with the org Castile Ventures? i 
417
-
418
- > first
419
- third
420
- fifth
421
- sixth
422
- eighth
423
- ninth
424
- thirteenth
425
- fifteenth
426
- sixteenth
427
- eighteenth
428
- nineteenth
429
- twentieth
430
- twenty-first
431
- twenty-third
432
- twenty-fifth
433
- twenty-sixth
434
- twenty-eighth
435
- twenty-ninth
436
- thirtieth
437
- thirty-first
438
- thirty-second
439
- thirty-third
440
- thirty-fourth
441
- thirty-fifth
442
- thirty-sixth
443
-
444
- Press ↑↓ arrows to select, enter to confirm
475
+ "? Associate your project with the org Castile Ventures? i█
476
+
477
+ > first  
478
+ third  
479
+ fifth  
480
+ sixth  
481
+ eighth  
482
+ ninth  
483
+ thirteenth  
484
+ fifteenth  
485
+ sixteenth  
486
+ eighteenth  
487
+ nineteenth  
488
+ twentieth  
489
+ twenty-first  
490
+ twenty-third  
491
+ twenty-fifth  
492
+ twenty-sixth  
493
+ twenty-eighth  
494
+ twenty-ninth  
495
+ thirtieth  
496
+ thirty-first  
497
+ thirty-second  
498
+ thirty-third  
499
+ thirty-fourth  
500
+ thirty-fifth  
501
+ thirty-sixth  
502
+
503
+ Press ↑↓ arrows to select, enter to confirm.
445
504
  "
446
505
  `);
447
506
  await sendInputAndWaitForChange(renderInstance, DELETE);
448
507
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
449
508
  "? Associate your project with the org Castile Ventures? Type to search...
450
509
 
451
- > first
452
- second
453
- third
454
- fourth
455
- fifth
456
- sixth
457
- seventh
458
- eighth
459
- ninth
460
- tenth
461
- eleventh
462
- twelfth
463
- thirteenth
464
- fourteenth
465
- fifteenth
466
- sixteenth
467
- seventeenth
468
- eighteenth
469
- nineteenth
470
- twentieth
471
- twenty-first
472
- twenty-second
473
- twenty-third
474
- twenty-fourth
475
- twenty-fifth
476
-
477
- Press ↑↓ arrows to select, enter to confirm
510
+ > first  
511
+ second  
512
+ third  
513
+ fourth  
514
+ fifth  
515
+ sixth  
516
+ seventh  
517
+ eighth  
518
+ ninth  
519
+ tenth  
520
+ eleventh  
521
+ twelfth  
522
+ thirteenth  
523
+ fourteenth  
524
+ fifteenth  
525
+ sixteenth  
526
+ seventeenth  
527
+ eighteenth  
528
+ nineteenth  
529
+ twentieth  
530
+ twenty-first  
531
+ twenty-second  
532
+ twenty-third  
533
+ twenty-fourth  
534
+ twenty-fifth  
535
+
536
+ Press ↑↓ arrows to select, enter to confirm.
478
537
  "
479
538
  `);
480
539
  });
@@ -489,34 +548,34 @@ describe('AutocompletePrompt', async () => {
489
548
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
490
549
  "? Associate your project with the org Castile Ventures? Type to search...
491
550
 
492
- > first
493
- second
494
- third
495
- fourth
496
- fifth
497
- sixth
498
- seventh
499
- eighth
500
- ninth
501
- tenth
502
- eleventh
503
- twelfth
504
- thirteenth
505
- fourteenth
506
- fifteenth
507
- sixteenth
508
- seventeenth
509
- eighteenth
510
- nineteenth
511
- twentieth
512
- twenty-first
513
- twenty-second
514
- twenty-third
515
- twenty-fourth
516
- twenty-fifth
517
-
518
- 1-25 of many Find what you're looking for by typing its name.
519
- Press ↑↓ arrows to select, enter to confirm
551
+ > first  
552
+ second  
553
+ third  
554
+ fourth  
555
+ fifth  
556
+ sixth  
557
+ seventh  
558
+ eighth  
559
+ ninth  
560
+ tenth  
561
+ eleventh  
562
+ twelfth  
563
+ thirteenth  
564
+ fourteenth  
565
+ fifteenth  
566
+ sixteenth  
567
+ seventeenth  
568
+ eighteenth  
569
+ nineteenth  
570
+ twentieth  
571
+ twenty-first  
572
+ twenty-second  
573
+ twenty-third  
574
+ twenty-fourth  
575
+ twenty-fifth  
576
+
577
+ Press ↑↓ arrows to select, enter to confirm.
578
+ 1-50 of many Find what you're looking for by typing its name.
520
579
  "
521
580
  `);
522
581
  });
@@ -527,11 +586,11 @@ describe('AutocompletePrompt', async () => {
527
586
  write: () => { },
528
587
  });
529
588
  const items = [
530
- { label: 'first', value: 'first', group: 'Automations', key: 'f' },
531
- { label: 'second', value: 'second', group: 'Automations', key: 's' },
589
+ { label: 'first', value: 'first', group: 'Automations' },
590
+ { label: 'second', value: 'second', group: 'Automations' },
532
591
  { label: 'third', value: 'third', group: 'Merchant Admin' },
533
592
  { label: 'fourth', value: 'fourth', group: 'Merchant Admin' },
534
- { label: 'fifth', value: 'fifth', key: 'a' },
593
+ { label: 'fifth', value: 'fifth' },
535
594
  { label: 'sixth', value: 'sixth' },
536
595
  { label: 'seventh', value: 'seventh' },
537
596
  { label: 'eighth', value: 'eighth' },
@@ -542,15 +601,16 @@ describe('AutocompletePrompt', async () => {
542
601
  data: items,
543
602
  }) }));
544
603
  expect(renderInstance.lastFrame()).toMatchInlineSnapshot(`
545
- "? Associate your project with the org Castile Ventures?
604
+ "? Associate your project with the org Castile Ventures? Type to search...
546
605
 
547
- Automations
548
- > first
549
- second
606
+ Automations \u001b[46m \u001b[49m
607
+ > first \u001b[100m \u001b[49m
608
+ second \u001b[100m \u001b[49m
609
+ \u001b[100m \u001b[49m
610
+ Merchant Admin \u001b[100m \u001b[49m
550
611
 
612
+ Press ↑↓ arrows to select, enter to confirm.
551
613
  1-10 of many Find what you're looking for by typing its name.
552
- Showing 2 of 10 items.
553
- Press ↑↓ arrows to select, enter to confirm
554
614
  "
555
615
  `);
556
616
  });