diff --git a/modules/component-async.js b/modules/component-async.js index fb632e2..449215f 100644 --- a/modules/component-async.js +++ b/modules/component-async.js @@ -87,8 +87,6 @@ const actions = (viewObject) => { const getState = () => viewObject.actions.state; const setState = async (newState = {}, callback = null, updateView = true) => { - console.log('Setting new state...'); - let state = newState; let shouldComponentUpdate = true; @@ -98,7 +96,6 @@ const actions = (viewObject) => { viewObject.actions.state = defaultsDeepPreserveArrays(state, viewObject.actions.state); - console.log('shouldComponentUpdate'); if (isFunction(viewObject.actions.shouldComponentUpdate)) { shouldComponentUpdate = await !!viewObject.actions.shouldComponentUpdate(viewObject.actions.state, viewObject.actions); } else { @@ -107,14 +104,12 @@ const actions = (viewObject) => { if (shouldComponentUpdate) { if (updateView) { - console.log('componentWillUpdate'); if (viewObject.actions.componentWillUpdate && isFunction(viewObject.actions.componentWillUpdate)) { await viewObject.actions.componentWillUpdate(viewObject.actions.state, viewObject.actions, viewObject); } viewObject.nodes.view = patch(viewObject.nodes.view, viewObject.component.getViewComponent(viewObject.actions.state)); - console.log('componentDidUpdate'); if (viewObject.actions.componentDidUpdate && isFunction(viewObject.actions.componentDidUpdate)) { await viewObject.actions.componentDidUpdate(viewObject.actions.state, viewObject.actions); } @@ -149,8 +144,6 @@ const actions = (viewObject) => { return result; }); - } else { - console.error('Please provide reducer function to use this functionality!'); } }; @@ -195,8 +188,6 @@ const actions = (viewObject) => { const componentFn = (viewObject) => { const getViewComponent = (newState) => { - console.log('Getting view...'); - if (viewObject.actions.render && isFunction(viewObject.actions.render)) { let node = null; @@ -213,14 +204,10 @@ const componentFn = (viewObject) => { }; const getViewContext = () => { - console.log('Finding view context...'); - if (viewObject.actions.spinner) { - console.log('View context found: Spinner'); return loader(viewObject.actions); } - console.log('View context found: `render()` result'); return getViewComponent(viewObject.actions.state); }; @@ -338,7 +325,6 @@ const createAsyncComponent = async (params = defaultParams) => { } if (params.componentWillCreateViewObject && isFunction(params.componentWillCreateViewObject)) { - console.log('componentWillCreateViewObject'); params.componentWillCreateViewObject(params.state); } @@ -356,7 +342,6 @@ const createAsyncComponent = async (params = defaultParams) => { viewObject.component = componentFn(viewObject); if (viewObject.actions.componentWillInit && isFunction(viewObject.actions.componentWillInit)) { - console.log('componentWillInit'); viewObject.actions.componentWillInit(viewObject.actions.state, viewObject.actions); } @@ -369,43 +354,36 @@ const createAsyncComponent = async (params = defaultParams) => { ...viewObject.nodes.view.data, hook: { init: () => { - console.log('init'); if (viewObject.actions.componentDidInit && isFunction(viewObject.actions.componentDidInit)) { viewObject.actions.componentDidInit(viewObject.actions.state, viewObject.actions); } }, create: () => { - console.log('componentWillMount'); if (viewObject.actions.componentWillMount && isFunction(viewObject.actions.componentWillMount)) { viewObject.actions.componentWillMount(viewObject.actions.state, viewObject.actions); } }, prepatch: () => { - console.log('prepatch'); if (viewObject.actions.componentWillPrepatch && isFunction(viewObject.actions.componentWillPrepatch)) { viewObject.actions.componentWillPrepatch(viewObject.actions.state, viewObject.actions); } }, postpatch: () => { - console.log('postpatch'); if (viewObject.actions.componentWillPostpatch && isFunction(viewObject.actions.componentWillPostpatch)) { viewObject.actions.componentWillPostpatch(viewObject.actions.state, viewObject.actions); } }, insert: () => { - console.log('componentDidMount'); if (viewObject.actions.componentDidMount && isFunction(viewObject.actions.componentDidMount)) { viewObject.actions.componentDidMount(viewObject.actions.state, viewObject.actions); } }, destroy: () => { - console.log('componentWillUnmount'); if (viewObject.actions.componentWillUnmount && isFunction(viewObject.actions.componentWillUnmount)) { viewObject.actions.componentWillUnmount(viewObject.actions.state, viewObject.actions); } }, remove: (vnode, removeCallback) => { - console.log('componentDidUnmount'); if (viewObject.actions.componentDidUnmount && isFunction(viewObject.actions.componentDidUnmount)) { viewObject.actions.componentDidUnmount(viewObject.actions.state, viewObject.actions); } @@ -416,7 +394,6 @@ const createAsyncComponent = async (params = defaultParams) => { }; if (viewObject.actions.componentDidCreateViewObject && isFunction(viewObject.actions.componentDidCreateViewObject)) { - console.log('componentDidCreateViewObject'); viewObject.actions.componentDidCreateViewObject(viewObject.actions.state, viewObject.actions); } diff --git a/modules/component.js b/modules/component.js index ff3f434..8ddf0a0 100644 --- a/modules/component.js +++ b/modules/component.js @@ -52,8 +52,6 @@ const actions = (viewObject) => { const getState = () => viewObject.actions.state; const setState = (newState = {}, callback = null, updateView = true) => { - console.log('Setting new state...'); - let state = newState; let shouldComponentUpdate = true; @@ -63,7 +61,6 @@ const actions = (viewObject) => { viewObject.actions.state = defaultsDeepPreserveArrays(state, viewObject.actions.state); - console.log('shouldComponentUpdate'); if (isFunction(viewObject.actions.shouldComponentUpdate)) { shouldComponentUpdate = !!viewObject.actions.shouldComponentUpdate(viewObject.actions.state, viewObject.actions); } else { @@ -72,7 +69,6 @@ const actions = (viewObject) => { if (shouldComponentUpdate) { if (updateView) { - console.log('componentWillUpdate'); if (viewObject.actions.componentWillUpdate) { if (isFunction(viewObject.actions.componentWillUpdate)) { viewObject.actions.componentWillUpdate(viewObject.actions.state, viewObject.actions, viewObject); @@ -81,7 +77,6 @@ const actions = (viewObject) => { viewObject.nodes.view = patch(viewObject.nodes.view, viewObject.component.getViewComponent(viewObject.actions.state)); - console.log('componentDidUpdate'); if (viewObject.actions.componentDidUpdate) { if (isFunction(viewObject.actions.componentDidUpdate)) { viewObject.actions.componentDidUpdate(viewObject.actions.state, viewObject.actions); @@ -116,8 +111,6 @@ const actions = (viewObject) => { return viewObject.actions.reducer(prevState, nextAction, viewObject.actions); }); - } else { - console.error('Please provide reducer function to use this functionality!'); } }; @@ -159,8 +152,6 @@ const actions = (viewObject) => { const componentFn = (viewObject) => { const getViewComponent = (newState) => { - console.log('Getting view...'); - if (viewObject.actions.render && isFunction(viewObject.actions.render)) { let node = null; @@ -176,12 +167,7 @@ const componentFn = (viewObject) => { return h('div', 'Nothing to render'); }; - const getViewContext = () => { - console.log('Finding view context...'); - - console.log('View context found: `render()` result'); - return getViewComponent(viewObject.actions.state); - }; + const getViewContext = () => getViewComponent(viewObject.actions.state); const profileHook = (hook) => { const types = uniq(map(hook, (hk) => { @@ -295,7 +281,6 @@ const createComponent = (params = defaultParams) => { params.state = isFunction(params.state) ? params.state(params) : params.state; if (params.componentWillCreateViewObject && isFunction(params.componentWillCreateViewObject)) { - console.log('componentWillCreateViewObject'); params.componentWillCreateViewObject(params.state); } @@ -313,7 +298,6 @@ const createComponent = (params = defaultParams) => { viewObject.component = componentFn(viewObject); if (viewObject.actions.componentWillInit && isFunction(viewObject.actions.componentWillInit)) { - console.log('componentWillInit'); viewObject.actions.componentWillInit(viewObject.actions.state, viewObject.actions); } @@ -326,43 +310,36 @@ const createComponent = (params = defaultParams) => { ...viewObject.nodes.view.data, hook: { init: () => { - console.log('init'); if (viewObject.actions.componentDidInit && isFunction(viewObject.actions.componentDidInit)) { viewObject.actions.componentDidInit(viewObject.actions.state, viewObject.actions); } }, create: () => { - console.log('componentWillMount'); if (viewObject.actions.componentWillMount && isFunction(viewObject.actions.componentWillMount)) { viewObject.actions.componentWillMount(viewObject.actions.state, viewObject.actions); } }, prepatch: () => { - console.log('prepatch'); if (viewObject.actions.componentWillPrepatch && isFunction(viewObject.actions.componentWillPrepatch)) { viewObject.actions.componentWillPrepatch(viewObject.actions.state, viewObject.actions); } }, postpatch: () => { - console.log('postpatch'); if (viewObject.actions.componentWillPostpatch && isFunction(viewObject.actions.componentWillPostpatch)) { viewObject.actions.componentWillPostpatch(viewObject.actions.state, viewObject.actions); } }, insert: () => { - console.log('componentDidMount'); if (viewObject.actions.componentDidMount && isFunction(viewObject.actions.componentDidMount)) { viewObject.actions.componentDidMount(viewObject.actions.state, viewObject.actions); } }, destroy: () => { - console.log('componentWillUnmount'); if (viewObject.actions.componentWillUnmount && isFunction(viewObject.actions.componentWillUnmount)) { viewObject.actions.componentWillUnmount(viewObject.actions.state, viewObject.actions); } }, remove: (vnode, removeCallback) => { - console.log('componentDidUnmount'); if (viewObject.actions.componentDidUnmount && isFunction(viewObject.actions.componentDidUnmount)) { viewObject.actions.componentDidUnmount(viewObject.actions.state, viewObject.actions); } @@ -373,7 +350,6 @@ const createComponent = (params = defaultParams) => { }; if (viewObject.actions.componentDidCreateViewObject && isFunction(viewObject.actions.componentDidCreateViewObject)) { - console.log('componentDidCreateViewObject'); viewObject.actions.componentDidCreateViewObject(viewObject.actions.state, viewObject.actions); } diff --git a/modules/styled.js b/modules/styled.js index 9caae8b..1c98606 100644 --- a/modules/styled.js +++ b/modules/styled.js @@ -1,7 +1,7 @@ // ####### Declarations ########## const h = require('../vendors/snabbdom/h.js'); const cssToJS = require('../utils/cssToJS.js'); -const { forEach, has, filter } = require('lodash'); +const { forEach, has, filter, defaultsDeep } = require('lodash'); const { mergeWithFn, ss } = require('../utils/helpers.js'); const { isDefinedChild } = require('../utils/vDomHelpers.js'); @@ -19,7 +19,7 @@ const defaultData = { }; // ####### Helpers ########## -const getVNode = (sel = 'div', literals, ...expressions) => (d = { ...defaultData }, c) => { +const getVNode = (sel = 'div', literals, ...expressions) => (d = defaultData, c) => { let data = d; let children = c; @@ -27,13 +27,15 @@ const getVNode = (sel = 'div', literals, ...expressions) => (d = { ...defaultDat children = data; data = { ...defaultData }; } else { - data = { ...defaultData, ...data }; + data = defaultsDeep(data, defaultData); } const props = data.styled; - const style = cssWithProps(props, data)(literals, ...expressions); - const defprops = { style, styledProps: { css: cssWithPropsPlain(props, data)(literals, ...expressions) } }; + const css = cssWithPropsPlain(props, data)(literals, ...expressions); + const style = cssToJS(css); + + const defprops = { style, styledProps: { css } }; return h(sel, mergeWithFn(defprops, data), filter(children, child => isDefinedChild(child))); }; diff --git a/package.json b/package.json index 082067a..ca43868 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "snabbdom-react-components", - "version": "1.0.2", + "version": "1.0.3", "description": "React like, Snabbdom based, Virtual Dom framework for JavaScript Web Applications", "keywords": [ "React", diff --git a/prod/src.cjs.js b/prod/src.cjs.js index 8537422..ba397a8 100644 --- a/prod/src.cjs.js +++ b/prod/src.cjs.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */!function(t){function n(e,t,n,o){// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. -var c=t&&t.prototype instanceof a?t:a,i=Object.create(c.prototype),r=new h(o||[]);return i._invoke=p(e,n,r),i}// Try/catch helper to minimize deoptimizations. Returns a completion +var c=t&&t.prototype instanceof a?t:a,r=Object.create(c.prototype),i=new h(o||[]);return r._invoke=p(e,n,i),r}// Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we @@ -18,16 +18,16 @@ function o(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. -function a(){}function c(){}function i(){}// This is a polyfill for %IteratorPrototype% for environments that +function a(){}function c(){}function r(){}// This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. -function r(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function t(n,a,c,i){var r=o(e[n],e,a);if("throw"===r.type)i(r.arg);else{var l=r.arg,p=l.value;return p&&"object"==typeof p&&f.call(p,"__await")?Promise.resolve(p.__await).then(function(e){t("next",e,c,i)},function(e){t("throw",e,c,i)}):Promise.resolve(p).then(function(e){// When a yielded Promise is resolved, its final value becomes +function i(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function l(e){function t(n,a,c,r){var i=o(e[n],e,a);if("throw"===i.type)r(i.arg);else{var l=i.arg,p=l.value;return p&&"object"==typeof p&&f.call(p,"__await")?Promise.resolve(p.__await).then(function(e){t("next",e,c,r)},function(e){t("throw",e,c,r)}):Promise.resolve(p).then(function(e){// When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. l.value=e,c(l)},function(e){// If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. -return t("throw",e,c,i)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=// If enqueue has been called before, then we want to wait until +return t("throw",e,c,r)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=// If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to @@ -43,9 +43,9 @@ a?a.then(o,// Avoid propagating failures to Promises returned by later // invocations of the iterator. o):o()}// Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). -var a;this._invoke=n}function p(e,t,n){var a="suspendedStart";return function(c,i){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===c)throw i;// Be forgiving, per 25.3.3.3.3 of the spec: +var a;this._invoke=n}function p(e,t,n){var a="suspendedStart";return function(c,r){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===c)throw r;// Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume -return g()}for(n.method=c,n.arg=i;;){var r=n.delegate;if(r){var l=s(r,n);if(l){if(l===w)continue;return l}}if("next"===n.method)// Setting context._sent for legacy support of Babel's +return m()}for(n.method=c,n.arg=r;;){var i=n.delegate;if(i){var l=s(i,n);if(l){if(l===w)continue;return l}}if("next"===n.method)// Setting context._sent for legacy support of Babel's // function.sent implementation. n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var p=o(e,t,n);if("normal"===p.type){if(a=n.done?"completed":"suspendedYield",p.arg===w)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(// Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. @@ -64,13 +64,13 @@ function d(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLo // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries=[{tryLoc:"root"}],e.forEach(d,this),this.reset(!0)}function u(e){if(e){var t=e[_];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++ng?(y=isUndef(o[k+1])?null:o[k+1].elm,c(e,y,o,u,k,i)):u>k&&l(e,n,h,g)}function s(e,n,o){var r,s;isDef(r=n.data)&&isDef(s=r.hook)&&isDef(r=s.prepatch)&&r(e,n);var d=n.elm=e.elm,y=e.children,u=n.children;if(e!==n){if(!sameVnode(e,n)){var g=t.parentNode(e.elm);return d=a(n,o),t.insertBefore(g,d,e.elm),void l(g,[e],0,0)}if(isDef(n.data)){for(r=0;rm?(y=isUndef(o[k+1])?null:o[k+1].elm,c(e,y,o,u,k,r)):u>k&&l(e,n,h,m)}function s(e,n,o){var r,s;isDef(r=n.data)&&isDef(s=r.hook)&&isDef(r=s.prepatch)&&r(e,n);var d=n.elm=e.elm,y=e.children,u=n.children;if(e!==n){if(!sameVnode(e,n)){var m=t.parentNode(e.elm);return d=a(n,o),t.insertBefore(m,d,e.elm),void l(m,[e],0,0)}if(isDef(n.data)){for(r=0;r [false, false] - */function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a?_root.Buffer:void 0,i=c?c.isBuffer:void 0;/** Detect free variable `module`. */e.exports=i||stubFalse_1}),objectTag="[object Object]",funcProto$2=Function.prototype,objectProto$7=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$5=objectProto$7.hasOwnProperty,objectCtorString=funcToString$2.call(Object);/** + */function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a?_root.Buffer:void 0,r=c?c.isBuffer:void 0;/** Detect free variable `module`. */e.exports=r||stubFalse_1}),objectTag="[object Object]",funcProto$2=Function.prototype,objectProto$7=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$5=objectProto$7.hasOwnProperty,objectCtorString=funcToString$2.call(Object);/** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * @@ -680,9 +680,9 @@ Stack.prototype.clear=_stackClear,Stack.prototype["delete"]=_stackDelete,Stack.p * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. - */function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a&&_freeGlobal.process,i=function(){try{// Use `util.types` for Node.js 10+. + */function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a&&_freeGlobal.process,r=function(){try{// Use `util.types` for Node.js 10+. var e=o&&o.require&&o.require("util").types;return e?e:c&&c.binding&&c.binding("util");// Legacy `process.binding('util')` for Node.js < 10. -}catch(t){}}();/** Detect free variable `module`. */e.exports=i}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray;/** +}catch(t){}}();/** Detect free variable `module`. */e.exports=r}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray;/** * Gets the value at `key`, unless `key` is "__proto__". * * @private @@ -707,7 +707,7 @@ var e=o&&o.require&&o.require("util").types;return e?e:c&&c.binding&&c.binding(" * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. - */function copyObject(e,t,n,o){var a=!n;n||(n={});for(var c=-1,i=t.length;++ca?void 0:c,a=1),t=Object(t);++oa?void 0:c,a=1),t=Object(t);++or))return!1;// Assume cyclic values are equal. + */function equalArrays(e,t,n,o,a,c){var r=n&COMPARE_PARTIAL_FLAG,i=e.length,l=t.length;if(i!=l&&!(r&&l>i))return!1;// Assume cyclic values are equal. var p=c.get(e);if(p&&c.get(t))return p==t;var s=-1,d=!0,y=n&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;// Ignore non-index properties. -for(c.set(e,t),c.set(t,e);++s false */function isEqual(e,t){return _baseIsEqual(e,t)}var isEqual_1=isEqual,mergeWithFnCustomizer=function(e,t){if(isFunction_1(e)&&isFunction_1(t))return function(){e.apply(void 0,arguments),t.apply(void 0,arguments)}},mergeWithFn=function(e,t){return mergeWith_1(e,t,mergeWithFnCustomizer)},getPropertyByCaseInsensitiveKey=function(){var e=0 false - */function isUndefined(e){return e===void 0}var isUndefined_1=isUndefined,toVNode=function(e){return"object"===_typeof_1(e)?e:{children:void 0,data:void 0,elm:void 0,key:void 0,sel:void 0,text:e}},isVNode=function(e){return!!(isObject_1(e)&&has_1(e,"children")&&has_1(e,"data")&&has_1(e,"elm")&&has_1(e,"key")&&has_1(e,"sel")&&has_1(e,"text"))},trustHTML=function(e){var t=function(t){return t.elm.innerHTML=e};return h("div",{hook:{insert:t,update:t}})},JsonToVNode=function e(t,n){isString_1(t)&&(t=JSON.parse(t));var o;if(isArray_1(t.children))o=map_1(t.children,function(t){return e(t,n)});else if(isObject_1(t.children))o=[e(t.children,n)];else if(isString_1(t.children)&&t.children.match(/{{\s*[\w\.]+\s*}}/g)){var a=get_1(n,t.children.match(/[\w\.]+/)[0]);isString_1(a)?t.children=a:isArray_1(a)?o=a:isObject_1(a)&&(o=[a])}return{children:o,data:{style:t.style,class:t.class,attrs:t.attrs,props:t.props},elm:void 0,key:t.key,sel:t.tag,text:isString_1(t.children)?t.children:void 0}},isDefinedValue=function(e){return!isUndefined_1(e)&&!isNull_1(e)},isGhost=function(e){return!(isVNode(e)&&(isDefinedValue(e.children)||isDefinedValue(e.text)||isDefinedValue(e.trustHTML)))},isDefinedChild=function(e){return!isGhost(e)||!isUndefined_1(e)&&!isNull_1(e)&&(!isObject_1(e)||isArray_1(e))},toVNode_1=toVNode,isVNode_1=isVNode,trustHTML_1=trustHTML,JsonToVNode_1=JsonToVNode,isDefinedValue_1=isDefinedValue,isGhost_1=isGhost,isDefinedChild_1=isDefinedChild,vDomHelpers={toVNode:toVNode_1,isVNode:isVNode_1,trustHTML:trustHTML_1,JsonToVNode:JsonToVNode_1,isDefinedValue:isDefinedValue_1,isGhost:isGhost_1,isDefinedChild:isDefinedChild_1},forEach$3=lodash.forEach,has$1=lodash.has,filter=lodash.filter,mergeWithFn$1=helpers.mergeWithFn,ss$1=helpers.ss,isDefinedChild$1=vDomHelpers.isDefinedChild,defaultData={on:{},hook:{},props:{},attrs:{},class:{},style:{},styled:{},dataset:{}},getVNode=function(){for(var e=0 result for the // current iteration. l.value=e,c(l)},function(e){// If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. -return t("throw",e,c,i)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=// If enqueue has been called before, then we want to wait until +return t("throw",e,c,r)})}}function n(e,n){function o(){return new Promise(function(o,a){t(e,n,o,a)})}return a=// If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to @@ -43,9 +43,9 @@ a?a.then(o,// Avoid propagating failures to Promises returned by later // invocations of the iterator. o):o()}// Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). -var a;this._invoke=n}function p(e,t,n){var a="suspendedStart";return function(c,i){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===c)throw i;// Be forgiving, per 25.3.3.3.3 of the spec: +var a;this._invoke=n}function p(e,t,n){var a="suspendedStart";return function(c,r){if(a==="executing")throw new Error("Generator is already running");if("completed"===a){if("throw"===c)throw r;// Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume -return g()}for(n.method=c,n.arg=i;;){var r=n.delegate;if(r){var l=s(r,n);if(l){if(l===w)continue;return l}}if("next"===n.method)// Setting context._sent for legacy support of Babel's +return m()}for(n.method=c,n.arg=r;;){var i=n.delegate;if(i){var l=s(i,n);if(l){if(l===w)continue;return l}}if("next"===n.method)// Setting context._sent for legacy support of Babel's // function.sent implementation. n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===a)throw a="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a="executing";var p=o(e,t,n);if("normal"===p.type){if(a=n.done?"completed":"suspendedYield",p.arg===w)continue;return{value:p.arg,done:n.done}}"throw"===p.type&&(// Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. @@ -64,13 +64,13 @@ function d(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLo // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries=[{tryLoc:"root"}],e.forEach(d,this),this.reset(!0)}function u(e){if(e){var t=e[_];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++ng?(y=isUndef(o[k+1])?null:o[k+1].elm,c(e,y,o,u,k,i)):u>k&&l(e,n,h,g)}function s(e,n,o){var r,s;isDef(r=n.data)&&isDef(s=r.hook)&&isDef(r=s.prepatch)&&r(e,n);var d=n.elm=e.elm,y=e.children,u=n.children;if(e!==n){if(!sameVnode(e,n)){var g=t.parentNode(e.elm);return d=a(n,o),t.insertBefore(g,d,e.elm),void l(g,[e],0,0)}if(isDef(n.data)){for(r=0;rm?(y=isUndef(o[k+1])?null:o[k+1].elm,c(e,y,o,u,k,r)):u>k&&l(e,n,h,m)}function s(e,n,o){var r,s;isDef(r=n.data)&&isDef(s=r.hook)&&isDef(r=s.prepatch)&&r(e,n);var d=n.elm=e.elm,y=e.children,u=n.children;if(e!==n){if(!sameVnode(e,n)){var m=t.parentNode(e.elm);return d=a(n,o),t.insertBefore(m,d,e.elm),void l(m,[e],0,0)}if(isDef(n.data)){for(r=0;r [false, false] - */function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a?_root.Buffer:void 0,i=c?c.isBuffer:void 0;/** Detect free variable `module`. */e.exports=i||stubFalse_1}),objectTag="[object Object]",funcProto$2=Function.prototype,objectProto$7=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$5=objectProto$7.hasOwnProperty,objectCtorString=funcToString$2.call(Object);/** + */function stubFalse(){return!1}var stubFalse_1=stubFalse,isBuffer_1=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a?_root.Buffer:void 0,r=c?c.isBuffer:void 0;/** Detect free variable `module`. */e.exports=r||stubFalse_1}),objectTag="[object Object]",funcProto$2=Function.prototype,objectProto$7=Object.prototype,funcToString$2=funcProto$2.toString,hasOwnProperty$5=objectProto$7.hasOwnProperty,objectCtorString=funcToString$2.call(Object);/** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * @@ -680,9 +680,9 @@ Stack.prototype.clear=_stackClear,Stack.prototype["delete"]=_stackDelete,Stack.p * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. - */function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a&&_freeGlobal.process,i=function(){try{// Use `util.types` for Node.js 10+. + */function baseUnary(e){return function(t){return e(t)}}var _baseUnary=baseUnary,_nodeUtil=createCommonjsModule(function(e,t){/** Detect free variable `exports`. */var n=t&&!t.nodeType&&t,o=n&&!0&&e&&!e.nodeType&&e,a=o&&o.exports===n,c=a&&_freeGlobal.process,r=function(){try{// Use `util.types` for Node.js 10+. var e=o&&o.require&&o.require("util").types;return e?e:c&&c.binding&&c.binding("util");// Legacy `process.binding('util')` for Node.js < 10. -}catch(t){}}();/** Detect free variable `module`. */e.exports=i}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray;/** +}catch(t){}}();/** Detect free variable `module`. */e.exports=r}),nodeIsTypedArray=_nodeUtil&&_nodeUtil.isTypedArray,isTypedArray=nodeIsTypedArray?_baseUnary(nodeIsTypedArray):_baseIsTypedArray,isTypedArray_1=isTypedArray;/** * Gets the value at `key`, unless `key` is "__proto__". * * @private @@ -707,7 +707,7 @@ var e=o&&o.require&&o.require("util").types;return e?e:c&&c.binding&&c.binding(" * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. - */function copyObject(e,t,n,o){var a=!n;n||(n={});for(var c=-1,i=t.length;++ca?void 0:c,a=1),t=Object(t);++oa?void 0:c,a=1),t=Object(t);++or))return!1;// Assume cyclic values are equal. + */function equalArrays(e,t,n,o,a,c){var r=n&COMPARE_PARTIAL_FLAG,i=e.length,l=t.length;if(i!=l&&!(r&&l>i))return!1;// Assume cyclic values are equal. var p=c.get(e);if(p&&c.get(t))return p==t;var s=-1,d=!0,y=n&COMPARE_UNORDERED_FLAG?new _SetCache:void 0;// Ignore non-index properties. -for(c.set(e,t),c.set(t,e);++s false */function isEqual(e,t){return _baseIsEqual(e,t)}var isEqual_1=isEqual,mergeWithFnCustomizer=function(e,t){if(isFunction_1(e)&&isFunction_1(t))return function(){e.apply(void 0,arguments),t.apply(void 0,arguments)}},mergeWithFn=function(e,t){return mergeWith_1(e,t,mergeWithFnCustomizer)},getPropertyByCaseInsensitiveKey=function(){var e=0 false - */function isUndefined(e){return e===void 0}var isUndefined_1=isUndefined,toVNode=function(e){return"object"===_typeof_1(e)?e:{children:void 0,data:void 0,elm:void 0,key:void 0,sel:void 0,text:e}},isVNode=function(e){return!!(isObject_1(e)&&has_1(e,"children")&&has_1(e,"data")&&has_1(e,"elm")&&has_1(e,"key")&&has_1(e,"sel")&&has_1(e,"text"))},trustHTML=function(e){var t=function(t){return t.elm.innerHTML=e};return h("div",{hook:{insert:t,update:t}})},JsonToVNode=function e(t,n){isString_1(t)&&(t=JSON.parse(t));var o;if(isArray_1(t.children))o=map_1(t.children,function(t){return e(t,n)});else if(isObject_1(t.children))o=[e(t.children,n)];else if(isString_1(t.children)&&t.children.match(/{{\s*[\w\.]+\s*}}/g)){var a=get_1(n,t.children.match(/[\w\.]+/)[0]);isString_1(a)?t.children=a:isArray_1(a)?o=a:isObject_1(a)&&(o=[a])}return{children:o,data:{style:t.style,class:t.class,attrs:t.attrs,props:t.props},elm:void 0,key:t.key,sel:t.tag,text:isString_1(t.children)?t.children:void 0}},isDefinedValue=function(e){return!isUndefined_1(e)&&!isNull_1(e)},isGhost=function(e){return!(isVNode(e)&&(isDefinedValue(e.children)||isDefinedValue(e.text)||isDefinedValue(e.trustHTML)))},isDefinedChild=function(e){return!isGhost(e)||!isUndefined_1(e)&&!isNull_1(e)&&(!isObject_1(e)||isArray_1(e))},toVNode_1=toVNode,isVNode_1=isVNode,trustHTML_1=trustHTML,JsonToVNode_1=JsonToVNode,isDefinedValue_1=isDefinedValue,isGhost_1=isGhost,isDefinedChild_1=isDefinedChild,vDomHelpers={toVNode:toVNode_1,isVNode:isVNode_1,trustHTML:trustHTML_1,JsonToVNode:JsonToVNode_1,isDefinedValue:isDefinedValue_1,isGhost:isGhost_1,isDefinedChild:isDefinedChild_1},forEach$3=lodash.forEach,has$1=lodash.has,filter=lodash.filter,mergeWithFn$1=helpers.mergeWithFn,ss$1=helpers.ss,isDefinedChild$1=vDomHelpers.isDefinedChild,defaultData={on:{},hook:{},props:{},attrs:{},class:{},style:{},styled:{},dataset:{}},getVNode=function(){for(var e=0