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
1
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.0.1 to 1.0.2

2

dist/index.js

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

exports.Intact=function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(t,e){t.exports=require("intact/dist")},function(t,e){t.exports=require("react")},function(t,e,n){"use strict";n.r(e);var r=n(1),o=n.n(r),i=n(0),a=n.n(i),c=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var u=a.a.Vdt.miss.h,s=a.a.Vdt.miss.Types,p=a.a.Vdt.miss.VNode,l=a.a.utils,f=l.each,h=l.isFunction,d=(l.isString,l.isArray),y=l.isObject,v=l.hasOwn,b=(l.create,l.extend),m=l.isStringOrNumber,$="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,g=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.$$ctor=e.Ctor,n.instance=new n.$$ctor(t);var r=["constructor","props","_create","_mount","_beforeUpdate","_update","_destory","defaults","template","setState","forceUpdate"],o=n.instance,i=Object.getOwnPropertyNames(o.__proto__);i=i.concat(Object.getOwnPropertyNames(o));var a=!0,c=!1,u=void 0;try{for(var s,p=i[Symbol.iterator]();!(a=(s=p.next()).done);a=!0){var l=s.value;r.includes(l)||(h(o[l])?n[l]=o[l].bind(n):n[l]=o[l])}}catch(t){c=!0,u=t}finally{try{!a&&p.return&&p.return()}finally{if(c)throw u}}return n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.a),c(e,[{key:"_create",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillMount&&this.componentWillMount()}},{key:"_mount",value:function(){this.componentDidMount&&this.componentDidMount()}},{key:"_beforeUpdate",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillReceiveProps&&this.componentWillReceiveProps(),this.componentWillUpdate&&this.componentWillUpdate(),this.shouldComponentUpdate&&this.shouldComponentUpdate()}},{key:"_update",value:function(){this.getSnapshotBeforeUpdate&&this.getSnapshotBeforeUpdate(),this.componentDidUpdate&&this.componentDidUpdate()}},{key:"_destory",value:function(){this.componentWillUnmount&&this.componentWillUnmount()}},{key:"defaults",value:function(){return e.Ctor.props}},{key:"template",value:function(t,e,n,r){var o=this.data,i=w(o.instance.render.apply(o)).children;if(i.length>1)throw new Error("children must return only one"+i);var a=i;return a.children=a.props.children,a}},{key:"setState",value:function(t,e){this.state=t,this.set({state:t}),h(e)&&e.apply(this)}},{key:"forceUpdate",value:function(t){this.update(),h(t)&&t.apply(this)}}]),e}();function w(t){if(!t)return{children:t,_blocks:{}};d(t)||(t=[t]);var e=[],n={};return f(t,function(t){if(t){var r=t;if(m(t))r=new p(s.Text,null,{},t);else if(y(t)&&t.$$typeof===$){var o=O(b({},t.attributes,t.props)),i=t.type;h(t.type)&&"IntactReact"!==t.type.prototype.$$cid&&(g.Ctor=t.type,g.Ctor.props=o,i=g),r=u(i,o,o.children,null,t.key,t.ref)}if(y(r.props)&&r.props.slot){var a=void 0===r.props.slot||!0===r.props.slot?"default":r.props.slot;delete r.props.slot,n[a]=function(t){return r.children=r.props.children,r}}else e.push(r)}}),1===e.length&&(e=e[0]),{children:e,_blocks:n}}function O(t,e){var n=function(n){if(v.call(t,n)){if(function(t,e){return!(!h(t[e])||!/^on[A-Z]/.test(e))}(t,n)){var r="ev-"+n.replace(/^on([A-Z].*)$/,"$1").toLowerCase();t[r]=t[n],delete t[n]}if("ref"===n&&_.isObject(t[n])&&(t[n]=function(e){t[n].current=e}),"children"===n&&t.children&&!1!==e){var o=w(t.children),i=o.children,a=o._blocks;t.children=i,t._blocks=a}}};for(var r in t)n(r);return t}var j=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var k=a.a.utils,P=(k.get,k.set,k.extend),S=(k.isArray,k.create,k.isFunction,function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=2===r.length,a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(r)));return i&&(a.$$innerInstance={},a.props=r[0],a.$$wrapDom=null,a.$$props=P({},a.props)),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,a.a),j(e,[{key:"componentDidMount",value:function(){var t=this.$$wrapDom.parentElement;this.$$innerInstance=new this.constructor(O(this.$$props)),t.replaceChild(this.$$innerInstance.init(),this.$$wrapDom)}},{key:"componentWillUnmount",value:function(){this.$$innerInstance&&this.$$innerInstance.destroy()}},{key:"componentDidUpdate",value:function(t,e,n){this.$$innerInstance&&this.$$innerInstance.set(O(this.$$props))}},{key:"render",value:function(){var t=this;return this.$$props=P(this.$$props,this.props),o.a.createElement("i",P({},{ref:function(e){t.$$wrapDom=e}}),"")}},{key:"$$cid",get:function(){return"IntactReact"}},{key:"isMounted",get:function(){return this.mounted}},{key:"isReactComponent",get:function(){return{}}}]),e}());n.d(e,"default",function(){return S})}]);
exports.Intact=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=require("intact/dist")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(r).default}}),e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(3)),i=c(n(0)),u=n(4);function c(e){return e&&e.__esModule?e:{default:e}}var a=i.default.utils,s=(a.get,a.set,a.extend),l=a.isObject,p=(a.isArray,a.create,a.isFunction,o.default.createElement);o.default.createElement=function(e,t,n){var r=l(e.prototype)&&"IntactReact"===e.prototype.$$cid,o=e.propTypes;r&&delete e.propTypes;var i=p.call(this,e,t,n);return r&&o&&(e.propTypes=o),i};var f=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=2===r.length,u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return i&&(u.$$innerInstance=void 0,u.props=r[0],u.$$wrapDom=null,u.$$props=s({},u.props)),u}return function(e,t){if("function"!=typeof t&&null!==t)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:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default),r(t,[{key:"componentDidMount",value:function(){var e=this.$$wrapDom.parentElement;this.$$innerInstance=new this.constructor((0,u.conversionProps)(this.$$props)),e.replaceChild(this.$$innerInstance.init(),this.$$wrapDom)}},{key:"componentWillUnmount",value:function(){this.$$innerInstance&&this.$$innerInstance.destroy()}},{key:"componentDidUpdate",value:function(e,t,n){this.$$innerInstance&&this.$$innerInstance.set((0,u.conversionProps)(this.$$props))}},{key:"render",value:function(){var e=this;return this.$$props=s(this.$$props,this.props),o.default.createElement("i",s({},{ref:function(t){e.$$wrapDom=t}}),"")}},{key:"$$cid",get:function(){return"IntactReact"}},{key:"isMounted",get:function(){return this.mounted}},{key:"isReactComponent",get:function(){return{}}}]),t}();t.default=f,e.exports=t.default},function(e,t){e.exports=require("react")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conversionProps=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(n(0));var i=o.default.Vdt.miss.h,u=o.default.Vdt.miss.Types,c=o.default.Vdt.miss.VNode,a=o.default.utils,s=a.each,l=a.isFunction,p=(a.isString,a.isArray),f=a.isObject,d=a.hasOwn,h=(a.create,a.extend),y=a.isStringOrNumber,v="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.$$ctor=t.Ctor,n.instance=new n.$$ctor(e);var r=["constructor","props","_create","_mount","_beforeUpdate","_update","_destory","defaults","template","setState","forceUpdate"],o=n.instance,i=Object.getOwnPropertyNames(o.__proto__);i=i.concat(Object.getOwnPropertyNames(o));var u=!0,c=!1,a=void 0;try{for(var s,p=i[Symbol.iterator]();!(u=(s=p.next()).done);u=!0){var f=s.value;r.includes(f)||(l(o[f])?n[f]=o[f].bind(n):n[f]=o[f])}}catch(e){c=!0,a=e}finally{try{!u&&p.return&&p.return()}finally{if(c)throw a}}return n}return function(e,t){if("function"!=typeof t&&null!==t)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:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"_create",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillMount&&this.componentWillMount()}},{key:"_mount",value:function(){this.componentDidMount&&this.componentDidMount()}},{key:"_beforeUpdate",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillReceiveProps&&this.componentWillReceiveProps(),this.componentWillUpdate&&this.componentWillUpdate(),this.shouldComponentUpdate&&this.shouldComponentUpdate()}},{key:"_update",value:function(){this.getSnapshotBeforeUpdate&&this.getSnapshotBeforeUpdate(),this.componentDidUpdate&&this.componentDidUpdate()}},{key:"_destory",value:function(){this.componentWillUnmount&&this.componentWillUnmount()}},{key:"defaults",value:function(){return t.Ctor.props}},{key:"template",value:function(e,t,n,r){var o=this.data,i=m(o.instance.render.apply(o)).children;if(i.length>1)throw new Error("children must return only one"+i);var u=i;return u.children=u.props.children,u}},{key:"setState",value:function(e,t){this.state=e,this.set({state:e}),l(t)&&t.apply(this)}},{key:"forceUpdate",value:function(e){this.update(),l(e)&&e.apply(this)}}]),t}();function m(e){if(!e)return{children:e,_blocks:{}};p(e)||(e=[e]);var t=[],n={};return s(e,function(e){if(e){var r=e;if(y(e))r=new c(u.Text,null,{},e);else if(f(e)&&e.$$typeof===v){var o=$(h({},e.attributes,e.props)),a=e.type;l(a)&&a.prototype.render&&a.prototype.isReactComponent?(b.Ctor=e.type,b.Ctor.props=o,a=b):l(a)&&(a=function(t){var n=m(e.type(t)).children;if(n.length>1)throw new Error("children must return only one"+n);var r=n;return r.children=r.props.children,r}),r=i(a,o,o.children,null,e.key,e.ref)}if(f(r.props)&&r.props.slot){var s=void 0===r.props.slot||!0===r.props.slot?"default":r.props.slot;delete r.props.slot,n[s]=function(e){return r.children=r.props.children,r}}else t.push(r)}}),1===t.length&&(t=t[0]),{children:t,_blocks:n}}function $(e,t){var n=function(n){if(d.call(e,n)){if(function(e,t){return!(!l(e[t])||!/^on[A-Z]/.test(t))}(e,n)){var r="ev-"+n.replace(/^on([A-Z].*)$/,"$1").toLowerCase();e[r]=e[n],delete e[n]}if("ref"===n&&_.isObject(e[n])&&(e[n]=function(t){e[n].current=t}),"children"===n&&e.children&&!1!==t){var o=m(e.children),i=o.children,u=o._blocks;e.children=i,e._blocks=u}}};for(var r in e)n(r);return e}t.conversionProps=$}]);

@@ -103,7 +103,7 @@ (function webpackUniversalModuleDefinition(root, factory) {

\******************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _src_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./src/index.js */ \"./src/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _src_index_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\n//# sourceURL=webpack://Intact/./index.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _index = __webpack_require__(/*! ./src/index.js */ \"./src/index.js\");\n\nObject.defineProperty(exports, 'default', {\n enumerable: true,\n get: function get() {\n return _interopRequireDefault(_index).default;\n }\n});\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://Intact/./index.js?");

@@ -116,7 +116,7 @@ /***/ }),

