effector-inspector
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var t={};function o(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(r,n,function(t){return e[t]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t){e.exports=require("effector-dom")},function(e,t){e.exports=require("effector")},function(e,t,o){"use strict";o.r(t),o.d(t,"addStore",(function(){return l})),o.d(t,"addEvent",(function(){return u})),o.d(t,"addEffect",(function(){return p})),o.d(t,"addDomain",(function(){return f})),o.d(t,"createInspector",(function(){return b}));var r=o(1),n=o(0);function i(e){const t=Object(r.createStore)([],{name:`$${e}Storage`}),o=Object(r.createApi)(t,{add:(e,t)=>[...e,t]});return o.add.watch(t=>console.info(`Added ${e} unit ${t.compositeName.path.join("/")}`)),t.watch(t=>console.log(`Unit list ${e} changed`,t)),{$store:t,api:o}}const c=i("stores"),a=i("events"),s=i("effects"),d=i("domain"),l=c.api.add,u=a.api.add,p=s.api.add,f=d.api.add;function b(){const e=document.createElement("div");return e.classList.add("effector-inspector"),document.body.append(e),function(e){const t=Object(r.createStore)(!1),o=Object(r.createEvent)();console.info("%c[effector-inspector] %cPress %cCTRL+B %cto open Inspector","color: gray; font-size: 1rem;","color: currentColor; font-size: 1rem;","color: deepskyblue; font-family: monospace; font-size: 1rem;","color: currentColor; font-size: 1rem;"),t.on(o,e=>!e),document.addEventListener("keypress",e=>{const t=e;2===t.keyCode&&t.ctrlKey&&o()}),Object(n.using)(e,()=>{Object(n.h)("div",()=>{Object(n.spec)({style:m.root,visible:t}),Object(n.h)("div",{style:m.sectionHead,text:"Stores"}),Object(n.h)("div",()=>{Object(n.spec)({style:m.storesTable}),Object(n.list)(c.$store,({store:e})=>{Object(n.h)("div",()=>{Object(n.spec)({style:m.store,attr:{title:e.map(e=>{var t,o,r;return null!=(r=null===(o=null===(t=e.defaultConfig)||void 0===t?void 0:t.loc)||void 0===o?void 0:o.file)?r:""})}});const t=e.map(e=>e.compositeName.path.slice(1).join("/"));Object(n.h)("pre",()=>{Object(n.spec)({style:m.storeName,text:t})}),Object(n.h)("pre",()=>{Object(n.spec)({style:m.storeValue,text:e.getState().map(e=>JSON.stringify(e))})})})})})})})}(e),{root:e}}const m={root:{backgroundColor:"white",borderRadius:"0.5rem",bottom:"3rem",boxShadow:"0 14.5px 5.2px -10px rgba(0,0,0,0.038), 0 23.9px 16.6px -10px rgba(0,0,0,0.057), 0 64px 118px -10px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",left:"3rem",overflowX:"auto",position:"fixed",top:"3rem",userSelect:"none",width:"26rem",zIndex:1e3},sectionHead:{backgroundColor:"white",borderBottom:"1px solid rgba(0,0,0,0.08)",display:"flex",fontSize:"1.5rem",fontWeight:"bold",left:0,lineHeight:"2rem",padding:"0.5rem 1rem",position:"sticky",right:0,top:0},storesTable:{display:"table"},store:{display:"table-row",fontSize:"1rem"},storeName:{margin:0,display:"table-cell",padding:"0.5rem 1rem"},storeValue:{margin:0,display:"table-cell",padding:"0.5rem 1rem"}}}]); | ||
module.exports=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},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=2)}([function(e,t){e.exports=require("effector-dom")},function(e,t){e.exports=require("effector")},function(e,t,r){"use strict";r.r(t),r.d(t,"addStore",(function(){return l})),r.d(t,"addEvent",(function(){return u})),r.d(t,"addEffect",(function(){return p})),r.d(t,"addDomain",(function(){return f})),r.d(t,"createInspector",(function(){return b}));var o=r(1),n=r(0);function i(e){const t=Object(o.createStore)([],{name:`$${e}Storage`});return{$store:t,api:Object(o.createApi)(t,{add:(e,t)=>[...e,t]})}}const c=i("stores"),a=i("events"),s=i("effects"),d=i("domain"),l=c.api.add,u=a.api.add,p=s.api.add,f=d.api.add;function b(){const e=document.createElement("div");return e.classList.add("effector-inspector"),document.body.append(e),function(e){const t=Object(o.createStore)(!1),r=Object(o.createEvent)();console.info("%c[effector-inspector] %cPress %cCTRL+B %cto open Inspector","color: gray; font-size: 1rem;","color: currentColor; font-size: 1rem;","color: deepskyblue; font-family: monospace; font-size: 1rem;","color: currentColor; font-size: 1rem;"),t.on(r,e=>!e),document.addEventListener("keypress",e=>{const t=e;2===t.keyCode&&t.ctrlKey&&r()}),Object(n.using)(e,()=>{Object(n.h)("div",()=>{Object(n.spec)({style:m.root,visible:t}),Object(n.h)("div",{style:m.sectionHead,text:"Stores"}),Object(n.h)("div",()=>{Object(n.spec)({style:m.storesTable}),Object(n.list)(c.$store,({store:e})=>{Object(n.h)("div",()=>{Object(n.spec)({style:m.store,attr:{title:e.map(e=>{var t,r,o;return null!=(o=null===(r=null===(t=e.defaultConfig)||void 0===t?void 0:t.loc)||void 0===r?void 0:r.file)?o:""})}});const t=e.map(e=>e.compositeName.path.slice(1).join("/"));Object(n.h)("pre",()=>{Object(n.spec)({style:m.storeName,text:t})}),Object(n.h)("pre",()=>{Object(n.spec)({style:m.storeValue,text:e.getState().map(e=>JSON.stringify(e))})})})})})})})}(e),{root:e}}const m={root:{backgroundColor:"white",borderRadius:"0.5rem",bottom:"3rem",boxShadow:"0 14.5px 5.2px -10px rgba(0,0,0,0.038), 0 23.9px 16.6px -10px rgba(0,0,0,0.057), 0 64px 118px -10px rgba(0,0,0,0.08)",display:"flex",flexDirection:"column",left:"3rem",overflowX:"auto",position:"fixed",top:"3rem",userSelect:"none",width:"26rem",zIndex:1e3},sectionHead:{backgroundColor:"white",borderBottom:"1px solid rgba(0,0,0,0.08)",display:"flex",fontSize:"1.5rem",fontWeight:"bold",left:0,lineHeight:"2rem",padding:"0.5rem 1rem",position:"sticky",right:0,top:0},storesTable:{display:"table"},store:{display:"table-row",fontSize:"1rem"},storeName:{margin:0,display:"table-cell",padding:"0.5rem 1rem"},storeValue:{margin:0,display:"table-cell",padding:"0.5rem 1rem"}}}]); | ||
//# sourceMappingURL=common.js.map |
{ | ||
"name": "effector-inspector", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "./dist/common.js", | ||
@@ -5,0 +5,0 @@ "types": "./dist/index.d.ts", |
Sorry, the diff of this file is not supported yet
18014
22