maishu-chitu-react
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -6,3 +6,3 @@ import React = require("react"); | ||
data: chitu.Page["data"]; | ||
source: chitu.Page; | ||
source: Page; | ||
createService: chitu.Page["createService"]; | ||
@@ -16,7 +16,5 @@ } | ||
parser?: chitu.PageNodeParser; | ||
container?: HTMLElement | { | ||
[name: string]: HTMLElement; | ||
}; | ||
container?: HTMLElement; | ||
}); | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): chitu.Action; | ||
} |
/*! | ||
* | ||
* maishu-chitu-react v1.7.0 | ||
* maishu-chitu-react v1.8.0 | ||
* https://github.com/ansiboy/services-sdk | ||
@@ -209,4 +209,3 @@ * | ||
regeneratorRuntime.mark(function _callee() { | ||
var actionExports, _action, action, app, props, element, component; | ||
var actionExports, action, app, props, element, component; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -230,5 +229,5 @@ while (1) { | ||
case 5: | ||
_action = actionExports['default']; | ||
action = actionExports['default']; | ||
if (!(_action == null)) { | ||
if (!(action == null)) { | ||
_context.next = 8; | ||
@@ -241,20 +240,25 @@ break; | ||
case 8: | ||
// let action: any; | ||
// if (!chitu.PageMaster.isClass(_action)) { | ||
// return _action(page, this) | ||
// } | ||
action = _action; | ||
app = this; | ||
props = { | ||
app: app, | ||
data: page.data, | ||
source: page, | ||
createService: function createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
element = React.createElement(action, props); | ||
component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
// action = _action as any | ||
if (isReactComponent(action)) { | ||
app = this; | ||
props = { | ||
app: app, | ||
data: page.data, | ||
source: page, | ||
createService: function createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
element = React.createElement(action, props); | ||
component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
} else { | ||
action(page); | ||
} | ||
case 14: | ||
case 9: | ||
case "end": | ||
@@ -274,2 +278,14 @@ return _context.stop(); | ||
exports.Application = Application; | ||
function isClassComponent(component) { | ||
return typeof component === 'function' && !!component.prototype.isReactComponent ? true : false; | ||
} | ||
function isFunctionComponent(component) { | ||
return typeof component === 'function' && String(component).includes('return React.createElement') ? true : false; | ||
} | ||
function isReactComponent(component) { | ||
return isClassComponent(component) || isFunctionComponent(component) ? true : false; | ||
} | ||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -276,0 +292,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
/*! | ||
* | ||
* maishu-chitu-react v1.7.0 | ||
* maishu-chitu-react v1.8.0 | ||
* https://github.com/ansiboy/services-sdk | ||
@@ -135,23 +135,28 @@ * | ||
throw errors_1.Errors.exportsCanntNull(url); | ||
let _action = actionExports['default']; | ||
if (_action == null) { | ||
let action = actionExports['default']; | ||
if (action == null) { | ||
throw errors_1.Errors.canntFindAction(page.name); | ||
} | ||
let action; | ||
// let action: any; | ||
// if (!chitu.PageMaster.isClass(_action)) { | ||
// return _action(page, this) | ||
// } | ||
action = _action; | ||
let app = this; | ||
let props = { | ||
app, | ||
data: page.data, | ||
source: page, | ||
createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
let element = React.createElement(action, props); | ||
let component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
// action = _action as any | ||
if (isReactComponent(action)) { | ||
let app = this; | ||
let props = { | ||
app, | ||
data: page.data, | ||
source: page, | ||
createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
let element = React.createElement(action, props); | ||
let component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
} | ||
else { | ||
action(page); | ||
} | ||
}); | ||
@@ -161,2 +166,14 @@ } | ||
exports.Application = Application; | ||
function isClassComponent(component) { | ||
return (typeof component === 'function' && | ||
!!component.prototype.isReactComponent) ? true : false; | ||
} | ||
function isFunctionComponent(component) { | ||
return (typeof component === 'function' && | ||
String(component).includes('return React.createElement')) ? true : false; | ||
} | ||
function isReactComponent(component) { | ||
return (isClassComponent(component) || | ||
isFunctionComponent(component)) ? true : false; | ||
} | ||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
@@ -163,0 +180,0 @@ __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
@@ -0,1 +1,2 @@ | ||
let node_modules = 'node_modules' | ||
@@ -2,0 +3,0 @@ const webpackES6Config = require('./webpack.config.js'); |
@@ -104,4 +104,3 @@ "use strict"; | ||
regeneratorRuntime.mark(function _callee() { | ||
var actionExports, _action, action, app, props, element, component; | ||
var actionExports, action, app, props, element, component; | ||
return regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -125,5 +124,5 @@ while (1) { | ||
case 5: | ||
_action = actionExports['default']; | ||
action = actionExports['default']; | ||
if (!(_action == null)) { | ||
if (!(action == null)) { | ||
_context.next = 8; | ||
@@ -136,20 +135,25 @@ break; | ||
case 8: | ||
// let action: any; | ||
// if (!chitu.PageMaster.isClass(_action)) { | ||
// return _action(page, this) | ||
// } | ||
action = _action; | ||
app = this; | ||
props = { | ||
app: app, | ||
data: page.data, | ||
source: page, | ||
createService: function createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
element = React.createElement(action, props); | ||
component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
// action = _action as any | ||
if (isReactComponent(action)) { | ||
app = this; | ||
props = { | ||
app: app, | ||
data: page.data, | ||
source: page, | ||
createService: function createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
element = React.createElement(action, props); | ||
component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
} else { | ||
action(page); | ||
} | ||
case 14: | ||
case 9: | ||
case "end": | ||
@@ -169,3 +173,15 @@ return _context.stop(); | ||
exports.Application = Application; | ||
function isClassComponent(component) { | ||
return typeof component === 'function' && !!component.prototype.isReactComponent ? true : false; | ||
} | ||
function isFunctionComponent(component) { | ||
return typeof component === 'function' && String(component).includes('return React.createElement') ? true : false; | ||
} | ||
function isReactComponent(component) { | ||
return isClassComponent(component) || isFunctionComponent(component) ? true : false; | ||
} | ||
}); | ||
//# sourceMappingURL=application.js.map |
@@ -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"; |
@@ -6,3 +6,3 @@ import React = require("react"); | ||
data: chitu.Page["data"]; | ||
source: chitu.Page; | ||
source: Page; | ||
createService: chitu.Page["createService"]; | ||
@@ -16,7 +16,5 @@ } | ||
parser?: chitu.PageNodeParser; | ||
container?: HTMLElement | { | ||
[name: string]: HTMLElement; | ||
}; | ||
container?: HTMLElement; | ||
}); | ||
protected createDefaultAction(url: string, loadjs: (path: string) => Promise<any>): chitu.Action; | ||
} |
@@ -31,23 +31,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
throw errors_1.Errors.exportsCanntNull(url); | ||
let _action = actionExports['default']; | ||
if (_action == null) { | ||
let action = actionExports['default']; | ||
if (action == null) { | ||
throw errors_1.Errors.canntFindAction(page.name); | ||
} | ||
let action; | ||
// let action: any; | ||
// if (!chitu.PageMaster.isClass(_action)) { | ||
// return _action(page, this) | ||
// } | ||
action = _action; | ||
let app = this; | ||
let props = { | ||
app, | ||
data: page.data, | ||
source: page, | ||
createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
let element = React.createElement(action, props); | ||
let component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
// action = _action as any | ||
if (isReactComponent(action)) { | ||
let app = this; | ||
let props = { | ||
app, | ||
data: page.data, | ||
source: page, | ||
createService(type) { | ||
return page.createService(type); | ||
} | ||
}; | ||
let element = React.createElement(action, props); | ||
let component = ReactDOM.render(element, page.element); | ||
page.component = component; | ||
} | ||
else { | ||
action(page); | ||
} | ||
}); | ||
@@ -57,2 +62,14 @@ } | ||
exports.Application = Application; | ||
function isClassComponent(component) { | ||
return (typeof component === 'function' && | ||
!!component.prototype.isReactComponent) ? true : false; | ||
} | ||
function isFunctionComponent(component) { | ||
return (typeof component === 'function' && | ||
String(component).includes('return React.createElement')) ? true : false; | ||
} | ||
function isReactComponent(component) { | ||
return (isClassComponent(component) || | ||
isFunctionComponent(component)) ? true : false; | ||
} | ||
}); |
{ | ||
"name": "maishu-chitu-react", | ||
"version": "1.7.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "grunt" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ansiboy/chitu-react.git" | ||
}, | ||
"author": "mai.shu", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ansiboy/chitu-react/issues" | ||
}, | ||
"homepage": "https://github.com/ansiboy/chitu-react#readme", | ||
"dependencies": { | ||
"maishu-chitu": "^3.0.0", | ||
"maishu-chitu-service": "^1.1.16", | ||
"react": "^16.8.2", | ||
"react-dom": "^16.8.2" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^16.7.11", | ||
"@types/react-dom": "^16.0.11", | ||
"@babel/core": "^7.4.4", | ||
"@babel/preset-env": "^7.4.4", | ||
"grunt": "^1.0.3", | ||
"grunt-babel": "^8.0.0", | ||
"grunt-contrib-copy": "^1.0.0", | ||
"grunt-shell": "^2.1.0", | ||
"grunt-webpack": "^3.1.3", | ||
"load-grunt-tasks": "^4.0.0", | ||
"webpack": "^4.30.0", | ||
"webpack-cli": "^3.3.0" | ||
} | ||
} | ||
"name": "maishu-chitu-react", | ||
"version": "1.8.0", | ||
"description": "", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"build": "grunt" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ansiboy/chitu-react.git" | ||
}, | ||
"author": "mai.shu", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/ansiboy/chitu-react/issues" | ||
}, | ||
"homepage": "https://github.com/ansiboy/chitu-react#readme", | ||
"dependencies": { | ||
"maishu-chitu": "^3.4.6", | ||
"maishu-chitu-service": "^1.1.16", | ||
"react": "^16.8.2", | ||
"react-dom": "^16.8.2" | ||
}, | ||
"devDependencies": { | ||
"@types/react": "^16.7.11", | ||
"@types/react-dom": "^16.0.11", | ||
"@babel/core": "^7.4.4", | ||
"@babel/preset-env": "^7.4.4", | ||
"grunt": "^1.0.3", | ||
"grunt-babel": "^8.0.0", | ||
"grunt-contrib-copy": "^1.0.0", | ||
"grunt-shell": "^2.1.0", | ||
"grunt-webpack": "^3.1.3", | ||
"load-grunt-tasks": "^4.0.0", | ||
"webpack": "^4.30.0", | ||
"webpack-cli": "^3.3.0" | ||
} | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
428862
2479
Updatedmaishu-chitu@^3.4.6