intact-react
Advanced tools
Comparing version 1.1.22 to 1.1.23
@@ -446,6 +446,6 @@ 'use strict'; | ||
var _Intact$Vdt$miss = Intact.Vdt.miss; | ||
var h$1 = _Intact$Vdt$miss.h; | ||
var VNode = _Intact$Vdt$miss.VNode; | ||
var Types = _Intact$Vdt$miss.Types; | ||
var _Intact$Vdt$miss$1 = Intact.Vdt.miss; | ||
var h$1 = _Intact$Vdt$miss$1.h; | ||
var VNode = _Intact$Vdt$miss$1.VNode; | ||
var Types = _Intact$Vdt$miss$1.Types; | ||
var _Intact$utils$1 = Intact.utils; | ||
@@ -602,5 +602,12 @@ var isFunction = _Intact$utils$1.isFunction; | ||
var extend = _Intact$utils.extend; | ||
var _Intact$Vdt$miss = Intact.Vdt.miss; | ||
var h = _Intact$Vdt$miss.h; | ||
var config = _Intact$Vdt$miss.config; | ||
var h = Intact.Vdt.miss.h; | ||
// disable delegate events | ||
if (config) { | ||
config.disableDelegate = true; | ||
} | ||
var internalInstanceKey = void 0; | ||
@@ -607,0 +614,0 @@ var internalEventHandlersKey = void 0; |
@@ -448,6 +448,6 @@ (function (global, factory) { | ||
var _Intact$Vdt$miss = Intact.Vdt.miss; | ||
var h$1 = _Intact$Vdt$miss.h; | ||
var VNode = _Intact$Vdt$miss.VNode; | ||
var Types = _Intact$Vdt$miss.Types; | ||
var _Intact$Vdt$miss$1 = Intact.Vdt.miss; | ||
var h$1 = _Intact$Vdt$miss$1.h; | ||
var VNode = _Intact$Vdt$miss$1.VNode; | ||
var Types = _Intact$Vdt$miss$1.Types; | ||
var _Intact$utils$1 = Intact.utils; | ||
@@ -604,5 +604,12 @@ var isFunction = _Intact$utils$1.isFunction; | ||
var extend = _Intact$utils.extend; | ||
var _Intact$Vdt$miss = Intact.Vdt.miss; | ||
var h = _Intact$Vdt$miss.h; | ||
var config = _Intact$Vdt$miss.config; | ||
var h = Intact.Vdt.miss.h; | ||
// disable delegate events | ||
if (config) { | ||
config.disableDelegate = true; | ||
} | ||
var internalInstanceKey = void 0; | ||
@@ -609,0 +616,0 @@ var internalEventHandlersKey = void 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(e,t,r){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;r=r&&r.hasOwnProperty("default")?r["default"]:r;var n=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 i=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var o=function(){function e(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(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var a=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 s=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 u=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 p=function(){function e(t){var r=this;i(this,e);this.resolved=false;this.callbacks=[];t.call(this,function(){return r.resolve()})}e.prototype.resolve=function e(){this.resolved=true;var t=void 0;while(t=this.callbacks.shift()){t()}};e.prototype.then=function e(t){this.callbacks.push(t);if(this.resolved){this.resolve()}};return e}();p.all=function(e){var t=0;var r=e.callbacks||(e.callbacks=[]);var n=false;var i=false;e.forEach(function(e){if(e._hasRewrite)return;e._hasRewrite=true;e.then(s)});if(!e._hasRewrite){var o=e.push;e.push=function(t){t.then(s);o.call(e,t)};e.push.push=o;e._hasRewrite=true}function a(){e.length=0;e.push=e.push.push;e._hasRewrite=false;e.callbacks=[];var t=void 0;while(t=r.shift()){t()}}function s(){t++;if(e.length===t){n=true;if(i){return console.error("promise has done")}if(r.length){i=true;a()}}}return{then:function t(i){r.push(i);if(!e.length||n){a()}}}};var c=e.createElement;function l(e,t,r){var n=e.$$cid==="IntactReact";var i=e.propTypes;if(n&&i){e.propTypes=undefined}var o=c.apply(this,arguments);if(n&&i){e.propTypes=i}return o}e.createElement=l;var f=r.findDOMNode;r.findDOMNode=function(e){if(e instanceof H){return e.element}return f.call(r,e)};var h=t.Vdt.miss;var d=h.h;h.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 v=t.utils;var _=v.isStringOrNumber;var y=v.isArray;var m=v.noop;function g(t){function r(e,r){if(r){var n=t(P(e,r,{instance:r.__parent}),true);if(y(n)){return n.map(function(e,t){return b(e,t)})}return b(n)}else{return t(e)}}r.contextTypes={_context:m,__parent:m};var n=e.forwardRef(function(e,t){if(t)e=a({},e,{forwardRef:t});return l(r,e)});n.$$cid="IntactFunction";n.$$type=r;return n}function b(e,t){if(_(e)){return e}else if(e){return l(e.tag,a({key:t},e.props),e.props.children||e.children)}}var C=/_ev[A-Z]/;var x=" react-mount-point-unstable ";var w=function(){function t(){i(this,t)}t.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)}this._render(r);return n};t.prototype.update=function e(t,r){this._render(r);return this.placeholder};t.prototype.destroy=function e(t,n,i){var o=this.placeholder;r.render(null,o,function(){var e=o.parentNode;Object.defineProperty(o,"parentNode",{value:e});if(e._removeChild){e._removeChild(o)}else{e.removeChild(o)}});o._unmount=m;if(o._realElement){o._realElement._unmount=m}};t.prototype._render=function t(n){var i=this._addProps(n);var o=this.placeholder;var a=n.props._parentRef.instance;if(a){if(!a._reactInternalFiber){a=a.get("_parentRef").instance}}else{var s=n.parentVNode;while(s){var u=s.children;if(u&&u._reactInternalFiber!==undefined){a=u;break}s=s.parentVNode}}var c=a.__providers;c.forEach(function(t,r){i=e.createElement(r,{value:t},i)});var l=new p(function(e){r.unstable_renderSubtreeIntoContainer(a,i,o,function(){var t=void 0;if(this){t=this.nodeType===3?this:r.findDOMNode(this)}else{t=o.previousSibling}o._realElement=t;e()})});a.__promises.push(l)};t.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=a({},r.reactVNode);i=n.props=a({},n.props)}var s=r[o];if(o.substr(0,3)==="ev-"){i[N[o]]=s}else{i[o]=s}}return n||r.reactVNode};return t}();var N={"ev-click":"onClick","ev-mouseenter":"onMouseEnter","ev-mouseleave":"onMouseLeave"};var R=t.Vdt.miss;var O=R.h;var k=R.VNode;var E=R.Types;var M=t.utils;var V=M.isFunction;var Q=M.isArray;var T=M.isStringOrNumber;var $=M.set;var j=M.get;function I(t,r){if(t==null)return t;if(T(t)){return new k(E.Text,null,null,t)}if(t instanceof k){if(V(t.tag)){t.props._parentRef=r}return t}var n=void 0;if((n=t.type)&&(n=n.$$cid)&&(n==="IntactReact"||n==="IntactFunction")){return O(t.type,P(a({},t.props,{_parentRef:r}),{_context:t._owner&&t._owner.stateNode},r,t.key),null,null,t.key,F(t.ref))}if(t.type===e.Fragment){return S(t.props.children,r)}return O(w,{reactVNode:t,_parentRef:r},null,t.props.className)}function S(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(Q(e)){var r=[];e.forEach(function(e){if(Q(e)){r.push.apply(r,S(e,t))}else{r.push(I(e,t))}});return r}return I(e,t)}function P(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=S(e.children,r)}else if(a=D(s)){i[a]=e[s]}else if(s.substring(0,2)==="b-"){o[s.substring(2)]=A(e[s])}else if(s==="forwardRef"){i.ref=e[s]}else{i[s]=e[s]}}i._context=U(t);if(n!=null){i.key=n}return i}function F(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&e!==null?function(t){e.current=t}:e}function U(e){var t=e._context;return{data:{get:function e(r){if(r!=null){return j(t.state||{},r)}else{return t.state||{}}},set:function e(r,n){var i=a({},t.state);$(i,r,n);t.setState(i)}}}}function A(e){if(V(e)){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return S(e.apply(this,n),{instance:this.data})}}else{return function(){return S(e,{instance:this.data})}}}function D(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 G=t.utils;var q=G.isObject;var B=G.extend;var L=t.Vdt.miss.h;var W=void 0;var z=void 0;var Z=[];var H=function(t){s(r,t);function r(e,n){i(this,r);if(n){var o={};var a=P(e,n,o);var s=u(this,t.call(this,a));o.instance=s;s.__promises=n.__promises||Z;s.mountedQueue=n.__parent&&n.__parent.mountedQueue;s.vNode=L(s.constructor,a);s.vNode.children=s;s._props=s.props;delete s.props;s._isReact=true}else{var s=u(this,t.call(this,e))}s._triggerFlagStack=[];var p=void 0;Object.defineProperty(s,"element",{get:function e(){if(!this.__isUpdating&&p&&p.nodeType===8&&p.nodeValue===x){return p._realElement||p}return p},set:function e(t){p=t},configurable:true,enumerable:true});return u(s)}r.prototype.getChildContext=function e(){return{__parent:this,__promises:this.__promises}};r.prototype.get=function e(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}if(this._isReact){var o;var a=this.props;this.props=this._props;var s=(o=t.prototype.get).call.apply(o,[this].concat(n));this.props=a;return s}else{var u;return(u=t.prototype.get).call.apply(u,[this].concat(n))}};r.prototype.set=function e(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}if(this._isReact){var o;var a=this.props;this.props=this._props;var s=(o=t.prototype.set).call.apply(o,[this].concat(n));this.props=a;return s}else{var u;return(u=t.prototype.set).call.apply(u,[this].concat(n))}};r.prototype.init=function e(r,n){var i=this.__isUpdating;this.__isUpdating=true;this.refs=this.vdt.widgets||{};this.__pushGetChildContext(n);var o=t.prototype.init.call(this,r,n);this.__popGetChildContext();this.__isUpdating=i;return o};r.prototype.update=function e(r,n,i){var o=this;var e=function e(){var a=o.__isUpdating;o.__isUpdating=true;var s=!a&&!o.__getChildContext;if(s){o.__pushGetChildContext(n||o.vNode)}var u=t.prototype.update.call(o,r,n,i);if(s){o.__popGetChildContext()}o.__isUpdating=a;return u};if(!this._isReact)return e();this.__initMountedQueue();var a=e();this.__triggerMountedQueue();return a};r.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 a({},e,{__parent:i})}}this.__parentInstance=n};r.prototype.__popGetChildContext=function e(){if(this.__parentInstance){this.__parentInstance.getChildContext=this.__getChildContext;this.__getChildContext=null}};r.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[W]=n[W];r[z]=n[z];Object.defineProperty(n,"parentNode",{value:i});i.replaceChild(r,n);n._realElement=r;if(!i._hasRewrite){var o=i.removeChild;i._removeChild=o;i.removeChild=function(e){o.call(this,e._realElement||e)};var a=i.insertBefore;i.insertBefore=function(e,t){a.call(this,e,t._realElement||t)};i._hasRewrite=true}this.mountedQueue.push(function(){t.mount()});this.__triggerMountedQueue()};r.prototype.componentWillUnmount=function e(){this.destroy()};r.prototype.componentDidUpdate=function e(){this.__initMountedQueue();var t=L(this.constructor,P(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()};r.prototype.__ref=function e(t){this._placeholder=t;if(!W){var r=Object.keys(t);W=r[0];z=r[1]}};r.prototype.render=function t(){this.__providers=new Map;var r=this._reactInternalFiber;while(r=r.return){if(r.tag===10){var n=r.type;this.__providers.set(n,n._context._currentValue)}}return e.createElement("i",{ref:this.__ref})};r.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()}};r.prototype.__triggerMountedQueue=function e(){var t=this;if(this._shouldTrigger){p.all(this.__promises).then(function(){Z=[];t._triggerMountedQueue()})}this._shouldTrigger=this._triggerFlagStack.pop()};o(r,[{key:"isMounted",get:function e(){return this.mounted}}]);return r}(t);H.functionalWrapper=g;H.normalize=S;H.$$cid="IntactReact";H.prototype.isReactComponent={};H.contextTypes={_context:m,__parent:m,__promises:m,router:m};H.childContextTypes={__parent:m,__promises:m};if(!Object.setPrototypeOf){B(H,t);if(!H.template){H.template=t.template}}return H}); | ||
(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(e,t,r){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;t=t&&t.hasOwnProperty("default")?t["default"]:t;r=r&&r.hasOwnProperty("default")?r["default"]:r;var n=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 i=function(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}};var o=function(){function e(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(t,r,n){if(r)e(t.prototype,r);if(n)e(t,n);return t}}();var a=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 s=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 u=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 p=function(){function e(t){var r=this;i(this,e);this.resolved=false;this.callbacks=[];t.call(this,function(){return r.resolve()})}e.prototype.resolve=function e(){this.resolved=true;var t=void 0;while(t=this.callbacks.shift()){t()}};e.prototype.then=function e(t){this.callbacks.push(t);if(this.resolved){this.resolve()}};return e}();p.all=function(e){var t=0;var r=e.callbacks||(e.callbacks=[]);var n=false;var i=false;e.forEach(function(e){if(e._hasRewrite)return;e._hasRewrite=true;e.then(s)});if(!e._hasRewrite){var o=e.push;e.push=function(t){t.then(s);o.call(e,t)};e.push.push=o;e._hasRewrite=true}function a(){e.length=0;e.push=e.push.push;e._hasRewrite=false;e.callbacks=[];var t=void 0;while(t=r.shift()){t()}}function s(){t++;if(e.length===t){n=true;if(i){return console.error("promise has done")}if(r.length){i=true;a()}}}return{then:function t(i){r.push(i);if(!e.length||n){a()}}}};var c=e.createElement;function l(e,t,r){var n=e.$$cid==="IntactReact";var i=e.propTypes;if(n&&i){e.propTypes=undefined}var o=c.apply(this,arguments);if(n&&i){e.propTypes=i}return o}e.createElement=l;var f=r.findDOMNode;r.findDOMNode=function(e){if(e instanceof K){return e.element}return f.call(r,e)};var h=t.Vdt.miss;var d=h.h;h.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 v=t.utils;var _=v.isStringOrNumber;var y=v.isArray;var g=v.noop;function m(t){function r(e,r){if(r){var n=t(P(e,r,{instance:r.__parent}),true);if(y(n)){return n.map(function(e,t){return b(e,t)})}return b(n)}else{return t(e)}}r.contextTypes={_context:g,__parent:g};var n=e.forwardRef(function(e,t){if(t)e=a({},e,{forwardRef:t});return l(r,e)});n.$$cid="IntactFunction";n.$$type=r;return n}function b(e,t){if(_(e)){return e}else if(e){return l(e.tag,a({key:t},e.props),e.props.children||e.children)}}var C=/_ev[A-Z]/;var x=" react-mount-point-unstable ";var w=function(){function t(){i(this,t)}t.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)}this._render(r);return n};t.prototype.update=function e(t,r){this._render(r);return this.placeholder};t.prototype.destroy=function e(t,n,i){var o=this.placeholder;r.render(null,o,function(){var e=o.parentNode;Object.defineProperty(o,"parentNode",{value:e});if(e._removeChild){e._removeChild(o)}else{e.removeChild(o)}});o._unmount=g;if(o._realElement){o._realElement._unmount=g}};t.prototype._render=function t(n){var i=this._addProps(n);var o=this.placeholder;var a=n.props._parentRef.instance;if(a){if(!a._reactInternalFiber){a=a.get("_parentRef").instance}}else{var s=n.parentVNode;while(s){var u=s.children;if(u&&u._reactInternalFiber!==undefined){a=u;break}s=s.parentVNode}}var c=a.__providers;c.forEach(function(t,r){i=e.createElement(r,{value:t},i)});var l=new p(function(e){r.unstable_renderSubtreeIntoContainer(a,i,o,function(){var t=void 0;if(this){t=this.nodeType===3?this:r.findDOMNode(this)}else{t=o.previousSibling}o._realElement=t;e()})});a.__promises.push(l)};t.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=a({},r.reactVNode);i=n.props=a({},n.props)}var s=r[o];if(o.substr(0,3)==="ev-"){i[N[o]]=s}else{i[o]=s}}return n||r.reactVNode};return t}();var N={"ev-click":"onClick","ev-mouseenter":"onMouseEnter","ev-mouseleave":"onMouseLeave"};var R=t.Vdt.miss;var O=R.h;var k=R.VNode;var E=R.Types;var M=t.utils;var V=M.isFunction;var Q=M.isArray;var T=M.isStringOrNumber;var $=M.set;var j=M.get;function I(t,r){if(t==null)return t;if(T(t)){return new k(E.Text,null,null,t)}if(t instanceof k){if(V(t.tag)){t.props._parentRef=r}return t}var n=void 0;if((n=t.type)&&(n=n.$$cid)&&(n==="IntactReact"||n==="IntactFunction")){return O(t.type,P(a({},t.props,{_parentRef:r}),{_context:t._owner&&t._owner.stateNode},r,t.key),null,null,t.key,F(t.ref))}if(t.type===e.Fragment){return S(t.props.children,r)}return O(w,{reactVNode:t,_parentRef:r},null,t.props.className)}function S(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(Q(e)){var r=[];e.forEach(function(e){if(Q(e)){r.push.apply(r,S(e,t))}else{r.push(I(e,t))}});return r}return I(e,t)}function P(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=S(e.children,r)}else if(a=A(s)){i[a]=e[s]}else if(s.substring(0,2)==="b-"){o[s.substring(2)]=U(e[s])}else if(s==="forwardRef"){i.ref=e[s]}else{i[s]=e[s]}}i._context=D(t);if(n!=null){i.key=n}return i}function F(e){return(typeof e==="undefined"?"undefined":n(e))==="object"&&e!==null?function(t){e.current=t}:e}function D(e){var t=e._context;return{data:{get:function e(r){if(r!=null){return j(t.state||{},r)}else{return t.state||{}}},set:function e(r,n){var i=a({},t.state);$(i,r,n);t.setState(i)}}}}function U(e){if(V(e)){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++){n[i-1]=arguments[i]}return S(e.apply(this,n),{instance:this.data})}}else{return function(){return S(e,{instance:this.data})}}}function A(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 G=t.utils;var q=G.isObject;var B=G.extend;var L=t.Vdt.miss;var W=L.h;var z=L.config;if(z){z.disableDelegate=true}var Z=void 0;var H=void 0;var J=[];var K=function(t){s(r,t);function r(e,n){i(this,r);if(n){var o={};var a=P(e,n,o);var s=u(this,t.call(this,a));o.instance=s;s.__promises=n.__promises||J;s.mountedQueue=n.__parent&&n.__parent.mountedQueue;s.vNode=W(s.constructor,a);s.vNode.children=s;s._props=s.props;delete s.props;s._isReact=true}else{var s=u(this,t.call(this,e))}s._triggerFlagStack=[];var p=void 0;Object.defineProperty(s,"element",{get:function e(){if(!this.__isUpdating&&p&&p.nodeType===8&&p.nodeValue===x){return p._realElement||p}return p},set:function e(t){p=t},configurable:true,enumerable:true});return u(s)}r.prototype.getChildContext=function e(){return{__parent:this,__promises:this.__promises}};r.prototype.get=function e(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}if(this._isReact){var o;var a=this.props;this.props=this._props;var s=(o=t.prototype.get).call.apply(o,[this].concat(n));this.props=a;return s}else{var u;return(u=t.prototype.get).call.apply(u,[this].concat(n))}};r.prototype.set=function e(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++){n[i]=arguments[i]}if(this._isReact){var o;var a=this.props;this.props=this._props;var s=(o=t.prototype.set).call.apply(o,[this].concat(n));this.props=a;return s}else{var u;return(u=t.prototype.set).call.apply(u,[this].concat(n))}};r.prototype.init=function e(r,n){var i=this.__isUpdating;this.__isUpdating=true;this.refs=this.vdt.widgets||{};this.__pushGetChildContext(n);var o=t.prototype.init.call(this,r,n);this.__popGetChildContext();this.__isUpdating=i;return o};r.prototype.update=function e(r,n,i){var o=this;var e=function e(){var a=o.__isUpdating;o.__isUpdating=true;var s=!a&&!o.__getChildContext;if(s){o.__pushGetChildContext(n||o.vNode)}var u=t.prototype.update.call(o,r,n,i);if(s){o.__popGetChildContext()}o.__isUpdating=a;return u};if(!this._isReact)return e();this.__initMountedQueue();var a=e();this.__triggerMountedQueue();return a};r.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 a({},e,{__parent:i})}}this.__parentInstance=n};r.prototype.__popGetChildContext=function e(){if(this.__parentInstance){this.__parentInstance.getChildContext=this.__getChildContext;this.__getChildContext=null}};r.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[Z]=n[Z];r[H]=n[H];Object.defineProperty(n,"parentNode",{value:i});i.replaceChild(r,n);n._realElement=r;if(!i._hasRewrite){var o=i.removeChild;i._removeChild=o;i.removeChild=function(e){o.call(this,e._realElement||e)};var a=i.insertBefore;i.insertBefore=function(e,t){a.call(this,e,t._realElement||t)};i._hasRewrite=true}this.mountedQueue.push(function(){t.mount()});this.__triggerMountedQueue()};r.prototype.componentWillUnmount=function e(){this.destroy()};r.prototype.componentDidUpdate=function e(){this.__initMountedQueue();var t=W(this.constructor,P(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()};r.prototype.__ref=function e(t){this._placeholder=t;if(!Z){var r=Object.keys(t);Z=r[0];H=r[1]}};r.prototype.render=function t(){this.__providers=new Map;var r=this._reactInternalFiber;while(r=r.return){if(r.tag===10){var n=r.type;this.__providers.set(n,n._context._currentValue)}}return e.createElement("i",{ref:this.__ref})};r.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()}};r.prototype.__triggerMountedQueue=function e(){var t=this;if(this._shouldTrigger){p.all(this.__promises).then(function(){J=[];t._triggerMountedQueue()})}this._shouldTrigger=this._triggerFlagStack.pop()};o(r,[{key:"isMounted",get:function e(){return this.mounted}}]);return r}(t);K.functionalWrapper=m;K.normalize=S;K.$$cid="IntactReact";K.prototype.isReactComponent={};K.contextTypes={_context:g,__parent:g,__promises:g,router:g};K.childContextTypes={__parent:g,__promises:g};if(!Object.setPrototypeOf){B(K,t);if(!K.template){K.template=t.template}}return K}); |
{ | ||
"name": "intact-react", | ||
"version": "1.1.22", | ||
"version": "1.1.23", | ||
"description": "A compatibility layer for running intact component in react v16", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -10,4 +10,9 @@ import React from 'react'; | ||
const {isObject, extend} = Intact.utils; | ||
const h = Intact.Vdt.miss.h; | ||
const {h, config} = Intact.Vdt.miss; | ||
// disable delegate events | ||
if (config) { | ||
config.disableDelegate = true; | ||
} | ||
let internalInstanceKey; | ||
@@ -14,0 +19,0 @@ let internalEventHandlersKey; |
154489
3565