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

intact-react

Package Overview
Dependencies
Maintainers
6
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intact-react - npm Package Compare versions

Comparing version 1.1.27 to 1.1.28

14

dist/index.js

@@ -658,3 +658,3 @@ 'use strict';

// React will pass context to constructor
// React will pass context to constructor
if (context) {

@@ -675,3 +675,3 @@ var parentRef = {};

// We must keep the props to be undefined,
// We must keep the props to be undefined,
// otherwise React will think it has mutated

@@ -702,2 +702,10 @@ _this._props = _this.props;

});
// sometimes the dom may be destroyed
// we should not call _update in this case
var _update = _this._update;
_this._update = function (lastVNode, nextVNode) {
if (_this.destroyed) return;
_update.call(_this, lastVNode, nextVNode);
};
return possibleConstructorReturn(_this);

@@ -936,3 +944,3 @@ }

// for workInProgress.tag detection
// for workInProgress.tag detection

@@ -939,0 +947,0 @@

@@ -660,3 +660,3 @@ (function (global, factory) {

// React will pass context to constructor
// React will pass context to constructor
if (context) {

@@ -677,3 +677,3 @@ var parentRef = {};

// We must keep the props to be undefined,
// We must keep the props to be undefined,
// otherwise React will think it has mutated

@@ -704,2 +704,10 @@ _this._props = _this.props;

});
// sometimes the dom may be destroyed
// we should not call _update in this case
var _update = _this._update;
_this._update = function (lastVNode, nextVNode) {
if (_this.destroyed) return;
_update.call(_this, lastVNode, nextVNode);
};
return possibleConstructorReturn(_this);

@@ -938,3 +946,3 @@ }

// for workInProgress.tag detection
// for workInProgress.tag detection

@@ -941,0 +949,0 @@

@@ -1,1 +0,1 @@

