New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lightningtv/core

Package Overview
Dependencies
Maintainers
0
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightningtv/core - npm Package Compare versions

Comparing version 1.3.10 to 1.4.0-rc1

20

dist/src/elementNode.js

@@ -126,2 +126,3 @@ import { renderer, createShader } from './lightningInit.js';

insertChild(node, beforeNode) {
node.parent = this;
if (beforeNode) {

@@ -132,8 +133,8 @@ // SolidJS can move nodes around in the children array.

const index = this.children.indexOf(beforeNode);
this.children.splice(index, 0, node);
if (index >= 0) {
this.children.splice(index, 0, node);
return;
}
}
else {
this.children.push(node);
}
node.parent = this;
this.children.push(node);
}

@@ -234,4 +235,5 @@ removeChild(node) {

const focusedIndex = typeof this.forwardFocus === 'number' ? this.forwardFocus : null;
if (focusedIndex !== null && focusedIndex < this.children.length) {
const child = this.children[focusedIndex];
const nodes = this.children;
if (focusedIndex !== null && focusedIndex < nodes.length) {
const child = nodes[focusedIndex];
isElementNode(child) && child.setFocus();

@@ -320,3 +322,5 @@ return;

set states(states) {
this._states = new States(this._stateChanged.bind(this), states);
this._states = this._states
? this._states.merge(states)
: new States(this._stateChanged.bind(this), states);
if (this.rendered) {

@@ -323,0 +327,0 @@ this._stateChanged();

1

dist/src/states.d.ts

@@ -9,3 +9,4 @@ export type NodeStates = string[] | string | Record<string, boolean | undefined>;

toggle(state: string, force?: boolean): void;
merge(newStates: NodeStates): this;
remove(state: string): void;
}

@@ -34,10 +34,6 @@ import { isArray, isString } from './utils.js';

if (force === true) {
if (!this.has(state)) {
this.add(state);
}
this.add(state);
}
else if (force === false) {
if (this.has(state)) {
this.remove(state);
}
this.remove(state);
}

@@ -53,2 +49,18 @@ else {

}
merge(newStates) {
if (isArray(newStates)) {
this.length = 0; // Clear the current states
this.push(...newStates);
}
else if (isString(newStates)) {
this.length = 0; // Clear the current states
this.push(newStates);
}
else {
for (const state in newStates) {
this.toggle(state, newStates[state]);
}
}
return this;
}
remove(state) {

@@ -55,0 +67,0 @@ const stateIndexToRemove = this.indexOf(state);

{
"name": "@lightningtv/core",
"version": "1.3.10",
"version": "1.4.0-rc1",
"description": "Lightning TV Core for Universal Renderers",

@@ -5,0 +5,0 @@ "type": "module",

@@ -236,2 +236,3 @@ import { renderer, createShader } from './lightningInit.js';

) {
node.parent = this;
if (beforeNode) {

@@ -242,8 +243,8 @@ // SolidJS can move nodes around in the children array.

const index = this.children.indexOf(beforeNode);
this.children.splice(index, 0, node);
} else {
this.children.push(node);
if (index >= 0) {
this.children.splice(index, 0, node);
return;
}
}
node.parent = this;
this.children.push(node);
}

@@ -379,4 +380,5 @@

typeof this.forwardFocus === 'number' ? this.forwardFocus : null;
if (focusedIndex !== null && focusedIndex < this.children.length) {
const child = this.children[focusedIndex];
const nodes = this.children;
if (focusedIndex !== null && focusedIndex < nodes.length) {
const child = nodes[focusedIndex];
isElementNode(child) && child.setFocus();

@@ -482,3 +484,5 @@ return;

set states(states: NodeStates) {
this._states = new States(this._stateChanged.bind(this), states);
this._states = this._states
? this._states.merge(states)
: new States(this._stateChanged.bind(this), states);
if (this.rendered) {

@@ -485,0 +489,0 @@ this._stateChanged();

@@ -46,9 +46,5 @@ import { isArray, isString } from './utils.js';

if (force === true) {
if (!this.has(state)) {
this.add(state);
}
this.add(state);
} else if (force === false) {
if (this.has(state)) {
this.remove(state);
}
this.remove(state);
} else {

@@ -63,2 +59,17 @@ if (this.has(state)) {

merge(newStates: NodeStates) {
if (isArray(newStates)) {
this.length = 0; // Clear the current states
this.push(...newStates);
} else if (isString(newStates)) {
this.length = 0; // Clear the current states
this.push(newStates);
} else {
for (const state in newStates) {
this.toggle(state, newStates[state]);
}
}
return this;
}
remove(state: string) {

@@ -65,0 +76,0 @@ const stateIndexToRemove = this.indexOf(state);

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