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

react-i13n

Package Overview
Dependencies
Maintainers
6
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-i13n - npm Package Compare versions

Comparing version 2.0.13 to 2.1.0

28

dist/libs/ReactI13n.js

@@ -28,2 +28,6 @@ /**

* @param {Object} options.i13nNodeClass the i13nNode class, you can inherit it with your own functionalities
* @param {String} options.scrollableContainerId id of the scrollable element that your components
* reside within. Normally, you won't need to provide a value for this. This is only to
* support viewport checking when your components are contained within a scrollable element.
* Currently, only elements that fill the viewport are supported.
* @constructor

@@ -41,2 +45,3 @@ */

this._handlerTimeout = options.handlerTimeout || DEFAULT_HANDLER_TIMEOUT;
this._scrollableContainerId = options.scrollableContainerId || undefined;

@@ -165,2 +170,23 @@ // set itself to the global object so that we can get it anywhere by the static function getInstance

/**
* Get scrollableContainerId value
* @method getScrollableContainerId
* @return {String} scrollableContainerId value
*/
ReactI13n.prototype.getScrollableContainerId = function getScrollableContainerId () {
return this._scrollableContainerId;
};
/**
* Get scrollable container DOM node
* @method getScrollableContainerDOMNode
* @return {Object} scrollable container DOM node. This will be undefined if no
* scrollableContainerId was set, or null if the element was not found in the DOM.
*/
ReactI13n.prototype.getScrollableContainerDOMNode = function getScrollableContainerDOMNode () {
if (this._scrollableContainerId) {
return document && document.getElementById(this._scrollableContainerId);
}
};
/**
* Get root i13n node

@@ -187,4 +213,6 @@ * @method getRootI13nNode

this._handlerTimeout = options.handlerTimeout ? options.handlerTimeout : this._handlerTimeout;
this._scrollableContainerId = 'undefined' === typeof options.scrollableContainerId ?
this._scrollableContainerId : options.scrollableContainerId;
};
module.exports = ReactI13n;

12

dist/mixins/I13nMixin.js

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

}
var reactI13n = self._getReactI13n();

@@ -112,4 +113,11 @@ // bind the click event for i13n component if it's enabled

// enable viewport checking if enabled
if (self._getReactI13n().isViewportEnabled()) {
self.subscribeViewportEvents();
if (reactI13n.isViewportEnabled()) {
var options = {};
if (reactI13n.getScrollableContainerDOMNode) {
var domNode = reactI13n.getScrollableContainerDOMNode();
if (domNode) {
options.target = domNode;
}
}
self.subscribeViewportEvents(options);
self._enableViewportDetection();

@@ -116,0 +124,0 @@ }

4

dist/mixins/viewport/ViewportMixin.js

@@ -65,4 +65,4 @@ /**

subscribeViewportEvents: function () {
this.subscription = subscribe('scrollEnd', this._detectViewport);
subscribeViewportEvents: function (options) {
this.subscription = subscribe('scrollEnd', this._detectViewport, options || {});
},

@@ -69,0 +69,0 @@

@@ -143,3 +143,3 @@ // jscs:disable maximumLineLength

mocha: {
command: './node_modules/mocha/bin/mocha <%= project.tmp %>/<%= project.unit %> --require ./tests/setup --recursive --reporter spec'
command: 'node ./node_modules/mocha/bin/mocha <%= project.tmp %>/<%= project.unit %> --require ./tests/setup --recursive --reporter spec'
}

@@ -146,0 +146,0 @@ },

{
"name": "react-i13n",
"description": "React I13n provides a performant and scalable solution to application instrumentation.",
"version": "2.0.13",
"version": "2.1.0",
"main": "index.js",

@@ -19,3 +19,3 @@ "repository": {

"setimmediate": "^1.0.2",
"subscribe-ui-event": "^1.0.5"
"subscribe-ui-event": "^1.0.7"
},

@@ -22,0 +22,0 @@ "devDependencies": {

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