\**********************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var intact_dist__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! intact/dist */ \"intact/dist\");\n/* harmony import */ var intact_dist__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(intact_dist__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./src/util.js\");\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n// for webpack alias Intact to IntactReact\n\n\n\nvar _Intact$utils = intact_dist__WEBPACK_IMPORTED_MODULE_1___default.a.utils,\n get = _Intact$utils.get,\n set = _Intact$utils.set,\n extend = _Intact$utils.extend,\n isArray = _Intact$utils.isArray,\n create = _Intact$utils.create,\n isFunction = _Intact$utils.isFunction;\n\nvar IntactReact = function (_Intact) {\n _inherits(IntactReact, _Intact);\n\n function IntactReact() {\n var _ref;\n\n _classCallCheck(this, IntactReact);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var isReactCall = args.length === 2; //react 实例化是会传入两个参数 , 故使用此判断 是否为react 调用实例\n\n var _this = _possibleConstructorReturn(this, (_ref = IntactReact.__proto__ || Object.getPrototypeOf(IntactReact)).call.apply(_ref, [this].concat(args)));\n\n if (isReactCall) {\n _this.$$innerInstance = {};\n _this.props = args[0]; //react 需要验证props 全等 ,蛋疼\n _this.$$wrapDom = null;\n _this.$$props = extend({}, _this.props);\n }\n return _this;\n }\n\n _createClass(IntactReact, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var parentElement = this.$$wrapDom.parentElement;\n //重新初始化并创建节点 , 替换已存在节点\n this.$$innerInstance = new this.constructor(Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"conversionProps\"])(this.$$props));\n parentElement.replaceChild(this.$$innerInstance.init(), this.$$wrapDom);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.$$innerInstance && this.$$innerInstance.destroy();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState, snapshot) {\n // 更新实例\n this.$$innerInstance && this.$$innerInstance.set(Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"conversionProps\"])(this.$$props));\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n this.$$props = extend(this.$$props, this.props);\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement('i', extend({}, {\n ref: function ref(element) {\n _this2.$$wrapDom = element;\n }\n }), '');\n }\n }, {\n key: '$$cid',\n get: function get() {\n return 'IntactReact';\n }\n }, {\n key: 'isMounted',\n get: function get() {\n return this.mounted;\n }\n }, {\n key: 'isReactComponent',\n get: function get() {\n return {};\n }\n }]);\n\n return IntactReact;\n}(intact_dist__WEBPACK_IMPORTED_MODULE_1___default.a);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (IntactReact);\n\n//# sourceURL=webpack://Intact/./src/index.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _react = __webpack_require__(/*! react */ \"react\");\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _dist = __webpack_require__(/*! intact/dist */ \"intact/dist\");\n\nvar _dist2 = _interopRequireDefault(_dist);\n\nvar _util = __webpack_require__(/*! ./util */ \"./src/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n// for webpack alias Intact to IntactReact\n\n\nvar _Intact$utils = _dist2.default.utils,\n get = _Intact$utils.get,\n set = _Intact$utils.set,\n extend = _Intact$utils.extend,\n isObject = _Intact$utils.isObject,\n isArray = _Intact$utils.isArray,\n create = _Intact$utils.create,\n isFunction = _Intact$utils.isFunction;\n\n\nvar _createElement = _react2.default.createElement;\n_react2.default.createElement = function createElementWithValidation(type, props, children) {\n var isIntact = isObject(type.prototype) && type.prototype.$$cid === 'IntactReact';\n var propTypes = type.propTypes;\n if (isIntact) {\n delete type.propTypes;\n }\n var element = _createElement.call(this, type, props, children);\n if (isIntact && propTypes) {\n type.propTypes = propTypes;\n }\n return element;\n};\n\nvar IntactReact = function (_Intact) {\n _inherits(IntactReact, _Intact);\n\n function IntactReact() {\n var _ref;\n\n _classCallCheck(this, IntactReact);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var isReactCall = args.length === 2; //react 实例化是会传入两个参数 , 故使用此判断 是否为react 调用实例\n\n var _this = _possibleConstructorReturn(this, (_ref = IntactReact.__proto__ || Object.getPrototypeOf(IntactReact)).call.apply(_ref, [this].concat(args)));\n\n if (isReactCall) {\n _this.$$innerInstance = undefined;\n _this.props = args[0]; //react 需要验证props 全等 ,蛋疼\n _this.$$wrapDom = null;\n _this.$$props = extend({}, _this.props);\n }\n return _this;\n }\n\n _createClass(IntactReact, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n var parentElement = this.$$wrapDom.parentElement;\n //重新初始化并创建节点 , 替换已存在节点\n this.$$innerInstance = new this.constructor((0, _util.conversionProps)(this.$$props));\n parentElement.replaceChild(this.$$innerInstance.init(), this.$$wrapDom);\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.$$innerInstance && this.$$innerInstance.destroy();\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState, snapshot) {\n // 更新实例\n this.$$innerInstance && this.$$innerInstance.set((0, _util.conversionProps)(this.$$props));\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n this.$$props = extend(this.$$props, this.props);\n return _react2.default.createElement('i', extend({}, {\n ref: function ref(element) {\n _this2.$$wrapDom = element;\n }\n }), '');\n }\n }, {\n key: '$$cid',\n get: function get() {\n return 'IntactReact';\n }\n }, {\n key: 'isMounted',\n get: function get() {\n return this.mounted;\n }\n }, {\n key: 'isReactComponent',\n get: function get() {\n return {};\n }\n }]);\n\n return IntactReact;\n}(_dist2.default);\n\nexports.default = IntactReact;\nmodule.exports = exports.default;\n\n//# sourceURL=webpack://Intact/./src/index.js?");

