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

@noriginmedia/react-spatial-navigation

Package Overview
Dependencies
Maintainers
2
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noriginmedia/react-spatial-navigation - npm Package Compare versions

Comparing version 2.12.8 to 2.12.9

4

CHANGELOG.md

@@ -7,2 +7,6 @@ # Changelog

## [2.12.9]
### Changed
- performance optimization: updateLayout is only called for components affected by navigation
## [2.12.8]

@@ -9,0 +13,0 @@ ### Added

34

dist/spatialNavigation.js

@@ -650,2 +650,4 @@ 'use strict';

value: function smartNavigate(direction, fromParentFocusKey, details) {
var _this4 = this;
this.log('smartNavigate', 'direction', direction);

@@ -656,3 +658,5 @@ this.log('smartNavigate', 'fromParentFocusKey', fromParentFocusKey);

if (!this.nativeMode && !fromParentFocusKey) {
this.updateAllLayouts();
(0, _forOwn2.default)(this.focusableComponents, function (component) {
component.layoutUpdated = false;
});
}

@@ -665,2 +669,3 @@

if (currentComponent) {
this.updateLayout(currentComponent.focusKey);
var parentFocusKey = currentComponent.parentFocusKey,

@@ -681,2 +686,3 @@ focusKey = currentComponent.focusKey,

if (component.parentFocusKey === parentFocusKey && component.focusable) {
_this4.updateLayout(component.focusKey);
var siblingCutoffCoordinate = SpatialNavigation.getCutoffCoordinate(isVerticalDirection, isIncrementalDirection, true, component.layout);

@@ -756,2 +762,4 @@

value: function getNextFocusKey(targetFocusKey) {
var _this5 = this;
var targetComponent = this.focusableComponents[targetFocusKey];

@@ -799,2 +807,5 @@

*/
children.forEach(function (component) {
return _this5.updateLayout(component.focusKey);
});

@@ -867,3 +878,4 @@ var _getChildClosestToOri = getChildClosestToOrigin(children),

node: node
}
},
layoutUpdated: false
};

@@ -923,2 +935,4 @@

if (component) {
this.updateLayout(component.focusKey);
return component.layout;

@@ -954,3 +968,3 @@ }

value: function updateParentsHasFocusedChild(focusKey, details) {
var _this4 = this;
var _this6 = this;

@@ -985,13 +999,13 @@ var parents = [];

(0, _forEach2.default)(parentsToRemoveFlag, function (parentFocusKey) {
var parentComponent = _this4.focusableComponents[parentFocusKey];
var parentComponent = _this6.focusableComponents[parentFocusKey];
parentComponent && parentComponent.trackChildren && parentComponent.onUpdateHasFocusedChild(false);
_this4.onIntermediateNodeBecameBlurred(parentFocusKey, details);
_this6.onIntermediateNodeBecameBlurred(parentFocusKey, details);
});
(0, _forEach2.default)(parentsToAddFlag, function (parentFocusKey) {
var parentComponent = _this4.focusableComponents[parentFocusKey];
var parentComponent = _this6.focusableComponents[parentFocusKey];
parentComponent && parentComponent.trackChildren && parentComponent.onUpdateHasFocusedChild(true);
_this4.onIntermediateNodeBecameFocused(parentFocusKey, details);
_this6.onIntermediateNodeBecameFocused(parentFocusKey, details);
});

@@ -1094,3 +1108,3 @@

value: function updateAllLayouts() {
var _this5 = this;
var _this7 = this;

@@ -1102,3 +1116,3 @@ if (this.nativeMode) {

(0, _forOwn2.default)(this.focusableComponents, function (component, focusKey) {
_this5.updateLayout(focusKey);
_this7.updateLayout(focusKey);
});

@@ -1111,3 +1125,3 @@ }

if (!component || this.nativeMode) {
if (!component || this.nativeMode || component.layoutUpdated) {
return;

@@ -1114,0 +1128,0 @@ }

{
"name": "@noriginmedia/react-spatial-navigation",
"version": "2.12.8",
"version": "2.12.9",
"description": "HOC-based Spatial Navigation (key navigation) solution for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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