Socket
Socket
Sign inDemoInstall

ink

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ink - npm Package Compare versions

Comparing version 3.0.8 to 3.0.9

12

build/components/App.js

@@ -119,3 +119,4 @@ "use strict";

this.setState(previousState => {
const firstFocusableId = previousState.focusables[0].id;
var _a;
const firstFocusableId = (_a = previousState.focusables[0]) === null || _a === void 0 ? void 0 : _a.id;
const nextFocusableId = this.findNextFocusable(previousState);

@@ -129,3 +130,4 @@ return {

this.setState(previousState => {
const lastFocusableId = previousState.focusables[previousState.focusables.length - 1].id;
var _a;
const lastFocusableId = (_a = previousState.focusables[previousState.focusables.length - 1]) === null || _a === void 0 ? void 0 : _a.id;
const previousFocusableId = this.findPreviousFocusable(previousState);

@@ -195,2 +197,3 @@ return {

this.findNextFocusable = (state) => {
var _a;
const activeIndex = state.focusables.findIndex(focusable => {

@@ -200,3 +203,3 @@ return focusable.id === state.activeFocusId;

for (let index = activeIndex + 1; index < state.focusables.length; index++) {
if (state.focusables[index].isActive) {
if ((_a = state.focusables[index]) === null || _a === void 0 ? void 0 : _a.isActive) {
return state.focusables[index].id;

@@ -208,2 +211,3 @@ }

this.findPreviousFocusable = (state) => {
var _a;
const activeIndex = state.focusables.findIndex(focusable => {

@@ -213,3 +217,3 @@ return focusable.id === state.activeFocusId;

for (let index = activeIndex - 1; index >= 0; index--) {
if (state.focusables[index].isActive) {
if ((_a = state.focusables[index]) === null || _a === void 0 ? void 0 : _a.isActive) {
return state.focusables[index].id;

@@ -216,0 +220,0 @@ }

import { ReactNode } from 'react';
import { Styles } from '../styles';
export interface Props<T> extends Styles {
export interface Props<T> {
/**

@@ -5,0 +5,0 @@ * Array of items of any type to render using a function you pass as a component child.

import { FC, ReactNode } from 'react';
import { ForegroundColor, BackgroundColor } from 'chalk';
import { ForegroundColor } from 'chalk';
import { Styles } from '../styles';

@@ -13,3 +13,3 @@ import { LiteralUnion } from 'type-fest';

*/
readonly backgroundColor?: LiteralUnion<typeof BackgroundColor, string>;
readonly backgroundColor?: LiteralUnion<typeof ForegroundColor, string>;
/**

@@ -16,0 +16,0 @@ * Dim the color (emit a small amount of light).

@@ -74,3 +74,3 @@ /**

* This hook is used for handling user input.
* It's a more convienient alternative to using `StdinContext` and listening to `data` events.
* It's a more convenient alternative to using `StdinContext` and listening to `data` events.
* The callback you pass to `useInput` is called for each character when user enters any input.

@@ -77,0 +77,0 @@ * However, if user pastes text and it's more than one character, the callback will be called only once and the whole string will be passed as `input`.

@@ -10,3 +10,3 @@ "use strict";

* This hook is used for handling user input.
* It's a more convienient alternative to using `StdinContext` and listening to `data` events.
* It's a more convenient alternative to using `StdinContext` and listening to `data` events.
* The callback you pass to `useInput` is called for each character when user enters any input.

@@ -13,0 +13,0 @@ * However, if user pastes text and it's more than one character, the callback will be called only once and the whole string will be passed as `input`.

@@ -7,3 +7,3 @@ "use strict";

const slice_ansi_1 = __importDefault(require("slice-ansi"));
const string_length_1 = __importDefault(require("string-length"));
const string_width_1 = __importDefault(require("string-width"));
class Output {

@@ -39,3 +39,3 @@ constructor(options) {

}
const length = string_length_1.default(line);
const width = string_width_1.default(line);
for (const transformer of transformers) {

@@ -47,3 +47,3 @@ line = transformer(line);

line +
slice_ansi_1.default(currentLine, x + length);
slice_ansi_1.default(currentLine, x + width);
offsetY++;

@@ -50,0 +50,0 @@ }

{
"name": "ink",
"version": "3.0.8",
"version": "3.0.9",
"description": "React for CLI",

@@ -58,3 +58,3 @@ "license": "MIT",

"stack-utils": "^2.0.2",
"string-length": "^3.1.0",
"string-width": "^4.2.2",
"type-fest": "^0.12.0",

@@ -61,0 +61,0 @@ "widest-line": "^3.1.0",

@@ -64,5 +64,3 @@ <h1 align="center">

- [Gatsby](https://www.gatsbyjs.org) - Gatsby is a modern web framework for blazing fast websites.
- [Parcel](https://parceljs.org) - Blazing fast, zero configuration web application bundler.
- [tap](https://node-tap.org) - A Test-Anything-Protocol library for JavaScript.
- [Yarn 2](https://yarnpkg.com) - Fast, reliable, and secure dependency management for JavaScript.
- [Terraform CDK](https://github.com/hashicorp/terraform-cdk) - CDK (Cloud Development Kit) for HashiCorp Terraform.

@@ -93,2 +91,5 @@ - [Twilio's SIGNAL](https://github.com/twilio-labs/plugin-signal2020) - CLI for Twilio's SIGNAL conference. [Blog post](https://www.twilio.com/blog/building-conference-cli-in-react).

- [gitgud](https://github.com/GitGud-org/GitGud) - An interactive command-line GUI for Git.
- [Autarky](https://github.com/pranshuchittora/autarky) - An interactive CLI to find and delete old `node_modules` directories in order to free up disk space.
- [fast-cli](https://github.com/sindresorhus/fast-cli) - Test your download and upload speed.
- [tasuku](https://github.com/privatenumber/tasuku) - Minimal task runner.

@@ -354,7 +355,7 @@ ## Contents

const Example = () => {
const Example = () => (
<Box margin={2}>
<Text>This is a box with margin</Text>
</Box>;
};
);

@@ -1087,3 +1088,3 @@ render(<Example />);

This hook is used for handling user input.
It's a more convienient alternative to using `useStdin` and listening to `data` events.
It's a more convenient alternative to using `useStdin` and listening to `data` events.
The callback you pass to `useInput` is called for each character when user enters any input.

@@ -1754,2 +1755,5 @@ However, if user pastes text and it's more than one character, the callback will be called only once and the whole string will be passed as `input`.

- [ink-confirm-input](https://github.com/kevva/ink-confirm-input) - Yes/No confirmation input.
- [ink-syntax-highlight](https://github.com/vsashyn/ink-syntax-highlight) - Code syntax highlighting.
- [ink-form](https://github.com/lukasbach/ink-form) - Form component.
- [ink-task-list](https://github.com/privatenumber/ink-task-list) - Task list component.

@@ -1773,2 +1777,3 @@ ## Useful Hooks

- [Static](examples/static/static.js) - Use `<Static>` to render permanent output.
- [Child process](examples/subprocess-output) - Render output from a child process.

@@ -1775,0 +1780,0 @@ ## Maintainers

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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