Releases: bombshell-dev/clack
@clack/[email protected]
Patch Changes
- 8093f3c: Adds
Errorsupport to thevalidatefunction - e5ba09a: Fixes a cursor display bug in terminals that do not support the "hidden" escape sequence. See Issue #127.
- 8cba8e3: Fixes a rendering bug with cursor positions for
TextPrompt
@clack/[email protected]
Minor Changes
-
a83d2f8: Adds a new
updateSettings()function to support new global keybindings.updateSettings()accepts analiasesobject that maps custom keys to an action (up | down | left | right | space | enter | cancel).import { updateSettings } from "@clack/prompts"; // Support custom keybindings updateSettings({ aliases: { w: "up", a: "left", s: "down", d: "right", }, });
Warning
In order to enforce consistent, user-friendly defaults across the ecosystem, updateSettings does not support disabling Clack's default keybindings.
-
801246b: Adds a new
signaloption to support programmatic prompt cancellation with an abort controller.One example use case is automatically cancelling a prompt after a timeout.
const shouldContinue = await confirm({ message: "This message will self destruct in 5 seconds", signal: AbortSignal.timeout(5000), });
Another use case is racing a long running task with a manual prompt.
const abortController = new AbortController(); const projectType = await Promise.race([ detectProjectType({ signal: abortController.signal, }), select({ message: "Pick a project type.", options: [ { value: "ts", label: "TypeScript" }, { value: "js", label: "JavaScript" }, { value: "coffee", label: "CoffeeScript", hint: "oh no" }, ], signal: abortController.signal, }), ]); abortController.abort();
-
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escapekey to cancel (ctrl+c).alias action kup lright jdown hleft esccancel
Patch Changes
@clack/[email protected]
Minor Changes
-
a83d2f8: Adds a new
updateSettings()function to support new global keybindings.updateSettings()accepts analiasesobject that maps custom keys to an action (up | down | left | right | space | enter | cancel).import { updateSettings } from "@clack/core"; // Support custom keybindings updateSettings({ aliases: { w: "up", a: "left", s: "down", d: "right", }, });
Warning
In order to enforce consistent, user-friendly defaults across the ecosystem, updateSettings does not support disabling Clack's default keybindings.
-
801246b: Adds a new
signaloption to support programmatic prompt cancellation with an abort controller. -
a83d2f8: Updates default keybindings to support Vim motion shortcuts and map the
escapekey to cancel (ctrl+c).alias action kup lright jdown hleft esccancel
Patch Changes
- 51e12bc: Improves types for events and interaction states.
@clack/[email protected]
Patch Changes
- Updated dependencies [4845f4f]
- Updated dependencies [d7b2fb9]
- @clack/[email protected]
@clack/[email protected]
Patch Changes
- 360afeb: feat: adaptative max items
@clack/[email protected]
Minor Changes
- b27a701: add maxItems option to select prompt
- 89371be: added a new method called
spinner.message(msg: string)
Patch Changes
- 52183c4: Fix
spinnerconflict with terminal on error betweenspinner.start()andspinner.stop() - ab51d29: Fixes cases where the note title length was miscalculated due to ansi characters
- Updated dependencies [cd79076]
- @clack/[email protected]
@clack/[email protected]
Patch Changes
- c96eda5: Enable hard line-wrapping behavior for long words without spaces
- Updated dependencies [c96eda5]
- @clack/[email protected]
@clack/[email protected]
Patch Changes
- 58a1df1: Fix line duplication bug by automatically wrapping prompts to
process.stdout.columns - Updated dependencies [58a1df1]
- @clack/[email protected]
@clack/[email protected]
Patch Changes
- ca08fb6: Support complex value types for
select,multiselectandgroupMultiselect.
@clack/[email protected]
Minor Changes
- 8a4a12f: add
groupMultiselectprompt - 165a1b3: Add
logAPIs. Supportslog.info,log.success,log.warn, andlog.error. For low-level control,log.messageis also exposed.
Patch Changes
- Updated dependencies [8a4a12f]
- Updated dependencies [8a4a12f]
- @clack/[email protected]