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

maishu-chitu-react

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maishu-chitu-react - npm Package Compare versions

Comparing version 1.27.0 to 1.30.0

demo/index.html

1

dist/application.d.ts

@@ -18,3 +18,2 @@ import React = require("react");

component: React.Component | null;
app: Application;
}

@@ -21,0 +20,0 @@ declare class DefaultPageNodeParser implements PageNodeParser {

/*!
*
* maishu-chitu-react v1.27.0
* maishu-chitu-react v1.30.0
* https://github.com/ansiboy/services-sdk

@@ -174,2 +174,3 @@ *

});
exports.Application = exports.Page = void 0;

@@ -187,3 +188,4 @@ var Page =

_this = _possibleConstructorReturn(this, _getPrototypeOf(Page).apply(this, arguments));
_this.component = null;
_this.component = null; // app: Application
return _this;

@@ -241,4 +243,3 @@ }

regeneratorRuntime.mark(function _callee() {
var actionExports, action, _app, props, element, component;
var actionExports, action, props, element, component;
return regeneratorRuntime.wrap(function _callee$(_context) {

@@ -272,29 +273,29 @@ while (1) {

case 8:
if (isClassComponent(action)) {
console.assert(this.app != null);
_app = this.app;
props = {
app: _app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding
},
source: page,
createService: function createService(type) {
return page.createService(type);
}
}; // let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
// if (isClassComponent(action)) {
// console.assert(this.app != null);
// let app = this.app;
props = {
app: app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding
},
source: page,
createService: function createService(type) {
return page.createService(type);
}
}; // let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
element = React.createElement(action, props); // )
element = React.createElement(action, props); // )
component = ReactDOM.render(element, page.element);
page.component = component;
} else {
action(page);
}
component = ReactDOM.render(element, page.element);
page.component = component; // }
// else {
// action(page);
// }
case 9:
case 12:
case "end":

@@ -304,3 +305,3 @@ return _context.stop();

}
}, _callee, this);
}, _callee);
}));

@@ -401,2 +402,3 @@ };

});
exports.Errors = void 0;

@@ -451,4 +453,15 @@ var Errors =

});
exports.Application = application_1.Application;
exports.Page = application_1.Page;
exports.Page = exports.Application = void 0;
Object.defineProperty(exports, "Application", {
enumerable: true,
get: function get() {
return application_1.Application;
}
});
Object.defineProperty(exports, "Page", {
enumerable: true,
get: function get() {
return application_1.Page;
}
});
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),

@@ -455,0 +468,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));

/*!
*
* maishu-chitu-react v1.27.0
* maishu-chitu-react v1.30.0
* https://github.com/ansiboy/services-sdk

@@ -10,3 +10,3 @@ *

*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("maishu-chitu"));else if("function"==typeof define&&define.amd)define(["react","react-dom","maishu-chitu"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("maishu-chitu")):t(e.react,e["react-dom"],e["maishu-chitu"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"==typeof window?global:window,function(e,t,n){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=0)}([function(e,t,n){"use strict";var r,o;r=[n,t,n(1)],void 0===(o=function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Application=n.Application,t.Page=n.Page}.apply(t,r))||(e.exports=o)},function(e,t,n){"use strict";var r,o;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(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)}}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}c((r=r.apply(e,t||[])).next())})};r=[n,t,n(2),n(3),n(4),n(5)],void 0===(o=function(e,t,n,r,o,i){Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){var e;return c(this,t),(e=f(this,l(t).apply(this,arguments))).component=null,e}return p(t,o.Page),t}();t.Page=u;var d=function(){function e(t){c(this,e),this.nodes={},this.modulesPath=t.endsWith("/")?t.substr(0,t.length-1):t}return a(e,[{key:"parse",value:function(e){var t=this,n=this.nodes[e];if(null==n){var r="".concat(e).split("_").join("/");this.modulesPath&&(r="".concat(this.modulesPath,"/").concat(r)),n={action:this.createDefaultAction(r,function(e){return t.loadjs(e)}),name:e},this.nodes[e]=n}return n}},{key:"createDefaultAction",value:function(e,t){var o=this;return function(u,a){return y(o,void 0,void 0,regeneratorRuntime.mark(function o(){var a,c,f,s,l,p;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,t(e);case 2:if(a=o.sent){o.next=5;break}throw i.Errors.exportsCanntNull(e);case 5:if(null!=(c=a.default)){o.next=8;break}throw i.Errors.canntFindAction(u.name);case 8:v(c)?(console.assert(null!=this.app),f=this.app,s={app:f,data:u.data,events:{shown:u.shown,showing:u.showing,hidden:u.hidden,hiding:u.hiding},source:u,createService:function(e){return u.createService(e)}},l=n.createElement(c,s),p=r.render(l,u.element),u.component=p):c(u);case 9:case"end":return o.stop()}},o,this)}))}}}]),e}(),h=function(e){function t(e){var n;return c(this,t),void 0===(e=e||{}).modulesPath&&(e.modulesPath="modules"),e.parser||(e.parser=t.createPageNodeParser(e.modulesPath)),n=f(this,l(t).call(this,e)),e.parser.app=s(n),e.parser.loadjs=function(e){return n.loadjs(e)},n.pageType=u,n}return p(t,o.Application),a(t,null,[{key:"createPageNodeParser",value:function(e){return new d(e)}}]),t}();function v(e){return!("function"!=typeof e||!e.prototype.isReactComponent)}t.Application=h}.apply(t,r))||(e.exports=o)},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";var r;function o(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)}}void 0===(r=function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"canntFindAction",value:function(e){var t="Cannt find action in page '".concat(e,"', is the exports has default field?");return new Error(t)}},{key:"exportsCanntNull",value:function(e){var t="Exports of page '".concat(e,"' is null.");return new Error(t)}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}();t.Errors=n}.apply(t,[n,t]))||(e.exports=r)}])});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("maishu-chitu"));else if("function"==typeof define&&define.amd)define(["react","react-dom","maishu-chitu"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("maishu-chitu")):t(e.react,e["react-dom"],e["maishu-chitu"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"==typeof window?global:window,function(e,t,n){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=0)}([function(e,t,n){"use strict";var r,o;r=[n,t,n(1)],void 0===(o=function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Page=t.Application=void 0,Object.defineProperty(t,"Application",{enumerable:!0,get:function(){return n.Application}}),Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return n.Page}})}.apply(t,r))||(e.exports=o)},function(e,t,n){"use strict";var r,o;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(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)}}function a(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?l(e):t}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function u(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}c((r=r.apply(e,t||[])).next())})};r=[n,t,n(2),n(3),n(4),n(5)],void 0===(o=function(e,t,n,r,o,i){Object.defineProperty(t,"__esModule",{value:!0}),t.Application=t.Page=void 0;var u=function(e){function t(){var e;return c(this,t),(e=f(this,s(t).apply(this,arguments))).component=null,e}return p(t,o.Page),t}();t.Page=u;var d=function(){function e(t){c(this,e),this.nodes={},this.modulesPath=t.endsWith("/")?t.substr(0,t.length-1):t}return a(e,[{key:"parse",value:function(e){var t=this,n=this.nodes[e];if(null==n){var r="".concat(e).split("_").join("/");this.modulesPath&&(r="".concat(this.modulesPath,"/").concat(r)),n={action:this.createDefaultAction(r,function(e){return t.loadjs(e)}),name:e},this.nodes[e]=n}return n}},{key:"createDefaultAction",value:function(e,t){var o=this;return function(u,a){return y(o,void 0,void 0,regeneratorRuntime.mark(function o(){var c,f,l,s,p;return regeneratorRuntime.wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,t(e);case 2:if(c=o.sent){o.next=5;break}throw i.Errors.exportsCanntNull(e);case 5:if(null!=(f=c.default)){o.next=8;break}throw i.Errors.canntFindAction(u.name);case 8:l={app:a,data:u.data,events:{shown:u.shown,showing:u.showing,hidden:u.hidden,hiding:u.hiding},source:u,createService:function(e){return u.createService(e)}},s=n.createElement(f,l),p=r.render(s,u.element),u.component=p;case 12:case"end":return o.stop()}},o)}))}}}]),e}(),h=function(e){function t(e){var n;return c(this,t),void 0===(e=e||{}).modulesPath&&(e.modulesPath="modules"),e.parser||(e.parser=t.createPageNodeParser(e.modulesPath)),n=f(this,s(t).call(this,e)),e.parser.app=l(n),e.parser.loadjs=function(e){return n.loadjs(e)},n.pageType=u,n}return p(t,o.Application),a(t,null,[{key:"createPageNodeParser",value:function(e){return new d(e)}}]),t}();t.Application=h}.apply(t,r))||(e.exports=o)},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";var r;function o(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)}}void 0===(r=function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=void 0;var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,r=[{key:"canntFindAction",value:function(e){var t="Cannt find action in page '".concat(e,"', is the exports has default field?");return new Error(t)}},{key:"exportsCanntNull",value:function(e){var t="Exports of page '".concat(e,"' is null.");return new Error(t)}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}();t.Errors=n}.apply(t,[n,t]))||(e.exports=r)}])});
//# sourceMappingURL=index.es5.min.js.map
/*!
*
* maishu-chitu-react v1.27.0
* maishu-chitu-react v1.30.0
* https://github.com/ansiboy/services-sdk

@@ -127,2 +127,3 @@ *

Object.defineProperty(exports, "__esModule", { value: true });
exports.Application = exports.Page = void 0;
class Page extends chitu.Page {

@@ -132,2 +133,3 @@ constructor() {

this.component = null;
// app: Application
}

@@ -163,28 +165,28 @@ }

}
if (isClassComponent(action)) {
console.assert(this.app != null);
let app = this.app;
let props = {
app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding,
},
source: page,
createService(type) {
return page.createService(type);
}
};
// let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
let element = React.createElement(action, props);
// )
let component = ReactDOM.render(element, page.element);
page.component = component;
}
else {
action(page);
}
// if (isClassComponent(action)) {
// console.assert(this.app != null);
// let app = this.app;
let props = {
app: app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding,
},
source: page,
createService(type) {
return page.createService(type);
}
};
// let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
let element = React.createElement(action, props);
// )
let component = ReactDOM.render(element, page.element);
page.component = component;
// }
// else {
// action(page);
// }
});

@@ -247,2 +249,3 @@ }

Object.defineProperty(exports, "__esModule", { value: true });
exports.Errors = void 0;
class Errors {

@@ -275,4 +278,5 @@ static canntFindAction(pageName) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.Application = application_1.Application;
exports.Page = application_1.Page;
exports.Page = exports.Application = void 0;
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_1.Application; } });
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return application_1.Page; } });
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),

@@ -279,0 +283,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));

/*!
*
* maishu-chitu-react v1.27.0
* maishu-chitu-react v1.30.0
* https://github.com/ansiboy/services-sdk

@@ -10,3 +10,3 @@ *

*/
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("maishu-chitu"));else if("function"==typeof define&&define.amd)define(["react","react-dom","maishu-chitu"],t);else{var n="object"==typeof exports?t(require("react"),require("react-dom"),require("maishu-chitu")):t(e.react,e["react-dom"],e["maishu-chitu"]);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"==typeof window?global:window,function(e,t,n){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=0)}([function(e,t,n){var r,o;r=[n,t,n(1)],void 0===(o=function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Application=n.Application,t.Page=n.Page}.apply(t,r))||(e.exports=o)},function(e,t,n){var r,o,i=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{u(r.next(e))}catch(e){i(e)}}function s(e){try{u(r.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}u((r=r.apply(e,t||[])).next())})};r=[n,t,n(2),n(3),n(4),n(5)],void 0===(o=function(e,t,n,r,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class s extends o.Page{constructor(){super(...arguments),this.component=null}}t.Page=s;class u{constructor(e){this.nodes={},this.modulesPath=e.endsWith("/")?e.substr(0,e.length-1):e}parse(e){let t=this.nodes[e];if(null==t){let n=`${e}`.split("_").join("/");this.modulesPath&&(n=`${this.modulesPath}/${n}`),t={action:this.createDefaultAction(n,e=>this.loadjs(e)),name:e},this.nodes[e]=t}return t}createDefaultAction(e,t){return(o,s)=>i(this,void 0,void 0,function*(){let i=yield t(e);if(!i)throw a.Errors.exportsCanntNull(e);let s=i.default;if(null==s)throw a.Errors.canntFindAction(o.name);if("function"==typeof(u=s)&&u.prototype.isReactComponent){console.assert(null!=this.app);let e={app:this.app,data:o.data,events:{shown:o.shown,showing:o.showing,hidden:o.hidden,hiding:o.hiding},source:o,createService:e=>o.createService(e)},t=n.createElement(s,e),i=r.render(t,o.element);o.component=i}else s(o);var u})}}class c extends o.Application{constructor(e){void 0===(e=e||{}).modulesPath&&(e.modulesPath="modules"),e.parser||(e.parser=c.createPageNodeParser(e.modulesPath)),super(e),e.parser.app=this,e.parser.loadjs=(e=>this.loadjs(e)),this.pageType=s}static createPageNodeParser(e){return new u(e)}}t.Application=c}.apply(t,r))||(e.exports=o)},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){var r;void 0===(r=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Errors=class{static canntFindAction(e){return new Error(`Cannt find action in page '${e}', is the exports has default field?`)}static exportsCanntNull(e){return new Error(`Exports of page '${e}' is null.`)}}}.apply(t,[n,t]))||(e.exports=r)}])});
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("react"),require("react-dom"),require("maishu-chitu"));else if("function"==typeof define&&define.amd)define(["react","react-dom","maishu-chitu"],t);else{var r="object"==typeof exports?t(require("react"),require("react-dom"),require("maishu-chitu")):t(e.react,e["react-dom"],e["maishu-chitu"]);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"==typeof window?global:window,function(e,t,r){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){var n,o;n=[r,t,r(1)],void 0===(o=function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Page=t.Application=void 0,Object.defineProperty(t,"Application",{enumerable:!0,get:function(){return r.Application}}),Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return r.Page}})}.apply(t,n))||(e.exports=o)},function(e,t,r){var n,o,i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function u(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,u)}s((n=n.apply(e,t||[])).next())})};n=[r,t,r(2),r(3),r(4),r(5)],void 0===(o=function(e,t,r,n,o,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Application=t.Page=void 0;class u extends o.Page{constructor(){super(...arguments),this.component=null}}t.Page=u;class s{constructor(e){this.nodes={},this.modulesPath=e.endsWith("/")?e.substr(0,e.length-1):e}parse(e){let t=this.nodes[e];if(null==t){let r=`${e}`.split("_").join("/");this.modulesPath&&(r=`${this.modulesPath}/${r}`),t={action:this.createDefaultAction(r,e=>this.loadjs(e)),name:e},this.nodes[e]=t}return t}createDefaultAction(e,t){return(o,u)=>i(this,void 0,void 0,function*(){let i=yield t(e);if(!i)throw a.Errors.exportsCanntNull(e);let s=i.default;if(null==s)throw a.Errors.canntFindAction(o.name);let c={app:u,data:o.data,events:{shown:o.shown,showing:o.showing,hidden:o.hidden,hiding:o.hiding},source:o,createService:e=>o.createService(e)},l=r.createElement(s,c),d=n.render(l,o.element);o.component=d})}}class c extends o.Application{constructor(e){void 0===(e=e||{}).modulesPath&&(e.modulesPath="modules"),e.parser||(e.parser=c.createPageNodeParser(e.modulesPath)),super(e),e.parser.app=this,e.parser.loadjs=e=>this.loadjs(e),this.pageType=u}static createPageNodeParser(e){return new s(e)}}t.Application=c}.apply(t,n))||(e.exports=o)},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t){e.exports=r},function(e,t,r){var n;void 0===(n=function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Errors=void 0;t.Errors=class{static canntFindAction(e){return new Error(`Cannt find action in page '${e}', is the exports has default field?`)}static exportsCanntNull(e){return new Error(`Exports of page '${e}' is null.`)}}}.apply(t,[r,t]))||(e.exports=n)}])});
//# sourceMappingURL=index.min.js.map

@@ -59,2 +59,3 @@ "use strict";

});
exports.Application = exports.Page = void 0;

