Socket
Socket
Sign inDemoInstall

@inquirer/checkbox

Package Overview
Dependencies
Maintainers
3
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inquirer/checkbox - npm Package Compare versions

Comparing version 2.2.3 to 2.3.0

25

./dist/cjs/index.js

@@ -31,2 +31,3 @@ "use strict";

},
helpMode: 'auto',
};

@@ -51,2 +52,3 @@ function isSelectable(item) {

const prefix = (0, core_1.usePrefix)({ theme });
const firstRender = (0, core_1.useRef)(true);
const [status, setStatus] = (0, core_1.useState)('pending');

@@ -134,3 +136,2 @@ const [items, setItems] = (0, core_1.useState)(choices.map((choice) => (Object.assign({}, choice))));

loop,
theme,
});

@@ -142,6 +143,10 @@ if (status === 'done') {

}
let helpTip = '';
if (showHelpTip && (instructions === undefined || instructions)) {
let helpTipTop = '';
let helpTipBottom = '';
if (theme.helpMode === 'always' ||
(theme.helpMode === 'auto' &&
showHelpTip &&
(instructions === undefined || instructions))) {
if (typeof instructions === 'string') {
helpTip = instructions;
helpTipTop = instructions;
}

@@ -155,10 +160,16 @@ else {

];
helpTip = ` (Press ${keys.join(', ')})`;
helpTipTop = ` (Press ${keys.join(', ')})`;
}
if (items.length > pageSize &&
(theme.helpMode === 'always' ||
(theme.helpMode === 'auto' && firstRender.current))) {
helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`;
firstRender.current = false;
}
}
let error = '';
if (errorMsg) {
error = theme.style.error(errorMsg);
error = `\n${theme.style.error(errorMsg)}`;
}
return `${prefix} ${message}${helpTip}\n${page}\n${error}${ansi_escapes_1.default.cursorHide}`;
return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${error}${ansi_escapes_1.default.cursorHide}`;
});

@@ -31,2 +31,3 @@ "use strict";

},
helpMode: 'auto',
};

@@ -51,2 +52,3 @@ function isSelectable(item) {

const prefix = (0, core_1.usePrefix)({ theme });
const firstRender = (0, core_1.useRef)(true);
const [status, setStatus] = (0, core_1.useState)('pending');

@@ -134,3 +136,2 @@ const [items, setItems] = (0, core_1.useState)(choices.map((choice) => (Object.assign({}, choice))));

loop,
theme,
});

@@ -142,6 +143,10 @@ if (status === 'done') {

}
let helpTip = '';
if (showHelpTip && (instructions === undefined || instructions)) {
let helpTipTop = '';
let helpTipBottom = '';
if (theme.helpMode === 'always' ||
(theme.helpMode === 'auto' &&
showHelpTip &&
(instructions === undefined || instructions))) {
if (typeof instructions === 'string') {
helpTip = instructions;
helpTipTop = instructions;
}

@@ -155,10 +160,16 @@ else {

];
helpTip = ` (Press ${keys.join(', ')})`;
helpTipTop = ` (Press ${keys.join(', ')})`;
}
if (items.length > pageSize &&
(theme.helpMode === 'always' ||
(theme.helpMode === 'auto' && firstRender.current))) {
helpTipBottom = `\n${theme.style.help('(Use arrow keys to reveal more choices)')}`;
firstRender.current = false;
}
}
let error = '';
if (errorMsg) {
error = theme.style.error(errorMsg);
error = `\n${theme.style.error(errorMsg)}`;
}
return `${prefix} ${message}${helpTip}\n${page}\n${error}${ansi_escapes_1.default.cursorHide}`;
return `${prefix} ${message}${helpTipTop}\n${page}${helpTipBottom}${error}${ansi_escapes_1.default.cursorHide}`;
});

@@ -36,2 +36,3 @@ import { Separator } from '@inquirer/core';

} | undefined;
helpMode?: "always" | "auto" | "never" | undefined;
prefix?: string | undefined;

@@ -38,0 +39,0 @@ spinner?: {

{
"name": "@inquirer/checkbox",
"version": "2.2.3",
"version": "2.3.0",
"engines": {

@@ -60,5 +60,5 @@ "node": ">=18"

"dependencies": {
"@inquirer/core": "^7.1.3",
"@inquirer/core": "^8.0.0",
"@inquirer/figures": "^1.0.0",
"@inquirer/type": "^1.2.2",
"@inquirer/type": "^1.3.0",
"ansi-escapes": "^4.3.2",

@@ -68,3 +68,3 @@ "chalk": "^4.1.2"

"devDependencies": {
"@inquirer/testing": "^2.1.16"
"@inquirer/testing": "^2.1.17"
},

@@ -92,3 +92,3 @@ "scripts": {

},
"gitHead": "6bfbdfc457ab6d99b9d80c106b5edad285c8b9ba"
"gitHead": "bb5b6b857d227b0fe8fd55951784f03800cdf73c"
}

@@ -80,5 +80,12 @@ # `@inquirer/checkbox`

};
helpMode: 'always' | 'never' | 'auto';
};
```
### `theme.helpMode`
- `auto` (default): Hide the help tips after an interaction occurs. The scroll tip will hide after any interactions, the selection tip will hide as soon as a first selection is done.
- `always`: The help tips will always show and never hide.
- `never`: The help tips will never show.
# License

@@ -85,0 +92,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc