Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lightningjs/solid-primitives

Package Overview
Dependencies
Maintainers
7
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightningjs/solid-primitives - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

4

dist/packages/useFocusManager.d.ts

@@ -14,3 +14,3 @@ import { type Accessor } from 'solid-js';

export type KeyHandlerReturn = boolean | void;
export type KeyHandler = (this: ElementNode, e: KeyboardEvent, target: ElementNode) => KeyHandlerReturn;
export type KeyHandler = (this: ElementNode, e: KeyboardEvent, target: ElementNode, handlerElm: ElementNode) => KeyHandlerReturn;
/**

@@ -30,3 +30,3 @@ * Generates a map of event handlers for each key in the KeyMap

onBlur?: (currentFocusedElm: ElementNode | undefined, prevFocusedElm: ElementNode | undefined) => void;
onKeyPress?: (this: ElementNode, e: KeyboardEvent, mappedKeyEvent: string | undefined, currentFocusedElm: ElementNode) => KeyHandlerReturn;
onKeyPress?: (this: ElementNode, e: KeyboardEvent, mappedKeyEvent: string | undefined, handlerElm: ElementNode, currentFocusedElm: ElementNode) => KeyHandlerReturn;
onSelectedChanged?: (container: ElementNode, activeElm: ElementNode, selectedIndex: number | undefined, lastSelectedIndex: number | undefined) => void;

@@ -33,0 +33,0 @@ skipFocus?: boolean;

@@ -88,7 +88,9 @@ /*

const fp = focusPath();
let finalFocusElm = undefined;
for (const elm of fp) {
finalFocusElm = finalFocusElm || elm;
if (mappedKeyEvent) {
const onKeyHandler = elm[`on${mappedKeyEvent}`];
if (isFunc(onKeyHandler)) {
if (onKeyHandler.call(elm, e, elm) === true) {
if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {
break;

@@ -102,3 +104,3 @@ }

if (isFunc(elm.onKeyPress)) {
if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm) === true) {
if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm, finalFocusElm) === true) {
break;

@@ -105,0 +107,0 @@ }

{
"name": "@lightningjs/solid-primitives",
"version": "0.5.3",
"version": "0.5.4",
"description": "Lightning Primitives for Solid Lightning",

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

@@ -46,2 +46,3 @@ /*

target: ElementNode,
handlerElm: ElementNode,
) => KeyHandlerReturn;

@@ -74,2 +75,3 @@

mappedKeyEvent: string | undefined,
handlerElm: ElementNode,
currentFocusedElm: ElementNode,

@@ -186,3 +188,5 @@ ) => KeyHandlerReturn;

const fp = focusPath();
let finalFocusElm: ElementNode | undefined = undefined;
for (const elm of fp) {
finalFocusElm = finalFocusElm || elm;
if (mappedKeyEvent) {

@@ -192,3 +196,3 @@ const onKeyHandler =

if (isFunc(onKeyHandler)) {
if (onKeyHandler.call(elm, e, elm) === true) {
if (onKeyHandler.call(elm, e, elm, finalFocusElm) === true) {
break;

@@ -202,3 +206,11 @@ }

if (isFunc(elm.onKeyPress)) {
if (elm.onKeyPress.call(elm, e, mappedKeyEvent, elm) === true) {
if (
elm.onKeyPress.call(
elm,
e,
mappedKeyEvent,
elm,
finalFocusElm,
) === true
) {
break;

@@ -205,0 +217,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