@@ -129,7 +129,7 @@ /***/ }),

\*********************/
/*! exports provided: conversionProps, unfreeze */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conversionProps\", function() { return conversionProps; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"unfreeze\", function() { return unfreeze; });\n/* harmony import */ var intact_dist__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! intact/dist */ \"intact/dist\");\n/* harmony import */ var intact_dist__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(intact_dist__WEBPACK_IMPORTED_MODULE_0__);\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\n\n\nvar h = intact_dist__WEBPACK_IMPORTED_MODULE_0___default.a.Vdt.miss.h;\nvar Types = intact_dist__WEBPACK_IMPORTED_MODULE_0___default.a.Vdt.miss.Types;\nvar VNode = intact_dist__WEBPACK_IMPORTED_MODULE_0___default.a.Vdt.miss.VNode;\nvar _Intact$utils = intact_dist__WEBPACK_IMPORTED_MODULE_0___default.a.utils,\n each = _Intact$utils.each,\n isFunction = _Intact$utils.isFunction,\n isString = _Intact$utils.isString,\n isArray = _Intact$utils.isArray,\n isObject = _Intact$utils.isObject,\n hasOwn = _Intact$utils.hasOwn,\n create = _Intact$utils.create,\n extend = _Intact$utils.extend,\n isStringOrNumber = _Intact$utils.isStringOrNumber;\n\n//from react16 2456 行\n\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\n\nvar InheritIntactReact = function (_Intact) {\n _inherits(InheritIntactReact, _Intact);\n\n function InheritIntactReact(props) {\n _classCallCheck(this, InheritIntactReact);\n\n var _this = _possibleConstructorReturn(this, (InheritIntactReact.__proto__ || Object.getPrototypeOf(InheritIntactReact)).call(this, props));\n\n _this.$$ctor = InheritIntactReact.Ctor;\n _this.instance = new _this.$$ctor(props);\n var ignoreKeys = ['constructor', 'props', '_create', '_mount', '_beforeUpdate', '_update', '_destory', 'defaults', 'template', 'setState', 'forceUpdate'];\n var instance = _this.instance;\n var keys = Object.getOwnPropertyNames(instance.__proto__);\n keys = keys.concat(Object.getOwnPropertyNames(instance));\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n if (!ignoreKeys.includes(key)) {\n if (isFunction(instance[key])) {\n _this[key] = instance[key].bind(_this);\n } else {\n _this[key] = instance[key];\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return _this;\n }\n\n _createClass(InheritIntactReact, [{\n key: '_create',\n value: function _create() {\n this.$$ctor.getDerivedStateFromProps && this.$$ctor.getDerivedStateFromProps();\n this.componentWillMount && this.componentWillMount();\n }\n }, {\n key: '_mount',\n value: function _mount() {\n this.componentDidMount && this.componentDidMount();\n }\n }, {\n key: '_beforeUpdate',\n value: function _beforeUpdate() {\n this.$$ctor.getDerivedStateFromProps && this.$$ctor.getDerivedStateFromProps();\n this.componentWillReceiveProps && this.componentWillReceiveProps();\n this.componentWillUpdate && this.componentWillUpdate();\n this.shouldComponentUpdate && this.shouldComponentUpdate();\n }\n }, {\n key: '_update',\n value: function _update() {\n this.getSnapshotBeforeUpdate && this.getSnapshotBeforeUpdate();\n this.componentDidUpdate && this.componentDidUpdate();\n }\n }, {\n key: '_destory',\n value: function _destory() {\n this.componentWillUnmount && this.componentWillUnmount();\n }\n }, {\n key: 'defaults',\n value: function defaults() {\n return InheritIntactReact.Ctor.props;\n }\n }, {\n key: 'template',\n value: function template(obj, _Vdt, blocks, $callee) {\n var self = this.data;\n\n var _conversionChildrenBl = conversionChildrenBlocks(self.instance.render.apply(self)),\n children = _conversionChildrenBl.children;\n\n if (children.length > 1) {\n throw new Error('children must return only one' + children);\n }\n var vNode = children;\n vNode.children = vNode.props.children;\n return vNode;\n }\n }, {\n key: 'setState',\n value: function setState(state, callback) {\n this.state = state;\n this.set({ state: state });\n isFunction(callback) && callback.apply(this);\n }\n }, {\n key: 'forceUpdate',\n value: function forceUpdate(callback) {\n this.update();\n isFunction(callback) && callback.apply(this);\n }\n }]);\n\n return InheritIntactReact;\n}(intact_dist__WEBPACK_IMPORTED_MODULE_0___default.a);\n\nfunction conversionChildrenBlocks(children) {\n if (!children) {\n return {\n children: children,\n _blocks: {}\n };\n }\n if (!isArray(children)) {\n children = [children];\n }\n var newChildren = [];\n var newBlocks = {};\n\n each(children, function (child) {\n if (!child) {\n return;\n }\n var vNode = child;\n if (isStringOrNumber(child)) {\n vNode = new VNode(Types.Text, null, {}, child);\n } else if (isObject(child) && child.$$typeof === REACT_ELEMENT_TYPE) {\n var props = conversionProps(extend({}, child.attributes, child.props));\n var type = child.type;\n if (isFunction(child.type) && child.type.prototype.$$cid !== 'IntactReact') {\n InheritIntactReact.Ctor = child.type;\n InheritIntactReact.Ctor.props = props;\n type = InheritIntactReact;\n }\n vNode = h(type, props, props.children, null, child.key, child.ref);\n }\n if (isObject(vNode.props) && vNode.props.slot) {\n var slotName = vNode.props.slot === undefined || vNode.props.slot === true ? 'default' : vNode.props.slot;\n delete vNode.props.slot;\n newBlocks[slotName] = function (parent) {\n vNode.children = vNode.props.children;\n return vNode;\n };\n } else {\n newChildren.push(vNode);\n }\n });\n if (newChildren.length === 1) {\n newChildren = newChildren[0];\n }\n return {\n children: newChildren,\n _blocks: newBlocks\n };\n}\n\nfunction isEvent(props, key) {\n if (isFunction(props[key]) && /^on[A-Z]/.test(key)) {\n return true;\n }\n return false;\n}\n\nfunction conversionProps(props, init) {\n var _loop = function _loop(key) {\n if (hasOwn.call(props, key)) {\n //兼容 事件类型\n if (isEvent(props, key)) {\n var evEvent = 'ev-' + key.replace(/^on([A-Z].*)$/, \"$1\").toLowerCase();\n props[evEvent] = props[key];\n delete props[key];\n }\n //兼容 react 支持obj类型的ref\n if (key === 'ref' && _.isObject(props[key])) {\n props[key] = function (i) {\n props[key].current = i;\n };\n }\n //兼容 children 到 intact 类型\n if (key === 'children' && props['children'] && init !== false) {\n var _conversionChildrenBl2 = conversionChildrenBlocks(props['children']),\n children = _conversionChildrenBl2.children,\n _blocks = _conversionChildrenBl2._blocks;\n\n props['children'] = children;\n props['_blocks'] = _blocks;\n }\n }\n };\n\n for (var key in props) {\n _loop(key);\n }\n return props;\n}\n\n\n\n//# sourceURL=webpack://Intact/./src/util.js?");
eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.conversionProps = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _dist = __webpack_require__(/*! intact/dist */ \"intact/dist\");\n\nvar _dist2 = _interopRequireDefault(_dist);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar h = _dist2.default.Vdt.miss.h;\nvar Types = _dist2.default.Vdt.miss.Types;\nvar VNode = _dist2.default.Vdt.miss.VNode;\nvar _Intact$utils = _dist2.default.utils,\n each = _Intact$utils.each,\n isFunction = _Intact$utils.isFunction,\n isString = _Intact$utils.isString,\n isArray = _Intact$utils.isArray,\n isObject = _Intact$utils.isObject,\n hasOwn = _Intact$utils.hasOwn,\n create = _Intact$utils.create,\n extend = _Intact$utils.extend,\n isStringOrNumber = _Intact$utils.isStringOrNumber;\n\n//from react16 2456 行\n\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\n\nvar InheritIntactReact = function (_Intact) {\n _inherits(InheritIntactReact, _Intact);\n\n function InheritIntactReact(props) {\n _classCallCheck(this, InheritIntactReact);\n\n var _this = _possibleConstructorReturn(this, (InheritIntactReact.__proto__ || Object.getPrototypeOf(InheritIntactReact)).call(this, props));\n\n _this.$$ctor = InheritIntactReact.Ctor;\n _this.instance = new _this.$$ctor(props);\n var ignoreKeys = ['constructor', 'props', '_create', '_mount', '_beforeUpdate', '_update', '_destory', 'defaults', 'template', 'setState', 'forceUpdate'];\n var instance = _this.instance;\n var keys = Object.getOwnPropertyNames(instance.__proto__);\n keys = keys.concat(Object.getOwnPropertyNames(instance));\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var key = _step.value;\n\n if (!ignoreKeys.includes(key)) {\n if (isFunction(instance[key])) {\n _this[key] = instance[key].bind(_this);\n } else {\n _this[key] = instance[key];\n }\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return _this;\n }\n\n _createClass(InheritIntactReact, [{\n key: '_create',\n value: function _create() {\n this.$$ctor.getDerivedStateFromProps && this.$$ctor.getDerivedStateFromProps();\n this.componentWillMount && this.componentWillMount();\n }\n }, {\n key: '_mount',\n value: function _mount() {\n this.componentDidMount && this.componentDidMount();\n }\n }, {\n key: '_beforeUpdate',\n value: function _beforeUpdate() {\n this.$$ctor.getDerivedStateFromProps && this.$$ctor.getDerivedStateFromProps();\n this.componentWillReceiveProps && this.componentWillReceiveProps();\n this.componentWillUpdate && this.componentWillUpdate();\n this.shouldComponentUpdate && this.shouldComponentUpdate();\n }\n }, {\n key: '_update',\n value: function _update() {\n this.getSnapshotBeforeUpdate && this.getSnapshotBeforeUpdate();\n this.componentDidUpdate && this.componentDidUpdate();\n }\n }, {\n key: '_destory',\n value: function _destory() {\n this.componentWillUnmount && this.componentWillUnmount();\n }\n }, {\n key: 'defaults',\n value: function defaults() {\n return InheritIntactReact.Ctor.props;\n }\n }, {\n key: 'template',\n value: function template(obj, _Vdt, blocks, $callee) {\n var self = this.data;\n\n var _conversionChildrenBl = conversionChildrenBlocks(self.instance.render.apply(self)),\n children = _conversionChildrenBl.children;\n\n if (children.length > 1) {\n throw new Error('children must return only one' + children);\n }\n var vNode = children;\n vNode.children = vNode.props.children;\n return vNode;\n }\n }, {\n key: 'setState',\n value: function setState(state, callback) {\n this.state = state;\n this.set({ state: state });\n isFunction(callback) && callback.apply(this);\n }\n }, {\n key: 'forceUpdate',\n value: function forceUpdate(callback) {\n this.update();\n isFunction(callback) && callback.apply(this);\n }\n }]);\n\n return InheritIntactReact;\n}(_dist2.default);\n\nfunction conversionChildrenBlocks(children) {\n if (!children) {\n return {\n children: children,\n _blocks: {}\n };\n }\n if (!isArray(children)) {\n children = [children];\n }\n var newChildren = [];\n var newBlocks = {};\n\n each(children, function (child) {\n if (!child) {\n return;\n }\n var vNode = child;\n if (isStringOrNumber(child)) {\n vNode = new VNode(Types.Text, null, {}, child);\n } else if (isObject(child) && child.$$typeof === REACT_ELEMENT_TYPE) {\n var props = conversionProps(extend({}, child.attributes, child.props));\n var type = child.type;\n if (isFunction(type) && type.prototype.render && type.prototype.isReactComponent) {\n InheritIntactReact.Ctor = child.type;\n InheritIntactReact.Ctor.props = props;\n type = InheritIntactReact;\n } else if (isFunction(type)) {\n type = function type(props) {\n var _children = child.type(props);\n\n var _conversionChildrenBl2 = conversionChildrenBlocks(_children),\n children = _conversionChildrenBl2.children;\n\n if (children.length > 1) {\n throw new Error('children must return only one' + children);\n }\n var vNode = children;\n vNode.children = vNode.props.children;\n return vNode;\n };\n }\n vNode = h(type, props, props.children, null, child.key, child.ref);\n }\n if (isObject(vNode.props) && vNode.props.slot) {\n var slotName = vNode.props.slot === undefined || vNode.props.slot === true ? 'default' : vNode.props.slot;\n delete vNode.props.slot;\n newBlocks[slotName] = function (parent) {\n vNode.children = vNode.props.children;\n return vNode;\n };\n } else {\n newChildren.push(vNode);\n }\n });\n if (newChildren.length === 1) {\n newChildren = newChildren[0];\n }\n return {\n children: newChildren,\n _blocks: newBlocks\n };\n}\n\nfunction isEvent(props, key) {\n if (isFunction(props[key]) && /^on[A-Z]/.test(key)) {\n return true;\n }\n return false;\n}\n\nfunction conversionProps(props, init) {\n var _loop = function _loop(key) {\n if (hasOwn.call(props, key)) {\n //兼容 事件类型\n if (isEvent(props, key)) {\n var evEvent = 'ev-' + key.replace(/^on([A-Z].*)$/, \"$1\").toLowerCase();\n props[evEvent] = props[key];\n delete props[key];\n }\n //兼容 react 支持obj类型的ref\n if (key === 'ref' && _.isObject(props[key])) {\n props[key] = function (i) {\n props[key].current = i;\n };\n }\n //兼容 children 到 intact 类型\n if (key === 'children' && props['children'] && init !== false) {\n var _conversionChildrenBl3 = conversionChildrenBlocks(props['children']),\n children = _conversionChildrenBl3.children,\n _blocks = _conversionChildrenBl3._blocks;\n\n props['children'] = children;\n props['_blocks'] = _blocks;\n }\n }\n };\n\n for (var key in props) {\n _loop(key);\n }\n return props;\n}\n\nexports.conversionProps = conversionProps;\n\n//# sourceURL=webpack://Intact/./src/util.js?");