(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("react"),require("intact/dist"),require("react-dom")):typeof define==="function"&&define.amd?define(["react","intact/dist","react-dom"],t):e.Intact=t(e.React,e.Intact,e.ReactDOM)})(this,function(p,e,l){"use strict";p=p&&p.hasOwnProperty("default")?p["default"]:p;e=e&&e.hasOwnProperty("default")?e["default"]:e;l=l&&l.hasOwnProperty("default")?l["default"]:l;var r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var s=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var t=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(e,t,r){if(t)n(e.prototype,t);if(r)n(e,r);return e}}();var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var n=function(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t};var f=function(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e};var h=function(){function r(e){var t=this;s(this,r);this.resolved=false;this.callbacks=[];e.call(this,function(){return t.resolve()})}r.prototype.resolve=function e(){this.resolved=true;var t=void 0;while(t=this.callbacks.shift()){t()}};r.prototype.then=function e(t){this.callbacks.push(t);if(this.resolved){this.resolve()}};return r}();h.all=function(r){var e=0;var n=r.callbacks||(r.callbacks=[]);var i=false;var t=false;r.forEach(function(e){if(e._hasRewrite)return;e._hasRewrite=true;e.then(s)});if(!r._hasRewrite){var o=r.push;r.push=function(e){e.then(s);o.call(r,e)};r.push.push=o;r._hasRewrite=true}function a(){r.length=0;r.push=r.push.push;r._hasRewrite=false;r.callbacks=[];var e=void 0;while(e=n.shift()){e()}}function s(){e++;if(r.length===e){i=true;if(t){return console.error("promise has done")}if(n.length){t=true;a()}}}return{then:function e(t){n.push(t);if(!r.length||i){a()}}}};var a=p.createElement;function i(e,t,r){var n=e.$$cid==="IntactReact";var i=e.propTypes;if(n&&i){e.propTypes=undefined}var o=a.apply(this,arguments);if(n&&i){e.propTypes=i}return o}p.createElement=i;var o=l.findDOMNode;l.findDOMNode=function(e){if(e instanceof Y){return e.element}return o.call(l,e)};var u=e.Vdt.miss;var d=u.h;u.h=function e(t){if(t&&t.$$cid==="IntactFunction"){t=t.$$type}for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return d.call.apply(d,[this,t].concat(n))};var _=e.utils;var v=_.isStringOrNumber;var y=_.isArray;var m=_.noop;function g(n){function r(e,t){if(t){var r=n(D(e,t,{instance:t.__parent}),true);if(y(r)){return r.map(function(e,t){return b(e,t)})}return b(r)}else{return n(e)}}r.contextTypes={_context:m,__parent:m};var e=p.forwardRef(function(e,t){if(t)e=c({},e,{forwardRef:t});return i(r,e)});e.$$cid="IntactFunction";e.$$type=r;return e}function b(e,t){if(v(e)){return e}else if(e){return i(e.tag,c({key:t},e.props),e.props.children||e.children)}}var C=/_ev[A-Z]/;var x=" react-mount-point-unstable ";var w=function(){function e(){s(this,e)}e.prototype.init=function e(t,r){this.destroyed=true;var n=this.placeholder=document.createComment(x);var i=this.parentDom;if(!i){var o=this.parentVNode;while(o){if(o.dom){i=o.dom;break}o=o.parentVNode}}if(i){i.appendChild(n);R(i)}this._render(r);return n};e.prototype.update=function e(t,r){this._render(r);return this.placeholder};e.prototype.destroy=function e(t,r,n){var i=this.placeholder;var o=i.parentNode;Object.defineProperty(i,"parentNode",{value:o});l.render(null,i,function(){o.removeChild(i)});i._unmount=m;if(i._realElement){i._realElement._unmount=m}};e.prototype._render=function e(t){var r=this._addProps(t);var n=this.placeholder;var i=t.props._parentRef.instance;if(i){if(!i._reactInternalFiber){i=i.get("_parentRef").instance}}else{var o=t.parentVNode;while(o){var a=o.children;if(a&&a._reactInternalFiber!==undefined){i=a;break}o=o.parentVNode}}var s=i.__providers;s.forEach(function(e,t){r=p.createElement(t,{value:e},r)});var u=new h(function(t){l.unstable_renderSubtreeIntoContainer(i,r,n,function(){var e=void 0;if(this){e=this.nodeType===3?this:l.findDOMNode(this)}else{e=n.previousSibling}n._realElement=e;e._placeholder=n;t()})});i.__promises.push(u)};e.prototype._addProps=function e(t){this.vdt={vNode:t};var r=t.props;var n=void 0;var i=void 0;for(var o in r){if(o==="reactVNode"||o==="_parentRef")continue;if(C.test(o))continue;if(!n){n=c({},r.reactVNode);i=n.props=c({},n.props)}var a=r[o];if(o.substr(0,3)==="ev-"){i[N[o]]=a}else{i[o]=a}}return n||r.reactVNode};return e}();var N={"ev-click":"onClick","ev-mouseenter":"onMouseEnter","ev-mouseleave":"onMouseLeave"};function R(e){if(!e._hasRewrite){var t=e.removeChild;e.removeChild=function(e){e=e._realElement||e;if(e.__intactIsRemoved)return;t.call(this,e);e.__intactIsRemoved=true;O(e)};var r=e.insertBefore;e.insertBefore=function(e,t){r.call(this,e,t&&t._realElement||t)};e._hasRewrite=true}}function O(e){var t=void 0;if(t=e._realElement){delete e._realElement;delete t._placeholder}else if(t=e._placeholder){delete e._placeholder;delete t._realElement}}var k=e.Vdt.miss;var E=k.h;var M=k.VNode;var V=k.Types;var I=e.utils;var Q=I.isFunction;var T=I.isArray;var $=I.isStringOrNumber;var j=I.set;var S=I.get;function P(e,t){if(e==null)return e;if($(e)){return new M(V.Text,null,null,e)}if(e instanceof M){if(Q(e.tag)){e.props._parentRef=t}return e}var r=void 0;if((r=e.type)&&(r=r.$$cid)&&(r==="IntactReact"||r==="IntactFunction")){return E(e.type,D(c({},e.props,{_parentRef:t}),{_context:e._owner&&e._owner.stateNode},t,e.key),null,null,e.key,U(e.ref))}if(e.type===p.Fragment){return F(e.props.children,t)}return E(w,{reactVNode:e,_parentRef:t},null,e.props.className,e.key)}function F(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(T(e)){var r=[];e.forEach(function(e){if(T(e)){r.push.apply(r,F(e,t))}else{r.push(P(e,t))}});return r}return P(e,t)}function D(e,t,r,n){if(!e)return;var i={};var o=i._blocks={};var a=void 0;for(var s in e){if(s==="children"){i.children=F(e.children,r)}else if(a=q(s)){i[a]=e[s]}else if(s.substring(0,2)==="b-"){o[s.substring(2)]=G(e[s])}else if(s==="forwardRef"){i.ref=e[s]}else{i[s]=e[s]}}i._context=A(t);if(n!=null){i.key=n}return i}function U(t){return(typeof t==="undefined"?"undefined":r(t))==="object"&&t!==null?function(e){t.current=e}:t}function A(e){var i=e._context;return{data:{get:function e(t){if(t!=null){return S(i.state||{},t)}else{return i.state||{}}},set:function e(t,r){var n=c({},i.state);j(n,t,r);i.setState(n)}}}}function G(i){if(Q(i)){return function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return F(i.apply(this,r),{instance:this.data})}}else{return function(){return F(i,{instance:this.data})}}}function q(e){var t=e[0],r=e[1],n=e[2];if(!n)return;var i=void 0;if(t==="o"&&r==="n"){if(n==="$"){return"ev-$"+e.substring(3).replace(/\-/g,":")}else if((i=n.charCodeAt(0))&&i>=65&&i<=90){return"ev-"+e.substring(2).toLowerCase().replace(/\-/g,":")}}}var B=e.utils;var L=B.isObject;var W=B.extend;var z=e.Vdt.miss;var Z=z.h;var H=z.config;if(H){H.disableDelegate=true}var J=void 0;var K=void 0;var X=[];var Y=function(u){n(a,u);function a(e,t){s(this,a);if(t){var r={};var n=D(e,t,r);var i=f(this,u.call(this,n));r.instance=i;i.__promises=t.__promises||X;i.mountedQueue=t.__parent&&t.__parent.mountedQueue;i.vNode=Z(i.constructor,n);i.vNode.children=i;i._props=i.props;delete i.props;i._isReact=true}else{var i=f(this,u.call(this,e))}i._triggerFlagStack=[];var o=void 0;Object.defineProperty(i,"element",{get:function e(){if(!this.__isUpdating&&o&&o.nodeType===8&&o.nodeValue===x){return o._realElement||o}return o},set:function e(t){o=t},configurable:true,enumerable:true});return f(i)}a.prototype.getChildContext=function e(){return{__parent:this,__promises:this.__promises}};a.prototype.get=function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}if(this._isReact){var i;var o=this.props;this.props=this._props;var a=(i=u.prototype.get).call.apply(i,[this].concat(r));this.props=o;return a}else{var s;return(s=u.prototype.get).call.apply(s,[this].concat(r))}};a.prototype.set=function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}if(this._isReact){var i;var o=this.props;this.props=this._props;var a=(i=u.prototype.set).call.apply(i,[this].concat(r));this.props=o;return a}else{var s;return(s=u.prototype.set).call.apply(s,[this].concat(r))}};a.prototype.init=function e(t,r){var n=this.__isUpdating;this.__isUpdating=true;this.refs=this.vdt.widgets||{};this.__pushGetChildContext(r);var i=u.prototype.init.call(this,t,r);this.__popGetChildContext();this.__isUpdating=n;return i};a.prototype.update=function e(i,o,a){var s=this;var e=function e(){var t=s.__isUpdating;s.__isUpdating=true;var r=!t&&!s.__getChildContext;if(r){s.__pushGetChildContext(o||s.vNode)}var n=u.prototype.update.call(s,i,o,a);if(r){s.__popGetChildContext()}s.__isUpdating=t;return n};if(!this._isReact)return e();this.__initMountedQueue();var t=e();this.__triggerMountedQueue();return t};a.prototype.__pushGetChildContext=function e(t){var r=t&&t.props._parentRef;var n=r&&r.instance;if(n){var i=this;this.__getChildContext=n.getChildContext;n.getChildContext=function(){var e=i.__getChildContext.call(this);return c({},e,{__parent:i})}}this.__parentInstance=n};a.prototype.__popGetChildContext=function e(){if(this.__parentInstance){this.__parentInstance.getChildContext=this.__getChildContext;this.__getChildContext=null}};a.prototype.componentDidMount=function e(){var t=this;this.__initMountedQueue();this.inited=true;this.parentVNode=this.vNode.parentVNode=this.context.__parent&&this.context.__parent.vNode;var r=this.init(null,this.vNode);var n=this._placeholder;var i=n.parentElement;this.parentDom=i;r[J]=n[J];r[K]=n[K];Object.defineProperty(n,"parentNode",{value:i});i.replaceChild(r,n);n._realElement=r;R(i);this.mountedQueue.push(function(){t.mount()});this.__triggerMountedQueue()};a.prototype.componentWillUnmount=function e(){this.destroy()};a.prototype.componentDidUpdate=function e(){this.__initMountedQueue();var t=Z(this.constructor,D(this.props,this.context,{instance:this}));var r=this.vNode;t.children=this;this.vNode=t;this.parentVNode=t.parentVNode=this.context.__parent&&this.context.__parent.vNode;this.update(r,t);this.__triggerMountedQueue()};a.prototype.__ref=function e(t){this._placeholder=t;if(!J){var r=Object.keys(t);J=r[0];K=r[1]}};a.prototype.render=function e(){this.__providers=new Map;var t=this._reactInternalFiber;while(t=t.return){if(t.tag===10){var r=t.type;this.__providers.set(r,r._context._currentValue)}}return p.createElement("i",{ref:this.__ref})};a.prototype.__initMountedQueue=function e(){this._triggerFlagStack.push(this._shouldTrigger);this._shouldTrigger=false;if(!this.mountedQueue||this.mountedQueue.done){var t=void 0;if((t=this.context)&&(t=t.__parent)&&(t=t.mountedQueue)){if(!t.done){this.mountedQueue=t;return}}this._shouldTrigger=true;this._initMountedQueue()}};a.prototype.__triggerMountedQueue=function e(){var t=this;if(this._shouldTrigger){h.all(this.__promises).then(function(){X=[];t._triggerMountedQueue()})}this._shouldTrigger=this._triggerFlagStack.pop()};t(a,[{key:"isMounted",get:function e(){return this.mounted}}]);return a}(e);Y.functionalWrapper=g;Y.normalize=F;Y.$$cid="IntactReact";Y.prototype.isReactComponent={};Y.contextTypes={_context:m,__parent:m,__promises:m,router:m};Y.childContextTypes={__parent:m,__promises:m};if(!Object.setPrototypeOf){W(Y,e);if(!Y.template){Y.template=e.template}}return Y});
(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("react"),require("intact/dist"),require("react-dom")):typeof define==="function"&&define.amd?define(["react","intact/dist","react-dom"],t):e.Intact=t(e.React,e.Intact,e.ReactDOM)})(this,function(p,e,l){"use strict";p=p&&p.hasOwnProperty("default")?p["default"]:p;e=e&&e.hasOwnProperty("default")?e["default"]:e;l=l&&l.hasOwnProperty("default")?l["default"]:l;var r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var c=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var t=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||false;n.configurable=true;if("value"in n)n.writable=true;Object.defineProperty(e,n.key,n)}}return function(e,t,r){if(t)n(e.prototype,t);if(r)n(e,r);return e}}();var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r){if(Object.prototype.hasOwnProperty.call(r,n)){e[n]=r[n]}}}return e};var n=function(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t};var h=function(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e};var d=function(){function r(e){var t=this;c(this,r);this.resolved=false;this.callbacks=[];e.call(this,function(){return t.resolve()})}r.prototype.resolve=function e(){this.resolved=true;var t=void 0;while(t=this.callbacks.shift()){t()}};r.prototype.then=function e(t){this.callbacks.push(t);if(this.resolved){this.resolve()}};return r}();d.all=function(r){var e=0;var n=r.callbacks||(r.callbacks=[]);var i=false;var t=false;r.forEach(function(e){if(e._hasRewrite)return;e._hasRewrite=true;e.then(s)});if(!r._hasRewrite){var o=r.push;r.push=function(e){e.then(s);o.call(r,e)};r.push.push=o;r._hasRewrite=true}function a(){r.length=0;r.push=r.push.push;r._hasRewrite=false;r.callbacks=[];var e=void 0;while(e=n.shift()){e()}}function s(){e++;if(r.length===e){i=true;if(t){return console.error("promise has done")}if(n.length){t=true;a()}}}return{then:function e(t){n.push(t);if(!r.length||i){a()}}}};var a=p.createElement;function i(e,t,r){var n=e.$$cid==="IntactReact";var i=e.propTypes;if(n&&i){e.propTypes=undefined}var o=a.apply(this,arguments);if(n&&i){e.propTypes=i}return o}p.createElement=i;var o=l.findDOMNode;l.findDOMNode=function(e){if(e instanceof Y){return e.element}return o.call(l,e)};var s=e.Vdt.miss;var u=s.h;s.h=function e(t){if(t&&t.$$cid==="IntactFunction"){t=t.$$type}for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return u.call.apply(u,[this,t].concat(n))};var _=e.utils;var v=_.isStringOrNumber;var y=_.isArray;var m=_.noop;function g(n){function r(e,t){if(t){var r=n(D(e,t,{instance:t.__parent}),true);if(y(r)){return r.map(function(e,t){return b(e,t)})}return b(r)}else{return n(e)}}r.contextTypes={_context:m,__parent:m};var e=p.forwardRef(function(e,t){if(t)e=f({},e,{forwardRef:t});return i(r,e)});e.$$cid="IntactFunction";e.$$type=r;return e}function b(e,t){if(v(e)){return e}else if(e){return i(e.tag,f({key:t},e.props),e.props.children||e.children)}}var C=/_ev[A-Z]/;var x=" react-mount-point-unstable ";var w=function(){function e(){c(this,e)}e.prototype.init=function e(t,r){this.destroyed=true;var n=this.placeholder=document.createComment(x);var i=this.parentDom;if(!i){var o=this.parentVNode;while(o){if(o.dom){i=o.dom;break}o=o.parentVNode}}if(i){i.appendChild(n);R(i)}this._render(r);return n};e.prototype.update=function e(t,r){this._render(r);return this.placeholder};e.prototype.destroy=function e(t,r,n){var i=this.placeholder;var o=i.parentNode;Object.defineProperty(i,"parentNode",{value:o});l.render(null,i,function(){o.removeChild(i)});i._unmount=m;if(i._realElement){i._realElement._unmount=m}};e.prototype._render=function e(t){var r=this._addProps(t);var n=this.placeholder;var i=t.props._parentRef.instance;if(i){if(!i._reactInternalFiber){i=i.get("_parentRef").instance}}else{var o=t.parentVNode;while(o){var a=o.children;if(a&&a._reactInternalFiber!==undefined){i=a;break}o=o.parentVNode}}var s=i.__providers;s.forEach(function(e,t){r=p.createElement(t,{value:e},r)});var u=new d(function(t){l.unstable_renderSubtreeIntoContainer(i,r,n,function(){var e=void 0;if(this){e=this.nodeType===3?this:l.findDOMNode(this)}else{e=n.previousSibling}n._realElement=e;e._placeholder=n;t()})});i.__promises.push(u)};e.prototype._addProps=function e(t){this.vdt={vNode:t};var r=t.props;var n=void 0;var i=void 0;for(var o in r){if(o==="reactVNode"||o==="_parentRef")continue;if(C.test(o))continue;if(!n){n=f({},r.reactVNode);i=n.props=f({},n.props)}var a=r[o];if(o.substr(0,3)==="ev-"){i[N[o]]=a}else{i[o]=a}}return n||r.reactVNode};return e}();var N={"ev-click":"onClick","ev-mouseenter":"onMouseEnter","ev-mouseleave":"onMouseLeave"};function R(e){if(!e._hasRewrite){var t=e.removeChild;e.removeChild=function(e){e=e._realElement||e;if(e.__intactIsRemoved)return;t.call(this,e);e.__intactIsRemoved=true;O(e)};var r=e.insertBefore;e.insertBefore=function(e,t){r.call(this,e,t&&t._realElement||t)};e._hasRewrite=true}}function O(e){var t=void 0;if(t=e._realElement){delete e._realElement;delete t._placeholder}else if(t=e._placeholder){delete e._placeholder;delete t._realElement}}var k=e.Vdt.miss;var E=k.h;var M=k.VNode;var V=k.Types;var I=e.utils;var Q=I.isFunction;var T=I.isArray;var $=I.isStringOrNumber;var j=I.set;var S=I.get;function P(e,t){if(e==null)return e;if($(e)){return new M(V.Text,null,null,e)}if(e instanceof M){if(Q(e.tag)){e.props._parentRef=t}return e}var r=void 0;if((r=e.type)&&(r=r.$$cid)&&(r==="IntactReact"||r==="IntactFunction")){return E(e.type,D(f({},e.props,{_parentRef:t}),{_context:e._owner&&e._owner.stateNode},t,e.key),null,null,e.key,U(e.ref))}if(e.type===p.Fragment){return F(e.props.children,t)}return E(w,{reactVNode:e,_parentRef:t},null,e.props.className,e.key)}function F(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(T(e)){var r=[];e.forEach(function(e){if(T(e)){r.push.apply(r,F(e,t))}else{r.push(P(e,t))}});return r}return P(e,t)}function D(e,t,r,n){if(!e)return;var i={};var o=i._blocks={};var a=void 0;for(var s in e){if(s==="children"){i.children=F(e.children,r)}else if(a=q(s)){i[a]=e[s]}else if(s.substring(0,2)==="b-"){o[s.substring(2)]=G(e[s])}else if(s==="forwardRef"){i.ref=e[s]}else{i[s]=e[s]}}i._context=A(t);if(n!=null){i.key=n}return i}function U(t){return(typeof t==="undefined"?"undefined":r(t))==="object"&&t!==null?function(e){t.current=e}:t}function A(e){var i=e._context;return{data:{get:function e(t){if(t!=null){return S(i.state||{},t)}else{return i.state||{}}},set:function e(t,r){var n=f({},i.state);j(n,t,r);i.setState(n)}}}}function G(i){if(Q(i)){return function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return F(i.apply(this,r),{instance:this.data})}}else{return function(){return F(i,{instance:this.data})}}}function q(e){var t=e[0],r=e[1],n=e[2];if(!n)return;var i=void 0;if(t==="o"&&r==="n"){if(n==="$"){return"ev-$"+e.substring(3).replace(/\-/g,":")}else if((i=n.charCodeAt(0))&&i>=65&&i<=90){return"ev-"+e.substring(2).toLowerCase().replace(/\-/g,":")}}}var B=e.utils;var L=B.isObject;var W=B.extend;var z=e.Vdt.miss;var Z=z.h;var H=z.config;if(H){H.disableDelegate=true}var J=void 0;var K=void 0;var X=[];var Y=function(u){n(s,u);function s(e,t){c(this,s);if(t){var r={};var n=D(e,t,r);var i=h(this,u.call(this,n));r.instance=i;i.__promises=t.__promises||X;i.mountedQueue=t.__parent&&t.__parent.mountedQueue;i.vNode=Z(i.constructor,n);i.vNode.children=i;i._props=i.props;delete i.props;i._isReact=true}else{var i=h(this,u.call(this,e))}i._triggerFlagStack=[];var o=void 0;Object.defineProperty(i,"element",{get:function e(){if(!this.__isUpdating&&o&&o.nodeType===8&&o.nodeValue===x){return o._realElement||o}return o},set:function e(t){o=t},configurable:true,enumerable:true});var a=i._update;i._update=function(e,t){if(i.destroyed)return;a.call(i,e,t)};return h(i)}s.prototype.getChildContext=function e(){return{__parent:this,__promises:this.__promises}};s.prototype.get=function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}if(this._isReact){var i;var o=this.props;this.props=this._props;var a=(i=u.prototype.get).call.apply(i,[this].concat(r));this.props=o;return a}else{var s;return(s=u.prototype.get).call.apply(s,[this].concat(r))}};s.prototype.set=function e(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++){r[n]=arguments[n]}if(this._isReact){var i;var o=this.props;this.props=this._props;var a=(i=u.prototype.set).call.apply(i,[this].concat(r));this.props=o;return a}else{var s;return(s=u.prototype.set).call.apply(s,[this].concat(r))}};s.prototype.init=function e(t,r){var n=this.__isUpdating;this.__isUpdating=true;this.refs=this.vdt.widgets||{};this.__pushGetChildContext(r);var i=u.prototype.init.call(this,t,r);this.__popGetChildContext();this.__isUpdating=n;return i};s.prototype.update=function e(i,o,a){var s=this;var e=function e(){var t=s.__isUpdating;s.__isUpdating=true;var r=!t&&!s.__getChildContext;if(r){s.__pushGetChildContext(o||s.vNode)}var n=u.prototype.update.call(s,i,o,a);if(r){s.__popGetChildContext()}s.__isUpdating=t;return n};if(!this._isReact)return e();this.__initMountedQueue();var t=e();this.__triggerMountedQueue();return t};s.prototype.__pushGetChildContext=function e(t){var r=t&&t.props._parentRef;var n=r&&r.instance;if(n){var i=this;this.__getChildContext=n.getChildContext;n.getChildContext=function(){var e=i.__getChildContext.call(this);return f({},e,{__parent:i})}}this.__parentInstance=n};s.prototype.__popGetChildContext=function e(){if(this.__parentInstance){this.__parentInstance.getChildContext=this.__getChildContext;this.__getChildContext=null}};s.prototype.componentDidMount=function e(){var t=this;this.__initMountedQueue();this.inited=true;this.parentVNode=this.vNode.parentVNode=this.context.__parent&&this.context.__parent.vNode;var r=this.init(null,this.vNode);var n=this._placeholder;var i=n.parentElement;this.parentDom=i;r[J]=n[J];r[K]=n[K];Object.defineProperty(n,"parentNode",{value:i});i.replaceChild(r,n);n._realElement=r;R(i);this.mountedQueue.push(function(){t.mount()});this.__triggerMountedQueue()};s.prototype.componentWillUnmount=function e(){this.destroy()};s.prototype.componentDidUpdate=function e(){this.__initMountedQueue();var t=Z(this.constructor,D(this.props,this.context,{instance:this}));var r=this.vNode;t.children=this;this.vNode=t;this.parentVNode=t.parentVNode=this.context.__parent&&this.context.__parent.vNode;this.update(r,t);this.__triggerMountedQueue()};s.prototype.__ref=function e(t){this._placeholder=t;if(!J){var r=Object.keys(t);J=r[0];K=r[1]}};s.prototype.render=function e(){this.__providers=new Map;var t=this._reactInternalFiber;while(t=t.return){if(t.tag===10){var r=t.type;this.__providers.set(r,r._context._currentValue)}}return p.createElement("i",{ref:this.__ref})};s.prototype.__initMountedQueue=function e(){this._triggerFlagStack.push(this._shouldTrigger);this._shouldTrigger=false;if(!this.mountedQueue||this.mountedQueue.done){var t=void 0;if((t=this.context)&&(t=t.__parent)&&(t=t.mountedQueue)){if(!t.done){this.mountedQueue=t;return}}this._shouldTrigger=true;this._initMountedQueue()}};s.prototype.__triggerMountedQueue=function e(){var t=this;if(this._shouldTrigger){d.all(this.__promises).then(function(){X=[];t._triggerMountedQueue()})}this._shouldTrigger=this._triggerFlagStack.pop()};t(s,[{key:"isMounted",get:function e(){return this.mounted}}]);return s}(e);Y.functionalWrapper=g;Y.normalize=F;Y.$$cid="IntactReact";Y.prototype.isReactComponent={};Y.contextTypes={_context:m,__parent:m,__promises:m,router:m};Y.childContextTypes={__parent:m,__promises:m};if(!Object.setPrototypeOf){W(Y,e);if(!Y.template){Y.template=e.template}}return Y});
{
"name": "intact-react",
"version": "1.1.27",
"version": "1.1.28",
"description": "A compatibility layer for running intact component in react v16",

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

@@ -6,3 +6,3 @@ import React from 'react';

import functionalWrapper, {noop, isArray} from './functionalWrapper';
import FakePromise from './FakePromise';
import FakePromise from './FakePromise';
import {commentNodeValue} from './Wrapper';

@@ -31,3 +31,3 @@ import {rewriteParentElementApi} from './Wrapper';

constructor(props, context) {
// React will pass context to constructor
// React will pass context to constructor
if (context) {

@@ -46,5 +46,5 @@ const parentRef = {};

// We must keep the props to be undefined,
// We must keep the props to be undefined,
// otherwise React will think it has mutated
this._props = this.props;
this._props = this.props;
delete this.props;

@@ -72,2 +72,10 @@ this._isReact = true;

});
// sometimes the dom may be destroyed
// we should not call _update in this case
const _update = this._update;
this._update = (lastVNode, nextVNode) => {
if (this.destroyed) return;
_update.call(this, lastVNode, nextVNode);
};
}

@@ -211,6 +219,6 @@

const vNode = h(
this.constructor,
this.constructor,
normalizeProps(
this.props,
this.context,
this.context,
{instance: this}

@@ -250,3 +258,3 @@ )

return React.createElement('i', {
ref: this.__ref
ref: this.__ref
});

@@ -284,7 +292,7 @@ }

}
this._shouldTrigger = this._triggerFlagStack.pop();
this._shouldTrigger = this._triggerFlagStack.pop();
}
}
// for workInProgress.tag detection
// for workInProgress.tag detection
IntactReact.prototype.isReactComponent = {};

@@ -291,0 +299,0 @@ // for getting _context in Intact

@@ -311,3 +311,3 @@ import Intact from '../index';

h(_Dropdown, {children: [element], ref: props.ref}),
// menu
menu
];

@@ -314,0 +314,0 @@ });

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