@@ -72,3 +73,4 @@ var Page =

_this = _possibleConstructorReturn(this, _getPrototypeOf(Page).apply(this, arguments));
_this.component = null;
_this.component = null; // app: Application
return _this;

@@ -126,4 +128,3 @@ }

regeneratorRuntime.mark(function _callee() {
var actionExports, action, _app, props, element, component;
var actionExports, action, props, element, component;
return regeneratorRuntime.wrap(function _callee$(_context) {

@@ -157,29 +158,29 @@ while (1) {

case 8:
if (isClassComponent(action)) {
console.assert(this.app != null);
_app = this.app;
props = {
app: _app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding
},
source: page,
createService: function createService(type) {
return page.createService(type);
}
}; // let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
// if (isClassComponent(action)) {
// console.assert(this.app != null);
// let app = this.app;
props = {
app: app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding
},
source: page,
createService: function createService(type) {
return page.createService(type);
}
}; // let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
element = React.createElement(action, props); // )
element = React.createElement(action, props); // )
component = ReactDOM.render(element, page.element);
page.component = component;
} else {
action(page);
}
component = ReactDOM.render(element, page.element);
page.component = component; // }
// else {
// action(page);
// }
case 9:
case 12:
case "end":

@@ -189,3 +190,3 @@ return _context.stop();

}
}, _callee, this);
}, _callee);
}));