@@ -136,0 +136,0 @@ /***/ }),

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("intact/dist"),require("react")):"function"==typeof define&&define.amd?define(["intact/dist","react"],e):"object"==typeof exports?exports.Intact=e(require("intact/dist"),require("react")):t.Intact=e(t.Intact,t.React)}(window,function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e,n){"use strict";n.r(e);var r=n(1),o=n.n(r),i=n(0),c=n.n(i),a=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var u=c.a.Vdt.miss.h,s=c.a.Vdt.miss.Types,p=c.a.Vdt.miss.VNode,l=c.a.utils,f=l.each,d=l.isFunction,h=(l.isString,l.isArray),y=l.isObject,b=l.hasOwn,m=(l.create,l.extend),v=l.isStringOrNumber,$="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,w=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.$$ctor=e.Ctor,n.instance=new n.$$ctor(t);var r=["constructor","props","_create","_mount","_beforeUpdate","_update","_destory","defaults","template","setState","forceUpdate"],o=n.instance,i=Object.getOwnPropertyNames(o.__proto__);i=i.concat(Object.getOwnPropertyNames(o));var c=!0,a=!1,u=void 0;try{for(var s,p=i[Symbol.iterator]();!(c=(s=p.next()).done);c=!0){var l=s.value;r.includes(l)||(d(o[l])?n[l]=o[l].bind(n):n[l]=o[l])}}catch(t){a=!0,u=t}finally{try{!c&&p.return&&p.return()}finally{if(a)throw u}}return n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,c.a),a(e,[{key:"_create",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillMount&&this.componentWillMount()}},{key:"_mount",value:function(){this.componentDidMount&&this.componentDidMount()}},{key:"_beforeUpdate",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillReceiveProps&&this.componentWillReceiveProps(),this.componentWillUpdate&&this.componentWillUpdate(),this.shouldComponentUpdate&&this.shouldComponentUpdate()}},{key:"_update",value:function(){this.getSnapshotBeforeUpdate&&this.getSnapshotBeforeUpdate(),this.componentDidUpdate&&this.componentDidUpdate()}},{key:"_destory",value:function(){this.componentWillUnmount&&this.componentWillUnmount()}},{key:"defaults",value:function(){return e.Ctor.props}},{key:"template",value:function(t,e,n,r){var o=this.data,i=g(o.instance.render.apply(o)).children;if(i.length>1)throw new Error("children must return only one"+i);var c=i;return c.children=c.props.children,c}},{key:"setState",value:function(t,e){this.state=t,this.set({state:t}),d(e)&&e.apply(this)}},{key:"forceUpdate",value:function(t){this.update(),d(t)&&t.apply(this)}}]),e}();function g(t){if(!t)return{children:t,_blocks:{}};h(t)||(t=[t]);var e=[],n={};return f(t,function(t){if(t){var r=t;if(v(t))r=new p(s.Text,null,{},t);else if(y(t)&&t.$$typeof===$){var o=O(m({},t.attributes,t.props)),i=t.type;d(t.type)&&"IntactReact"!==t.type.prototype.$$cid&&(w.Ctor=t.type,w.Ctor.props=o,i=w),r=u(i,o,o.children,null,t.key,t.ref)}if(y(r.props)&&r.props.slot){var c=void 0===r.props.slot||!0===r.props.slot?"default":r.props.slot;delete r.props.slot,n[c]=function(t){return r.children=r.props.children,r}}else e.push(r)}}),1===e.length&&(e=e[0]),{children:e,_blocks:n}}function O(t,e){var n=function(n){if(b.call(t,n)){if(function(t,e){return!(!d(t[e])||!/^on[A-Z]/.test(e))}(t,n)){var r="ev-"+n.replace(/^on([A-Z].*)$/,"$1").toLowerCase();t[r]=t[n],delete t[n]}if("ref"===n&&_.isObject(t[n])&&(t[n]=function(e){t[n].current=e}),"children"===n&&t.children&&!1!==e){var o=g(t.children),i=o.children,c=o._blocks;t.children=i,t._blocks=c}}};for(var r in t)n(r);return t}var j=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var k=c.a.utils,P=(k.get,k.set,k.extend),S=(k.isArray,k.create,k.isFunction,function(t){function e(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=2===r.length,c=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(r)));return i&&(c.$$innerInstance={},c.props=r[0],c.$$wrapDom=null,c.$$props=P({},c.props)),c}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,c.a),j(e,[{key:"componentDidMount",value:function(){var t=this.$$wrapDom.parentElement;this.$$innerInstance=new this.constructor(O(this.$$props)),t.replaceChild(this.$$innerInstance.init(),this.$$wrapDom)}},{key:"componentWillUnmount",value:function(){this.$$innerInstance&&this.$$innerInstance.destroy()}},{key:"componentDidUpdate",value:function(t,e,n){this.$$innerInstance&&this.$$innerInstance.set(O(this.$$props))}},{key:"render",value:function(){var t=this;return this.$$props=P(this.$$props,this.props),o.a.createElement("i",P({},{ref:function(e){t.$$wrapDom=e}}),"")}},{key:"$$cid",get:function(){return"IntactReact"}},{key:"isMounted",get:function(){return this.mounted}},{key:"isReactComponent",get:function(){return{}}}]),e}());n.d(e,"default",function(){return S})}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("intact/dist"),require("react")):"function"==typeof define&&define.amd?define(["intact/dist","react"],t):"object"==typeof exports?exports.Intact=t(require("intact/dist"),require("react")):e.Intact=t(e.Intact,e.React)}(window,function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"default",{enumerable:!0,get:function(){return function(e){return e&&e.__esModule?e:{default:e}}(r).default}}),e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=c(n(3)),i=c(n(0)),u=n(4);function c(e){return e&&e.__esModule?e:{default:e}}var a=i.default.utils,s=(a.get,a.set,a.extend),l=a.isObject,p=(a.isArray,a.create,a.isFunction,o.default.createElement);o.default.createElement=function(e,t,n){var r=l(e.prototype)&&"IntactReact"===e.prototype.$$cid,o=e.propTypes;r&&delete e.propTypes;var i=p.call(this,e,t,n);return r&&o&&(e.propTypes=o),i};var f=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=2===r.length,u=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return i&&(u.$$innerInstance=void 0,u.props=r[0],u.$$wrapDom=null,u.$$props=s({},u.props)),u}return function(e,t){if("function"!=typeof t&&null!==t)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:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,i.default),r(t,[{key:"componentDidMount",value:function(){var e=this.$$wrapDom.parentElement;this.$$innerInstance=new this.constructor((0,u.conversionProps)(this.$$props)),e.replaceChild(this.$$innerInstance.init(),this.$$wrapDom)}},{key:"componentWillUnmount",value:function(){this.$$innerInstance&&this.$$innerInstance.destroy()}},{key:"componentDidUpdate",value:function(e,t,n){this.$$innerInstance&&this.$$innerInstance.set((0,u.conversionProps)(this.$$props))}},{key:"render",value:function(){var e=this;return this.$$props=s(this.$$props,this.props),o.default.createElement("i",s({},{ref:function(t){e.$$wrapDom=t}}),"")}},{key:"$$cid",get:function(){return"IntactReact"}},{key:"isMounted",get:function(){return this.mounted}},{key:"isReactComponent",get:function(){return{}}}]),t}();t.default=f,e.exports=t.default},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.conversionProps=void 0;var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=function(e){return e&&e.__esModule?e:{default:e}}(n(0));var i=o.default.Vdt.miss.h,u=o.default.Vdt.miss.Types,c=o.default.Vdt.miss.VNode,a=o.default.utils,s=a.each,l=a.isFunction,p=(a.isString,a.isArray),f=a.isObject,d=a.hasOwn,h=(a.create,a.extend),y=a.isStringOrNumber,v="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,b=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.$$ctor=t.Ctor,n.instance=new n.$$ctor(e);var r=["constructor","props","_create","_mount","_beforeUpdate","_update","_destory","defaults","template","setState","forceUpdate"],o=n.instance,i=Object.getOwnPropertyNames(o.__proto__);i=i.concat(Object.getOwnPropertyNames(o));var u=!0,c=!1,a=void 0;try{for(var s,p=i[Symbol.iterator]();!(u=(s=p.next()).done);u=!0){var f=s.value;r.includes(f)||(l(o[f])?n[f]=o[f].bind(n):n[f]=o[f])}}catch(e){c=!0,a=e}finally{try{!u&&p.return&&p.return()}finally{if(c)throw a}}return n}return function(e,t){if("function"!=typeof t&&null!==t)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:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,o.default),r(t,[{key:"_create",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillMount&&this.componentWillMount()}},{key:"_mount",value:function(){this.componentDidMount&&this.componentDidMount()}},{key:"_beforeUpdate",value:function(){this.$$ctor.getDerivedStateFromProps&&this.$$ctor.getDerivedStateFromProps(),this.componentWillReceiveProps&&this.componentWillReceiveProps(),this.componentWillUpdate&&this.componentWillUpdate(),this.shouldComponentUpdate&&this.shouldComponentUpdate()}},{key:"_update",value:function(){this.getSnapshotBeforeUpdate&&this.getSnapshotBeforeUpdate(),this.componentDidUpdate&&this.componentDidUpdate()}},{key:"_destory",value:function(){this.componentWillUnmount&&this.componentWillUnmount()}},{key:"defaults",value:function(){return t.Ctor.props}},{key:"template",value:function(e,t,n,r){var o=this.data,i=m(o.instance.render.apply(o)).children;if(i.length>1)throw new Error("children must return only one"+i);var u=i;return u.children=u.props.children,u}},{key:"setState",value:function(e,t){this.state=e,this.set({state:e}),l(t)&&t.apply(this)}},{key:"forceUpdate",value:function(e){this.update(),l(e)&&e.apply(this)}}]),t}();function m(e){if(!e)return{children:e,_blocks:{}};p(e)||(e=[e]);var t=[],n={};return s(e,function(e){if(e){var r=e;if(y(e))r=new c(u.Text,null,{},e);else if(f(e)&&e.$$typeof===v){var o=$(h({},e.attributes,e.props)),a=e.type;l(a)&&a.prototype.render&&a.prototype.isReactComponent?(b.Ctor=e.type,b.Ctor.props=o,a=b):l(a)&&(a=function(t){var n=m(e.type(t)).children;if(n.length>1)throw new Error("children must return only one"+n);var r=n;return r.children=r.props.children,r}),r=i(a,o,o.children,null,e.key,e.ref)}if(f(r.props)&&r.props.slot){var s=void 0===r.props.slot||!0===r.props.slot?"default":r.props.slot;delete r.props.slot,n[s]=function(e){return r.children=r.props.children,r}}else t.push(r)}}),1===t.length&&(t=t[0]),{children:t,_blocks:n}}function $(e,t){var n=function(n){if(d.call(e,n)){if(function(e,t){return!(!l(e[t])||!/^on[A-Z]/.test(t))}(e,n)){var r="ev-"+n.replace(/^on([A-Z].*)$/,"$1").toLowerCase();e[r]=e[n],delete e[n]}if("ref"===n&&_.isObject(e[n])&&(e[n]=function(t){e[n].current=t}),"children"===n&&e.children&&!1!==t){var o=m(e.children),i=o.children,u=o._blocks;e.children=i,e._blocks=u}}};for(var r in e)n(r);return e}t.conversionProps=$}])});

