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

0ui

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

0ui - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

CHANGELOG.md

6

dist/0ui.umd.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lib0ui=e():t.lib0ui=e()}(window,function(){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,{configurable:!1,enumerable:!0,get:r})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},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=1)}([function(t,e,n){"use strict";t.exports=n(5)},function(t,e,n){"use strict";n.r(e);var r={};n.d(r,"assoc",function(){return c}),n.d(r,"assocIn",function(){return s}),n.d(r,"dissoc",function(){return a}),n.d(r,"update",function(){return l}),n.d(r,"updateIn",function(){return f}),n.d(r,"conj",function(){return p}),n.d(r,"get",function(){return h}),n.d(r,"getIn",function(){return d});var o={};n.d(o,"createComponent",function(){return m});var u={};n.d(u,"match",function(){return v}),n.d(u,"withStyles",function(){return b}),n.d(u,"withPreventDefault",function(){return g});const i=t=>null!==t&&"object"==typeof t&&!1===Array.isArray(t),c=(t,...e)=>{let n=t;for(let t=0;t<e.length;t+=2){const r=e[t],o=e[t+1];if(Array.isArray(n)){const t=n.slice();t[r]=o,n=t}i(n)&&(n=Object.assign({},n,{[r]:o}))}return n},s=(t,[e,...n],r)=>n.length>0?c(t,e,s(h(t,e,{}),n,r)):c(t,e,r),a=(t,...e)=>{let n=t;for(let t=0;t<e.length;t++){const r=e[t];delete(n=Object.assign({},n))[r]}return n},l=(t,e,n,...r)=>c(t,e,n(h(t,e),...r)),f=(t,e,n,...r)=>{const o=(t,[e,...n],r,u)=>n.length>0?c(t,e,o(h(t,e,{}),n,r,u)):c(t,e,r(h(t,e),...u));return o(t,e,n,r)},p=(t,...e)=>{let n=t;for(let t=0;t<e.length;t++){const r=e[t];if(Array.isArray(n)&&(n=n.concat(r)),i(n)){const[t,e]=r;n=c(n,t,e)}}return n},h=(t,e,n)=>void 0!==t[e]?t[e]:n,d=(t,e,n)=>{let r=t;for(let t=0;t<e.length;t++){const o=e[t],u=h(r,o);if(void 0===u)return n;r=u}return r};var y=n(0);const m=({displayName:t,states:e,render:n,onWillMount:r,onDidMount:o,onWillUnmount:u,onAfterRender:i,propTypes:c,defaultProps:s,...a})=>{class l extends y.Component{constructor(){super(),Object.entries(a).forEach(([t,e])=>{this[t]=e})}componentWillMount(){r&&r.call(this)}componentDidMount(){Object.entries(e).forEach(([t,e])=>{e.addWatch(t,(t,e,n,r)=>{r!==n&&this.forceUpdate()})}),o&&o.call(this),i&&i.call(this)}componentWillUnmount(){Object.entries(e).forEach(([t,e])=>{e.removeWatch(t)}),u&&u.call(this)}componentDidUpdate(){i&&i.call(this)}render(){return n.call(this,e,this.props)}}return l.propTypes=c,l.defaultProps=s,l.displayName=t,l},v=t=>e=>{if(e.hasOwnProperty(t))return e[t]();throw new Error(`No matching clause for "${t}"`)},b=t=>e=>{const n={...e};return t.hasOwnProperty("my")&&(n.marginTop=4*t.my,n.marginBottom=4*t.my),t.hasOwnProperty("mx")&&(n.marginLeft=4*t.mx,n.marginRight=4*t.mx),n},g=t=>e=>(e.preventDefault(),t(e));class w{constructor(t){this.state=t,this.watchers={}}addWatch(t,e){return this.watchers[t]=e,this}removeWatch(t){return delete this.watchers[t],this}reset(t){const e=this.state;return this.state=t,this.notify(e,t),this.state}swap(t,...e){return this.reset(t(this.state,...e))}notify(t,e){Object.entries(this.watchers).forEach(([n,r])=>{r(n,this,t,e)})}}w.create=(t=>new w(t));var j=w;class O{constructor(t){this.dispatchFn=t,this.vtable=new Map}addMethod(t,e){this.vtable.set(t,e)}dispatch(...t){const e=this.dispatchFn(...t),n=this.vtable.get(e);if(n)return n(...t);throw new ReferenceError(e)}}O.create=(t=>new O(t));var x=O;let P=0;class _ extends j{constructor(t,e){super(e(t.state)),t.addWatch(++P,(t,n,r,o)=>{const u=e(r),i=e(o);i!==u&&this.reset(i)})}}_.create=((t,e)=>new _(t,e));var k=_;n.d(e,"react",function(){return y}),n.d(e,"imtbl",function(){return r}),n.d(e,"core",function(){return u}),n.d(e,"ui",function(){return o}),n.d(e,"State",function(){return j}),n.d(e,"MultiMethod",function(){return x}),n.d(e,"DerivedState",function(){return k})},function(t,e,n){"use strict";function r(t){return function(){return t}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lib0ui=e():t.lib0ui=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){"use strict";t.exports=r(5)},function(t,e,r){"use strict";r.r(e);var n={};r.d(n,"assoc",function(){return c}),r.d(n,"assocIn",function(){return s}),r.d(n,"dissoc",function(){return a}),r.d(n,"update",function(){return l}),r.d(n,"updateIn",function(){return f}),r.d(n,"conj",function(){return p}),r.d(n,"get",function(){return h}),r.d(n,"getIn",function(){return d});var o={};r.d(o,"createComponent",function(){return m});var u={};r.d(u,"match",function(){return v}),r.d(u,"withStyles",function(){return b}),r.d(u,"withPreventDefault",function(){return g});const i=t=>null!==t&&"object"==typeof t&&!1===Array.isArray(t),c=(t,...e)=>{let r=t;for(let t=0;t<e.length;t+=2){const n=e[t],o=e[t+1];if(Array.isArray(r)){const t=r.slice();t[n]=o,r=t}i(r)&&(r=Object.assign({},r,{[n]:o}))}return r},s=(t,[e,...r],n)=>r.length>0?c(t,e,s(h(t,e,{}),r,n)):c(t,e,n),a=(t,...e)=>{let r=t;for(let t=0;t<e.length;t++){const n=e[t];delete(r=Object.assign({},r))[n]}return r},l=(t,e,r,...n)=>c(t,e,r(h(t,e),...n)),f=(t,e,r,...n)=>{const o=(t,[e,...r],n,u)=>r.length>0?c(t,e,o(h(t,e,{}),r,n,u)):c(t,e,n(h(t,e),...u));return o(t,e,r,n)},p=(t,...e)=>{let r=t;for(let t=0;t<e.length;t++){const n=e[t];if(Array.isArray(r)&&(r=r.concat(n)),i(r)){const[t,e]=n;r=c(r,t,e)}}return r},h=(t,e,r)=>void 0!==t[e]?t[e]:r,d=(t,e,r)=>{let n=t;for(let t=0;t<e.length;t++){const o=e[t],u=h(n,o);if(void 0===u)return r;n=u}return n};var y=r(0);const m=({displayName:t,states:e,render:r,onWillMount:n,onDidMount:o,onWillUnmount:u,onAfterRender:i,propTypes:c,defaultProps:s,...a})=>{const l=class extends y.Component{constructor(){super(),Object.entries(a).forEach(([t,e])=>{this[t]=e})}componentWillMount(){n&&n.call(this)}componentDidMount(){Object.entries(e).forEach(([t,e])=>{e.addWatch(t,(t,e,r,n)=>{n!==r&&this.forceUpdate()})}),o&&o.call(this),i&&i.call(this)}componentWillUnmount(){Object.entries(e).forEach(([t,e])=>{e.removeWatch(t)}),u&&u.call(this)}componentDidUpdate(){i&&i.call(this)}render(){return r.call(this,e,this.props)}};return l.propTypes=c,l.defaultProps=s,l.displayName=t,l},v=t=>e=>{if(e.hasOwnProperty(t))return e[t]();if(e.hasOwnProperty("else"))return e.else();throw new Error(`No matching clause for "${t}"`)},b=t=>e=>{const r={...e};return t.hasOwnProperty("my")&&(r.marginTop=4*t.my,r.marginBottom=4*t.my),t.hasOwnProperty("mx")&&(r.marginLeft=4*t.mx,r.marginRight=4*t.mx),r},g=t=>e=>(e.preventDefault(),t(e));class w{constructor(t){this.state=t,this.watchers={}}addWatch(t,e){return this.watchers[t]=e,this}removeWatch(t){return delete this.watchers[t],this}reset(t){const e=this.state;return this.state=t,this.notify(e,t),this.state}swap(t,...e){return this.reset(t(this.state,...e))}notify(t,e){Object.entries(this.watchers).forEach(([r,n])=>{n(r,this,t,e)})}}w.create=(t=>new w(t));var j=w;class O{constructor(t){this.dispatchFn=t,this.vtable=new Map}addMethod(t,e){this.vtable.set(t,e)}dispatch(...t){const e=this.dispatchFn(...t),r=this.vtable.get(e),n=this.vtable.get("default");if(r)return r(...t);if(n)return n(...t);throw new ReferenceError(e)}}O.create=(t=>new O(t));var x=O;let P=0;class _ extends j{constructor(t,e){super(e(t.state)),t.addWatch(++P,(t,r,n,o)=>{const u=e(n),i=e(o);i!==u&&this.reset(i)})}}_.create=((t,e)=>new _(t,e));var k=_;r.d(e,"react",function(){return y}),r.d(e,"imtbl",function(){return n}),r.d(e,"core",function(){return u}),r.d(e,"ui",function(){return o}),r.d(e,"State",function(){return j}),r.d(e,"MultiMethod",function(){return x}),r.d(e,"DerivedState",function(){return k})},function(t,e,r){"use strict";function n(t){return function(){return t}}var o=function(){};o.thatReturns=n,o.thatReturnsFalse=n(!1),o.thatReturnsTrue=n(!0),o.thatReturnsNull=n(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(t){return t},t.exports=o},function(t,e,r){"use strict";t.exports={}},function(t,e,r){"use strict";
/*

@@ -6,3 +6,3 @@ object-assign

@license MIT
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(t){r[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,i,c=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),s=1;s<arguments.length;s++){for(var a in n=Object(arguments[s]))o.call(n,a)&&(c[a]=n[a]);if(r){i=r(n);for(var l=0;l<i.length;l++)u.call(n,i[l])&&(c[i[l]]=n[i[l]])}}return c}},function(t,e,n){"use strict";
*/var n=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,i,c=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),s=1;s<arguments.length;s++){for(var a in r=Object(arguments[s]))o.call(r,a)&&(c[a]=r[a]);if(n){i=n(r);for(var l=0;l<i.length;l++)u.call(r,i[l])&&(c[i[l]]=r[i[l]])}}return c}},function(t,e,r){"use strict";
/** @license React v16.2.0

@@ -15,2 +15,2 @@ * react.production.min.js

* LICENSE file in the root directory of this source tree.
*/var r=n(4),o=n(3),u=n(2),i="function"==typeof Symbol&&Symbol.for,c=i?Symbol.for("react.element"):60103,s=i?Symbol.for("react.call"):60104,a=i?Symbol.for("react.return"):60105,l=i?Symbol.for("react.portal"):60106,f=i?Symbol.for("react.fragment"):60107,p="function"==typeof Symbol&&Symbol.iterator;function h(t){for(var e=arguments.length-1,n="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,r=0;r<e;r++)n+="&args[]="+encodeURIComponent(arguments[r+1]);throw(e=Error(n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")).name="Invariant Violation",e.framesToPop=1,e}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function y(t,e,n){this.props=t,this.context=e,this.refs=o,this.updater=n||d}function m(t,e,n){this.props=t,this.context=e,this.refs=o,this.updater=n||d}function v(){}y.prototype.isReactComponent={},y.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&h("85"),this.updater.enqueueSetState(this,t,e,"setState")},y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},v.prototype=y.prototype;var b=m.prototype=new v;function g(t,e,n){this.props=t,this.context=e,this.refs=o,this.updater=n||d}b.constructor=m,r(b,y.prototype),b.isPureReactComponent=!0;var w=g.prototype=new v;w.constructor=g,r(w,y.prototype),w.unstable_isAsyncReactComponent=!0,w.render=function(){return this.props.children};var j={current:null},O=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function P(t,e,n){var r,o={},u=null,i=null;if(null!=e)for(r in void 0!==e.ref&&(i=e.ref),void 0!==e.key&&(u=""+e.key),e)O.call(e,r)&&!x.hasOwnProperty(r)&&(o[r]=e[r]);var s=arguments.length-2;if(1===s)o.children=n;else if(1<s){for(var a=Array(s),l=0;l<s;l++)a[l]=arguments[l+2];o.children=a}if(t&&t.defaultProps)for(r in s=t.defaultProps)void 0===o[r]&&(o[r]=s[r]);return{$$typeof:c,type:t,key:u,ref:i,props:o,_owner:j.current}}function _(t){return"object"==typeof t&&null!==t&&t.$$typeof===c}var k=/\/+/g,S=[];function R(t,e,n,r){if(S.length){var o=S.pop();return o.result=t,o.keyPrefix=e,o.func=n,o.context=r,o.count=0,o}return{result:t,keyPrefix:e,func:n,context:r,count:0}}function A(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>S.length&&S.push(t)}function E(t,e,n,r){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var u=!1;if(null===t)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case c:case s:case a:case l:u=!0}}if(u)return n(r,t,""===e?"."+C(t,0):e),1;if(u=0,e=""===e?".":e+":",Array.isArray(t))for(var i=0;i<t.length;i++){var f=e+C(o=t[i],i);u+=E(o,f,n,r)}else if(null===t||void 0===t?f=null:f="function"==typeof(f=p&&t[p]||t["@@iterator"])?f:null,"function"==typeof f)for(t=f.call(t),i=0;!(o=t.next()).done;)u+=E(o=o.value,f=e+C(o,i++),n,r);else"object"===o&&h("31","[object Object]"===(n=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":n,"");return u}function C(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}(t.key):e.toString(36)}function $(t,e){t.func.call(t.context,e,t.count++)}function M(t,e,n){var r=t.result,o=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?U(t,r,n,u.thatReturnsArgument):null!=t&&(_(t)&&(e=o+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(k,"$&/")+"/")+n,t={$$typeof:c,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}),r.push(t))}function U(t,e,n,r,o){var u="";null!=n&&(u=(""+n).replace(k,"$&/")+"/"),e=R(e,u,r,o),null==t||E(t,"",M,e),A(e)}var N={Children:{map:function(t,e,n){if(null==t)return t;var r=[];return U(t,r,null,e,n),r},forEach:function(t,e,n){if(null==t)return t;e=R(null,null,e,n),null==t||E(t,"",$,e),A(e)},count:function(t){return null==t?0:E(t,"",u.thatReturnsNull,null)},toArray:function(t){var e=[];return U(t,e,null,u.thatReturnsArgument),e},only:function(t){return _(t)||h("143"),t}},Component:y,PureComponent:m,unstable_AsyncComponent:g,Fragment:f,createElement:P,cloneElement:function(t,e,n){var o=r({},t.props),u=t.key,i=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(i=e.ref,s=j.current),void 0!==e.key&&(u=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)O.call(e,l)&&!x.hasOwnProperty(l)&&(o[l]=void 0===e[l]&&void 0!==a?a[l]:e[l])}var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){a=Array(l);for(var f=0;f<l;f++)a[f]=arguments[f+2];o.children=a}return{$$typeof:c,type:t.type,key:u,ref:i,props:o,_owner:s}},createFactory:function(t){var e=P.bind(null,t);return e.type=t,e},isValidElement:_,version:"16.2.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:j,assign:r}},T=Object.freeze({default:N}),W=T&&N||T;t.exports=W.default?W.default:W}])});
*/var n=r(4),o=r(3),u=r(2),i="function"==typeof Symbol&&Symbol.for,c=i?Symbol.for("react.element"):60103,s=i?Symbol.for("react.call"):60104,a=i?Symbol.for("react.return"):60105,l=i?Symbol.for("react.portal"):60106,f=i?Symbol.for("react.fragment"):60107,p="function"==typeof Symbol&&Symbol.iterator;function h(t){for(var e=arguments.length-1,r="Minified React error #"+t+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+t,n=0;n<e;n++)r+="&args[]="+encodeURIComponent(arguments[n+1]);throw(e=Error(r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.")).name="Invariant Violation",e.framesToPop=1,e}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}};function y(t,e,r){this.props=t,this.context=e,this.refs=o,this.updater=r||d}function m(t,e,r){this.props=t,this.context=e,this.refs=o,this.updater=r||d}function v(){}y.prototype.isReactComponent={},y.prototype.setState=function(t,e){"object"!=typeof t&&"function"!=typeof t&&null!=t&&h("85"),this.updater.enqueueSetState(this,t,e,"setState")},y.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},v.prototype=y.prototype;var b=m.prototype=new v;function g(t,e,r){this.props=t,this.context=e,this.refs=o,this.updater=r||d}b.constructor=m,n(b,y.prototype),b.isPureReactComponent=!0;var w=g.prototype=new v;w.constructor=g,n(w,y.prototype),w.unstable_isAsyncReactComponent=!0,w.render=function(){return this.props.children};var j={current:null},O=Object.prototype.hasOwnProperty,x={key:!0,ref:!0,__self:!0,__source:!0};function P(t,e,r){var n,o={},u=null,i=null;if(null!=e)for(n in void 0!==e.ref&&(i=e.ref),void 0!==e.key&&(u=""+e.key),e)O.call(e,n)&&!x.hasOwnProperty(n)&&(o[n]=e[n]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){for(var a=Array(s),l=0;l<s;l++)a[l]=arguments[l+2];o.children=a}if(t&&t.defaultProps)for(n in s=t.defaultProps)void 0===o[n]&&(o[n]=s[n]);return{$$typeof:c,type:t,key:u,ref:i,props:o,_owner:j.current}}function _(t){return"object"==typeof t&&null!==t&&t.$$typeof===c}var k=/\/+/g,S=[];function R(t,e,r,n){if(S.length){var o=S.pop();return o.result=t,o.keyPrefix=e,o.func=r,o.context=n,o.count=0,o}return{result:t,keyPrefix:e,func:r,context:n,count:0}}function A(t){t.result=null,t.keyPrefix=null,t.func=null,t.context=null,t.count=0,10>S.length&&S.push(t)}function E(t,e,r,n){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var u=!1;if(null===t)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case c:case s:case a:case l:u=!0}}if(u)return r(n,t,""===e?"."+C(t,0):e),1;if(u=0,e=""===e?".":e+":",Array.isArray(t))for(var i=0;i<t.length;i++){var f=e+C(o=t[i],i);u+=E(o,f,r,n)}else if(null===t||void 0===t?f=null:f="function"==typeof(f=p&&t[p]||t["@@iterator"])?f:null,"function"==typeof f)for(t=f.call(t),i=0;!(o=t.next()).done;)u+=E(o=o.value,f=e+C(o,i++),r,n);else"object"===o&&h("31","[object Object]"===(r=""+t)?"object with keys {"+Object.keys(t).join(", ")+"}":r,"");return u}function C(t,e){return"object"==typeof t&&null!==t&&null!=t.key?function(t){var e={"=":"=0",":":"=2"};return"$"+(""+t).replace(/[=:]/g,function(t){return e[t]})}(t.key):e.toString(36)}function $(t,e){t.func.call(t.context,e,t.count++)}function M(t,e,r){var n=t.result,o=t.keyPrefix;t=t.func.call(t.context,e,t.count++),Array.isArray(t)?U(t,n,r,u.thatReturnsArgument):null!=t&&(_(t)&&(e=o+(!t.key||e&&e.key===t.key?"":(""+t.key).replace(k,"$&/")+"/")+r,t={$$typeof:c,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}),n.push(t))}function U(t,e,r,n,o){var u="";null!=r&&(u=(""+r).replace(k,"$&/")+"/"),e=R(e,u,n,o),null==t||E(t,"",M,e),A(e)}var N={Children:{map:function(t,e,r){if(null==t)return t;var n=[];return U(t,n,null,e,r),n},forEach:function(t,e,r){if(null==t)return t;e=R(null,null,e,r),null==t||E(t,"",$,e),A(e)},count:function(t){return null==t?0:E(t,"",u.thatReturnsNull,null)},toArray:function(t){var e=[];return U(t,e,null,u.thatReturnsArgument),e},only:function(t){return _(t)||h("143"),t}},Component:y,PureComponent:m,unstable_AsyncComponent:g,Fragment:f,createElement:P,cloneElement:function(t,e,r){var o=n({},t.props),u=t.key,i=t.ref,s=t._owner;if(null!=e){if(void 0!==e.ref&&(i=e.ref,s=j.current),void 0!==e.key&&(u=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)O.call(e,l)&&!x.hasOwnProperty(l)&&(o[l]=void 0===e[l]&&void 0!==a?a[l]:e[l])}var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){a=Array(l);for(var f=0;f<l;f++)a[f]=arguments[f+2];o.children=a}return{$$typeof:c,type:t.type,key:u,ref:i,props:o,_owner:s}},createFactory:function(t){var e=P.bind(null,t);return e.type=t,e},isValidElement:_,version:"16.2.0",__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:j,assign:n}},T=Object.freeze({default:N}),W=T&&N||T;t.exports=W.default?W.default:W}])});
export const match = expr => obj => {
if (obj.hasOwnProperty(expr)) {
return obj[expr]();
} else if (obj.hasOwnProperty("else")) {
return obj["else"]();
} else {

@@ -5,0 +7,0 @@ throw new Error(`No matching clause for "${expr}"`);

@@ -12,5 +12,8 @@ class MultiMethod {

const method = this.vtable.get(dv);
const defaultMethod = this.vtable.get("default");
if (method) {
return method(...args);
} else if (defaultMethod) {
return defaultMethod(...args);
} else {

@@ -17,0 +20,0 @@ throw new ReferenceError(dv);

{
"name": "0ui",
"version": "1.1.0",
"version": "1.2.0",
"description": "A set of utilities for building UIs with React",

@@ -8,3 +8,4 @@ "scripts": {

"webpack --config ./example/webpack.config.js --mode=development --watch",
"build": "webpack --config webpack.config.js --mode=production"
"build": "webpack --config webpack.config.js --mode=production",
"test": "jest ./test/*.js"
},

@@ -22,2 +23,3 @@ "author": "Roman Liutikov",

"babel-preset-stage-2": "^6.24.1",
"jest": "^22.4.3",
"react-dom": "^16.2.0",

@@ -24,0 +26,0 @@ "webpack": "^4.2.0",

_A set of utilities for building UIs with React_
v1.1.0
[Demo](https://jsfiddle.net/qrtzgju2/5/)
v1.2.0
```

@@ -6,0 +8,0 @@ npm i 0ui

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