diff --git a/packages/omi-cli/template/mvvm/src/view/todo-list.js b/packages/omi-cli/template/mvvm/src/view/todo-list.js index 15eb65cd7..1420f6cb8 100644 --- a/packages/omi-cli/template/mvvm/src/view/todo-list.js +++ b/packages/omi-cli/template/mvvm/src/view/todo-list.js @@ -29,6 +29,7 @@ define('todo-list', class extends WeElement { onChange={evt => { this.onChange(evt, item.id) }} + checked={item.completed} /> {item.text} diff --git a/packages/omi/examples/mvvm/b.js b/packages/omi/examples/mvvm/b.js index eeec6ecc4..0be862766 100644 --- a/packages/omi/examples/mvvm/b.js +++ b/packages/omi/examples/mvvm/b.js @@ -721,17 +721,17 @@ will emit {op: replace, path: '/arr/1', value: arr_2} {op: remove, path: '/arr/2'} - by default, the second operation would revoke the proxy, and this renders arr revoked. + by default, the second operation would revoke the proxy, and this renders arr revoked. That's why we need to remember the proxies that are inherited. */ var revokableInstance = instance.proxifiedObjectsMap.get(newValue); /* Why do we need to check instance.isProxifyingTreeNow? - We need to make sure we mark revokables as inherited ONLY when we're observing, + We need to make sure we mark revokables as inherited ONLY when we're observing, because throughout the first proxification, a sub-object is proxified and then assigned to its parent object. This assignment of a pre-proxified object can fool us into thinking that it's a proxified object moved around, while in fact it's the first assignment ever. - Checking isProxifyingTreeNow ensures this is not happening in the first proxification, + Checking isProxifyingTreeNow ensures this is not happening in the first proxification, but in fact is is a proxified object moved around the tree */ if (revokableInstance && !instance.isProxifyingTreeNow) { @@ -809,7 +809,7 @@ this is an inherited proxy (an already proxified object that was moved around), we shouldn't revoke it, because even though it was removed from path1, it is still used in path2. And we know that because we mark moved proxies with `inherited` flag when we move them - it is a good idea to remove this flag if we come across it here, in deleteProperty trap. + it is a good idea to remove this flag if we come across it here, in deleteProperty trap. We DO want to revoke the proxy if it was removed again. */ revokableProxyInstance.inherited = false; @@ -1540,113 +1540,131 @@ var mappingjs = createCommonjsModule(function (module, exports) { /** - * mappingjs v1.0.1 by dntzhang + * mappingjs v2.0.0 by dntzhang * Objects mapping for javascript. Omi MVVM's best partner. * @method mapping - * @param {Object} options {from: .., to: .., rule: .. } + * @param {from} options + * @param {to} options + * @param {rule} options * @return {Object} To Object */ var ARRAYTYPE = '[object Array]'; var OBJECTTYPE = '[object Object]'; - var mapping = function (options) { - var from = options.from; - var to = options.to; - var rules = options.rule; - + function mapping(from, to, rule) { + var tempRule = Object.assign({}, rule); var res = to || {}; - Object.keys(from).forEach(function (key) { - res[key] = from[key]; + var obj = from[key]; + if (isArray(obj)) { + res[key] = res[key] || []; + arrayMapping(obj, res[key], tempRule, key); + } else if (isObject(obj)) { + res[key] = res[key] || {}; + objMapping(obj, res[key], tempRule, key); + } else { + res[key] = obj; + } }); - rules && - Object.keys(rules).forEach(function (key) { - var rule = rules[key]; - var isPath = key.match(/\.|\[/); - if (typeof rule === 'function') { - if (isPath) { - setPathValue(res, key, rule.call(from)); - } else { - res[key] = rule.call(from); - } - } else { - if (isPath) { - setPathValue(res, key, rule); - } else { - res[key] = rule; - } - } - }); - return res - }; + rule && Object.keys(tempRule).forEach(function (key) { + var arr = key + .replace(/]/g, '') + .replace(/\[/g, '.') + .split('.'); - function setPathValue(obj, path, value) { - var arr = path - .replace(/]/g, '') - .replace(/\[/g, '.') - .split('.'); - - var current = obj; - for (var i = 0, len = arr.length; i < len; i++) { - var key = arr[i]; - var temp = current[key]; - if (i === len - 1) { - current[arr[len - 1]] = value; - } else { - if (temp === undefined) { - if (isNaN(Number(arr[i + 1]))) { - current[key] = {}; - } else { - current[key] = []; - } - - temp = current[key]; - } + if (arr.length === 1) { + res[key] = tempRule[key].call ? tempRule[key].call(from) : tempRule[key]; + delete tempRule[key]; } + }); - current = temp; - } + return res } - mapping.auto = function (from, to) { - return objMapping(from, to) - }; - function arrayMapping(from, to) { + function arrayMapping(from, to, rule, path) { if (from.length < to.length) { to.length = from.length; } from.forEach(function (item, index) { if (isArray(item)) { to[index] = to[index] || []; - arrayMapping(item, to[index]); + arrayMapping(item, to[index], rule, path + '[' + index + ']'); } else if (isObject(item)) { - to[index] = objMapping(item, to[index]); + to[index] = objMapping(item, to[index], rule, path + '[' + index + ']'); } else { to[index] = item; } }); + + + rule && Object.keys(rule).forEach(function (key) { + var arr = key + .replace(/]/g, '') + .replace(/\[/g, '.') + .split('.'); + var pathArr = path + .replace(/]/g, '') + .replace(/\[/g, '.') + .split('.'); + + var dl = arr.length - pathArr.length; + if (dl === 1 && equalArr(arr, pathArr)) { + to[arr[arr.length - 1]] = rule[key].call ? rule[key].call(from) : rule[key]; + delete rule[key]; + } + }); } - function objMapping(from, to) { + function objMapping(from, to, rule, path) { var res = to || {}; - Object.keys(from).forEach(key => { + Object.keys(from).forEach(function (key) { var obj = from[key]; if (isArray(obj)) { res[key] = res[key] || []; - arrayMapping(obj, res[key]); + arrayMapping(obj, res[key], rule, path + '.' + key); } else if (isObject(obj)) { res[key] = res[key] || {}; - objMapping(obj, res[key]); + objMapping(obj, res[key], rule, path + '.' + key); } else { res[key] = obj; } }); + + rule && Object.keys(rule).forEach(function (key) { + var arr = key + .replace(/]/g, '') + .replace(/\[/g, '.') + .split('.'); + var pathArr = path + .replace(/]/g, '') + .replace(/\[/g, '.') + .split('.'); + + if (arr.length - pathArr.length === 1 && equalArr(arr, pathArr)) { + res[arr[arr.length - 1]] = rule[key].call ? rule[key].call(from) : rule[key]; + if (arr.indexOf('*') === -1) { + delete rule[key]; + } + } + + }); + return res } + function equalArr(arrA, arrB) { + var i = 0, len = arrB.length; + for (; i < len; i++) { + if (arrA[i] !== arrB[i] && !(arrA[i] === '*' && !isNaN(Number(arrB[i])))) { + return false + } + } + return true + } + function isArray(obj) { return Object.prototype.toString.call(obj) === ARRAYTYPE } @@ -1655,6 +1673,9 @@ return Object.prototype.toString.call(obj) === OBJECTTYPE } + //Compatible with older versions + mapping.auto = mapping; + { module.exports = mapping; } @@ -1790,7 +1811,7 @@ TodoViewModel.prototype.update = function update() { //will automatically update the view!!! - mappingjs.auto(todo, this.data); + mappingjs(todo, this.data); }; TodoViewModel.prototype.complete = function complete(id) { @@ -1873,7 +1894,8 @@ type: 'checkbox', onChange: function onChange(evt) { _this2.onChange(evt, item.id); - } + }, + checked: item.completed }), item.text, Omi.h( diff --git a/packages/omi/examples/mvvm/b.js.map b/packages/omi/examples/mvvm/b.js.map index 303c088a3..22832194b 100644 --- a/packages/omi/examples/mvvm/b.js.map +++ b/packages/omi/examples/mvvm/b.js.map @@ -1 +1 @@ -{"version":3,"file":"b.js","sources":["../../src/vnode.js","../../src/options.js","../../src/h.js","../../src/util.js","../../src/constants.js","../../src/vdom/index.js","../../src/dom/index.js","../../src/vdom/diff.js","../../src/proxy.js","../../src/tick.js","../../src/observe.js","../../src/we-element.js","../../src/render.js","../../src/define.js","../../src/tag.js","../../src/clone-element.js","../../src/get-host.js","../../src/rpx.js","../../src/model-view.js","../../src/omi.js","../../node_modules/mappingjs/index.js","model/todo/todo-item.js","model/todo/todo-server.js","model/todo/todo.js","model/todo/index.js","view-model/todo.js","view/todo-list.js","view/todo-app.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n if (\n typeof global !== 'object' ||\n !global ||\n global.Math !== Math ||\n global.Array !== Array\n ) {\n return (\n self ||\n window ||\n global ||\n (function() {\n return this\n })()\n )\n }\n return global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n store: null,\n root: getGlobal()\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n let children = EMPTY_CHILDREN,\n lastSimple,\n child,\n simple,\n i\n for (i = arguments.length; i-- > 2; ) {\n stack.push(arguments[i])\n }\n if (attributes && attributes.children != null) {\n if (!stack.length) stack.push(attributes.children)\n delete attributes.children\n }\n while (stack.length) {\n if ((child = stack.pop()) && child.pop !== undefined) {\n for (i = child.length; i--; ) stack.push(child[i])\n } else {\n if (typeof child === 'boolean') child = null\n\n if ((simple = typeof nodeName !== 'function')) {\n if (child == null) child = ''\n else if (typeof child === 'number') child = String(child)\n else if (typeof child !== 'string') simple = false\n }\n\n if (simple && lastSimple) {\n children[children.length - 1] += child\n } else if (children === EMPTY_CHILDREN) {\n children = [child]\n } else {\n children.push(child)\n }\n\n lastSimple = simple\n }\n }\n\n let p = new VNode()\n p.nodeName = nodeName\n p.children = children\n p.attributes = attributes == null ? undefined : attributes\n p.key = attributes == null ? undefined : attributes.key\n\n // if a \"vnode hook\" is defined, pass every created VNode to it\n if (options.vnode !== undefined) options.vnode(p)\n\n return p\n}\n","/**\n * @license\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * This shim allows elements written in, or compiled to, ES5 to work on native\n * implementations of Custom Elements v1. It sets new.target to the value of\n * this.constructor so that the native HTMLElement constructor can access the\n * current under-construction element's definition.\n */\n;(function() {\n if (\n // No Reflect, no classes, no need for shim because native custom elements\n // require ES2015 classes or Reflect.\n window.Reflect === undefined ||\n window.customElements === undefined ||\n // The webcomponentsjs custom elements polyfill doesn't require\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\n ) {\n return\n }\n const BuiltInHTMLElement = HTMLElement\n window.HTMLElement = function HTMLElement() {\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n }\n HTMLElement.prototype = BuiltInHTMLElement.prototype\n HTMLElement.prototype.constructor = HTMLElement\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\nexport function cssToDom(css) {\n const node = document.createElement('style')\n node.textContent = css\n return node\n}\n\nexport function npn(str) {\n return str.replace(/-(\\w)/g, ($, $1) => {\n return $1.toUpperCase()\n })\n}\n\nexport function extend(obj, props) {\n for (let i in props) obj[i] = props[i]\n return obj\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n * @param {object|function} [ref=null]\n * @param {any} [value]\n */\nexport function applyRef(ref, value) {\n if (ref != null) {\n if (typeof ref == 'function') ref(value)\n else ref.current = value\n }\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer =\n typeof Promise == 'function'\n ? Promise.resolve().then.bind(Promise.resolve())\n : setTimeout\n\nexport function isArray(obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props) {\n if (!props || isArray(props)) return {}\n const result = {}\n Object.keys(props).forEach(key => {\n result[key] = props[key].value\n })\n return result\n}\n","// render modes\n\nexport const NO_RENDER = 0\nexport const SYNC_RENDER = 1\nexport const FORCE_RENDER = 2\nexport const ASYNC_RENDER = 3\n\nexport const ATTR_KEY = '__omiattr_'\n\n// DOM properties that should NOT have \"px\" added when numeric\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\n","import { extend } from '../util'\n\n/**\n * Check if two nodes are equivalent.\n *\n * @param {Node} node\t\t\tDOM Node to compare\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n return node.splitText !== undefined\n }\n if (typeof vnode.nodeName === 'string') {\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n }\n return hydrating || node._componentConstructor === vnode.nodeName\n}\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n *\n * @param {Element} node\tA DOM Element to inspect the name of.\n * @param {String} nodeName\tUnnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n return (\n node.normalizedNodeName === nodeName ||\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\n )\n}\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n *\n * @param {VNode} vnode\n * @returns {Object} props\n */\nexport function getNodeProps(vnode) {\n let props = extend({}, vnode.attributes)\n props.children = vnode.children\n\n let defaultProps = vnode.nodeName.defaultProps\n if (defaultProps !== undefined) {\n for (let i in defaultProps) {\n if (props[i] === undefined) {\n props[i] = defaultProps[i]\n }\n }\n }\n\n return props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n * namespace.\n * @returns {Element} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n /** @type {Element} */\n let node = isSvg\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\n : document.createElement(nodeName)\n node.normalizedNodeName = nodeName\n return node\n}\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n let parentNode = node.parentNode\n if (parentNode) parentNode.removeChild(node)\n}\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {Element} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n * event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n if (name === 'className') name = 'class'\n\n if (name === 'key') {\n // ignore\n } else if (name === 'ref') {\n applyRef(old, null)\n applyRef(value, node)\n } else if (name === 'class' && !isSvg) {\n node.className = value || ''\n } else if (name === 'style') {\n if (!value || typeof value === 'string' || typeof old === 'string') {\n node.style.cssText = value || ''\n }\n if (value && typeof value === 'object') {\n if (typeof old !== 'string') {\n for (let i in old) if (!(i in value)) node.style[i] = ''\n }\n for (let i in value) {\n node.style[i] =\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\n ? value[i] + 'px'\n : value[i]\n }\n }\n } else if (name === 'dangerouslySetInnerHTML') {\n if (value) node.innerHTML = value.__html || ''\n } else if (name[0] == 'o' && name[1] == 'n') {\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\n name = name.toLowerCase().substring(2)\n if (value) {\n if (!old) {\n node.addEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.addEventListener('touchstart', touchStart, useCapture)\n node.addEventListener('touchend', touchEnd, useCapture)\n }\n }\n } else {\n node.removeEventListener(name, eventProxy, useCapture)\n if (name == 'tap') {\n node.removeEventListener('touchstart', touchStart, useCapture)\n node.removeEventListener('touchend', touchEnd, useCapture)\n }\n }\n ;(node._listeners || (node._listeners = {}))[name] = value\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\n // Attempt to set a DOM property to the given value.\n // IE & FF throw for certain property-value combinations.\n try {\n node[name] = value == null ? '' : value\n } catch (e) {}\n if ((value == null || value === false) && name != 'spellcheck')\n node.removeAttribute(name)\n } else {\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\n // spellcheck is treated differently than all other boolean values and\n // should not be removed when the value is `false`. See:\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n if (value == null || value === false) {\n if (ns)\n node.removeAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase()\n )\n else node.removeAttribute(name)\n } else if (typeof value === 'string') {\n if (ns) {\n node.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n name.toLowerCase(),\n value\n )\n } else {\n node.setAttribute(name, value)\n }\n }\n }\n}\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n return this._listeners[e.type]((options.event && options.event(e)) || e)\n}\n\nfunction touchStart(e) {\n this.___touchX = e.touches[0].pageX\n this.___touchY = e.touches[0].pageY\n this.___scrollTop = document.body.scrollTop\n}\n\nfunction touchEnd(e) {\n if (\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\n ) {\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\n }\n}\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\n }\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object') {\n if (name === 'style') {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n }\n if (dom.receiveProps) {\n try {\n old[name] = JSON.parse(JSON.stringify(attrs[name]))\n } catch (e) {\n console.warn(\n 'When using receiveProps, you cannot pass prop of cyclic dependencies down.'\n )\n }\n }\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data, oldClone)\n dom.update()\n }\n }\n}\n","/*!\n * https://github.com/Palindrom/JSONPatcherProxy\n * (c) 2017 Starcounter\n * MIT license\n */\n\n/** Class representing a JS Object observer */\nconst JSONPatcherProxy = (function() {\n /**\n * Deep clones your object and returns a new object.\n */\n function deepClone(obj) {\n switch (typeof obj) {\n case 'object':\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case 'undefined':\n return null //this is how JSON.stringify behaves for array items\n default:\n return obj //no need to clone primitives\n }\n }\n JSONPatcherProxy.deepClone = deepClone\n\n function escapePathComponent(str) {\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\n }\n JSONPatcherProxy.escapePathComponent = escapePathComponent\n\n /**\n * Walk up the parenthood tree to get the path\n * @param {JSONPatcherProxy} instance\n * @param {Object} obj the object you need to find its path\n */\n function findObjectPath(instance, obj) {\n const pathComponents = []\n let parentAndPath = instance.parenthoodMap.get(obj)\n while (parentAndPath && parentAndPath.path) {\n // because we're walking up-tree, we need to use the array as a stack\n pathComponents.unshift(parentAndPath.path)\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\n }\n if (pathComponents.length) {\n const path = pathComponents.join('/')\n return '/' + path\n }\n return ''\n }\n /**\n * A callback to be used as th proxy set trap callback.\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the affected object\n * @param {String} key the effect property's name\n * @param {Any} newValue the value being set\n */\n function setTrap(instance, target, key, newValue) {\n const parentPath = findObjectPath(instance, target)\n\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n if (instance.proxifiedObjectsMap.has(newValue)) {\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\n\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\n parent: target,\n path: key\n })\n }\n /*\n mark already proxified values as inherited.\n rationale: proxy.arr.shift()\n will emit\n {op: replace, path: '/arr/1', value: arr_2}\n {op: remove, path: '/arr/2'}\n\n by default, the second operation would revoke the proxy, and this renders arr revoked.\n That's why we need to remember the proxies that are inherited.\n */\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\n /*\n Why do we need to check instance.isProxifyingTreeNow?\n\n We need to make sure we mark revokables as inherited ONLY when we're observing,\n because throughout the first proxification, a sub-object is proxified and then assigned to\n its parent object. This assignment of a pre-proxified object can fool us into thinking\n that it's a proxified object moved around, while in fact it's the first assignment ever.\n\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\n but in fact is is a proxified object moved around the tree\n */\n if (revokableInstance && !instance.isProxifyingTreeNow) {\n revokableInstance.inherited = true\n }\n\n // if the new value is an object, make sure to watch it\n if (\n newValue &&\n typeof newValue == 'object' &&\n !instance.proxifiedObjectsMap.has(newValue)\n ) {\n instance.parenthoodMap.set(newValue, {\n parent: target,\n path: key\n })\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\n }\n // let's start with this operation, and may or may not update it later\n const operation = {\n op: 'remove',\n path: destinationPropKey\n }\n if (typeof newValue == 'undefined') {\n // applying De Morgan's laws would be a tad faster, but less readable\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\n // `undefined` is being set to an already undefined value, keep silent\n return Reflect.set(target, key, newValue)\n }\n // when array element is set to `undefined`, should generate replace to `null`\n if (Array.isArray(target)) {\n // undefined array elements are JSON.stringified to `null`\n ;(operation.op = 'replace'), (operation.value = null)\n }\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\n // was the deleted a proxified object?\n if (oldValue) {\n instance.parenthoodMap.delete(target[key])\n instance.disableTrapsForProxy(oldValue)\n instance.proxifiedObjectsMap.delete(oldValue)\n }\n } else {\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\n if (key != 'length') {\n console.warn(\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\n )\n }\n return Reflect.set(target, key, newValue)\n }\n operation.op = 'add'\n if (target.hasOwnProperty(key)) {\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\n }\n }\n operation.value = newValue\n }\n operation.oldValue = target[key]\n const reflectionResult = Reflect.set(target, key, newValue)\n instance.defaultCallback(operation)\n return reflectionResult\n }\n /**\n * A callback to be used as th proxy delete trap callback.\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\n * @param {Object} target the effected object\n * @param {String} key the effected property's name\n */\n function deleteTrap(instance, target, key) {\n if (typeof target[key] !== 'undefined') {\n const parentPath = findObjectPath(instance, target)\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\n\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\n target[key]\n )\n\n if (revokableProxyInstance) {\n if (revokableProxyInstance.inherited) {\n /*\n this is an inherited proxy (an already proxified object that was moved around),\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\n And we know that because we mark moved proxies with `inherited` flag when we move them\n\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\n We DO want to revoke the proxy if it was removed again.\n */\n revokableProxyInstance.inherited = false\n } else {\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\n instance.disableTrapsForProxy(revokableProxyInstance)\n instance.proxifiedObjectsMap.delete(target[key])\n }\n }\n const reflectionResult = Reflect.deleteProperty(target, key)\n\n instance.defaultCallback({\n op: 'remove',\n path: destinationPropKey\n })\n\n return reflectionResult\n }\n }\n /* pre-define resume and pause functions to enhance constructors performance */\n function resume() {\n this.defaultCallback = operation => {\n this.isRecording && this.patches.push(operation)\n this.userCallback && this.userCallback(operation)\n }\n this.isObserving = true\n }\n function pause() {\n this.defaultCallback = () => {}\n this.isObserving = false\n }\n /**\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\n * @param {Object|Array} root - the object you want to wrap\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\n * @returns {JSONPatcherProxy}\n * @constructor\n */\n function JSONPatcherProxy(root, showDetachedWarning) {\n this.isProxifyingTreeNow = false\n this.isObserving = false\n this.proxifiedObjectsMap = new Map()\n this.parenthoodMap = new Map()\n // default to true\n if (typeof showDetachedWarning !== 'boolean') {\n showDetachedWarning = true\n }\n\n this.showDetachedWarning = showDetachedWarning\n this.originalObject = root\n this.cachedProxy = null\n this.isRecording = false\n this.userCallback\n /**\n * @memberof JSONPatcherProxy\n * Restores callback back to the original one provided to `observe`.\n */\n this.resume = resume.bind(this)\n /**\n * @memberof JSONPatcherProxy\n * Replaces your callback with a noop function.\n */\n this.pause = pause.bind(this)\n }\n\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\n if (!obj) {\n return obj\n }\n const traps = {\n set: (target, key, value, receiver) =>\n setTrap(this, target, key, value, receiver),\n deleteProperty: (target, key) => deleteTrap(this, target, key)\n }\n const revocableInstance = Proxy.revocable(obj, traps)\n // cache traps object to disable them later.\n revocableInstance.trapsInstance = traps\n revocableInstance.originalObject = obj\n\n /* keeping track of object's parent and path */\n\n this.parenthoodMap.set(obj, { parent, path })\n\n /* keeping track of all the proxies to be able to revoke them later */\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\n return revocableInstance.proxy\n }\n // grab tree's leaves one by one, encapsulate them into a proxy and return\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\n parent,\n root,\n path\n ) {\n for (let key in root) {\n if (root.hasOwnProperty(key)) {\n if (root[key] instanceof Object) {\n root[key] = this._proxifyObjectTreeRecursively(\n root,\n root[key],\n escapePathComponent(key)\n )\n }\n }\n }\n return this.generateProxyAtPath(parent, root, path)\n }\n // this function is for aesthetic purposes\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\n /*\n while proxyifying object tree,\n the proxyifying operation itself is being\n recorded, which in an unwanted behavior,\n that's why we disable recording through this\n initial process;\n */\n this.pause()\n this.isProxifyingTreeNow = true\n const proxifiedObject = this._proxifyObjectTreeRecursively(\n undefined,\n root,\n ''\n )\n /* OK you can record now */\n this.isProxifyingTreeNow = false\n this.resume()\n return proxifiedObject\n }\n /**\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\n * @param {Proxy} proxy - The target proxy object\n */\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\n revokableProxyInstance\n ) {\n if (this.showDetachedWarning) {\n const message =\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\n\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.set = (\n targetObject,\n propKey,\n newValue\n ) => {\n console.warn(message)\n return Reflect.set(targetObject, propKey, newValue)\n }\n revokableProxyInstance.trapsInstance.deleteProperty = (\n targetObject,\n propKey\n ) => {\n return Reflect.deleteProperty(targetObject, propKey)\n }\n } else {\n delete revokableProxyInstance.trapsInstance.set\n delete revokableProxyInstance.trapsInstance.get\n delete revokableProxyInstance.trapsInstance.deleteProperty\n }\n }\n /**\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\n */\n JSONPatcherProxy.prototype.observe = function(record, callback) {\n if (!record && !callback) {\n throw new Error('You need to either record changes or pass a callback')\n }\n this.isRecording = record\n this.userCallback = callback\n /*\n I moved it here to remove it from `unobserve`,\n this will also make the constructor faster, why initiate\n the array before they decide to actually observe with recording?\n They might need to use only a callback.\n */\n if (record) this.patches = []\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\n return this.cachedProxy\n }\n /**\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\n */\n JSONPatcherProxy.prototype.generate = function() {\n if (!this.isRecording) {\n throw new Error('You should set record to true to get patches later')\n }\n return this.patches.splice(0, this.patches.length)\n }\n /**\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\n */\n JSONPatcherProxy.prototype.revoke = function() {\n this.proxifiedObjectsMap.forEach(el => {\n el.revoke()\n })\n }\n /**\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\n */\n JSONPatcherProxy.prototype.disableTraps = function() {\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\n }\n return JSONPatcherProxy\n})()\n\nexport default JSONPatcherProxy\n","const callbacks = []\nconst nextTickCallback = []\n\nexport function tick(fn, scope) {\n callbacks.push({ fn, scope })\n}\n\nexport function fireTick() {\n callbacks.forEach(item => {\n item.fn.call(item.scope)\n })\n\n nextTickCallback.forEach(nextItem => {\n nextItem.fn.call(nextItem.scope)\n })\n nextTickCallback.length = 0\n}\n\nexport function nextTick(fn, scope) {\n nextTickCallback.push({ fn, scope })\n}\n","import JSONProxy from './proxy'\nimport { fireTick } from './tick'\n\nexport function observe(target) {\n target.observe = true\n}\n\nexport function proxyUpdate(ele) {\n let timeout = null\n ele.data = new JSONProxy(ele.data).observe(false, () => {\n if (ele._willUpdate) {\n return\n }\n if (ele.constructor.mergeUpdate) {\n clearTimeout(timeout)\n\n timeout = setTimeout(() => {\n ele.update()\n fireTick()\n }, 0)\n } else {\n ele.update()\n fireTick()\n }\n })\n}\n","import { cssToDom, nProps, isArray } from './util'\nimport { diff } from './vdom/diff'\nimport options from './options'\nimport { proxyUpdate } from './observe'\n\nlet id = 0\n\nexport default class WeElement extends HTMLElement {\n static is = 'WeElement'\n\n constructor() {\n super()\n this.props = Object.assign(\n nProps(this.constructor.props),\n this.constructor.defaultProps\n )\n this.__elementId = id++\n this.data = this.constructor.data || {}\n }\n\n connectedCallback() {\n if (!this.constructor.pure) {\n let p = this.parentNode\n while (p && !this.store) {\n this.store = p.store\n p = p.parentNode || p.host\n }\n if (this.store) {\n this.store.instances.push(this)\n }\n }\n this.beforeInstall()\n !this._isInstalled && this.install()\n this.afterInstall()\n let shadowRoot\n if (!this.shadowRoot) {\n shadowRoot = this.attachShadow({\n mode: 'open'\n })\n } else {\n shadowRoot = this.shadowRoot\n let fc\n while ((fc = shadowRoot.firstChild)) {\n shadowRoot.removeChild(fc)\n }\n }\n\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\n !this._isInstalled && this.beforeRender()\n options.afterInstall && options.afterInstall(this)\n if (this.constructor.observe) {\n this.beforeObserve()\n proxyUpdate(this)\n this.observed()\n }\n this._host = diff(\n null,\n this.render(this.props, this.data, this.store),\n {},\n false,\n null,\n false\n )\n this.rendered()\n if (isArray(this._host)) {\n this._host.forEach(function(item) {\n shadowRoot.appendChild(item)\n })\n } else {\n shadowRoot.appendChild(this._host)\n }\n !this._isInstalled && this.installed()\n this._isInstalled = true\n }\n\n disconnectedCallback() {\n this.uninstall()\n this._isInstalled = false\n if (this.store) {\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\n if (this.store.instances[i] === this) {\n this.store.instances.splice(i, 1)\n break\n }\n }\n }\n }\n\n update() {\n this._willUpdate = true\n this.beforeUpdate()\n this.beforeRender()\n this._host = diff(\n this._host,\n this.render(this.props, this.data, this.store),\n null,\n null,\n this.shadowRoot\n )\n this.afterUpdate()\n this.updated()\n this._willUpdate = false\n }\n\n fire(name, data) {\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\n }\n\n beforeInstall() {}\n\n install() {}\n\n afterInstall() {}\n\n installed() {}\n\n uninstall() {}\n\n beforeUpdate() {}\n\n afterUpdate() {} //deprecated, please use updated\n\n updated() {}\n\n beforeRender() {}\n\n rendered() {}\n\n receiveProps() {}\n\n beforeObserve() {}\n\n observed() {}\n}\n","import { diff } from './vdom/diff'\nimport JSONProxy from './proxy'\n\nexport function render(vnode, parent, store) {\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\n if (store) {\n store.instances = []\n extendStoreUpate(store)\n let timeout = null\n let patchs = {}\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\n clearTimeout(timeout)\n if (patch.op === 'remove') {\n // fix arr splice\n const kv = getArrayPatch(patch.path, store)\n patchs[kv.k] = kv.v\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n } else {\n const key = fixPath(patch.path)\n patchs[key] = patch.value\n timeout = setTimeout(() => {\n update(patchs, store)\n patchs = {}\n }, 0)\n }\n })\n parent.store = store\n }\n return diff(null, vnode, {}, false, parent, false)\n}\n\nfunction update(patch, store) {\n store.update(patch)\n}\n\nfunction extendStoreUpate(store) {\n store.update = function(patch) {\n const updateAll = matchGlobalData(this.globalData, patch)\n\n if (Object.keys(patch).length > 0) {\n this.instances.forEach(instance => {\n if (\n updateAll ||\n this.updateAll ||\n (instance.constructor.updatePath &&\n needUpdate(patch, instance.constructor.updatePath))\n ) {\n instance.update()\n }\n })\n this.onChange && this.onChange(patch)\n }\n }\n}\n\nexport function matchGlobalData(globalData, diffResult) {\n if (!globalData) return false\n for (let keyA in diffResult) {\n if (globalData.indexOf(keyA) > -1) {\n return true\n }\n for (let i = 0, len = globalData.length; i < len; i++) {\n if (includePath(keyA, globalData[i])) {\n return true\n }\n }\n }\n return false\n}\n\nexport function needUpdate(diffResult, updatePath) {\n for (let keyA in diffResult) {\n if (updatePath[keyA]) {\n return true\n }\n for (let keyB in updatePath) {\n if (includePath(keyA, keyB)) {\n return true\n }\n }\n }\n return false\n}\n\nfunction includePath(pathA, pathB) {\n if (pathA.indexOf(pathB) === 0) {\n const next = pathA.substr(pathB.length, 1)\n if (next === '[' || next === '.') {\n return true\n }\n }\n return false\n}\n\nexport function fixPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n arr.forEach((item, index) => {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n })\n return mpPath\n}\n\nfunction getArrayPatch(path, store) {\n const arr = path.replace('/', '').split('/')\n let current = store.data[arr[0]]\n for (let i = 1, len = arr.length; i < len - 1; i++) {\n current = current[arr[i]]\n }\n return { k: fixArrPath(path), v: current }\n}\n\nfunction fixArrPath(path) {\n let mpPath = ''\n const arr = path.replace('/', '').split('/')\n const len = arr.length\n arr.forEach((item, index) => {\n if (index < len - 1) {\n if (index) {\n if (isNaN(Number(item))) {\n mpPath += '.' + item\n } else {\n mpPath += '[' + item + ']'\n }\n } else {\n mpPath += item\n }\n }\n })\n return mpPath\n}\n","import WeElement from './we-element'\nimport { cssToDom } from './util'\n\nconst OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n if (ctor.is === 'WeElement') {\n customElements.define(name, ctor)\n if (ctor.data && !ctor.pure) {\n ctor.updatePath = getUpdatePath(ctor.data)\n }\n } else {\n class Element extends WeElement {\n _useId = 0\n\n _useMap = {}\n\n _preCss = null\n\n render(props, data) {\n return ctor.call(this, props, data)\n }\n\n beforeRender() {\n this._useId = 0\n }\n\n useCss(css) {\n if (css === this._preCss) {\n return\n }\n this._preCss = css\n const style = this.shadowRoot.querySelector('style')\n style && this.shadowRoot.removeChild(style)\n this.shadowRoot.appendChild(cssToDom(css))\n }\n\n useData(data) {\n return this.use({ data: data })\n }\n\n use(option) {\n this._useId++\n const updater = newValue => {\n const item = this._useMap[updater.id]\n\n item.data = newValue\n\n this.update()\n item.effect && item.effect()\n }\n\n updater.id = this._useId\n if (!this._isInstalled) {\n this._useMap[this._useId] = option\n return [option.data, updater]\n }\n\n return [this._useMap[this._useId].data, updater]\n }\n\n installed() {\n this._isInstalled = true\n }\n }\n customElements.define(name, Element)\n }\n}\n\nexport function getUpdatePath(data) {\n const result = {}\n dataToPath(data, result)\n return result\n}\n\nfunction dataToPath(data, result) {\n Object.keys(data).forEach(key => {\n result[key] = true\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], key, result)\n }\n })\n}\n\nfunction _objToPath(data, path, result) {\n Object.keys(data).forEach(key => {\n result[path + '.' + key] = true\n delete result[path]\n const type = Object.prototype.toString.call(data[key])\n if (type === OBJECTTYPE) {\n _objToPath(data[key], path + '.' + key, result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(data[key], path + '.' + key, result)\n }\n })\n}\n\nfunction _arrayToPath(data, path, result) {\n data.forEach((item, index) => {\n result[path + '[' + index + ']'] = true\n delete result[path]\n const type = Object.prototype.toString.call(item)\n if (type === OBJECTTYPE) {\n _objToPath(item, path + '[' + index + ']', result)\n } else if (type === ARRAYTYPE) {\n _arrayToPath(item, path + '[' + index + ']', result)\n }\n })\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n return function(target) {\n target.pure = pure\n define(name, target)\n }\n}\n","import { extend } from './util'\nimport { h } from './h'\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\n * @param {Object} props\tAttributes/props to add when cloning\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\n */\nexport function cloneElement(vnode, props) {\n return h(\n vnode.nodeName,\n extend(extend({}, vnode.attributes), props),\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\n )\n}\n","export function getHost(ele) {\n let p = ele.parentNode\n while (p) {\n if (p.host) {\n return p.host\n } else if (p.shadowRoot && p.shadowRoot.host) {\n return p.shadowRoot.host\n } else {\n p = p.parentNode\n }\n }\n}\n","export function rpx(str) {\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\n return (window.innerWidth * Number(b)) / 750 + 'px'\n })\n}\n","import WeElement from './we-element'\n\nexport default class ModelView extends WeElement {\n static observe = true\n\n beforeInstall() {\n this.data = this.vm.data\n }\n\n observed() {\n this.vm.data = this.data\n }\n}\n","import { h, h as createElement } from './h'\nimport options from './options'\nimport WeElement from './we-element'\nimport { render } from './render'\nimport { define } from './define'\nimport { tag } from './tag'\nimport { observe } from './observe'\nimport { cloneElement } from './clone-element'\nimport { getHost } from './get-host'\nimport { rpx } from './rpx'\nimport { tick, nextTick } from './tick'\nimport ModelView from './model-view'\n\nconst Component = WeElement\nconst defineElement = define\n\nconst omi = {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView,\n defineElement\n}\n\noptions.root.Omi = omi\noptions.root.Omi.version = '5.0.11'\n\nexport default omi\n\nexport {\n tag,\n WeElement,\n Component,\n render,\n h,\n createElement,\n options,\n define,\n observe,\n cloneElement,\n getHost,\n rpx,\n tick,\n nextTick,\n ModelView,\n defineElement\n}\n","/**\n * mappingjs v1.0.1 by dntzhang\n * Objects mapping for javascript. Omi MVVM's best partner.\n * @method mapping\n * @param {Object} options {from: .., to: .., rule: .. }\n * @return {Object} To Object\n */\n\nvar ARRAYTYPE = '[object Array]'\nvar OBJECTTYPE = '[object Object]'\n\nvar mapping = function (options) {\n var from = options.from\n var to = options.to\n var rules = options.rule\n\n var res = to || {}\n\n Object.keys(from).forEach(function (key) {\n res[key] = from[key]\n })\n\n rules &&\n Object.keys(rules).forEach(function (key) {\n var rule = rules[key]\n var isPath = key.match(/\\.|\\[/)\n if (typeof rule === 'function') {\n if (isPath) {\n setPathValue(res, key, rule.call(from))\n } else {\n res[key] = rule.call(from)\n }\n } else {\n if (isPath) {\n setPathValue(res, key, rule)\n } else {\n res[key] = rule\n }\n }\n })\n return res\n}\n\nfunction setPathValue(obj, path, value) {\n var arr = path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n\n var current = obj\n for (var i = 0, len = arr.length; i < len; i++) {\n var key = arr[i]\n var temp = current[key]\n if (i === len - 1) {\n current[arr[len - 1]] = value\n } else {\n if (temp === undefined) {\n if (isNaN(Number(arr[i + 1]))) {\n current[key] = {}\n } else {\n current[key] = []\n }\n\n temp = current[key]\n }\n }\n\n current = temp\n }\n}\n\nmapping.auto = function (from, to) {\n return objMapping(from, to)\n}\n\nfunction arrayMapping(from, to) {\n if (from.length < to.length) {\n to.length = from.length\n }\n from.forEach(function (item, index) {\n if (isArray(item)) {\n to[index] = to[index] || []\n arrayMapping(item, to[index])\n } else if (isObject(item)) {\n to[index] = objMapping(item, to[index])\n } else {\n to[index] = item\n }\n })\n}\n\nfunction objMapping(from, to) {\n var res = to || {}\n Object.keys(from).forEach(key => {\n var obj = from[key]\n if (isArray(obj)) {\n res[key] = res[key] || []\n arrayMapping(obj, res[key])\n } else if (isObject(obj)) {\n res[key] = res[key] || {}\n objMapping(obj, res[key])\n } else {\n res[key] = obj\n }\n })\n return res\n}\n\nfunction isArray(obj) {\n return Object.prototype.toString.call(obj) === ARRAYTYPE\n}\n\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) === OBJECTTYPE\n}\n\nif (typeof exports == \"object\") {\n module.exports = mapping\n} else if (typeof define == \"function\" && define.amd) {\n define([], function () { return mapping })\n} else {\n window.mapping = mapping\n}\n","let id = 0\n\nexport default class TodoItem {\n constructor(text, completed) {\n this.id = id++\n this.text = text\n this.completed = completed || false\n }\n}\n","//mock\nconst list = [\n {\n text: 'Task One'\n },\n {\n text: 'Task Two'\n }\n]\n\nexport function getAll(callback) {\n callback(JSON.parse(JSON.stringify(list)))\n}\n\nexport function add(item) {\n list.push({\n text: item.text\n })\n}\n","import TodoItem from './todo-item'\nimport { getAll, add } from './todo-server'\n\nexport default class Todo {\n constructor() {\n this.items = []\n\n this.author = {\n firstName: 'dnt',\n lastName: 'zhang'\n }\n }\n\n initItems(list) {\n list.forEach(item => {\n this.items.push(new TodoItem(item.text))\n })\n }\n\n add(content) {\n const item = new TodoItem(content)\n this.items.push(item)\n add(item)\n }\n\n updateContent(id, content) {\n this.items.every(item => {\n if (id === item.id) {\n item.content = content\n return false\n }\n return true\n })\n }\n\n complete(id) {\n this.items.every(item => {\n if (id === item.id) {\n item.completed = true\n return false\n }\n return true\n })\n }\n\n uncomplete(id) {\n this.items.every(item => {\n if (id === item.id) {\n item.completed = false\n return false\n }\n return true\n })\n }\n\n remove(id) {\n this.items.every((item, index) => {\n if (id === item.id) {\n this.items.splice(index, 1)\n return false\n }\n return true\n })\n }\n\n clear() {\n this.items.length = 0\n }\n\n getAll(callback) {\n getAll(list => {\n this.initItems(list)\n callback()\n })\n }\n}\n","import Todo from './todo'\n\nconst todo = new Todo()\n\nexport default todo\n","import mapping from 'mappingjs'\nimport todo from '../model/todo'\n\nclass TodoViewModel {\n constructor() {\n this.data = {\n items: []\n }\n }\n\n update() {\n //will automatically update the view!!!\n mapping.auto(todo, this.data)\n }\n\n complete(id) {\n todo.complete(id)\n this.update()\n }\n\n uncomplete(id) {\n todo.uncomplete(id)\n this.update()\n }\n\n add(text) {\n todo.add(text)\n this.update()\n }\n\n remove(id) {\n todo.remove(id)\n this.update()\n }\n\n getAll() {\n todo.getAll(() => {\n this.update()\n })\n }\n}\n\nconst vm = new TodoViewModel()\n\nexport default vm\n","import { define, WeElement } from '../../../src/omi'\nimport vm from '../view-model/todo'\n\ndefine('todo-list', class extends WeElement {\n css() {\n return `\n .completed{\n color: #d9d9d9;\n text-decoration: line-through;\n }\n `\n }\n\n onChange = (evt, id) => {\n if (evt.target.checked) {\n vm.complete(id)\n } else {\n vm.uncomplete(id)\n }\n }\n\n onClick = id => {\n vm.remove(id)\n }\n\n render(props) {\n return (\n \n )\n }\n})\n","import { ModelView, define } from '../../../src/omi'\nimport vm from '../view-model/todo'\nimport './todo-list'\n\ndefine('todo-app', class extends ModelView {\n vm = vm\n\n install() {\n vm.getAll()\n }\n\n css() {\n return `\n span{\n color: #888;\n font-size: 11px;\n }\n `\n }\n\n render(props, data) {\n return (\n
\n

\n TODO by by {data.author.firstName + data.author.lastName}\n

\n \n
\n \n \n
\n \n
\n )\n }\n\n handleChange = e => {\n this.text = e.target.value\n }\n\n handleSubmit = e => {\n e.preventDefault()\n const text = this.text\n if (text !== '') {\n this.text = ''\n vm.add(text)\n }\n }\n})\n","import { render } from '../../src/omi'\nimport './view/todo-app'\n\nrender(, 'body')\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","store","root","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","update","isWeElement","oldClone","receiveProps","assign","JSON","parse","stringify","console","warn","data","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","el","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","mergeUpdate","clearTimeout","id","WeElement","defaultProps","__elementId","connectedCallback","pure","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","mode","beforeRender","beforeObserve","observed","_host","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","extendStoreUpate","patchs","patch","kv","getArrayPatch","k","v","fixPath","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","_preCss","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","defineElement","omi","Omi","version","TodoItem","text","completed","list","getAll","add","Todo","items","author","firstName","lastName","initItems","content","updateContent","every","complete","uncomplete","remove","clear","todo","TodoViewModel","mapping","auto","evt","checked","onClick","map","handleChange","handleSubmit","preventDefault"],"mappings":";;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;EACV,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP;EAFO,CAAf;;ECpBA,IAAMQ,QAAQ,EAAd;EACA,IAAMC,iBAAiB,EAAvB;;AAEA,EAAO,SAASC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;EACtC,MAAIC,WAAWJ,cAAf;EAAA,MACEK,mBADF;EAAA,MAEEC,cAFF;EAAA,MAGEC,eAHF;EAAA,MAIEC,UAJF;EAKA,OAAKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;EACpCT,UAAMY,IAAN,CAAWF,UAAUD,CAAV,CAAX;EACD;EACD,MAAIL,cAAcA,WAAWC,QAAX,IAAuB,IAAzC,EAA+C;EAC7C,QAAI,CAACL,MAAMW,MAAX,EAAmBX,MAAMY,IAAN,CAAWR,WAAWC,QAAtB;EACnB,WAAOD,WAAWC,QAAlB;EACD;EACD,SAAOL,MAAMW,MAAb,EAAqB;EACnB,QAAI,CAACJ,QAAQP,MAAMa,GAAN,EAAT,KAAyBN,MAAMM,GAAN,KAAcC,SAA3C,EAAsD;EACpD,WAAKL,IAAIF,MAAMI,MAAf,EAAuBF,GAAvB;EAA8BT,cAAMY,IAAN,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ArB;;;;"} \ No newline at end of file +{"version":3,"file":"b.js","sources":["../../src/vnode.js","../../src/options.js","../../src/h.js","../../src/util.js","../../src/constants.js","../../src/vdom/index.js","../../src/dom/index.js","../../src/vdom/diff.js","../../src/proxy.js","../../src/tick.js","../../src/observe.js","../../src/we-element.js","../../src/render.js","../../src/define.js","../../src/tag.js","../../src/clone-element.js","../../src/get-host.js","../../src/rpx.js","../../src/model-view.js","../../src/omi.js","../../node_modules/mappingjs/index.js","model/todo/todo-item.js","model/todo/todo-server.js","model/todo/todo.js","model/todo/index.js","view-model/todo.js","view/todo-list.js","view/todo-app.js","main.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n if (\r\n typeof global !== 'object' ||\r\n !global ||\r\n global.Math !== Math ||\r\n global.Array !== Array\r\n ) {\r\n return (\r\n self ||\r\n window ||\r\n global ||\r\n (function() {\r\n return this\r\n })()\r\n )\r\n }\r\n return global\r\n}\r\n\r\n/** Global options\r\n *\t@public\r\n *\t@namespace options {Object}\r\n */\r\nexport default {\r\n store: null,\r\n root: getGlobal()\r\n}\r\n","import { VNode } from './vnode'\r\nimport options from './options'\r\n\r\nconst stack = []\r\nconst EMPTY_CHILDREN = []\r\n\r\nexport function h(nodeName, attributes) {\r\n let children = EMPTY_CHILDREN,\r\n lastSimple,\r\n child,\r\n simple,\r\n i\r\n for (i = arguments.length; i-- > 2; ) {\r\n stack.push(arguments[i])\r\n }\r\n if (attributes && attributes.children != null) {\r\n if (!stack.length) stack.push(attributes.children)\r\n delete attributes.children\r\n }\r\n while (stack.length) {\r\n if ((child = stack.pop()) && child.pop !== undefined) {\r\n for (i = child.length; i--; ) stack.push(child[i])\r\n } else {\r\n if (typeof child === 'boolean') child = null\r\n\r\n if ((simple = typeof nodeName !== 'function')) {\r\n if (child == null) child = ''\r\n else if (typeof child === 'number') child = String(child)\r\n else if (typeof child !== 'string') simple = false\r\n }\r\n\r\n if (simple && lastSimple) {\r\n children[children.length - 1] += child\r\n } else if (children === EMPTY_CHILDREN) {\r\n children = [child]\r\n } else {\r\n children.push(child)\r\n }\r\n\r\n lastSimple = simple\r\n }\r\n }\r\n\r\n let p = new VNode()\r\n p.nodeName = nodeName\r\n p.children = children\r\n p.attributes = attributes == null ? undefined : attributes\r\n p.key = attributes == null ? undefined : attributes.key\r\n\r\n // if a \"vnode hook\" is defined, pass every created VNode to it\r\n if (options.vnode !== undefined) options.vnode(p)\r\n\r\n return p\r\n}\r\n","/**\r\n * @license\r\n * Copyright (c) 2016 The Polymer Project Authors. All rights reserved.\r\n * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt\r\n * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt\r\n * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt\r\n * Code distributed by Google as part of the polymer project is also\r\n * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt\r\n */\r\n\r\n/**\r\n * This shim allows elements written in, or compiled to, ES5 to work on native\r\n * implementations of Custom Elements v1. It sets new.target to the value of\r\n * this.constructor so that the native HTMLElement constructor can access the\r\n * current under-construction element's definition.\r\n */\r\n;(function() {\r\n if (\r\n // No Reflect, no classes, no need for shim because native custom elements\r\n // require ES2015 classes or Reflect.\r\n window.Reflect === undefined ||\r\n window.customElements === undefined ||\r\n // The webcomponentsjs custom elements polyfill doesn't require\r\n // ES2015-compatible construction (`super()` or `Reflect.construct`).\r\n window.customElements.hasOwnProperty('polyfillWrapFlushCallback')\r\n ) {\r\n return\r\n }\r\n const BuiltInHTMLElement = HTMLElement\r\n window.HTMLElement = function HTMLElement() {\r\n return Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n }\r\n HTMLElement.prototype = BuiltInHTMLElement.prototype\r\n HTMLElement.prototype.constructor = HTMLElement\r\n Object.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\nexport function cssToDom(css) {\r\n const node = document.createElement('style')\r\n node.textContent = css\r\n return node\r\n}\r\n\r\nexport function npn(str) {\r\n return str.replace(/-(\\w)/g, ($, $1) => {\r\n return $1.toUpperCase()\r\n })\r\n}\r\n\r\nexport function extend(obj, props) {\r\n for (let i in props) obj[i] = props[i]\r\n return obj\r\n}\r\n\r\n/** Invoke or update a ref, depending on whether it is a function or object ref.\r\n * @param {object|function} [ref=null]\r\n * @param {any} [value]\r\n */\r\nexport function applyRef(ref, value) {\r\n if (ref != null) {\r\n if (typeof ref == 'function') ref(value)\r\n else ref.current = value\r\n }\r\n}\r\n\r\n/**\r\n * Call a function asynchronously, as soon as possible. Makes\r\n * use of HTML Promise to schedule the callback if available,\r\n * otherwise falling back to `setTimeout` (mainly for IE<11).\r\n * @type {(callback: function) => void}\r\n */\r\nexport const defer =\r\n typeof Promise == 'function'\r\n ? Promise.resolve().then.bind(Promise.resolve())\r\n : setTimeout\r\n\r\nexport function isArray(obj) {\r\n return Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props) {\r\n if (!props || isArray(props)) return {}\r\n const result = {}\r\n Object.keys(props).forEach(key => {\r\n result[key] = props[key].value\r\n })\r\n return result\r\n}\r\n","// render modes\r\n\r\nexport const NO_RENDER = 0\r\nexport const SYNC_RENDER = 1\r\nexport const FORCE_RENDER = 2\r\nexport const ASYNC_RENDER = 3\r\n\r\nexport const ATTR_KEY = '__omiattr_'\r\n\r\n// DOM properties that should NOT have \"px\" added when numeric\r\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i\r\n","import { extend } from '../util'\r\n\r\n/**\r\n * Check if two nodes are equivalent.\r\n *\r\n * @param {Node} node\t\t\tDOM Node to compare\r\n * @param {VNode} vnode\t\t\tVirtual DOM node to compare\r\n * @param {boolean} [hydrating=false]\tIf true, ignores component constructors when comparing.\r\n * @private\r\n */\r\nexport function isSameNodeType(node, vnode, hydrating) {\r\n if (typeof vnode === 'string' || typeof vnode === 'number') {\r\n return node.splitText !== undefined\r\n }\r\n if (typeof vnode.nodeName === 'string') {\r\n return !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n }\r\n return hydrating || node._componentConstructor === vnode.nodeName\r\n}\r\n\r\n/**\r\n * Check if an Element has a given nodeName, case-insensitively.\r\n *\r\n * @param {Element} node\tA DOM Element to inspect the name of.\r\n * @param {String} nodeName\tUnnormalized name to compare against.\r\n */\r\nexport function isNamedNode(node, nodeName) {\r\n return (\r\n node.normalizedNodeName === nodeName ||\r\n node.nodeName.toLowerCase() === nodeName.toLowerCase()\r\n )\r\n}\r\n\r\n/**\r\n * Reconstruct Component-style `props` from a VNode.\r\n * Ensures default/fallback values from `defaultProps`:\r\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\r\n *\r\n * @param {VNode} vnode\r\n * @returns {Object} props\r\n */\r\nexport function getNodeProps(vnode) {\r\n let props = extend({}, vnode.attributes)\r\n props.children = vnode.children\r\n\r\n let defaultProps = vnode.nodeName.defaultProps\r\n if (defaultProps !== undefined) {\r\n for (let i in defaultProps) {\r\n if (props[i] === undefined) {\r\n props[i] = defaultProps[i]\r\n }\r\n }\r\n }\r\n\r\n return props\r\n}\r\n","import { IS_NON_DIMENSIONAL } from '../constants'\r\nimport { applyRef } from '../util'\r\nimport options from '../options'\r\n\r\n/**\r\n * Create an element with the given nodeName.\r\n * @param {string} nodeName The DOM node to create\r\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\r\n * namespace.\r\n * @returns {Element} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n /** @type {Element} */\r\n let node = isSvg\r\n ? document.createElementNS('http://www.w3.org/2000/svg', nodeName)\r\n : document.createElement(nodeName)\r\n node.normalizedNodeName = nodeName\r\n return node\r\n}\r\n\r\n/**\r\n * Remove a child node from its parent if attached.\r\n * @param {Node} node The node to remove\r\n */\r\nexport function removeNode(node) {\r\n let parentNode = node.parentNode\r\n if (parentNode) parentNode.removeChild(node)\r\n}\r\n\r\n/**\r\n * Set a named attribute on the given Node, with special behavior for some names\r\n * and event handlers. If `value` is `null`, the attribute/handler will be\r\n * removed.\r\n * @param {Element} node An element to mutate\r\n * @param {string} name The name/key to set, such as an event or attribute name\r\n * @param {*} old The last value that was set for this name/node pair\r\n * @param {*} value An attribute value, such as a function to be used as an\r\n * event handler\r\n * @param {boolean} isSvg Are we currently diffing inside an svg?\r\n * @private\r\n */\r\nexport function setAccessor(node, name, old, value, isSvg) {\r\n if (name === 'className') name = 'class'\r\n\r\n if (name === 'key') {\r\n // ignore\r\n } else if (name === 'ref') {\r\n applyRef(old, null)\r\n applyRef(value, node)\r\n } else if (name === 'class' && !isSvg) {\r\n node.className = value || ''\r\n } else if (name === 'style') {\r\n if (!value || typeof value === 'string' || typeof old === 'string') {\r\n node.style.cssText = value || ''\r\n }\r\n if (value && typeof value === 'object') {\r\n if (typeof old !== 'string') {\r\n for (let i in old) if (!(i in value)) node.style[i] = ''\r\n }\r\n for (let i in value) {\r\n node.style[i] =\r\n typeof value[i] === 'number' && IS_NON_DIMENSIONAL.test(i) === false\r\n ? value[i] + 'px'\r\n : value[i]\r\n }\r\n }\r\n } else if (name === 'dangerouslySetInnerHTML') {\r\n if (value) node.innerHTML = value.__html || ''\r\n } else if (name[0] == 'o' && name[1] == 'n') {\r\n let useCapture = name !== (name = name.replace(/Capture$/, ''))\r\n name = name.toLowerCase().substring(2)\r\n if (value) {\r\n if (!old) {\r\n node.addEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.addEventListener('touchstart', touchStart, useCapture)\r\n node.addEventListener('touchend', touchEnd, useCapture)\r\n }\r\n }\r\n } else {\r\n node.removeEventListener(name, eventProxy, useCapture)\r\n if (name == 'tap') {\r\n node.removeEventListener('touchstart', touchStart, useCapture)\r\n node.removeEventListener('touchend', touchEnd, useCapture)\r\n }\r\n }\r\n ;(node._listeners || (node._listeners = {}))[name] = value\r\n } else if (name !== 'list' && name !== 'type' && !isSvg && name in node) {\r\n // Attempt to set a DOM property to the given value.\r\n // IE & FF throw for certain property-value combinations.\r\n try {\r\n node[name] = value == null ? '' : value\r\n } catch (e) {}\r\n if ((value == null || value === false) && name != 'spellcheck')\r\n node.removeAttribute(name)\r\n } else {\r\n let ns = isSvg && name !== (name = name.replace(/^xlink:?/, ''))\r\n // spellcheck is treated differently than all other boolean values and\r\n // should not be removed when the value is `false`. See:\r\n // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n if (value == null || value === false) {\r\n if (ns)\r\n node.removeAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase()\r\n )\r\n else node.removeAttribute(name)\r\n } else if (typeof value === 'string') {\r\n if (ns) {\r\n node.setAttributeNS(\r\n 'http://www.w3.org/1999/xlink',\r\n name.toLowerCase(),\r\n value\r\n )\r\n } else {\r\n node.setAttribute(name, value)\r\n }\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Proxy an event to hooked event handlers\r\n * @param {Event} e The event object from the browser\r\n * @private\r\n */\r\nfunction eventProxy(e) {\r\n return this._listeners[e.type]((options.event && options.event(e)) || e)\r\n}\r\n\r\nfunction touchStart(e) {\r\n this.___touchX = e.touches[0].pageX\r\n this.___touchY = e.touches[0].pageY\r\n this.___scrollTop = document.body.scrollTop\r\n}\r\n\r\nfunction touchEnd(e) {\r\n if (\r\n Math.abs(e.changedTouches[0].pageX - this.___touchX) < 30 &&\r\n Math.abs(e.changedTouches[0].pageY - this.___touchY) < 30 &&\r\n Math.abs(document.body.scrollTop - this.___scrollTop) < 30\r\n ) {\r\n this.dispatchEvent(new CustomEvent('tap', { detail: e }))\r\n }\r\n}\r\n","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn, isArray } from '../util'\nimport { removeNode } from '../dom/index'\n\n/** Queue of components that have been mounted and are awaiting componentDidMount */\nexport const mounts = []\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false\n\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\n *\t@returns {Element} dom\t\t\tThe created/mutated element\n *\t@private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n // diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n let ret\n if (!diffLevel++) {\n // when first starting the diff, check if we're diffing an SVG or within an SVG\n isSvgMode = parent != null && parent.ownerSVGElement !== undefined\n\n // hydration is indicated by the existing element to be diffed not having a prop cache\n hydrating = dom != null && !(ATTR_KEY in dom)\n }\n if (isArray(vnode)) {\n ret = []\n let parentNode = null\n if (isArray(dom)) {\n let domLength = dom.length\n let vnodeLength = vnode.length\n let maxLength = domLength >= vnodeLength ? domLength : vnodeLength\n parentNode = dom[0].parentNode\n for (let i = 0; i < maxLength; i++) {\n let ele = idiff(dom[i], vnode[i], context, mountAll, componentRoot)\n ret.push(ele)\n if (i > domLength - 1) {\n parentNode.appendChild(ele)\n }\n }\n } else {\n vnode.forEach(function(item) {\n let ele = idiff(dom, item, context, mountAll, componentRoot)\n ret.push(ele)\n parent && parent.appendChild(ele)\n })\n }\n } else {\n if (isArray(dom)) {\n ret = idiff(dom[0], vnode, context, mountAll, componentRoot)\n } else {\n ret = idiff(dom, vnode, context, mountAll, componentRoot)\n }\n // append the element if its a new parent\n if (parent && ret.parentNode !== parent) parent.appendChild(ret)\n }\n\n // diffLevel being reduced to 0 means we're exiting the diff\n if (!--diffLevel) {\n hydrating = false\n // invoke queued componentDidMount lifecycle methods\n }\n\n return ret\n}\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n if (dom && vnode && dom.props) {\n dom.props.children = vnode.children\n }\n let out = dom,\n prevSvgMode = isSvgMode\n\n // empty values (null, undefined, booleans) render as empty Text nodes\n if (vnode == null || typeof vnode === 'boolean') vnode = ''\n\n // Fast case: Strings & Numbers create/update Text nodes.\n if (typeof vnode === 'string' || typeof vnode === 'number') {\n // update if it's already a Text node:\n if (\n dom &&\n dom.splitText !== undefined &&\n dom.parentNode &&\n (!dom._component || componentRoot)\n ) {\n /* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n if (dom.nodeValue != vnode) {\n dom.nodeValue = vnode\n }\n } else {\n // it wasn't a Text node: replace it with one and recycle the old Element\n out = document.createTextNode(vnode)\n if (dom) {\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n recollectNodeTree(dom, true)\n }\n }\n\n out[ATTR_KEY] = true\n\n return out\n }\n\n // If the VNode represents a Component, perform a component diff:\n let vnodeName = vnode.nodeName\n\n // Tracks entering and exiting SVG namespace when descending through the tree.\n isSvgMode =\n vnodeName === 'svg'\n ? true\n : vnodeName === 'foreignObject'\n ? false\n : isSvgMode\n\n // If there's no existing element or it's the wrong type, create a new one:\n vnodeName = String(vnodeName)\n if (!dom || !isNamedNode(dom, vnodeName)) {\n out = createNode(vnodeName, isSvgMode)\n\n if (dom) {\n // move children into the replacement node\n while (dom.firstChild) out.appendChild(dom.firstChild)\n\n // if the previous Element was mounted into the DOM, replace it inline\n if (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n // recycle the old element (skips non-Element node types)\n recollectNodeTree(dom, true)\n }\n }\n\n let fc = out.firstChild,\n props = out[ATTR_KEY],\n vchildren = vnode.children\n\n if (props == null) {\n props = out[ATTR_KEY] = {}\n for (let a = out.attributes, i = a.length; i--; )\n props[a[i].name] = a[i].value\n }\n\n // Optimization: fast-path for elements containing a single TextNode:\n if (\n !hydrating &&\n vchildren &&\n vchildren.length === 1 &&\n typeof vchildren[0] === 'string' &&\n fc != null &&\n fc.splitText !== undefined &&\n fc.nextSibling == null\n ) {\n if (fc.nodeValue != vchildren[0]) {\n fc.nodeValue = vchildren[0]\n }\n }\n // otherwise, if there are existing or new children, diff them:\n else if ((vchildren && vchildren.length) || fc != null) {\n if (!(out.constructor.is == 'WeElement' && out.constructor.noSlot)) {\n innerDiffNode(\n out,\n vchildren,\n context,\n mountAll,\n hydrating || props.dangerouslySetInnerHTML != null\n )\n }\n }\n\n // Apply attributes/props from VNode to the DOM Element:\n diffAttributes(out, vnode.attributes, props, vnode.children)\n if (out.props) {\n out.props.children = vnode.children\n }\n // restore previous SVG mode: (in case we're exiting an SVG namespace)\n isSvgMode = prevSvgMode\n\n return out\n}\n\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\n *\t@param {Boolean} mountAll\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n let originalChildren = dom.childNodes,\n children = [],\n keyed = {},\n keyedLen = 0,\n min = 0,\n len = originalChildren.length,\n childrenLen = 0,\n vlen = vchildren ? vchildren.length : 0,\n j,\n c,\n f,\n vchild,\n child\n\n // Build up a map of keyed children and an Array of unkeyed children:\n if (len !== 0) {\n for (let i = 0; i < len; i++) {\n let child = originalChildren[i],\n props = child[ATTR_KEY],\n key =\n vlen && props\n ? child._component\n ? child._component.__key\n : props.key\n : null\n if (key != null) {\n keyedLen++\n keyed[key] = child\n } else if (\n props ||\n (child.splitText !== undefined\n ? isHydrating\n ? child.nodeValue.trim()\n : true\n : isHydrating)\n ) {\n children[childrenLen++] = child\n }\n }\n }\n\n if (vlen !== 0) {\n for (let i = 0; i < vlen; i++) {\n vchild = vchildren[i]\n child = null\n\n // attempt to find a node based on key matching\n let key = vchild.key\n if (key != null) {\n if (keyedLen && keyed[key] !== undefined) {\n child = keyed[key]\n keyed[key] = undefined\n keyedLen--\n }\n }\n // attempt to pluck a node of the same type from the existing children\n else if (!child && min < childrenLen) {\n for (j = min; j < childrenLen; j++) {\n if (\n children[j] !== undefined &&\n isSameNodeType((c = children[j]), vchild, isHydrating)\n ) {\n child = c\n children[j] = undefined\n if (j === childrenLen - 1) childrenLen--\n if (j === min) min++\n break\n }\n }\n }\n\n // morph the matched/found/created DOM child to match vchild (deep)\n child = idiff(child, vchild, context, mountAll)\n\n f = originalChildren[i]\n if (child && child !== dom && child !== f) {\n if (f == null) {\n dom.appendChild(child)\n } else if (child === f.nextSibling) {\n removeNode(f)\n } else {\n dom.insertBefore(child, f)\n }\n }\n }\n }\n\n // remove unused keyed children:\n if (keyedLen) {\n for (let i in keyed)\n if (keyed[i] !== undefined) recollectNodeTree(keyed[i], false)\n }\n\n // remove orphaned unkeyed children:\n while (min <= childrenLen) {\n if ((child = children[childrenLen--]) !== undefined)\n recollectNodeTree(child, false)\n }\n}\n\n/** Recursively recycle (or just unmount) a node and its descendants.\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n // If the node's VNode had a ref function, invoke it with null here.\n // (this is part of the React spec, and smart for unsetting references)\n if (node[ATTR_KEY] != null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null)\n\n if (unmountOnly === false || node[ATTR_KEY] == null) {\n removeNode(node)\n }\n\n removeChildren(node)\n}\n\n/** Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n node = node.lastChild\n while (node) {\n let next = node.previousSibling\n recollectNodeTree(node, true)\n node = next\n }\n}\n\n/** Apply differences in attributes from a VNode to the given DOM Element.\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old, children) {\n let name\n let update = false\n let isWeElement = dom.update\n let oldClone\n if (dom.receiveProps) {\n oldClone = Object.assign({}, old)\n }\n // remove attributes no longer present on the vnode by setting them to undefined\n for (name in old) {\n if (!(attrs && attrs[name] != null) && old[name] != null) {\n setAccessor(dom, name, old[name], (old[name] = undefined), isSvgMode)\n if (isWeElement) {\n delete dom.props[name]\n update = true\n }\n }\n }\n\n // add new & update changed attributes\n for (name in attrs) {\n if (isWeElement && typeof attrs[name] === 'object') {\n if (name === 'style') {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n }\n if (dom.receiveProps) {\n try {\n old[name] = JSON.parse(JSON.stringify(attrs[name]))\n } catch (e) {\n console.warn(\n 'When using receiveProps, you cannot pass prop of cyclic dependencies down.'\n )\n }\n }\n dom.props[npn(name)] = attrs[name]\n update = true\n } else if (\n name !== 'children' &&\n name !== 'innerHTML' &&\n (!(name in old) ||\n attrs[name] !==\n (name === 'value' || name === 'checked' ? dom[name] : old[name]))\n ) {\n setAccessor(dom, name, old[name], (old[name] = attrs[name]), isSvgMode)\n if (isWeElement) {\n dom.props[npn(name)] = attrs[name]\n update = true\n }\n }\n }\n\n if (isWeElement && dom.parentNode) {\n if (update || children.length > 0) {\n dom.receiveProps(dom.props, dom.data, oldClone)\n dom.update()\n }\n }\n}\n","/*!\r\n * https://github.com/Palindrom/JSONPatcherProxy\r\n * (c) 2017 Starcounter\r\n * MIT license\r\n */\r\n\r\n/** Class representing a JS Object observer */\r\nconst JSONPatcherProxy = (function() {\r\n /**\r\n * Deep clones your object and returns a new object.\r\n */\r\n function deepClone(obj) {\r\n switch (typeof obj) {\r\n case 'object':\r\n return JSON.parse(JSON.stringify(obj)) //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\r\n case 'undefined':\r\n return null //this is how JSON.stringify behaves for array items\r\n default:\r\n return obj //no need to clone primitives\r\n }\r\n }\r\n JSONPatcherProxy.deepClone = deepClone\r\n\r\n function escapePathComponent(str) {\r\n if (str.indexOf('/') == -1 && str.indexOf('~') == -1) return str\r\n return str.replace(/~/g, '~0').replace(/\\//g, '~1')\r\n }\r\n JSONPatcherProxy.escapePathComponent = escapePathComponent\r\n\r\n /**\r\n * Walk up the parenthood tree to get the path\r\n * @param {JSONPatcherProxy} instance\r\n * @param {Object} obj the object you need to find its path\r\n */\r\n function findObjectPath(instance, obj) {\r\n const pathComponents = []\r\n let parentAndPath = instance.parenthoodMap.get(obj)\r\n while (parentAndPath && parentAndPath.path) {\r\n // because we're walking up-tree, we need to use the array as a stack\r\n pathComponents.unshift(parentAndPath.path)\r\n parentAndPath = instance.parenthoodMap.get(parentAndPath.parent)\r\n }\r\n if (pathComponents.length) {\r\n const path = pathComponents.join('/')\r\n return '/' + path\r\n }\r\n return ''\r\n }\r\n /**\r\n * A callback to be used as th proxy set trap callback.\r\n * It updates parenthood map if needed, proxifies nested newly-added objects, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the affected object\r\n * @param {String} key the effect property's name\r\n * @param {Any} newValue the value being set\r\n */\r\n function setTrap(instance, target, key, newValue) {\r\n const parentPath = findObjectPath(instance, target)\r\n\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n if (instance.proxifiedObjectsMap.has(newValue)) {\r\n const newValueOriginalObject = instance.proxifiedObjectsMap.get(newValue)\r\n\r\n instance.parenthoodMap.set(newValueOriginalObject.originalObject, {\r\n parent: target,\r\n path: key\r\n })\r\n }\r\n /*\r\n mark already proxified values as inherited.\r\n rationale: proxy.arr.shift()\r\n will emit\r\n {op: replace, path: '/arr/1', value: arr_2}\r\n {op: remove, path: '/arr/2'}\r\n\r\n by default, the second operation would revoke the proxy, and this renders arr revoked.\r\n That's why we need to remember the proxies that are inherited.\r\n */\r\n const revokableInstance = instance.proxifiedObjectsMap.get(newValue)\r\n /*\r\n Why do we need to check instance.isProxifyingTreeNow?\r\n\r\n We need to make sure we mark revokables as inherited ONLY when we're observing,\r\n because throughout the first proxification, a sub-object is proxified and then assigned to\r\n its parent object. This assignment of a pre-proxified object can fool us into thinking\r\n that it's a proxified object moved around, while in fact it's the first assignment ever.\r\n\r\n Checking isProxifyingTreeNow ensures this is not happening in the first proxification,\r\n but in fact is is a proxified object moved around the tree\r\n */\r\n if (revokableInstance && !instance.isProxifyingTreeNow) {\r\n revokableInstance.inherited = true\r\n }\r\n\r\n // if the new value is an object, make sure to watch it\r\n if (\r\n newValue &&\r\n typeof newValue == 'object' &&\r\n !instance.proxifiedObjectsMap.has(newValue)\r\n ) {\r\n instance.parenthoodMap.set(newValue, {\r\n parent: target,\r\n path: key\r\n })\r\n newValue = instance._proxifyObjectTreeRecursively(target, newValue, key)\r\n }\r\n // let's start with this operation, and may or may not update it later\r\n const operation = {\r\n op: 'remove',\r\n path: destinationPropKey\r\n }\r\n if (typeof newValue == 'undefined') {\r\n // applying De Morgan's laws would be a tad faster, but less readable\r\n if (!Array.isArray(target) && !target.hasOwnProperty(key)) {\r\n // `undefined` is being set to an already undefined value, keep silent\r\n return Reflect.set(target, key, newValue)\r\n }\r\n // when array element is set to `undefined`, should generate replace to `null`\r\n if (Array.isArray(target)) {\r\n // undefined array elements are JSON.stringified to `null`\r\n ;(operation.op = 'replace'), (operation.value = null)\r\n }\r\n const oldValue = instance.proxifiedObjectsMap.get(target[key])\r\n // was the deleted a proxified object?\r\n if (oldValue) {\r\n instance.parenthoodMap.delete(target[key])\r\n instance.disableTrapsForProxy(oldValue)\r\n instance.proxifiedObjectsMap.delete(oldValue)\r\n }\r\n } else {\r\n if (Array.isArray(target) && !Number.isInteger(+key.toString())) {\r\n /* array props (as opposed to indices) don't emit any patches, to avoid needless `length` patches */\r\n if (key != 'length') {\r\n console.warn(\r\n 'JSONPatcherProxy noticed a non-integer prop was set for an array. This will not emit a patch'\r\n )\r\n }\r\n return Reflect.set(target, key, newValue)\r\n }\r\n operation.op = 'add'\r\n if (target.hasOwnProperty(key)) {\r\n if (typeof target[key] !== 'undefined' || Array.isArray(target)) {\r\n operation.op = 'replace' // setting `undefined` array elements is a `replace` op\r\n }\r\n }\r\n operation.value = newValue\r\n }\r\n operation.oldValue = target[key]\r\n const reflectionResult = Reflect.set(target, key, newValue)\r\n instance.defaultCallback(operation)\r\n return reflectionResult\r\n }\r\n /**\r\n * A callback to be used as th proxy delete trap callback.\r\n * It updates parenthood map if needed, calls default callbacks with the changes occurred.\r\n * @param {JSONPatcherProxy} instance JSONPatcherProxy instance\r\n * @param {Object} target the effected object\r\n * @param {String} key the effected property's name\r\n */\r\n function deleteTrap(instance, target, key) {\r\n if (typeof target[key] !== 'undefined') {\r\n const parentPath = findObjectPath(instance, target)\r\n const destinationPropKey = parentPath + '/' + escapePathComponent(key)\r\n\r\n const revokableProxyInstance = instance.proxifiedObjectsMap.get(\r\n target[key]\r\n )\r\n\r\n if (revokableProxyInstance) {\r\n if (revokableProxyInstance.inherited) {\r\n /*\r\n this is an inherited proxy (an already proxified object that was moved around),\r\n we shouldn't revoke it, because even though it was removed from path1, it is still used in path2.\r\n And we know that because we mark moved proxies with `inherited` flag when we move them\r\n\r\n it is a good idea to remove this flag if we come across it here, in deleteProperty trap.\r\n We DO want to revoke the proxy if it was removed again.\r\n */\r\n revokableProxyInstance.inherited = false\r\n } else {\r\n instance.parenthoodMap.delete(revokableProxyInstance.originalObject)\r\n instance.disableTrapsForProxy(revokableProxyInstance)\r\n instance.proxifiedObjectsMap.delete(target[key])\r\n }\r\n }\r\n const reflectionResult = Reflect.deleteProperty(target, key)\r\n\r\n instance.defaultCallback({\r\n op: 'remove',\r\n path: destinationPropKey\r\n })\r\n\r\n return reflectionResult\r\n }\r\n }\r\n /* pre-define resume and pause functions to enhance constructors performance */\r\n function resume() {\r\n this.defaultCallback = operation => {\r\n this.isRecording && this.patches.push(operation)\r\n this.userCallback && this.userCallback(operation)\r\n }\r\n this.isObserving = true\r\n }\r\n function pause() {\r\n this.defaultCallback = () => {}\r\n this.isObserving = false\r\n }\r\n /**\r\n * Creates an instance of JSONPatcherProxy around your object of interest `root`.\r\n * @param {Object|Array} root - the object you want to wrap\r\n * @param {Boolean} [showDetachedWarning = true] - whether to log a warning when a detached sub-object is modified @see {@link https://github.com/Palindrom/JSONPatcherProxy#detached-objects}\r\n * @returns {JSONPatcherProxy}\r\n * @constructor\r\n */\r\n function JSONPatcherProxy(root, showDetachedWarning) {\r\n this.isProxifyingTreeNow = false\r\n this.isObserving = false\r\n this.proxifiedObjectsMap = new Map()\r\n this.parenthoodMap = new Map()\r\n // default to true\r\n if (typeof showDetachedWarning !== 'boolean') {\r\n showDetachedWarning = true\r\n }\r\n\r\n this.showDetachedWarning = showDetachedWarning\r\n this.originalObject = root\r\n this.cachedProxy = null\r\n this.isRecording = false\r\n this.userCallback\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Restores callback back to the original one provided to `observe`.\r\n */\r\n this.resume = resume.bind(this)\r\n /**\r\n * @memberof JSONPatcherProxy\r\n * Replaces your callback with a noop function.\r\n */\r\n this.pause = pause.bind(this)\r\n }\r\n\r\n JSONPatcherProxy.prototype.generateProxyAtPath = function(parent, obj, path) {\r\n if (!obj) {\r\n return obj\r\n }\r\n const traps = {\r\n set: (target, key, value, receiver) =>\r\n setTrap(this, target, key, value, receiver),\r\n deleteProperty: (target, key) => deleteTrap(this, target, key)\r\n }\r\n const revocableInstance = Proxy.revocable(obj, traps)\r\n // cache traps object to disable them later.\r\n revocableInstance.trapsInstance = traps\r\n revocableInstance.originalObject = obj\r\n\r\n /* keeping track of object's parent and path */\r\n\r\n this.parenthoodMap.set(obj, { parent, path })\r\n\r\n /* keeping track of all the proxies to be able to revoke them later */\r\n this.proxifiedObjectsMap.set(revocableInstance.proxy, revocableInstance)\r\n return revocableInstance.proxy\r\n }\r\n // grab tree's leaves one by one, encapsulate them into a proxy and return\r\n JSONPatcherProxy.prototype._proxifyObjectTreeRecursively = function(\r\n parent,\r\n root,\r\n path\r\n ) {\r\n for (let key in root) {\r\n if (root.hasOwnProperty(key)) {\r\n if (root[key] instanceof Object) {\r\n root[key] = this._proxifyObjectTreeRecursively(\r\n root,\r\n root[key],\r\n escapePathComponent(key)\r\n )\r\n }\r\n }\r\n }\r\n return this.generateProxyAtPath(parent, root, path)\r\n }\r\n // this function is for aesthetic purposes\r\n JSONPatcherProxy.prototype.proxifyObjectTree = function(root) {\r\n /*\r\n while proxyifying object tree,\r\n the proxyifying operation itself is being\r\n recorded, which in an unwanted behavior,\r\n that's why we disable recording through this\r\n initial process;\r\n */\r\n this.pause()\r\n this.isProxifyingTreeNow = true\r\n const proxifiedObject = this._proxifyObjectTreeRecursively(\r\n undefined,\r\n root,\r\n ''\r\n )\r\n /* OK you can record now */\r\n this.isProxifyingTreeNow = false\r\n this.resume()\r\n return proxifiedObject\r\n }\r\n /**\r\n * Turns a proxified object into a forward-proxy object; doesn't emit any patches anymore, like a normal object\r\n * @param {Proxy} proxy - The target proxy object\r\n */\r\n JSONPatcherProxy.prototype.disableTrapsForProxy = function(\r\n revokableProxyInstance\r\n ) {\r\n if (this.showDetachedWarning) {\r\n const message =\r\n \"You're accessing an object that is detached from the observedObject tree, see https://github.com/Palindrom/JSONPatcherProxy#detached-objects\"\r\n\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.set = (\r\n targetObject,\r\n propKey,\r\n newValue\r\n ) => {\r\n console.warn(message)\r\n return Reflect.set(targetObject, propKey, newValue)\r\n }\r\n revokableProxyInstance.trapsInstance.deleteProperty = (\r\n targetObject,\r\n propKey\r\n ) => {\r\n return Reflect.deleteProperty(targetObject, propKey)\r\n }\r\n } else {\r\n delete revokableProxyInstance.trapsInstance.set\r\n delete revokableProxyInstance.trapsInstance.get\r\n delete revokableProxyInstance.trapsInstance.deleteProperty\r\n }\r\n }\r\n /**\r\n * Proxifies the object that was passed in the constructor and returns a proxified mirror of it. Even though both parameters are options. You need to pass at least one of them.\r\n * @param {Boolean} [record] - whether to record object changes to a later-retrievable patches array.\r\n * @param {Function} [callback] - this will be synchronously called with every object change with a single `patch` as the only parameter.\r\n */\r\n JSONPatcherProxy.prototype.observe = function(record, callback) {\r\n if (!record && !callback) {\r\n throw new Error('You need to either record changes or pass a callback')\r\n }\r\n this.isRecording = record\r\n this.userCallback = callback\r\n /*\r\n I moved it here to remove it from `unobserve`,\r\n this will also make the constructor faster, why initiate\r\n the array before they decide to actually observe with recording?\r\n They might need to use only a callback.\r\n */\r\n if (record) this.patches = []\r\n this.cachedProxy = this.proxifyObjectTree(this.originalObject)\r\n return this.cachedProxy\r\n }\r\n /**\r\n * If the observed is set to record, it will synchronously return all the patches and empties patches array.\r\n */\r\n JSONPatcherProxy.prototype.generate = function() {\r\n if (!this.isRecording) {\r\n throw new Error('You should set record to true to get patches later')\r\n }\r\n return this.patches.splice(0, this.patches.length)\r\n }\r\n /**\r\n * Revokes all proxies rendering the observed object useless and good for garbage collection @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable}\r\n */\r\n JSONPatcherProxy.prototype.revoke = function() {\r\n this.proxifiedObjectsMap.forEach(el => {\r\n el.revoke()\r\n })\r\n }\r\n /**\r\n * Disables all proxies' traps, turning the observed object into a forward-proxy object, like a normal object that you can modify silently.\r\n */\r\n JSONPatcherProxy.prototype.disableTraps = function() {\r\n this.proxifiedObjectsMap.forEach(this.disableTrapsForProxy, this)\r\n }\r\n return JSONPatcherProxy\r\n})()\r\n\r\nexport default JSONPatcherProxy\r\n","const callbacks = []\r\nconst nextTickCallback = []\r\n\r\nexport function tick(fn, scope) {\r\n callbacks.push({ fn, scope })\r\n}\r\n\r\nexport function fireTick() {\r\n callbacks.forEach(item => {\r\n item.fn.call(item.scope)\r\n })\r\n\r\n nextTickCallback.forEach(nextItem => {\r\n nextItem.fn.call(nextItem.scope)\r\n })\r\n nextTickCallback.length = 0\r\n}\r\n\r\nexport function nextTick(fn, scope) {\r\n nextTickCallback.push({ fn, scope })\r\n}\r\n","import JSONProxy from './proxy'\r\nimport { fireTick } from './tick'\r\n\r\nexport function observe(target) {\r\n target.observe = true\r\n}\r\n\r\nexport function proxyUpdate(ele) {\r\n let timeout = null\r\n ele.data = new JSONProxy(ele.data).observe(false, () => {\r\n if (ele._willUpdate) {\r\n return\r\n }\r\n if (ele.constructor.mergeUpdate) {\r\n clearTimeout(timeout)\r\n\r\n timeout = setTimeout(() => {\r\n ele.update()\r\n fireTick()\r\n }, 0)\r\n } else {\r\n ele.update()\r\n fireTick()\r\n }\r\n })\r\n}\r\n","import { cssToDom, nProps, isArray } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport { proxyUpdate } from './observe'\r\n\r\nlet id = 0\r\n\r\nexport default class WeElement extends HTMLElement {\r\n static is = 'WeElement'\r\n\r\n constructor() {\r\n super()\r\n this.props = Object.assign(\r\n nProps(this.constructor.props),\r\n this.constructor.defaultProps\r\n )\r\n this.__elementId = id++\r\n this.data = this.constructor.data || {}\r\n }\r\n\r\n connectedCallback() {\r\n if (!this.constructor.pure) {\r\n let p = this.parentNode\r\n while (p && !this.store) {\r\n this.store = p.store\r\n p = p.parentNode || p.host\r\n }\r\n if (this.store) {\r\n this.store.instances.push(this)\r\n }\r\n }\r\n this.beforeInstall()\r\n !this._isInstalled && this.install()\r\n this.afterInstall()\r\n let shadowRoot\r\n if (!this.shadowRoot) {\r\n shadowRoot = this.attachShadow({\r\n mode: 'open'\r\n })\r\n } else {\r\n shadowRoot = this.shadowRoot\r\n let fc\r\n while ((fc = shadowRoot.firstChild)) {\r\n shadowRoot.removeChild(fc)\r\n }\r\n }\r\n\r\n this.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n !this._isInstalled && this.beforeRender()\r\n options.afterInstall && options.afterInstall(this)\r\n if (this.constructor.observe) {\r\n this.beforeObserve()\r\n proxyUpdate(this)\r\n this.observed()\r\n }\r\n this._host = diff(\r\n null,\r\n this.render(this.props, this.data, this.store),\r\n {},\r\n false,\r\n null,\r\n false\r\n )\r\n this.rendered()\r\n if (isArray(this._host)) {\r\n this._host.forEach(function(item) {\r\n shadowRoot.appendChild(item)\r\n })\r\n } else {\r\n shadowRoot.appendChild(this._host)\r\n }\r\n !this._isInstalled && this.installed()\r\n this._isInstalled = true\r\n }\r\n\r\n disconnectedCallback() {\r\n this.uninstall()\r\n this._isInstalled = false\r\n if (this.store) {\r\n for (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n if (this.store.instances[i] === this) {\r\n this.store.instances.splice(i, 1)\r\n break\r\n }\r\n }\r\n }\r\n }\r\n\r\n update() {\r\n this._willUpdate = true\r\n this.beforeUpdate()\r\n this.beforeRender()\r\n this._host = diff(\r\n this._host,\r\n this.render(this.props, this.data, this.store),\r\n null,\r\n null,\r\n this.shadowRoot\r\n )\r\n this.afterUpdate()\r\n this.updated()\r\n this._willUpdate = false\r\n }\r\n\r\n fire(name, data) {\r\n this.dispatchEvent(new CustomEvent(name, { detail: data }))\r\n }\r\n\r\n beforeInstall() {}\r\n\r\n install() {}\r\n\r\n afterInstall() {}\r\n\r\n installed() {}\r\n\r\n uninstall() {}\r\n\r\n beforeUpdate() {}\r\n\r\n afterUpdate() {} //deprecated, please use updated\r\n\r\n updated() {}\r\n\r\n beforeRender() {}\r\n\r\n rendered() {}\r\n\r\n receiveProps() {}\r\n\r\n beforeObserve() {}\r\n\r\n observed() {}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport JSONProxy from './proxy'\r\n\r\nexport function render(vnode, parent, store) {\r\n parent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n if (store) {\r\n store.instances = []\r\n extendStoreUpate(store)\r\n let timeout = null\r\n let patchs = {}\r\n store.data = new JSONProxy(store.data).observe(false, function(patch) {\r\n clearTimeout(timeout)\r\n if (patch.op === 'remove') {\r\n // fix arr splice\r\n const kv = getArrayPatch(patch.path, store)\r\n patchs[kv.k] = kv.v\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n } else {\r\n const key = fixPath(patch.path)\r\n patchs[key] = patch.value\r\n timeout = setTimeout(() => {\r\n update(patchs, store)\r\n patchs = {}\r\n }, 0)\r\n }\r\n })\r\n parent.store = store\r\n }\r\n return diff(null, vnode, {}, false, parent, false)\r\n}\r\n\r\nfunction update(patch, store) {\r\n store.update(patch)\r\n}\r\n\r\nfunction extendStoreUpate(store) {\r\n store.update = function(patch) {\r\n const updateAll = matchGlobalData(this.globalData, patch)\r\n\r\n if (Object.keys(patch).length > 0) {\r\n this.instances.forEach(instance => {\r\n if (\r\n updateAll ||\r\n this.updateAll ||\r\n (instance.constructor.updatePath &&\r\n needUpdate(patch, instance.constructor.updatePath))\r\n ) {\r\n instance.update()\r\n }\r\n })\r\n this.onChange && this.onChange(patch)\r\n }\r\n }\r\n}\r\n\r\nexport function matchGlobalData(globalData, diffResult) {\r\n if (!globalData) return false\r\n for (let keyA in diffResult) {\r\n if (globalData.indexOf(keyA) > -1) {\r\n return true\r\n }\r\n for (let i = 0, len = globalData.length; i < len; i++) {\r\n if (includePath(keyA, globalData[i])) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function needUpdate(diffResult, updatePath) {\r\n for (let keyA in diffResult) {\r\n if (updatePath[keyA]) {\r\n return true\r\n }\r\n for (let keyB in updatePath) {\r\n if (includePath(keyA, keyB)) {\r\n return true\r\n }\r\n }\r\n }\r\n return false\r\n}\r\n\r\nfunction includePath(pathA, pathB) {\r\n if (pathA.indexOf(pathB) === 0) {\r\n const next = pathA.substr(pathB.length, 1)\r\n if (next === '[' || next === '.') {\r\n return true\r\n }\r\n }\r\n return false\r\n}\r\n\r\nexport function fixPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n arr.forEach((item, index) => {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n })\r\n return mpPath\r\n}\r\n\r\nfunction getArrayPatch(path, store) {\r\n const arr = path.replace('/', '').split('/')\r\n let current = store.data[arr[0]]\r\n for (let i = 1, len = arr.length; i < len - 1; i++) {\r\n current = current[arr[i]]\r\n }\r\n return { k: fixArrPath(path), v: current }\r\n}\r\n\r\nfunction fixArrPath(path) {\r\n let mpPath = ''\r\n const arr = path.replace('/', '').split('/')\r\n const len = arr.length\r\n arr.forEach((item, index) => {\r\n if (index < len - 1) {\r\n if (index) {\r\n if (isNaN(Number(item))) {\r\n mpPath += '.' + item\r\n } else {\r\n mpPath += '[' + item + ']'\r\n }\r\n } else {\r\n mpPath += item\r\n }\r\n }\r\n })\r\n return mpPath\r\n}\r\n","import WeElement from './we-element'\r\nimport { cssToDom } from './util'\r\n\r\nconst OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n if (ctor.is === 'WeElement') {\r\n customElements.define(name, ctor)\r\n if (ctor.data && !ctor.pure) {\r\n ctor.updatePath = getUpdatePath(ctor.data)\r\n }\r\n } else {\r\n class Element extends WeElement {\r\n _useId = 0\r\n\r\n _useMap = {}\r\n\r\n _preCss = null\r\n\r\n render(props, data) {\r\n return ctor.call(this, props, data)\r\n }\r\n\r\n beforeRender() {\r\n this._useId = 0\r\n }\r\n\r\n useCss(css) {\r\n if (css === this._preCss) {\r\n return\r\n }\r\n this._preCss = css\r\n const style = this.shadowRoot.querySelector('style')\r\n style && this.shadowRoot.removeChild(style)\r\n this.shadowRoot.appendChild(cssToDom(css))\r\n }\r\n\r\n useData(data) {\r\n return this.use({ data: data })\r\n }\r\n\r\n use(option) {\r\n this._useId++\r\n const updater = newValue => {\r\n const item = this._useMap[updater.id]\r\n\r\n item.data = newValue\r\n\r\n this.update()\r\n item.effect && item.effect()\r\n }\r\n\r\n updater.id = this._useId\r\n if (!this._isInstalled) {\r\n this._useMap[this._useId] = option\r\n return [option.data, updater]\r\n }\r\n\r\n return [this._useMap[this._useId].data, updater]\r\n }\r\n\r\n installed() {\r\n this._isInstalled = true\r\n }\r\n }\r\n customElements.define(name, Element)\r\n }\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n const result = {}\r\n dataToPath(data, result)\r\n return result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n Object.keys(data).forEach(key => {\r\n result[key] = true\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n Object.keys(data).forEach(key => {\r\n result[path + '.' + key] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(data[key])\r\n if (type === OBJECTTYPE) {\r\n _objToPath(data[key], path + '.' + key, result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(data[key], path + '.' + key, result)\r\n }\r\n })\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n data.forEach((item, index) => {\r\n result[path + '[' + index + ']'] = true\r\n delete result[path]\r\n const type = Object.prototype.toString.call(item)\r\n if (type === OBJECTTYPE) {\r\n _objToPath(item, path + '[' + index + ']', result)\r\n } else if (type === ARRAYTYPE) {\r\n _arrayToPath(item, path + '[' + index + ']', result)\r\n }\r\n })\r\n}\r\n","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n return function(target) {\r\n target.pure = pure\r\n define(name, target)\r\n }\r\n}\r\n","import { extend } from './util'\r\nimport { h } from './h'\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n return h(\r\n vnode.nodeName,\r\n extend(extend({}, vnode.attributes), props),\r\n arguments.length > 2 ? [].slice.call(arguments, 2) : vnode.children\r\n )\r\n}\r\n","export function getHost(ele) {\r\n let p = ele.parentNode\r\n while (p) {\r\n if (p.host) {\r\n return p.host\r\n } else if (p.shadowRoot && p.shadowRoot.host) {\r\n return p.shadowRoot.host\r\n } else {\r\n p = p.parentNode\r\n }\r\n }\r\n}\r\n","export function rpx(str) {\r\n return str.replace(/([1-9]\\d*|0)(\\.\\d*)*rpx/g, (a, b) => {\r\n return (window.innerWidth * Number(b)) / 750 + 'px'\r\n })\r\n}\r\n","import WeElement from './we-element'\r\n\r\nexport default class ModelView extends WeElement {\r\n static observe = true\r\n\r\n beforeInstall() {\r\n this.data = this.vm.data\r\n }\r\n\r\n observed() {\r\n this.vm.data = this.data\r\n }\r\n}\r\n","import { h, h as createElement } from './h'\r\nimport options from './options'\r\nimport WeElement from './we-element'\r\nimport { render } from './render'\r\nimport { define } from './define'\r\nimport { tag } from './tag'\r\nimport { observe } from './observe'\r\nimport { cloneElement } from './clone-element'\r\nimport { getHost } from './get-host'\r\nimport { rpx } from './rpx'\r\nimport { tick, nextTick } from './tick'\r\nimport ModelView from './model-view'\r\n\r\nconst Component = WeElement\r\nconst defineElement = define\r\n\r\nconst omi = {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView,\r\n defineElement\r\n}\r\n\r\noptions.root.Omi = omi\r\noptions.root.Omi.version = '5.0.11'\r\n\r\nexport default omi\r\n\r\nexport {\r\n tag,\r\n WeElement,\r\n Component,\r\n render,\r\n h,\r\n createElement,\r\n options,\r\n define,\r\n observe,\r\n cloneElement,\r\n getHost,\r\n rpx,\r\n tick,\r\n nextTick,\r\n ModelView,\r\n defineElement\r\n}\r\n","/**\n * mappingjs v2.0.0 by dntzhang\n * Objects mapping for javascript. Omi MVVM's best partner.\n * @method mapping\n * @param {from} options\n * @param {to} options\n * @param {rule} options\n * @return {Object} To Object\n */\n\nvar ARRAYTYPE = '[object Array]'\nvar OBJECTTYPE = '[object Object]'\n\nfunction mapping(from, to, rule) {\n var tempRule = Object.assign({}, rule)\n var res = to || {}\n Object.keys(from).forEach(function (key) {\n var obj = from[key]\n if (isArray(obj)) {\n res[key] = res[key] || []\n arrayMapping(obj, res[key], tempRule, key)\n } else if (isObject(obj)) {\n res[key] = res[key] || {}\n objMapping(obj, res[key], tempRule, key)\n } else {\n res[key] = obj\n }\n })\n\n rule && Object.keys(tempRule).forEach(function (key) {\n var arr = key\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n\n if (arr.length === 1) {\n res[key] = tempRule[key].call ? tempRule[key].call(from) : tempRule[key]\n delete tempRule[key]\n }\n })\n\n return res\n}\n\n\nfunction arrayMapping(from, to, rule, path) {\n if (from.length < to.length) {\n to.length = from.length\n }\n from.forEach(function (item, index) {\n if (isArray(item)) {\n to[index] = to[index] || []\n arrayMapping(item, to[index], rule, path + '[' + index + ']')\n } else if (isObject(item)) {\n to[index] = objMapping(item, to[index], rule, path + '[' + index + ']')\n } else {\n to[index] = item\n }\n })\n\n\n rule && Object.keys(rule).forEach(function (key) {\n var arr = key\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n var pathArr = path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n\n var dl = arr.length - pathArr.length\n if (dl === 1 && equalArr(arr, pathArr)) {\n to[arr[arr.length - 1]] = rule[key].call ? rule[key].call(from) : rule[key]\n delete rule[key]\n }\n })\n}\n\nfunction objMapping(from, to, rule, path) {\n var res = to || {}\n Object.keys(from).forEach(function (key) {\n var obj = from[key]\n if (isArray(obj)) {\n res[key] = res[key] || []\n arrayMapping(obj, res[key], rule, path + '.' + key)\n } else if (isObject(obj)) {\n res[key] = res[key] || {}\n objMapping(obj, res[key], rule, path + '.' + key)\n } else {\n res[key] = obj\n }\n })\n\n rule && Object.keys(rule).forEach(function (key) {\n var arr = key\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n var pathArr = path\n .replace(/]/g, '')\n .replace(/\\[/g, '.')\n .split('.')\n\n if (arr.length - pathArr.length === 1 && equalArr(arr, pathArr)) {\n res[arr[arr.length - 1]] = rule[key].call ? rule[key].call(from) : rule[key]\n if (arr.indexOf('*') === -1) {\n delete rule[key]\n }\n }\n\n })\n\n return res\n}\n\nfunction equalArr(arrA, arrB) {\n var i = 0, len = arrB.length\n for (; i < len; i++) {\n if (arrA[i] !== arrB[i] && !(arrA[i] === '*' && !isNaN(Number(arrB[i])))) {\n return false\n }\n }\n return true\n}\n\nfunction isArray(obj) {\n return Object.prototype.toString.call(obj) === ARRAYTYPE\n}\n\nfunction isObject(obj) {\n return Object.prototype.toString.call(obj) === OBJECTTYPE\n}\n\n//Compatible with older versions\nmapping.auto = mapping\n\nif (typeof exports == \"object\") {\n module.exports = mapping\n} else if (typeof define == \"function\" && define.amd) {\n define([], function () { return mapping })\n} else {\n window.mapping = mapping\n}\n","let id = 0\r\n\r\nexport default class TodoItem {\r\n constructor(text, completed) {\r\n this.id = id++\r\n this.text = text\r\n this.completed = completed || false\r\n }\r\n}\r\n","//mock\r\nconst list = [\r\n {\r\n text: 'Task One'\r\n },\r\n {\r\n text: 'Task Two'\r\n }\r\n]\r\n\r\nexport function getAll(callback) {\r\n callback(JSON.parse(JSON.stringify(list)))\r\n}\r\n\r\nexport function add(item) {\r\n list.push({\r\n text: item.text\r\n })\r\n}\r\n","import TodoItem from './todo-item'\r\nimport { getAll, add } from './todo-server'\r\n\r\nexport default class Todo {\r\n constructor() {\r\n this.items = []\r\n\r\n this.author = {\r\n firstName: 'dnt',\r\n lastName: 'zhang'\r\n }\r\n }\r\n\r\n initItems(list) {\r\n list.forEach(item => {\r\n this.items.push(new TodoItem(item.text))\r\n })\r\n }\r\n\r\n add(content) {\r\n const item = new TodoItem(content)\r\n this.items.push(item)\r\n add(item)\r\n }\r\n\r\n updateContent(id, content) {\r\n this.items.every(item => {\r\n if (id === item.id) {\r\n item.content = content\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n complete(id) {\r\n this.items.every(item => {\r\n if (id === item.id) {\r\n item.completed = true\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n uncomplete(id) {\r\n this.items.every(item => {\r\n if (id === item.id) {\r\n item.completed = false\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n remove(id) {\r\n this.items.every((item, index) => {\r\n if (id === item.id) {\r\n this.items.splice(index, 1)\r\n return false\r\n }\r\n return true\r\n })\r\n }\r\n\r\n clear() {\r\n this.items.length = 0\r\n }\r\n\r\n getAll(callback) {\r\n getAll(list => {\r\n this.initItems(list)\r\n callback()\r\n })\r\n }\r\n}\r\n","import Todo from './todo'\r\n\r\nconst todo = new Todo()\r\n\r\nexport default todo\r\n","import mapping from 'mappingjs'\r\nimport todo from '../model/todo'\r\n\r\nclass TodoViewModel {\r\n constructor() {\r\n this.data = {\r\n items: []\r\n }\r\n }\r\n\r\n update() {\r\n //will automatically update the view!!!\r\n mapping(todo, this.data)\r\n }\r\n\r\n complete(id) {\r\n todo.complete(id)\r\n this.update()\r\n }\r\n\r\n uncomplete(id) {\r\n todo.uncomplete(id)\r\n this.update()\r\n }\r\n\r\n add(text) {\r\n todo.add(text)\r\n this.update()\r\n }\r\n\r\n remove(id) {\r\n todo.remove(id)\r\n this.update()\r\n }\r\n\r\n getAll() {\r\n todo.getAll(() => {\r\n this.update()\r\n })\r\n }\r\n}\r\n\r\nconst vm = new TodoViewModel()\r\n\r\nexport default vm\r\n","import { define, WeElement } from '../../../src/omi'\r\nimport vm from '../view-model/todo'\r\n\r\ndefine('todo-list', class extends WeElement {\r\n css() {\r\n return `\r\n .completed{\r\n color: #d9d9d9;\r\n text-decoration: line-through;\r\n }\r\n `\r\n }\r\n\r\n onChange = (evt, id) => {\r\n if (evt.target.checked) {\r\n vm.complete(id)\r\n } else {\r\n vm.uncomplete(id)\r\n }\r\n }\r\n\r\n onClick = id => {\r\n vm.remove(id)\r\n }\r\n\r\n render(props) {\r\n return (\r\n \r\n )\r\n }\r\n})\r\n","import { ModelView, define } from '../../../src/omi'\r\nimport vm from '../view-model/todo'\r\nimport './todo-list'\r\n\r\ndefine('todo-app', class extends ModelView {\r\n vm = vm\r\n\r\n install() {\r\n vm.getAll()\r\n }\r\n\r\n css() {\r\n return `\r\n span{\r\n color: #888;\r\n font-size: 11px;\r\n }\r\n `\r\n }\r\n\r\n render(props, data) {\r\n return (\r\n
\r\n

\r\n TODO by by {data.author.firstName + data.author.lastName}\r\n

\r\n \r\n
\r\n \r\n \r\n
\r\n \r\n
\r\n )\r\n }\r\n\r\n handleChange = e => {\r\n this.text = e.target.value\r\n }\r\n\r\n handleSubmit = e => {\r\n e.preventDefault()\r\n const text = this.text\r\n if (text !== '') {\r\n this.text = ''\r\n vm.add(text)\r\n }\r\n }\r\n})\r\n","import { render } from '../../src/omi'\r\nimport './view/todo-app'\r\n\r\nrender(, 'body')\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","store","root","stack","EMPTY_CHILDREN","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","key","options","vnode","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","HTMLElement","construct","constructor","prototype","Object","setPrototypeOf","cssToDom","css","node","document","createElement","textContent","npn","str","replace","$","$1","toUpperCase","extend","obj","props","applyRef","ref","value","current","defer","Promise","resolve","then","bind","setTimeout","isArray","toString","call","nProps","result","keys","forEach","ATTR_KEY","IS_NON_DIMENSIONAL","isSameNodeType","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","createNode","isSvg","createElementNS","removeNode","parentNode","removeChild","setAccessor","name","old","className","style","cssText","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","touchStart","touchEnd","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","___touchX","touches","pageX","___touchY","pageY","___scrollTop","body","scrollTop","abs","changedTouches","dispatchEvent","CustomEvent","detail","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ret","ownerSVGElement","domLength","vnodeLength","maxLength","ele","idiff","appendChild","item","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","is","noSlot","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","unmountOnly","removeChildren","lastChild","next","previousSibling","attrs","update","isWeElement","oldClone","receiveProps","assign","JSON","parse","stringify","console","warn","data","JSONPatcherProxy","deepClone","escapePathComponent","indexOf","findObjectPath","instance","pathComponents","parentAndPath","parenthoodMap","get","path","unshift","join","setTrap","target","newValue","parentPath","destinationPropKey","proxifiedObjectsMap","has","newValueOriginalObject","set","originalObject","revokableInstance","isProxifyingTreeNow","inherited","_proxifyObjectTreeRecursively","operation","op","oldValue","delete","disableTrapsForProxy","Number","isInteger","reflectionResult","defaultCallback","deleteTrap","revokableProxyInstance","deleteProperty","resume","isRecording","patches","userCallback","isObserving","pause","showDetachedWarning","Map","cachedProxy","generateProxyAtPath","traps","receiver","revocableInstance","Proxy","revocable","trapsInstance","proxy","proxifyObjectTree","proxifiedObject","message","targetObject","propKey","observe","record","callback","Error","generate","splice","revoke","el","disableTraps","callbacks","nextTickCallback","tick","fn","scope","fireTick","nextItem","nextTick","proxyUpdate","timeout","JSONProxy","_willUpdate","mergeUpdate","clearTimeout","id","WeElement","defaultProps","__elementId","connectedCallback","pure","host","instances","beforeInstall","_isInstalled","install","afterInstall","shadowRoot","attachShadow","mode","beforeRender","beforeObserve","observed","_host","render","rendered","installed","disconnectedCallback","uninstall","beforeUpdate","afterUpdate","updated","fire","querySelector","extendStoreUpate","patchs","patch","kv","getArrayPatch","k","v","fixPath","updateAll","matchGlobalData","globalData","updatePath","needUpdate","onChange","diffResult","keyA","includePath","keyB","pathA","pathB","substr","mpPath","arr","split","index","isNaN","fixArrPath","OBJECTTYPE","ARRAYTYPE","define","ctor","getUpdatePath","Element","_useId","_useMap","_preCss","useCss","useData","use","option","updater","effect","dataToPath","_objToPath","_arrayToPath","tag","cloneElement","slice","getHost","rpx","b","innerWidth","ModelView","vm","Component","defineElement","omi","Omi","version","TodoItem","text","completed","list","getAll","add","Todo","items","author","firstName","lastName","initItems","content","updateContent","every","complete","uncomplete","remove","clear","todo","TodoViewModel","mapping","evt","checked","onClick","map","handleChange","handleSubmit","preventDefault"],"mappings":";;;EAAA;AACA,EAAO,SAASA,KAAT,GAAiB;;ECDxB,SAASC,SAAT,GAAqB;EACnB,MACE,OAAOC,MAAP,KAAkB,QAAlB,IACA,CAACA,MADD,IAEAA,OAAOC,IAAP,KAAgBA,IAFhB,IAGAD,OAAOE,KAAP,KAAiBA,KAJnB,EAKE;EACA,WACEC,QACAC,MADA,IAEAJ,MAFA,IAGC,YAAW;EACV,aAAO,IAAP;EACD,KAFD,EAJF;EAQD;EACD,SAAOA,MAAP;EACD;;EAED;;;;AAIA,gBAAe;EACbK,SAAO,IADM;EAEbC,QAAMP;EAFO,CAAf;;ECpBA,IAAMQ,QAAQ,EAAd;EACA,IAAMC,iBAAiB,EAAvB;;AAEA,EAAO,SAASC,CAAT,CAAWC,QAAX,EAAqBC,UAArB,EAAiC;EACtC,MAAIC,WAAWJ,cAAf;EAAA,MACEK,mBADF;EAAA,MAEEC,cAFF;EAAA,MAGEC,eAHF;EAAA,MAIEC,UAJF;EAKA,OAAKA,IAAIC,UAAUC,MAAnB,EAA2BF,MAAM,CAAjC,GAAsC;EACpCT,UAAMY,IAAN,CAAWF,UAAUD,CA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AM3B,OAAO,MAAKA,IAAlB;EACA,UAAIA,SAAS,EAAb,EAAiB;EACf,cAAKA,IAAL,GAAY,EAAZ;EACAP,WAAGW,GAAH,CAAOJ,IAAP;EACD;EACF,KA3CH;EAAA;;EAAA,oBAGE/E,OAHF,sBAGY;EACRwE,OAAGU,MAAH;EACD,GALH;;EAAA,oBAOExU,GAPF,kBAOQ;EACJ;EAMD,GAdH;;EAAA,oBAgBE+P,MAhBF,sBAgBSlP,KAhBT,EAgBgB0I,IAhBhB,EAgBsB;EAClB,WACE;EAAA;EAAA;EACE;EAAA;EAAA;EAAA;EACU;EAAA;EAAA;EAAA;EAAUA,eAAKqL,MAAL,CAAYC,SAAZ,GAAwBtL,KAAKqL,MAAL,CAAYE;EAA9C;EADV,OADF;EAIE,2BAAW,OAAOvL,KAAKoL,KAAvB,GAJF;EAKE;EAAA;EAAA,UAAM,UAAU,KAAKoB,YAArB;EACE,yBAAO,UAAU,KAAKD,YAAtB,EAAoC,OAAO,KAAKzB,IAAhD,GADF;EAEE;EAAA;EAAA;EAAA;EAAc9K,eAAKoL,KAAL,CAAW/V,MAAX,GAAoB;EAAlC;EAFF,OALF;EASE;EATF,KADF;EAaD,GA9BH;;EAAA;EAAA,EAAiCiV,SAAjC;;ECDA9D,OAAO,uBAAP,EAAqB,MAArB;;;;"} \ No newline at end of file diff --git a/packages/omi/examples/mvvm/view-model/todo.js b/packages/omi/examples/mvvm/view-model/todo.js index 438f1f8fc..07a5600e8 100644 --- a/packages/omi/examples/mvvm/view-model/todo.js +++ b/packages/omi/examples/mvvm/view-model/todo.js @@ -10,7 +10,7 @@ class TodoViewModel { update() { //will automatically update the view!!! - mapping.auto(todo, this.data) + mapping(todo, this.data) } complete(id) { diff --git a/packages/omi/examples/mvvm/view/todo-list.js b/packages/omi/examples/mvvm/view/todo-list.js index 6aaef2b22..40d3ad1ec 100644 --- a/packages/omi/examples/mvvm/view/todo-list.js +++ b/packages/omi/examples/mvvm/view/todo-list.js @@ -33,6 +33,7 @@ define('todo-list', class extends WeElement { onChange={evt => { this.onChange(evt, item.id) }} + checked={item.completed} /> {item.text}