@@ -1,8 +0,31 @@

const baseWebpack = require('./webpack.config');
const path = require('path');
const baseWebpack = require('./webpack.config.js');
baseWebpack.module.rules = baseWebpack.module.rules.concat([
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
url: true
}
}
]
},
{
test: /\.(woff2?|eot|ttf|otf|svg)(\?.*)?$/,
loader: 'file-loader'
}
])
const webpack = {
mode: 'development',
devtool: 'eval-source-map',
module: baseWebpack.module,
resolve: {
alias: {}
alias: {
'intact$': path.resolve(__dirname, 'dist/intact.react.js'),
'kpc': 'kpc/@css'
}
}

@@ -16,5 +39,7 @@ }

logLevel: config.LOG_INFO,
files: ['./test/index.js'],
files: [
{pattern: 'test/*.js', watched: true}
],
preprocessors: {
'./test/index.js': ['webpack', 'sourcemap'],
'./test/*.js': ['webpack'],
},

@@ -21,0 +46,0 @@ webpack: webpack,

{
"name": "intact-react",
"version": "1.0.1",
"version": "1.0.2",
"description": "A compatibility layer for running intact component in react v16",

@@ -42,3 +42,4 @@ "main": "dist/index.js",

"chai": "^4.2.0",
"css-loader": "^1.0.0",
"css-loader": "^1.0.1",
"file-loader": "^2.0.0",
"intact": "^2.3.0",

@@ -51,3 +52,4 @@ "karma": "^3.0.0",

"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^3.0.5",
"karma-webpack": "^4.0.0-rc.2",
"kpc": "^0.5.15",
"mocha": "^5.2.0",

@@ -61,5 +63,5 @@ "react": "^16.0.0",

"vdt-loader": "^1.3.1",
"webpack": "^4.22.0",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.2"
}
}

