concent-middleware-web-devtool
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -41,2 +41,7 @@ (function (global, factory) { | ||
var ignoreEmptyMS = true; | ||
var labelKey_label_ = { | ||
clear: '清除', | ||
close: '关闭', | ||
open: '开启状态调试工具' | ||
}; | ||
var toExport = module.exports = {}; | ||
@@ -61,2 +66,7 @@ var stBox = { | ||
color: 'red', | ||
border: '1px solid red', | ||
marginRight: '12px' | ||
}; | ||
var stCtrlBtn2 = { | ||
color: 'red', | ||
border: '1px solid red' | ||
@@ -212,4 +222,4 @@ }; | ||
} | ||
}, "\u6E05\u9664"), React.createElement("button", { | ||
style: stCtrlBtn, | ||
}, labelKey_label_.clear), React.createElement("button", { | ||
style: stCtrlBtn2, | ||
onClick: function onClick() { | ||
@@ -220,3 +230,3 @@ return _this2.setState({ | ||
} | ||
}, "\u5173\u95ED"), this.renderHistory()); | ||
}, labelKey_label_.close), this.renderHistory()); | ||
} else { | ||
@@ -230,3 +240,3 @@ return React.createElement("button", { | ||
} | ||
}, "\u5F00\u542F\u72B6\u6001\u8C03\u8BD5\u5DE5\u5177"); | ||
}, labelKey_label_.open); | ||
} | ||
@@ -245,6 +255,12 @@ }; | ||
toExport.setConf = function (ignoreEmptyModuleState) { | ||
if (ignoreEmptyModuleState != undefined) ignoreEmptyMS = ignoreEmptyModuleState; | ||
toExport.setConf = function (wordConf, options) { | ||
if (options && options.ignoreEmptyModuleState != undefined) ignoreEmptyMS = options.ignoreEmptyModuleState; | ||
if (wordConf) { | ||
if (wordConf.clear != undefined) labelKey_label_.clear = wordConf.clear; | ||
if (wordConf.close != undefined) labelKey_label_.close = wordConf.close; | ||
if (wordConf.open != undefined) labelKey_label_.clear = wordConf.open; | ||
} | ||
}; | ||
}))); |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@babel/runtime/helpers/esm/assertThisInitialized"),require("@babel/runtime/helpers/esm/inheritsLoose")):"function"==typeof define&&define.amd?define(["@babel/runtime/helpers/esm/assertThisInitialized","@babel/runtime/helpers/esm/inheritsLoose"],t):t(e._assertThisInitialized,e._inheritsLoose)}(this,function(a,r){"use strict";a=a&&a.hasOwnProperty("default")?a.default:a,r=r&&r.hasOwnProperty("default")?r.default:r;var i=require("react"),s=require("react-json-tree").default,l=require("immutable").fromJS,c=require("concent").getState,o={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},d=!0,e=module.exports={},u={position:"fixed",zIndex:9999,top:0,right:0,width:"280px",height:"100vh",backgroundColor:"#00262f",overflowY:"auto"},f={position:"fixed",top:19,right:19,zIndex:9999},h={color:"red",border:"1px solid red"},b={color:"#57c7de",margin:0,padding:"2px"},m=1;function y(){var t=c(),n={};return Object.keys(t).forEach(function(e){n[e]=l(t[e])}),n}var p={changeState:function(){}};e.ConcentWebDevTool=function(t){function e(){var e;return(e=t.call(this)||this).state={historyStateList:[],show:!1},e.changeState=e.changeState.bind(a(e)),e.renderHistory=e.renderHistory.bind(a(e)),p.changeState=e.changeState,e}r(e,t);var n=e.prototype;return n.componentDidMount=function(){var e=this.state.historyStateList;e.push({calledBy:"",modifiedModule:"",type:"",state:y()}),this.setState({historyStateList:e})},n.changeState=function(e){var t=e.calledBy||e.ccKey,n=e.type||"",a=e.module,r=this.state.historyStateList,i=r[r.length-1],s=e.sharedState;if(!d||s){s||(s={});var o=function(e,t,n){var a,r=e[t];r||(r=l(c(t)));var i=r;return Object.keys(n).forEach(function(e){i=r.set(e,n[e])}),Object.assign({},e,((a={})[t]=i,a))}(i?i.state:y(),a,s);r.push({calledBy:t,modifiedModule:a,type:n,state:o}),this.setState({historyStateList:r})}},n.renderHistory=function(){return this.state.historyStateList.map(function(e){return i.createElement("div",{key:++m,style:{border:"1px solid #35aa7e",margin:"5px 2px"}},i.createElement("h4",{style:b},"calledBy: ",e.calledBy),i.createElement("h4",{style:b},"type: ",e.type),i.createElement("h4",{style:b},"modifiedModule: ",e.modifiedModule),i.createElement("div",{style:{marginTop:"-12px"}},i.createElement(s,{data:e.state,theme:o,invertTheme:!1,shouldExpandNode:!1})))})},n.render=function(){var e=this;return this.state.show?i.createElement("div",{style:u},i.createElement("button",{style:h,onClick:function(){return e.setState({historyStateList:[]})}},"清除"),i.createElement("button",{style:h,onClick:function(){return e.setState({show:!1})}},"关闭"),this.renderHistory()):i.createElement("button",{style:f,onClick:function(){return e.setState({show:!0})}},"开启状态调试工具")},e}(i.Component),e.concentWebDevToolMiddleWare=function(e,t){p.changeState(e),t()},e.setConf=function(e){null!=e&&(d=e)}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@babel/runtime/helpers/esm/assertThisInitialized"),require("@babel/runtime/helpers/esm/inheritsLoose")):"function"==typeof define&&define.amd?define(["@babel/runtime/helpers/esm/assertThisInitialized","@babel/runtime/helpers/esm/inheritsLoose"],t):t(e._assertThisInitialized,e._inheritsLoose)}(this,function(r,a){"use strict";r=r&&r.hasOwnProperty("default")?r.default:r,a=a&&a.hasOwnProperty("default")?a.default:a;var o=require("react"),i=require("react-json-tree").default,l=require("immutable").fromJS,c=require("concent").getState,s={scheme:"monokai",author:"wimer hazenberg (http://www.monokai.nl)",base00:"#272822",base01:"#383830",base02:"#49483e",base03:"#75715e",base04:"#a59f85",base05:"#f8f8f2",base06:"#f5f4f1",base07:"#f9f8f5",base08:"#f92672",base09:"#fd971f",base0A:"#f4bf75",base0B:"#a6e22e",base0C:"#a1efe4",base0D:"#66d9ef",base0E:"#ae81ff",base0F:"#cc6633"},d=!0,u={clear:"清除",close:"关闭",open:"开启状态调试工具"},e=module.exports={},f={position:"fixed",zIndex:9999,top:0,right:0,width:"280px",height:"100vh",backgroundColor:"#00262f",overflowY:"auto"},h={position:"fixed",top:19,right:19,zIndex:9999},p={color:"red",border:"1px solid red",marginRight:"12px"},m={color:"red",border:"1px solid red"},b={color:"#57c7de",margin:0,padding:"2px"},y=1;function S(){var t=c(),n={};return Object.keys(t).forEach(function(e){n[e]=l(t[e])}),n}var g={changeState:function(){}};e.ConcentWebDevTool=function(t){function e(){var e;return(e=t.call(this)||this).state={historyStateList:[],show:!1},e.changeState=e.changeState.bind(r(e)),e.renderHistory=e.renderHistory.bind(r(e)),g.changeState=e.changeState,e}a(e,t);var n=e.prototype;return n.componentDidMount=function(){var e=this.state.historyStateList;e.push({calledBy:"",modifiedModule:"",type:"",state:S()}),this.setState({historyStateList:e})},n.changeState=function(e){var t=e.calledBy||e.ccKey,n=e.type||"",r=e.module,a=this.state.historyStateList,o=a[a.length-1],i=e.sharedState;if(!d||i){i||(i={});var s=function(e,t,n){var r,a=e[t];a||(a=l(c(t)));var o=a;return Object.keys(n).forEach(function(e){o=a.set(e,n[e])}),Object.assign({},e,((r={})[t]=o,r))}(o?o.state:S(),r,i);a.push({calledBy:t,modifiedModule:r,type:n,state:s}),this.setState({historyStateList:a})}},n.renderHistory=function(){return this.state.historyStateList.map(function(e){return o.createElement("div",{key:++y,style:{border:"1px solid #35aa7e",margin:"5px 2px"}},o.createElement("h4",{style:b},"calledBy: ",e.calledBy),o.createElement("h4",{style:b},"type: ",e.type),o.createElement("h4",{style:b},"modifiedModule: ",e.modifiedModule),o.createElement("div",{style:{marginTop:"-12px"}},o.createElement(i,{data:e.state,theme:s,invertTheme:!1,shouldExpandNode:!1})))})},n.render=function(){var e=this;return this.state.show?o.createElement("div",{style:f},o.createElement("button",{style:p,onClick:function(){return e.setState({historyStateList:[]})}},u.clear),o.createElement("button",{style:m,onClick:function(){return e.setState({show:!1})}},u.close),this.renderHistory()):o.createElement("button",{style:h,onClick:function(){return e.setState({show:!0})}},u.open)},e}(o.Component),e.concentWebDevToolMiddleWare=function(e,t){g.changeState(e),t()},e.setConf=function(e,t){t&&null!=t.ignoreEmptyModuleState&&(d=t.ignoreEmptyModuleState),e&&(null!=e.clear&&(u.clear=e.clear),null!=e.close&&(u.close=e.close),null!=e.open&&(u.clear=e.open))}}); |
@@ -28,2 +28,7 @@ | ||
var ignoreEmptyMS = true; | ||
var labelKey_label_ = { | ||
clear: '清除', | ||
close: '关闭', | ||
open: '开启状态调试工具', | ||
}; | ||
@@ -36,3 +41,4 @@ var toExport = module.exports = {}; | ||
var stBtn = { position: 'fixed', top: 19, right: 19, zIndex: 9999 }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red' }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red', marginRight:'12px' }; | ||
var stCtrlBtn2 = { color: 'red', border: '1px solid red' }; | ||
var stItem = { color: '#57c7de', margin: 0, padding: '2px' }; | ||
@@ -143,4 +149,4 @@ var hid = 1; | ||
<div style={stBox}> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>清除</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ show: false })}>关闭</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>{labelKey_label_.clear}</button> | ||
<button style={stCtrlBtn2} onClick={() => this.setState({ show: false })}>{labelKey_label_.close}</button> | ||
{this.renderHistory()} | ||
@@ -150,3 +156,3 @@ </div> | ||
} else { | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>开启状态调试工具</button> | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>{labelKey_label_.open}</button> | ||
} | ||
@@ -164,5 +170,10 @@ | ||
toExport.setConf = function (ignoreEmptyModuleState) { | ||
if (ignoreEmptyModuleState != undefined) ignoreEmptyMS = ignoreEmptyModuleState; | ||
toExport.setConf = function (wordConf, options) { | ||
if (options && options.ignoreEmptyModuleState != undefined) ignoreEmptyMS = options.ignoreEmptyModuleState; | ||
if (wordConf) { | ||
if (wordConf.clear != undefined) labelKey_label_.clear = wordConf.clear; | ||
if (wordConf.close != undefined) labelKey_label_.close = wordConf.close; | ||
if (wordConf.open != undefined) labelKey_label_.clear = wordConf.open; | ||
} | ||
} | ||
23
index.js
@@ -28,2 +28,7 @@ | ||
var ignoreEmptyMS = true; | ||
var labelKey_label_ = { | ||
clear: '清除', | ||
close: '关闭', | ||
open: '开启状态调试工具', | ||
}; | ||
@@ -36,3 +41,4 @@ var toExport = module.exports = {}; | ||
var stBtn = { position: 'fixed', top: 19, right: 19, zIndex: 9999 }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red' }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red', marginRight:'12px' }; | ||
var stCtrlBtn2 = { color: 'red', border: '1px solid red' }; | ||
var stItem = { color: '#57c7de', margin: 0, padding: '2px' }; | ||
@@ -143,4 +149,4 @@ var hid = 1; | ||
<div style={stBox}> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>清除</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ show: false })}>关闭</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>{labelKey_label_.clear}</button> | ||
<button style={stCtrlBtn2} onClick={() => this.setState({ show: false })}>{labelKey_label_.close}</button> | ||
{this.renderHistory()} | ||
@@ -150,3 +156,3 @@ </div> | ||
} else { | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>开启状态调试工具</button> | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>{labelKey_label_.open}</button> | ||
} | ||
@@ -164,5 +170,10 @@ | ||
toExport.setConf = function (ignoreEmptyModuleState) { | ||
if (ignoreEmptyModuleState != undefined) ignoreEmptyMS = ignoreEmptyModuleState; | ||
toExport.setConf = function (wordConf, options) { | ||
if (options && options.ignoreEmptyModuleState != undefined) ignoreEmptyMS = options.ignoreEmptyModuleState; | ||
if (wordConf) { | ||
if (wordConf.clear != undefined) labelKey_label_.clear = wordConf.clear; | ||
if (wordConf.close != undefined) labelKey_label_.close = wordConf.close; | ||
if (wordConf.open != undefined) labelKey_label_.clear = wordConf.open; | ||
} | ||
} | ||
@@ -40,2 +40,7 @@ "use strict"; | ||
var ignoreEmptyMS = true; | ||
var labelKey_label_ = { | ||
clear: '清除', | ||
close: '关闭', | ||
open: '开启状态调试工具' | ||
}; | ||
var toExport = module.exports = {}; | ||
@@ -60,2 +65,7 @@ var stBox = { | ||
color: 'red', | ||
border: '1px solid red', | ||
marginRight: '12px' | ||
}; | ||
var stCtrlBtn2 = { | ||
color: 'red', | ||
border: '1px solid red' | ||
@@ -211,4 +221,4 @@ }; | ||
} | ||
}, "\u6E05\u9664"), React.createElement("button", { | ||
style: stCtrlBtn, | ||
}, labelKey_label_.clear), React.createElement("button", { | ||
style: stCtrlBtn2, | ||
onClick: function onClick() { | ||
@@ -219,3 +229,3 @@ return _this2.setState({ | ||
} | ||
}, "\u5173\u95ED"), this.renderHistory()); | ||
}, labelKey_label_.close), this.renderHistory()); | ||
} else { | ||
@@ -229,3 +239,3 @@ return React.createElement("button", { | ||
} | ||
}, "\u5F00\u542F\u72B6\u6001\u8C03\u8BD5\u5DE5\u5177"); | ||
}, labelKey_label_.open); | ||
} | ||
@@ -244,4 +254,10 @@ }; | ||
toExport.setConf = function (ignoreEmptyModuleState) { | ||
if (ignoreEmptyModuleState != undefined) ignoreEmptyMS = ignoreEmptyModuleState; | ||
toExport.setConf = function (wordConf, options) { | ||
if (options && options.ignoreEmptyModuleState != undefined) ignoreEmptyMS = options.ignoreEmptyModuleState; | ||
if (wordConf) { | ||
if (wordConf.clear != undefined) labelKey_label_.clear = wordConf.clear; | ||
if (wordConf.close != undefined) labelKey_label_.close = wordConf.close; | ||
if (wordConf.open != undefined) labelKey_label_.clear = wordConf.open; | ||
} | ||
}; |
{ | ||
"name": "concent-middleware-web-devtool", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "concent的状态变迁调试工具", | ||
@@ -27,3 +27,3 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"concent": "^1.4.9", | ||
"concent": "^1.5.162", | ||
"immutable": "^4.0.0-rc.12", | ||
@@ -30,0 +30,0 @@ "react": "^16.8.6", |
@@ -28,2 +28,7 @@ | ||
var ignoreEmptyMS = true; | ||
var labelKey_label_ = { | ||
clear: '清除', | ||
close: '关闭', | ||
open: '开启状态调试工具', | ||
}; | ||
@@ -36,3 +41,4 @@ var toExport = module.exports = {}; | ||
var stBtn = { position: 'fixed', top: 19, right: 19, zIndex: 9999 }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red' }; | ||
var stCtrlBtn = { color: 'red', border: '1px solid red', marginRight:'12px' }; | ||
var stCtrlBtn2 = { color: 'red', border: '1px solid red' }; | ||
var stItem = { color: '#57c7de', margin: 0, padding: '2px' }; | ||
@@ -143,4 +149,4 @@ var hid = 1; | ||
<div style={stBox}> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>清除</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ show: false })}>关闭</button> | ||
<button style={stCtrlBtn} onClick={() => this.setState({ historyStateList: [] })}>{labelKey_label_.clear}</button> | ||
<button style={stCtrlBtn2} onClick={() => this.setState({ show: false })}>{labelKey_label_.close}</button> | ||
{this.renderHistory()} | ||
@@ -150,3 +156,3 @@ </div> | ||
} else { | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>开启状态调试工具</button> | ||
return <button style={stBtn} onClick={() => this.setState({ show: true })}>{labelKey_label_.open}</button> | ||
} | ||
@@ -164,5 +170,10 @@ | ||
toExport.setConf = function (ignoreEmptyModuleState) { | ||
if (ignoreEmptyModuleState != undefined) ignoreEmptyMS = ignoreEmptyModuleState; | ||
toExport.setConf = function (wordConf, options) { | ||
if (options && options.ignoreEmptyModuleState != undefined) ignoreEmptyMS = options.ignoreEmptyModuleState; | ||
if (wordConf) { | ||
if (wordConf.clear != undefined) labelKey_label_.clear = wordConf.clear; | ||
if (wordConf.close != undefined) labelKey_label_.close = wordConf.close; | ||
if (wordConf.open != undefined) labelKey_label_.clear = wordConf.open; | ||
} | ||
} | ||
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
34742
921
Updatedconcent@^1.5.162