@@ -192,0 +193,0 @@ };

@@ -15,2 +15,3 @@ "use strict";

});
exports.Errors = void 0;

@@ -17,0 +18,0 @@ var Errors =

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -0,0 +0,0 @@ "use strict";

@@ -9,5 +9,16 @@ "use strict";

});
exports.Application = application_1.Application;
exports.Page = application_1.Page;
exports.Page = exports.Application = void 0;
Object.defineProperty(exports, "Application", {
enumerable: true,
get: function get() {
return application_1.Application;
}
});
Object.defineProperty(exports, "Page", {
enumerable: true,
get: function get() {
return application_1.Page;
}
});
});
//# sourceMappingURL=index.js.map

@@ -18,3 +18,2 @@ import React = require("react");

component: React.Component | null;
app: Application;
}

@@ -21,0 +20,0 @@ declare class DefaultPageNodeParser implements PageNodeParser {

@@ -13,2 +13,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.Application = exports.Page = void 0;
class Page extends chitu.Page {

@@ -18,2 +19,3 @@ constructor() {

this.component = null;
// app: Application
}

@@ -49,28 +51,28 @@ }

}
if (isClassComponent(action)) {
console.assert(this.app != null);
let app = this.app;
let props = {
app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding,
},
source: page,
createService(type) {
return page.createService(type);
}
};
// let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
let element = React.createElement(action, props);
// )
let component = ReactDOM.render(element, page.element);
page.component = component;
}
else {
action(page);
}
// if (isClassComponent(action)) {
// console.assert(this.app != null);
// let app = this.app;
let props = {
app: app,
data: page.data,
events: {
shown: page.shown,
showing: page.showing,
hidden: page.hidden,
hiding: page.hiding,
},
source: page,
createService(type) {
return page.createService(type);
}
};
// let element = React.createElement(PageContext.Provider, { value: { page: page as Page } },
let element = React.createElement(action, props);
// )
let component = ReactDOM.render(element, page.element);
page.component = component;
// }
// else {
// action(page);
// }
});

@@ -77,0 +79,0 @@ }

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Errors = void 0;
class Errors {

@@ -5,0 +6,0 @@ static canntFindAction(pageName) {

define(["require", "exports", "./application"], function (require, exports, application_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Application = application_1.Application;
exports.Page = application_1.Page;
exports.Page = exports.Application = void 0;
Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return application_1.Application; } });
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return application_1.Page; } });
});
{
"name": "maishu-chitu-react",
"version": "1.27.0",
"version": "1.30.0",
"description": "",

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

@@ -20,3 +20,3 @@ const webpack = require('webpack');

devtool: 'source-map',
externals: ['react', 'react-dom', 'maishu-chitu'],
externals: ['react', 'react-dom', 'maishu-chitu', "maishu-chitu-service"],
plugins: [

@@ -23,0 +23,0 @@ new webpack.BannerPlugin(license),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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