🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@farjs/ui

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farjs/ui - npm Package Compare versions

Comparing version
0.7.2
to
0.8.0
+3
-3
package.json
{
"name": "@farjs/ui",
"author": "viktor-podzigun",
"version": "0.7.2",
"version": "0.8.0",
"license": "MIT",

@@ -44,3 +44,3 @@ "description": "Terminal UI React.js components library",

"dependencies": {
"@farjs/blessed": "0.3.2",
"@farjs/blessed": "0.4.0",
"react": "^17.0.1",

@@ -60,4 +60,4 @@ "react-blessed": "0.7.2"

"react-test-renderer": "^17.0.1",
"typescript": "^4.9.5"
"typescript": "^5.7.3"
}
}

@@ -16,3 +16,3 @@ import React from "react";

* readonly top: number;
* readonly actions: ButtonsPanelAction[];
* readonly actions: readonly ButtonsPanelAction[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -19,0 +19,0 @@ * readonly padding?: number;

@@ -21,3 +21,3 @@ /**

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly value: string;

@@ -24,0 +24,0 @@ * onChange(value: string): void;

@@ -16,3 +16,3 @@ /**

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -19,0 +19,0 @@ * readonly viewport: ListViewport;

@@ -18,3 +18,3 @@ /**

* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;
* readonly items: string[];
* readonly items: readonly string[];
* readonly selected: number;

@@ -21,0 +21,0 @@ * onAction(index: number): void;

@@ -19,3 +19,3 @@ /**

* readonly height: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly style: BlessedStyle;

@@ -30,6 +30,6 @@ * readonly viewport: ListViewport;

* @param {number} selected
* @param {string[]} items
* @param {readonly string[]} items
* @param {number} width
* @param {BlessedStyle} theme
* @returns {string[]}
* @returns {readonly string[]}
*/

@@ -36,0 +36,0 @@ function renderItems(selected, items, width, theme) {

@@ -9,3 +9,3 @@ import React from "react";

* @typedef {{
* readonly items: string[];
* readonly items: readonly string[];
* }} BottomMenuProps

@@ -12,0 +12,0 @@ */

@@ -9,3 +9,3 @@ import React from "react";

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* }} BottomMenuViewProps

@@ -33,3 +33,3 @@ */