@@ -81,3 +81,4 @@ # IntactReact

### 注意
**intact 内部 的react 组件render 只支持返回一个节点 , 多节点将会报错**
**react 添加 slot 支持 , children 的 props 属性上添加`slot` 将对应 intact 内部的`<b:block></b:block>` , 详细可参见test 目录下的测试用例**
- **不支持`ReactDOMServer` , 不支持`ReactDOM.hydrate`, 不支持`ReactDOM.findDOMNode` 请使用ref 代替**
- **intact 内部 的react 组件render 只支持返回一个节点 , 多节点将会报错**
- **react 添加 slot 支持 , children 的 props 属性上添加`slot` 将对应 intact 内部的`<b:block></b:block>` , 详细可参见test 目录下的测试用例**
import React from 'react';
// for webpack alias Intact to IntactReact
import Intact from 'intact/dist';
import {conversionProps, unfreeze} from './util'
import {conversionProps} from './util'
const {get, set, extend, isArray, create, isFunction} = Intact.utils;
const {get, set, extend, isObject, isArray, create, isFunction} = Intact.utils;
const _createElement = React.createElement;
React.createElement = function createElementWithValidation(type, props, children) {
const isIntact = isObject(type.prototype) && type.prototype.$$cid === 'IntactReact';
const propTypes = type.propTypes;
if (isIntact) {
delete type.propTypes;
}
const element = _createElement.call(this, type, props, children);
if (isIntact && propTypes) {
type.propTypes = propTypes;
}
return element;
};
class IntactReact extends Intact {

@@ -13,3 +28,3 @@ constructor(...args) {

if (isReactCall) {
this.$$innerInstance = {};
this.$$innerInstance = undefined;
this.props = args[0];//react 需要验证props 全等 ,蛋疼

@@ -16,0 +31,0 @@ this.$$wrapDom = null;

@@ -121,7 +121,19 @@ import Intact from 'intact/dist';

let type = child.type;
if (isFunction(child.type) &&
child.type.prototype.$$cid !== 'IntactReact') {
if (isFunction(type) &&
type.prototype.render &&
type.prototype.isReactComponent) {
InheritIntactReact.Ctor = child.type;
InheritIntactReact.Ctor.props = props;
type = InheritIntactReact;
} else if (isFunction(type)) {
type = (props) => {
const _children = child.type(props);
const {children} = conversionChildrenBlocks(_children);
if (children.length > 1) {
throw new Error('children must return only one' + children);
}
const vNode = children;
vNode.children = vNode.props.children;
return vNode
}
}

@@ -194,4 +206,3 @@ vNode = h(

export {
conversionProps,
unfreeze
conversionProps
}

@@ -1,5 +0,7 @@

import Intact from '../index.js';
import Intact from '../index';
import React from 'react'
import ReactDOM from 'react-dom'
import {Button, ButtonGroup} from 'kpc/components/button';
const h = React.createElement;

@@ -54,2 +56,8 @@

function Functional(props) {
return h('div', {id: props.id}, [
props.children
]);
}
const br = document.createElement('div')

@@ -209,2 +217,96 @@ br.style = 'height:100px';

})
describe('Functional React Inner Intact', () => {
it('render', (done) => {
const container5 = document.createElement('div');
document.body.appendChild(container5);
const component = h(Functional, {id: 'react5'}, [h(Intact1, {
id: "intact5",
key: '1'
}), h('div', {key: '2'}, 'content')])
ReactDOM.render(
component,
container5, () => {
const intact = document.getElementById('intact5');
const react = document.getElementById('react5');
let count = 1;
setTimeout(() => {
intact.click()
count++;
console.log(react.innerHTML)
assert(react.innerHTML === `<div id="intact5">Intact ${count}</div><div>content</div>`, '渲染结果不正确');
// container4.remove();
container5.appendChild(br.cloneNode())
done()
})
})
})
})
describe('Intact Inner Functional React', () => {
it('render', (done) => {
const container6 = document.createElement('div');
document.body.appendChild(container6);
const component = h(Intact1,
{id: 'intact6'},
[
h(
Functional, {
id: "react6",
key: '1'
},
h(React1, {id: 'react6_1', key: '1'})
),
h(React1, {id: 'react6_3', key: '2'}),
h('div', {key: '3'}, 'content')
])
ReactDOM.render(
component,
container6, () => {
const intact = document.getElementById('intact6');
const react1 = document.getElementById('react6_1');
const react2 = document.getElementById('react6_3');
let count = 1;
let count1 = 1;
let count2 = 1;
setTimeout(() => {
intact.click()
count++;
react1.click();
count++;
count1++;
react2.click();
count++;
count2++;
console.log(intact.innerHTML)
assert(intact.innerHTML === `Intact ${count}<div id="react6"><div id="react6_1">React${count1}</div></div><div id="react6_3">React${count2}</div><div>content</div>`, '渲染结果不正确');
// container4.remove();
container6.appendChild(br.cloneNode())
done()
})
})
})
})
describe('render kpc component', () => {
it('render button', (done) => {
const container10 = document.createElement('div');
document.body.appendChild(container10);
const component = h(Functional,
{id: 'react5'},
[
h(ButtonGroup, {key: 1},
[
h(Button, {
key: 1, onClick: () => {
console.log('======')
}
}, '这是一个按钮1'),
h(Button, {key: 2}, '这是一个按钮2')
]
)
])
ReactDOM.render(
component,
container10)
done()
})
})
})

@@ -32,10 +32,2 @@ module.exports = {

loader: 'babel-loader',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
{
test: /\.vdt$/,
loader: 'vdt-loader'
}

@@ -42,0 +34,0 @@ ]

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