const itemWidth = Math.trunc(width / itemsCount);
/** @type {BottomMenuViewItem[]} */
/** @type {readonly BottomMenuViewItem[]} */
const itemsWithPos = items.map((item, index) => {

@@ -36,0 +36,0 @@ const leftPos = index * itemWidth;

@@ -15,3 +15,3 @@ /**

* readonly label: string;
* readonly subItems: string[];
* readonly subItems: readonly string[];
* }} MenuBarItem

@@ -22,3 +22,3 @@ */

* @typedef {{
* readonly items: MenuBarItem[];
* readonly items: readonly MenuBarItem[];
* onAction(menuIndex: number, subIndex: number): void;

@@ -50,3 +50,3 @@ * onClose(): void;

}, 0);
/** @type {ButtonsPanelAction[]} */
/** @type {readonly ButtonsPanelAction[]} */
const actions = props.items.map((item, index) => {

@@ -53,0 +53,0 @@ return {

@@ -15,3 +15,3 @@ import React from "react";

* readonly title: string;
* readonly items: string[];
* readonly items: readonly string[];
* getLeft(width: number): string;

@@ -18,0 +18,0 @@ * onSelect(index: number): void;

@@ -13,3 +13,3 @@ import React from "react";

* readonly selected: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly top: number;

@@ -16,0 +16,0 @@ * readonly left: number;

@@ -17,3 +17,3 @@ /**

* readonly title: string;
* readonly items: string[];
* readonly items: readonly string[];
* onAction(index: number): void;

@@ -20,0 +20,0 @@ * onClose(): void;

@@ -19,3 +19,3 @@ /**

* readonly message: string;
* readonly actions: MessageBoxAction[];
* readonly actions: readonly MessageBoxAction[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -38,3 +38,3 @@ * }} MessageBoxProps

/** @type {ButtonsPanelAction[]} */
/** @type {readonly ButtonsPanelAction[]} */
const actions = props.actions.map((action) => {

@@ -41,0 +41,0 @@ return {

@@ -38,3 +38,3 @@ /**

const [portals, setPortals] = useState(
/** @type {Array<PortalItem>} */ ([])
/** @type {readonly PortalItem[]} */ ([])
);

@@ -41,0 +41,0 @@

@@ -39,3 +39,5 @@ import React, { useState, useLayoutEffect } from "react";

const [errors, updateErrors] = useState(/** @type {string[]} */ ([]));
const [errors, updateErrors] = useState(
/** @type {readonly string[]} */ ([])
);
const statusMessage = (props.showLoading ? props.status : undefined) ?? "";

@@ -42,0 +44,0 @@ const errorMessage = (props.error ?? "").trim();

@@ -85,3 +85,3 @@ /**

* @param {number} [dx]
* @returns {number[]}
* @returns {readonly number[]}
*/

@@ -95,3 +95,3 @@ function moveLeft(dx) {

* @param {number} [dx]
* @returns {number[]}
* @returns {readonly number[]}
*/

@@ -98,0 +98,0 @@ //prettier-ignore

@@ -36,3 +36,3 @@ import Blessed from "@farjs/blessed";

* @param {number} maxLen
* @returns {string[]}
* @returns {readonly string[]}
*/

@@ -39,0 +39,0 @@ export function splitText(text, maxLen) {

@@ -39,3 +39,3 @@ export default AppRoot;

declare namespace AppRoot {
export const displayName: string;
export let displayName: string;
export { TaskManager as taskControllerComp };

@@ -46,6 +46,4 @@ export { LogController as logControllerComp };

import React from "react";
import Theme from "../theme/Theme.mjs";
import DevTool from "../tool/DevTool.mjs";
import TaskManager from "../task/TaskManager.mjs";
import LogController from "../tool/LogController.mjs";
import DevToolPanel from "../tool/DevToolPanel.mjs";

@@ -27,3 +27,3 @@ export default DoubleBorder;

declare namespace DoubleBorder {
export const displayName: string;
export let displayName: string;
export { HorizontalLine as horizontalLineComp };

@@ -30,0 +30,0 @@ export { VerticalLine as verticalLineComp };

@@ -34,4 +34,4 @@ export default HorizontalLine;

declare namespace HorizontalLine {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -19,3 +19,3 @@ export default SingleBorder;

declare namespace SingleBorder {
export const displayName: string;
export let displayName: string;
export { HorizontalLine as horizontalLineComp };

@@ -22,0 +22,0 @@ export { VerticalLine as verticalLineComp };

@@ -34,4 +34,4 @@ export default VerticalLine;

declare namespace VerticalLine {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -35,4 +35,4 @@ export default Button;

declare namespace Button {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -8,3 +8,3 @@ export default ButtonsPanel;

readonly top: number;
readonly actions: ButtonsPanelAction[];
readonly actions: readonly ButtonsPanelAction[];
readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -23,3 +23,3 @@ readonly padding?: number;

* readonly top: number;
* readonly actions: ButtonsPanelAction[];
* readonly actions: readonly ButtonsPanelAction[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -41,3 +41,3 @@ * readonly padding?: number;

declare namespace ButtonsPanel {
export const displayName: string;
export let displayName: string;
export { Button as buttonComp };

@@ -44,0 +44,0 @@ }

@@ -25,3 +25,3 @@ export default CheckBox;

declare namespace CheckBox {
export const displayName: string;
export let displayName: string;
export { Button as buttonComp };

@@ -28,0 +28,0 @@ }

@@ -10,3 +10,3 @@ export default ComboBox;

readonly width: number;
readonly items: string[];
readonly items: readonly string[];
readonly value: string;

@@ -21,3 +21,3 @@ onChange(value: string): void;

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly value: string;

@@ -33,6 +33,6 @@ * onChange(value: string): void;

declare namespace ComboBox {
export const displayName: string;
export let displayName: string;
export { TextInput as textInputComp };
export { ComboBoxPopup as comboBoxPopup };
export const arrowDownCh: string;
export let arrowDownCh: string;
}

@@ -39,0 +39,0 @@ import React from "react";

@@ -7,3 +7,3 @@ export default ComboBoxPopup;

readonly width: number;
readonly items: string[];
readonly items: readonly string[];
readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -19,3 +19,3 @@ readonly viewport: ListViewport;

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -42,7 +42,7 @@ * readonly viewport: ListViewport;

declare namespace ComboBoxPopup {
export const displayName: string;
export let displayName: string;
export { SingleBorder as singleBorderComp };
export { ListView as listViewComp };
export { ScrollBar as scrollBarComp };
export const maxItems: number;
export let maxItems: number;
}

@@ -49,0 +49,0 @@ import React from "react";

@@ -9,3 +9,3 @@ export default ListBox;

readonly style: import("@farjs/blessed").Widgets.Types.TStyle;
readonly items: string[];
readonly items: readonly string[];
readonly selected: number;

@@ -22,3 +22,3 @@ onAction(index: number): void;

* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;
* readonly items: string[];
* readonly items: readonly string[];
* readonly selected: number;

@@ -40,3 +40,3 @@ * onAction(index: number): void;

declare namespace ListBox {
export const displayName: string;
export let displayName: string;
export { ListView as listViewComp };

@@ -43,0 +43,0 @@ export { ScrollBar as scrollBarComp };

@@ -7,3 +7,3 @@ export default ListView;

readonly height: number;
readonly items: string[];
readonly items: readonly string[];
readonly style: BlessedStyle;

@@ -39,4 +39,4 @@ readonly viewport: ListViewport;

declare namespace ListView {
const displayName: string;
let displayName: string;
}
import React from "react";
export default BottomMenu;
export type BottomMenuProps = {
readonly items: string[];
readonly items: readonly string[];
};
/**
* @typedef {{
* readonly items: string[];
* readonly items: readonly string[];
* }} BottomMenuProps

@@ -13,5 +13,10 @@ */

*/
declare function BottomMenu(props: BottomMenuProps): React.FunctionComponentElement<import("../WithSize.mjs").WithSizeProps>;
declare function BottomMenu(props: BottomMenuProps): React.FunctionComponentElement<{
render: (width: number) => React.FunctionComponentElement<{
width: number;
items: readonly string[];
}>;
}>;
declare namespace BottomMenu {
export const displayName: string;
export let displayName: string;
export { WithSize as withSizeComp };

@@ -18,0 +23,0 @@ export { BottomMenuView as bottomMenuViewComp };

export default BottomMenuView;
export type BottomMenuViewProps = {
readonly width: number;
readonly items: string[];
readonly items: readonly string[];
};

@@ -15,3 +15,3 @@ export type BottomMenuViewItem = {

* readonly width: number;
* readonly items: string[];
* readonly items: readonly string[];
* }} BottomMenuViewProps

@@ -32,4 +32,4 @@ */

declare namespace BottomMenuView {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -5,6 +5,6 @@ export default MenuBar;

readonly label: string;
readonly subItems: string[];
readonly subItems: readonly string[];
};
export type MenuBarProps = {
readonly items: MenuBarItem[];
readonly items: readonly MenuBarItem[];
onAction(menuIndex: number, subIndex: number): void;

@@ -20,3 +20,3 @@ onClose(): void;

* readonly label: string;
* readonly subItems: string[];
* readonly subItems: readonly string[];
* }} MenuBarItem

@@ -26,3 +26,3 @@ */

* @typedef {{
* readonly items: MenuBarItem[];
* readonly items: readonly MenuBarItem[];
* onAction(menuIndex: number, subIndex: number): void;

@@ -43,3 +43,3 @@ * onClose(): void;

declare namespace MenuBar {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -46,0 +46,0 @@ export { ButtonsPanel as buttonsPanel };

@@ -7,4 +7,4 @@ export default MenuBarTrigger;

declare namespace MenuBarTrigger {
const displayName: string;
let displayName: string;
}
import React from "react";
export default MenuPopup;
export type MenuPopupProps = {
readonly title: string;
readonly items: string[];
readonly items: readonly string[];
getLeft(width: number): string;

@@ -12,3 +12,3 @@ onSelect(index: number): void;

* readonly title: string;
* readonly items: string[];
* readonly items: readonly string[];
* getLeft(width: number): string;

@@ -24,3 +24,3 @@ * onSelect(index: number): void;

declare namespace MenuPopup {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -27,0 +27,0 @@ export { ModalContent as modalContentComp };

export default SubMenu;
export type SubMenuProps = {
readonly selected: number;
readonly items: string[];
readonly items: readonly string[];
readonly top: number;

@@ -12,3 +12,3 @@ readonly left: number;

* readonly selected: number;
* readonly items: string[];
* readonly items: readonly string[];
* readonly top: number;

@@ -33,6 +33,6 @@ * readonly left: number;

declare namespace SubMenu {
export const displayName: string;
export let displayName: string;
export { DoubleBorder as doubleBorderComp };
export { HorizontalLine as horizontalLineComp };
export const separator: string;
export let separator: string;
}

@@ -39,0 +39,0 @@ import React from "react";

@@ -5,12 +5,12 @@ export default ListPopup;

readonly title: string;
readonly items: string[];
readonly items: readonly string[];
onAction(index: number): void;
onClose(): void;
readonly selected?: number | undefined;
readonly selected?: number;
onSelect?(index: number): void;
onKeypress?(keyFull: string): boolean;
readonly footer?: string | undefined;
readonly textPaddingLeft?: number | undefined;
readonly textPaddingRight?: number | undefined;
readonly itemWrapPrefixLen?: number | undefined;
readonly footer?: string;
readonly textPaddingLeft?: number;
readonly textPaddingRight?: number;
readonly itemWrapPrefixLen?: number;
};

@@ -20,3 +20,3 @@ /**

* readonly title: string;
* readonly items: string[];
* readonly items: readonly string[];
* onAction(index: number): void;

@@ -38,3 +38,3 @@ * onClose(): void;

declare namespace ListPopup {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -44,5 +44,5 @@ export { ModalContent as modalContentComp };

export { ListBox as listBoxComp };
export const paddingHorizontal: number;
export const paddingVertical: number;
export const padding: BlessedPadding;
export let paddingHorizontal: number;
export let paddingVertical: number;
export let padding: BlessedPadding;
}

@@ -49,0 +49,0 @@ import React from "react";

@@ -7,3 +7,3 @@ export default MessageBox;

readonly message: string;
readonly actions: MessageBoxAction[];
readonly actions: readonly MessageBoxAction[];
readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -15,3 +15,3 @@ };

* readonly message: string;
* readonly actions: MessageBoxAction[];
* readonly actions: readonly MessageBoxAction[];
* readonly style: import("@farjs/blessed").Widgets.Types.TStyle;

@@ -25,3 +25,3 @@ * }} MessageBoxProps

declare namespace MessageBox {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -28,0 +28,0 @@ export { ModalContent as modalContentComp };

@@ -8,5 +8,5 @@ export default MessageBoxAction;

declare namespace MessageBoxAction {
function OK(onAction: () => void): MessageBoxAction;
function YES(onAction: () => void): MessageBoxAction;
function NO(onAction: () => void): MessageBoxAction;
let OK: (onAction: () => void) => MessageBoxAction;
let YES: (onAction: () => void) => MessageBoxAction;
let NO: (onAction: () => void) => MessageBoxAction;
}

@@ -23,3 +23,3 @@ export default Modal;

declare namespace Modal {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -26,0 +26,0 @@ export { ModalContent as modalContentComp };

@@ -51,9 +51,9 @@ export default ModalContent;

declare namespace ModalContent {
export const displayName: string;
export let displayName: string;
export { DoubleBorder as doubleBorderComp };
export const paddingHorizontal: number;
export const paddingVertical: number;
export const padding: BlessedPadding;
export let paddingHorizontal: number;
export let paddingVertical: number;
export let padding: BlessedPadding;
}
import React from "react";
import DoubleBorder from "../border/DoubleBorder.mjs";
export default Popup;
export type PopupProps = {
readonly focusable?: boolean | undefined;
readonly focusable?: boolean;
onClose?(): void;

@@ -21,3 +21,3 @@ onOpen?(): void;

declare namespace Popup {
export const displayName: string;
export let displayName: string;
export { Portal as portalComp };

@@ -24,0 +24,0 @@ export { PopupOverlay as popupOverlayComp };

@@ -17,5 +17,5 @@ export default PopupOverlay;

declare namespace PopupOverlay {
const displayName: string;
const style: import("@farjs/blessed").Widgets.Types.TStyle;
let displayName: string;
let style: import("@farjs/blessed").Widgets.Types.TStyle;
}
import React from "react";

@@ -19,3 +19,3 @@ export default StatusPopup;

declare namespace StatusPopup {
export const displayName: string;
export let displayName: string;
export { Popup as popupComp };

@@ -22,0 +22,0 @@ export { ModalContent as modalContentComp };

@@ -13,6 +13,6 @@ export default Portal;

declare namespace Portal {
const displayName: string;
const Context: React.Context<PortalContext>;
const _nextPortalId: number;
let displayName: string;
let Context: React.Context<PortalContext>;
let _nextPortalId: number;
}
import React from "react";

@@ -15,7 +15,5 @@ export default WithPortals;

declare namespace WithPortals {
const Context: React.Context<WithPortalsContext | null>;
function create(screen: import("blessed").Widgets.Screen): {
(props: {
children?: React.ReactNode;
}): React.FunctionComponentElement<{}>;
let Context: React.Context<WithPortalsContext | null>;
function create(screen: BlessedScreen): {
(props: React.PropsWithChildren<{}>): React.FunctionComponentElement<{}>;
displayName: string;

@@ -22,0 +20,0 @@ };

@@ -30,6 +30,6 @@ export default ProgressBar;

declare namespace ProgressBar {
const displayName: string;
const filledCh: string;
const dottedCh: string;
let displayName: string;
let filledCh: string;
let dottedCh: string;
}
import React from "react";

@@ -31,8 +31,8 @@ export default ScrollBar;

declare namespace ScrollBar {
const displayName: string;
const markerCh: string;
const scrollCh: string;
const upArrowCh: string;
const downArrowCh: string;
let displayName: string;
let markerCh: string;
let scrollCh: string;
let upArrowCh: string;
let downArrowCh: string;
}
import React from "react";

@@ -38,3 +38,3 @@ export default TaskManager;

declare namespace TaskManager {
export const displayName: string;
export let displayName: string;
export { TaskManagerUi as uiComponent };

@@ -41,0 +41,0 @@ export function errorHandler(error: any): TaskError;

@@ -15,3 +15,3 @@ export default TaskManagerUi;

declare namespace TaskManagerUi {
export const displayName: string;
export let displayName: string;
export { StatusPopup as statusPopupComp };

@@ -18,0 +18,0 @@ export { MessageBox as messageBoxComp };

@@ -25,5 +25,15 @@ export default TextBox;

*/
declare function TextBox(props: TextBoxProps): React.FunctionComponentElement<import("./TextInput.mjs").TextInputProps>;
declare function TextBox(props: TextBoxProps): React.FunctionComponentElement<{
inputRef: React.MutableRefObject<import("blessed").Widgets.BlessedElement>;
left: number;
top: number;
width: number;
value: string;
state: import("./TextInput.mjs").TextInputState;
stateUpdater: React.Dispatch<React.SetStateAction<import("./TextInput.mjs").TextInputState>>;
onChange: (value: string) => void;
onEnter: (() => void) | undefined;
}>;
declare namespace TextBox {
export const displayName: string;
export let displayName: string;
export { TextInput as textInputComp };

@@ -30,0 +40,0 @@ }

@@ -75,3 +75,3 @@ export default TextInput;

declare namespace TextInput {
const displayName: string;
let displayName: string;
/**

@@ -78,0 +78,0 @@ * @returns {TextInputState}

@@ -36,3 +36,3 @@ export default TextLine;

declare namespace TextLine {
const displayName: string;
let displayName: string;
/**

@@ -39,0 +39,0 @@ * @param {string} text

@@ -29,5 +29,5 @@ export default Theme;

declare namespace Theme {
const Context: React.Context<Theme | null>;
let Context: React.Context<Theme | null>;
function useTheme(): Theme;
}
import React from "react";

@@ -12,4 +12,4 @@ export default ColorPanel;

declare namespace ColorPanel {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -12,3 +12,3 @@ export default DevToolPanel;

declare namespace DevToolPanel {
export const displayName: string;
export let displayName: string;
export { LogPanel as logPanelComp };

@@ -15,0 +15,0 @@ export { InputController as inputController };

@@ -6,7 +6,7 @@ export default InputController;

declare namespace InputController {
export const displayName: string;
export let displayName: string;
export { LogPanel as logPanelComp };
export const maxBufferLength: number;
export let maxBufferLength: number;
}
import React from "react";
import LogPanel from "./LogPanel.mjs";

@@ -17,4 +17,4 @@ export default LogController;

declare namespace LogController {
const displayName: string;
const maxBufferLength: number;
let displayName: string;
let maxBufferLength: number;
}

@@ -18,4 +18,4 @@ export default LogPanel;

declare namespace LogPanel {
const displayName: string;
let displayName: string;
}
import React from "react";

@@ -18,4 +18,4 @@ /**

* @param {number} maxLen
* @returns {string[]}
* @returns {readonly string[]}
*/
export function splitText(text: string, maxLen: number): string[];
export function splitText(text: string, maxLen: number): readonly string[];

@@ -20,4 +20,4 @@ export default WithSize;

declare namespace WithSize {
const displayName: string;
let displayName: string;
}
import React from "react";