From 68a5e2a06aa340462f0c268cba9c0852fb36d465 Mon Sep 17 00:00:00 2001 From: dntzhang Date: Sat, 20 Oct 2018 14:23:08 +0800 Subject: [PATCH] build --- packages/omi-ie11/dist/omi.dev.js | 30 +++++++++++++++++++-------- packages/omi-ie11/dist/omi.dev.js.map | 2 +- packages/omi-ie11/dist/omi.esm.js | 30 +++++++++++++++++++-------- packages/omi-ie11/dist/omi.esm.js.map | 2 +- packages/omi-ie11/dist/omi.js | 25 ++++++++++++++++------ packages/omi-ie11/dist/omi.js.map | 2 +- packages/omi-ie11/dist/omi.min.js | 2 +- packages/omi-ie11/dist/omi.min.js.map | 2 +- packages/omi-ie11/package.json | 2 +- 9 files changed, 67 insertions(+), 30 deletions(-) diff --git a/packages/omi-ie11/dist/omi.dev.js b/packages/omi-ie11/dist/omi.dev.js index ca89c0b12..d581b317a 100644 --- a/packages/omi-ie11/dist/omi.dev.js +++ b/packages/omi-ie11/dist/omi.dev.js @@ -1,5 +1,5 @@ /** - * omi v4.0.1 http://omijs.org + * omi v4.0.2 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -34,8 +34,6 @@ */ var options = { - store: null, - root: getGlobal() //componentChange(component, element) { }, /** If `true`, `prop` changes trigger synchronous component updates. @@ -673,10 +671,17 @@ } WeElement.prototype.connectedCallback = function connectedCallback() { - this.store = options.store; - if (this.store) { - this.store.instances.push(this); + if (!this.constructor.pure) { + var p = this.parentNode; + while (p && !this.store) { + this.store = p.store; + p = p.parentNode || p.host; + } + if (this.store) { + this.store.instances.push(this); + } } + this.install(); var shadowRoot = this.attachShadow({ mode: 'open' }); @@ -825,23 +830,30 @@ return Object.prototype.toString.call(obj); } + var list = []; + var tick = false; + function render(vnode, parent, store) { parent = typeof parent === 'string' ? document.querySelector(parent) : parent; if (store) { store.instances = []; extendStoreUpate(store); - options.store = store; store.originData = JSON.parse(JSON.stringify(store.data)); } + parent.store = store; diff(null, vnode, {}, false, parent, false); + list.push(store); - if (store) { + if (store && !tick) { requestIdleCallback(execTask); + tick = true; } function execTask(deadline) { while (deadline.timeRemaining() > 0) { - store.update(); + list.forEach(function (currentStore) { + currentStore.update(); + }); } setTimeout(function () { requestIdleCallback(execTask); diff --git a/packages/omi-ie11/dist/omi.dev.js.map b/packages/omi-ie11/dist/omi.dev.js.map index b8facba4e..7315e2b8f 100644 --- a/packages/omi-ie11/dist/omi.dev.js.map +++ b/packages/omi-ie11/dist/omi.dev.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.dev.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/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/tag.js","../src/omi.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\r\n\t\tif (typeof self !== 'undefined') {\r\n\t\t\treturn self\r\n\t\t} else if (typeof window !== 'undefined') {\r\n\t\t\treturn window\r\n\t\t} else if (typeof global !== 'undefined') {\r\n\t\t\treturn global\r\n\t\t}\r\n\t\treturn (function(){\r\n\t\t\treturn this\r\n\t\t})()\r\n\t\t\r\n\t}\r\n\treturn 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\r\n\tstore: null,\r\n\t\r\n\troot: getGlobal()\r\n\t//componentChange(component, element) { },\r\n\t/** If `true`, `prop` changes trigger synchronous component updates.\r\n\t *\t@name syncComponentUpdates\r\n\t *\t@type Boolean\r\n\t *\t@default true\r\n\t */\r\n\t//syncComponentUpdates: true,\r\n\r\n\t/** Processes all created VNodes.\r\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n\t */\r\n\t//vnode(vnode) { }\r\n\r\n\t/** Hook invoked after a component is mounted. */\r\n\t//afterMount(component) { },\r\n\r\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\r\n\t//afterUpdate(component) { }\r\n\r\n\t/** Hook invoked immediately before a component is unmounted. */\r\n\t// beforeUnmount(component) { }\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\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\r\n\tfor (i = arguments.length; i-- > 2;) {\r\n\t\tstack.push(arguments[i])\r\n\t}\r\n\tif (attributes && attributes.children != null) {\r\n\t\tif (!stack.length) stack.push(attributes.children)\r\n\t\tdelete attributes.children\r\n\t}\r\n\twhile (stack.length) {\r\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\r\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (typeof child === 'boolean') child = null\r\n\r\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\r\n\t\t\t\tif (child == null) child = ''\r\n\t\t\t\telse if (typeof child === 'number') child = String(child)\r\n\t\t\t\telse if (typeof child !== 'string') simple = false\r\n\t\t\t}\r\n\r\n\t\t\tif (simple && lastSimple) {\r\n\t\t\t\tchildren[children.length - 1] += child\r\n\t\t\t}\r\n\t\t\telse if (children === EMPTY_CHILDREN) {\r\n\t\t\t\tchildren = [child]\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchildren.push(child)\r\n\t\t\t}\r\n\r\n\t\t\tlastSimple = simple\r\n\t\t}\r\n\t}\r\n\r\n\tlet p = new VNode()\r\n\tp.nodeName = nodeName\r\n\tp.children = children\r\n\tp.attributes = attributes == null ? undefined : attributes\r\n\tp.key = attributes == null ? undefined : attributes.key\r\n\r\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\r\n\tif (options.vnode !== undefined) options.vnode(p)\r\n\r\n\treturn p\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\tif (\r\n\t// No Reflect, no classes, no need for shim because native custom elements\r\n\t// require ES2015 classes or Reflect.\r\n\t\twindow.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\t) {\r\n\t\treturn\r\n\t}\r\n\tconst BuiltInHTMLElement = HTMLElement\r\n\twindow.HTMLElement = function HTMLElement() {\r\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n\t}\r\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\r\n\tHTMLElement.prototype.constructor = HTMLElement\r\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\n/*\r\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\r\n */\r\nwindow.requestIdleCallback = window.requestIdleCallback ||\r\n\tfunction (cb) {\r\n\t\treturn setTimeout(function () {\r\n\t\t\tvar start = Date.now();\r\n\t\t\tcb({\r\n\t\t\t\tdidTimeout: false,\r\n\t\t\t\ttimeRemaining: function () {\r\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}, 1);\r\n\t}\r\n\r\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\r\n\tfunction (id) {\r\n\t\tclearTimeout(id);\r\n\t} \r\n\r\nexport function cssToDom(css) {\r\n\tconst node = document.createElement('style')\r\n\tnode.innerText = css\r\n\treturn node\r\n}\r\n\r\n\r\nexport function npn(str) {\r\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\r\n\t\treturn $1.toUpperCase()\r\n\t})\r\n}\r\n\r\nexport function extend(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i]\r\n\treturn 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\tif (ref!=null) {\r\n\t\tif (typeof ref=='function') ref(value)\r\n\t\telse ref.current = value\r\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\r\n\r\nexport function isArray(obj){\r\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props){\r\n\tif (!props || isArray(props)) return {}\r\n\tconst result = {}\r\n\tObject.keys(props).forEach(key =>{\r\n\t\tresult[key] = props[key].value\r\n\t})\r\n\treturn 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\n\r\nexport const ATTR_KEY = '__preactattr_'\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\r\n","import { extend } from '../util'\r\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\t\treturn node.splitText!==undefined\r\n\t}\r\n\tif (typeof vnode.nodeName==='string') {\r\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n\t}\r\n\treturn hydrating || node._componentConstructor===vnode.nodeName\r\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\r\n\tprops.children = vnode.children\r\n\r\n\tlet defaultProps = vnode.nodeName.defaultProps\r\n\tif (defaultProps!==undefined) {\r\n\t\tfor (let i in defaultProps) {\r\n\t\t\tif (props[i]===undefined) {\r\n\t\t\t\tprops[i] = defaultProps[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 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 * A DOM event listener\r\n * @typedef {(e: Event) => void} EventListner\r\n */\r\n\r\n/**\r\n * A mapping of event types to event listeners\r\n * @typedef {Object.} EventListenerMap\r\n */\r\n\r\n/**\r\n * Properties Preact adds to elements it creates\r\n * @typedef PreactElementExtensions\r\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\r\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\r\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\r\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\r\n */\r\n\r\n/**\r\n * A DOM element that has been extended with Preact properties\r\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\r\n */\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 {PreactElement} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\t/** @type {PreactElement} */\r\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\r\n\tnode.normalizedNodeName = nodeName\r\n\treturn node\r\n}\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\tlet parentNode = node.parentNode\r\n\tif (parentNode) parentNode.removeChild(node)\r\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\r\n\r\n\r\n\tif (name==='key') {\r\n\t\t// ignore\r\n\t}\r\n\telse if (name==='ref') {\r\n\t\tapplyRef(old, null)\r\n\t\tapplyRef(value, node)\r\n\t}\r\n\telse if (name==='class' && !isSvg) {\r\n\t\tnode.className = value || ''\r\n\t}\r\n\telse if (name==='style') {\r\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\tnode.style.cssText = value || ''\r\n\t\t}\r\n\t\tif (value && typeof value==='object') {\r\n\t\t\tif (typeof old!=='string') {\r\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\r\n\t\t\t}\r\n\t\t\tfor (let i in value) {\r\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (name==='dangerouslySetInnerHTML') {\r\n\t\tif (value) node.innerHTML = value.__html || ''\r\n\t}\r\n\telse if (name[0]=='o' && name[1]=='n') {\r\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\r\n\t\tname = name.toLowerCase().substring(2)\r\n\t\tif (value) {\r\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\t(node._listeners || (node._listeners = {}))[name] = value\r\n\t}\r\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\r\n\t\t// Attempt to set a DOM property to the given value.\r\n\t\t// IE & FF throw for certain property-value combinations.\r\n\t\ttry {\r\n\t\t\tnode[name] = value==null ? '' : value\r\n\t\t} catch (e) { }\r\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\r\n\t\t// spellcheck is treated differently than all other boolean values and\r\n\t\t// should not be removed when the value is `false`. See:\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n\t\tif (value==null || value===false) {\r\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\r\n\t\t\telse node.removeAttribute(name)\r\n\t\t}\r\n\t\telse if (typeof value === 'string') {\r\n\t\t\tif (ns) {\r\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\r\n\t\t\t} else {\r\n\t\t\t\tnode.setAttribute(name, value)\r\n\t\t\t}\r\n\t\t}\r\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\r\n}","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n\r\n\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n\tif (!diffLevel++) {\r\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\r\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\r\n\r\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\r\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\r\n\t}\r\n\r\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n\r\n\t// append the element if its a new parent\r\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\r\n\r\n\t// diffLevel being reduced to 0 means we're exiting the diff\r\n\tif (!--diffLevel) {\r\n\t\thydrating = false\r\n\t\t// invoke queued componentDidMount lifecycle methods\r\n\t\t\r\n\t}\r\n\r\n\treturn ret\r\n}\r\n\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n\tlet out = dom,\r\n\t\tprevSvgMode = isSvgMode\r\n\r\n\t// empty values (null, undefined, booleans) render as empty Text nodes\r\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\r\n\r\n\r\n\t// Fast case: Strings & Numbers create/update Text nodes.\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\r\n\t\t// update if it's already a Text node:\r\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\r\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n\t\t\tif (dom.nodeValue!=vnode) {\r\n\t\t\t\tdom.nodeValue = vnode\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\r\n\t\t\tout = document.createTextNode(vnode)\r\n\t\t\tif (dom) {\r\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\t\t\t\trecollectNodeTree(dom, true)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tout[ATTR_KEY] = true\r\n\r\n\t\treturn out\r\n\t}\r\n\r\n\r\n\t// If the VNode represents a Component, perform a component diff:\r\n\tlet vnodeName = vnode.nodeName\r\n\t\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\r\n\r\n\r\n\t// If there's no existing element or it's the wrong type, create a new one:\r\n\tvnodeName = String(vnodeName)\r\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\r\n\t\tout = createNode(vnodeName, isSvgMode)\r\n\r\n\t\tif (dom) {\r\n\t\t\t// move children into the replacement node\r\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\r\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n\t\t\t// recycle the old element (skips non-Element node types)\r\n\t\t\trecollectNodeTree(dom, true)\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet fc = out.firstChild,\r\n\t\tprops = out[ATTR_KEY],\r\n\t\tvchildren = vnode.children\r\n\r\n\tif (props==null) {\r\n\t\tprops = out[ATTR_KEY] = {}\r\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\r\n\t}\r\n\r\n\t// Optimization: fast-path for elements containing a single TextNode:\r\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\r\n\t\tif (fc.nodeValue!=vchildren[0]) {\r\n\t\t\tfc.nodeValue = vchildren[0]\r\n\t\t}\r\n\t}\r\n\t// otherwise, if there are existing or new children, diff them:\r\n\telse if (vchildren && vchildren.length || fc!=null) {\r\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\r\n\t}\r\n\r\n\r\n\t// Apply attributes/props from VNode to the DOM Element:\r\n\tdiffAttributes(out, vnode.attributes, props)\r\n\r\n\r\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n\tisSvgMode = prevSvgMode\r\n\r\n\treturn out\r\n}\r\n\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n\tlet originalChildren = dom.childNodes,\r\n\t\tchildren = [],\r\n\t\tkeyed = {},\r\n\t\tkeyedLen = 0,\r\n\t\tmin = 0,\r\n\t\tlen = originalChildren.length,\r\n\t\tchildrenLen = 0,\r\n\t\tvlen = vchildren ? vchildren.length : 0,\r\n\t\tj, c, f, vchild, child\r\n\r\n\t// Build up a map of keyed children and an Array of unkeyed children:\r\n\tif (len!==0) {\r\n\t\tfor (let i=0; i= Object.keys(pre).length){\r\n for (let key in pre) {\r\n const currentValue = current[key]\r\n if (currentValue === undefined) {\r\n current[key] = null\r\n } else {\r\n syncKeys(currentValue, pre[key])\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\r\n if (current.length >= pre.length) {\r\n pre.forEach((item, index) => {\r\n syncKeys(current[index], item)\r\n })\r\n }\r\n }\r\n}\r\n\r\nfunction _diff(current, pre, path, result) {\r\n if (current === pre) return\r\n const rootCurrentType = type(current)\r\n const rootPreType = type(pre)\r\n if (rootCurrentType == OBJECTTYPE) {\r\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\r\n setResult(result, path, current)\r\n } else {\r\n for (let key in current) {\r\n const currentValue = current[key]\r\n const preValue = pre[key]\r\n const currentType = type(currentValue)\r\n const preType = type(preValue)\r\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\r\n if (currentValue != pre[key]) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n }\r\n } else if (currentType == ARRAYTYPE) {\r\n if (preType != ARRAYTYPE) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n if (currentValue.length < preValue.length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n currentValue.forEach((item, index) => {\r\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else if (currentType == OBJECTTYPE) {\r\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n for (let subKey in currentValue) {\r\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE) {\r\n if (rootPreType != ARRAYTYPE) {\r\n setResult(result, path, current)\r\n } else {\r\n if (current.length < pre.length) {\r\n setResult(result, path, current)\r\n } else {\r\n current.forEach((item, index) => {\r\n _diff(item, pre[index], path + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else {\r\n setResult(result, path, current)\r\n }\r\n}\r\n\r\nfunction setResult(result, k, v) {\r\n if (type(v) != FUNCTIONTYPE) {\r\n result[k] = v\r\n }\r\n}\r\n\r\nfunction type(obj) {\r\n return Object.prototype.toString.call(obj)\r\n}","import { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport jsonDiff from './json-diff'\r\n\r\nexport function render(vnode, parent, store) {\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n\tif(store){\r\n\t\tstore.instances = []\r\n\t\textendStoreUpate(store)\r\n\t\toptions.store = store\r\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\r\n\t}\r\n diff(null, vnode, {}, false, parent, false)\r\n \r\n if(store){\r\n requestIdleCallback(execTask)\r\n }\r\n \r\n function execTask(deadline){\r\n while (deadline.timeRemaining() > 0){\r\n store.update()\r\n }\r\n setTimeout(function(){\r\n requestIdleCallback(execTask)\r\n },200)\r\n \r\n }\r\n} \r\n\r\n\r\n\r\nfunction extendStoreUpate(store){\r\n\tstore.update = function(){\r\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\r\n\t\tif (Object.keys(diffResult)[0] == '') {\r\n\t\t\tdiffResult = diffResult['']\r\n\t\t}\r\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\r\n\t\tif (Object.keys(diffResult).length > 0) {\r\n\t\t\tthis.instances.forEach(instance => {\r\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\r\n\t\t\t\t\tinstance.update()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tthis.onChange && this.onChange(diffResult)\r\n\t\t\tfor (let key in diffResult) {\r\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction matchGlobalData(globalData, diffResult) {\r\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\r\nfunction 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\nfunction updateByPath(origin, path, value) {\r\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\r\n let current = origin\r\n for (let i = 0, len = arr.length; i < len; i++) {\r\n if (i === len - 1) {\r\n current[arr[i]] = value\r\n } else {\r\n current = current[arr[i]]\r\n }\r\n }\r\n}","const OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n\tcustomElements.define(name, ctor)\r\n\tif (ctor.data && !ctor.pure) {\r\n\t\tctor.updatePath = getUpdatePath(ctor.data)\r\n\t}\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n\tconst result = {}\r\n\tdataToPath(data, result)\r\n\treturn result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[key] = true\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[path + '.' + key] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], path + '.' + key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n\tdata.forEach((item, index) => {\r\n\t\tresult[path + '[' + index + ']'] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(item)\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\r\n\t\t}\r\n\t})\r\n}","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n\treturn function (target) {\r\n\t\ttarget.pure = pure\r\n\t\tdefine(name, target)\r\n\t}\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\n\r\noptions.root.Omi = {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\noptions.root.Omi.version = '4.0.1'\r\n\r\nexport default {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\nexport {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"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","requestIdleCallback","cb","setTimeout","start","Date","now","didTimeout","timeRemaining","max","cancelIdleCallback","id","clearTimeout","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","defer","Promise","resolve","then","bind","isArray","obj","toString","call","nProps","props","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","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","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","WeElement","data","connectedCallback","instances","install","shadowRoot","attachShadow","mode","host","render","pure","installed","disconnectedCallback","uninstall","splice","beforeUpdate","afterUpdate","fire","dispatchEvent","CustomEvent","detail","ARRAYTYPE","OBJECTTYPE","FUNCTIONTYPE","pre","syncKeys","_diff","rootCurrentType","rootPreType","currentValue","item","index","path","setResult","preValue","currentType","preType","subKey","k","v","querySelector","extendStoreUpate","originData","JSON","parse","stringify","execTask","deadline","diffResult","jsonDiff","updateAll","matchGlobalData","globalData","instance","updatePath","needUpdate","onChange","updateByPath","keyA","indexOf","includePath","keyB","pathA","pathB","substr","origin","arr","split","define","ctor","getUpdatePath","dataToPath","_objToPath","_arrayToPath","tag","target","Omi","version","module","exports"],"mappings":";;;;;;;;;;;CAAA;AACA,CAAO,SAASA,KAAT,GAAiB;;CCDxB,SAASC,SAAT,GAAqB;CACpB,KAAI,OAAOC,MAAP,KAAkB,QAAlB,IAA8B,CAACA,MAA/B,IAAyCA,OAAOC,IAAP,KAAgBA,IAAzD,IAAiED,OAAOE,KAAP,KAAiBA,KAAtF,EAA6F;CAC5F,MAAI,OAAOC,IAAP,KAAgB,WAApB,EAAiC;CAChC,UAAOA,IAAP;CACA,GAFD,MAEO,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;CACzC,UAAOA,MAAP;CACA,GAFM,MAEA,IAAI,OAAOJ,MAAP,KAAkB,WAAtB,EAAmC;CACzC,UAAOA,MAAP;CACA;CACD,SAAQ,YAAU;CACjB,UAAO,IAAP;CACA,GAFM,EAAP;CAIA;CACD,QAAOA,MAAP;CACA;;CAED;;;;AAIA,eAAe;;CAEdK,QAAO,IAFO;;CAIdC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AA3B;;AAEA,WAAe;CACdH,SADc;CAEd1E,qBAFc;CAGdS,eAHc;CAIdzK,KAJc;CAKd4C,iBALc;CAMd5B,iBANc;CAOdoN;CAPc,CAAf;;CCjBI,IAAI,OAAOU,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiBH,GAAjB,CAAhC,KACKlP,KAAKkP,GAAL,GAAWA,GAAX;;"} \ No newline at end of file +{"version":3,"file":"omi.dev.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/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/tag.js","../src/omi.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t} else if (typeof global !== 'undefined') {\n\t\t\treturn global\n\t\t}\n\t\treturn (function(){\n\t\t\treturn this\n\t\t})()\n\t\t\n\t}\n\treturn global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n\t\n\troot: getGlobal()\n\t//componentChange(component, element) { },\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n\t *\t@name syncComponentUpdates\n\t *\t@type Boolean\n\t *\t@default true\n\t */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n\t */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t//afterMount(component) { },\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t//afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i])\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children)\n\t\tdelete attributes.children\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\n\t\t}\n\t\telse {\n\t\t\tif (typeof child === 'boolean') child = null\n\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\n\t\t\t\tif (child == null) child = ''\n\t\t\t\telse if (typeof child === 'number') child = String(child)\n\t\t\t\telse if (typeof child !== 'string') simple = false\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child\n\t\t\t}\n\t\t\telse if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child]\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child)\n\t\t\t}\n\n\t\t\tlastSimple = simple\n\t\t}\n\t}\n\n\tlet p = new VNode()\n\tp.nodeName = nodeName\n\tp.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n\tp.key = attributes == null ? undefined : attributes.key\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p)\n\n\treturn p\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\tif (\n\t// No Reflect, no classes, no need for shim because native custom elements\n\t// require ES2015 classes or Reflect.\n\t\twindow.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\t) {\n\t\treturn\n\t}\n\tconst BuiltInHTMLElement = HTMLElement\n\twindow.HTMLElement = function HTMLElement() {\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n\t}\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\n\tHTMLElement.prototype.constructor = HTMLElement\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/*\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\n */\nwindow.requestIdleCallback = window.requestIdleCallback ||\n\tfunction (cb) {\n\t\treturn setTimeout(function () {\n\t\t\tvar start = Date.now();\n\t\t\tcb({\n\t\t\t\tdidTimeout: false,\n\t\t\t\ttimeRemaining: function () {\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\n\t\t\t\t}\n\t\t\t});\n\t\t}, 1);\n\t}\n\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\n\tfunction (id) {\n\t\tclearTimeout(id);\n\t} \n\nexport function cssToDom(css) {\n\tconst node = document.createElement('style')\n\tnode.innerText = css\n\treturn node\n}\n\n\nexport function npn(str) {\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\n\t\treturn $1.toUpperCase()\n\t})\n}\n\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i]\n\treturn 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\tif (ref!=null) {\n\t\tif (typeof ref=='function') ref(value)\n\t\telse ref.current = value\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\n\nexport function isArray(obj){\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props){\n\tif (!props || isArray(props)) return {}\n\tconst result = {}\n\tObject.keys(props).forEach(key =>{\n\t\tresult[key] = props[key].value\n\t})\n\treturn 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\n\nexport const ATTR_KEY = '__preactattr_'\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\n","import { extend } from '../util'\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\n\tprops.children = vnode.children\n\n\tlet defaultProps = vnode.nodeName.defaultProps\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\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 {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\n\tnode.normalizedNodeName = nodeName\n\treturn node\n}\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\tlet parentNode = node.parentNode\n\tif (parentNode) parentNode.removeChild(node)\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null)\n\t\tapplyRef(value, node)\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || ''\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || ''\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || ''\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\n\t\tname = name.toLowerCase().substring(2)\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\n\t\t\telse node.removeAttribute(name)\n\t\t}\n\t\telse if (typeof value === 'string') {\n\t\t\tif (ns) {\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\n\t\t\t} else {\n\t\t\t\tnode.setAttribute(name, value)\n\t\t\t}\n\t\t}\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\n}","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn } 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\n\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\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\t\n\t}\n\n\treturn ret\n}\n\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode)\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\t\t\t\trecollectNodeTree(dom, true)\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true\n\n\t\treturn out\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName\n\t\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName)\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode)\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true)\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {}\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0]\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props)\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode\n\n\treturn out\n}\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\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i= Object.keys(pre).length){\n for (let key in pre) {\n const currentValue = current[key]\n if (currentValue === undefined) {\n current[key] = null\n } else {\n syncKeys(currentValue, pre[key])\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\n if (current.length >= pre.length) {\n pre.forEach((item, index) => {\n syncKeys(current[index], item)\n })\n }\n }\n}\n\nfunction _diff(current, pre, path, result) {\n if (current === pre) return\n const rootCurrentType = type(current)\n const rootPreType = type(pre)\n if (rootCurrentType == OBJECTTYPE) {\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\n setResult(result, path, current)\n } else {\n for (let key in current) {\n const currentValue = current[key]\n const preValue = pre[key]\n const currentType = type(currentValue)\n const preType = type(preValue)\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\n if (currentValue != pre[key]) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n }\n } else if (currentType == ARRAYTYPE) {\n if (preType != ARRAYTYPE) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n if (currentValue.length < preValue.length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n currentValue.forEach((item, index) => {\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\n })\n }\n }\n } else if (currentType == OBJECTTYPE) {\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n for (let subKey in currentValue) {\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\n }\n }\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE) {\n if (rootPreType != ARRAYTYPE) {\n setResult(result, path, current)\n } else {\n if (current.length < pre.length) {\n setResult(result, path, current)\n } else {\n current.forEach((item, index) => {\n _diff(item, pre[index], path + '[' + index + ']', result)\n })\n }\n }\n } else {\n setResult(result, path, current)\n }\n}\n\nfunction setResult(result, k, v) {\n if (type(v) != FUNCTIONTYPE) {\n result[k] = v\n }\n}\n\nfunction type(obj) {\n return Object.prototype.toString.call(obj)\n}","import { diff } from './vdom/diff'\nimport jsonDiff from './json-diff'\n\nconst list = []\nlet tick = false\n\nexport function render(vnode, parent, store) {\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\n\tif(store){\n\t\tstore.instances = []\n\t\textendStoreUpate(store)\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\n }\n parent.store = store\n diff(null, vnode, {}, false, parent, false)\n list.push(store)\n\n if(store && !tick){\n requestIdleCallback(execTask)\n tick = true\n }\n \n function execTask(deadline){\n while (deadline.timeRemaining() > 0){\n list.forEach(currentStore => {\n currentStore.update()\n })\n }\n setTimeout(function(){\n requestIdleCallback(execTask)\n },200)\n \n }\n} \n\nfunction extendStoreUpate(store){\n\tstore.update = function(){\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\n\t\tif (Object.keys(diffResult)[0] == '') {\n\t\t\tdiffResult = diffResult['']\n\t\t}\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\n\t\tif (Object.keys(diffResult).length > 0) {\n\t\t\tthis.instances.forEach(instance => {\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\n\t\t\t\t\tinstance.update()\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.onChange && this.onChange(diffResult)\n\t\t\tfor (let key in diffResult) {\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction matchGlobalData(globalData, diffResult) {\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\nfunction 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\nfunction updateByPath(origin, path, value) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}","const OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n\tcustomElements.define(name, ctor)\n\tif (ctor.data && !ctor.pure) {\n\t\tctor.updatePath = getUpdatePath(ctor.data)\n\t}\n}\n\nexport function getUpdatePath(data) {\n\tconst result = {}\n\tdataToPath(data, result)\n\treturn result\n}\n\nfunction dataToPath(data, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[key] = true\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], key, result)\n\t\t}\n\t})\n}\n\nfunction _objToPath(data, path, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[path + '.' + key] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], path + '.' + key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\n\t\t}\n\t})\n}\n\nfunction _arrayToPath(data, path, result) {\n\tdata.forEach((item, index) => {\n\t\tresult[path + '[' + index + ']'] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(item)\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\n\t\t}\n\t})\n}","import { define } from './define'\n\nexport function tag(name, pure) {\n\treturn function (target) {\n\t\ttarget.pure = pure\n\t\tdefine(name, target)\n\t}\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'\n\noptions.root.Omi = {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\noptions.root.Omi.version = '4.0.1'\n\nexport default {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\nexport {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n","\n\t\t\t\timport Omi from './omi';\n\t\t\t\tif (typeof module!='undefined') module.exports = Omi;\n\t\t\t\telse self.Omi = Omi;\n\t\t\t"],"names":["VNode","getGlobal","global","Math","Array","self","window","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","requestIdleCallback","cb","setTimeout","start","Date","now","didTimeout","timeRemaining","max","cancelIdleCallback","id","clearTimeout","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","defer","Promise","resolve","then","bind","isArray","obj","toString","call","nProps","props","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","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","firstChild","fc","vchildren","a","nextSibling","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","WeElement","data","connectedCallback","pure","store","host","instances","install","shadowRoot","attachShadow","mode","render","installed","disconnectedCallback","uninstall","splice","beforeUpdate","afterUpdate","fire","dispatchEvent","CustomEvent","detail","ARRAYTYPE","OBJECTTYPE","FUNCTIONTYPE","pre","syncKeys","_diff","rootCurrentType","rootPreType","currentValue","item","index","path","setResult","preValue","currentType","preType","subKey","k","v","list","tick","querySelector","extendStoreUpate","originData","JSON","parse","stringify","execTask","deadline","currentStore","diffResult","jsonDiff","updateAll","matchGlobalData","globalData","instance","updatePath","needUpdate","onChange","updateByPath","keyA","indexOf","includePath","keyB","pathA","pathB","substr","origin","arr","split","define","ctor","getUpdatePath","dataToPath","_objToPath","_arrayToPath","tag","target","Omi","version","module","exports"],"mappings":";;;;;;;;;;;CAAA;AACA,CAAO,SAASA,KAAT,GAAiB;;CCDxB,SAASC,SAAT,GAAqB;CACpB,KAAI,OAAOC,MAAP,KAAkB,QAAlB,IAA8B,CAACA,MAA/B,IAAyCA,OAAOC,IAAP,KAAgBA,IAAzD,IAAiED,OAAOE,KAAP,KAAiBA,KAAtF,EAA6F;CAC5F,MAAI,OAAOC,I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+H,IAA/B,CAAb;CACA,MAAIrF,SAAS6E,YAAb,EAAyB;CACxBqD,cAAW7C,IAAX,EAAiBE,OAAO,GAAP,GAAaD,KAAb,GAAqB,GAAtC,EAA2C7H,MAA3C;CACA,GAFD,MAEO,IAAIuC,SAAS4E,WAAb,EAAwB;CAC9BuD,gBAAa9C,IAAb,EAAmBE,OAAO,GAAP,GAAaD,KAAb,GAAqB,GAAxC,EAA6C7H,MAA7C;CACA;CACD,EATD;CAUA;;UClDe2K,GAAT,CAAaxJ,IAAb,EAAmB6E,IAAnB,EAAyB;CAC/B,QAAO,UAAU4E,MAAV,EAAkB;CACxBA,SAAO5E,IAAP,GAAcA,IAAd;CACAqE,SAAOlJ,IAAP,EAAayJ,MAAb;CACA,EAHD;CAIA;;SCAOlP,IAAR,CAAamP,GAAb,GAAmB;CAClBF,SADkB;CAElB9E,qBAFkB;CAGlBW,eAHkB;CAIlB3K,KAJkB;CAKlB4C,iBALkB;CAMlB5B,iBANkB;CAOlBwN;CAPkB,CAAnB;;CAUAxN,QAAQnB,IAAR,CAAamP,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;AAEA,WAAe;CACdH,SADc;CAEd9E,qBAFc;CAGdW,eAHc;CAId3K,KAJc;CAKd4C,iBALc;CAMd5B,iBANc;CAOdwN;CAPc,CAAf;;CCjBI,IAAI,OAAOU,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiBH,GAAjB,CAAhC,KACKrP,KAAKqP,GAAL,GAAWA,GAAX;;"} \ No newline at end of file diff --git a/packages/omi-ie11/dist/omi.esm.js b/packages/omi-ie11/dist/omi.esm.js index 83f7923da..a11bf4e29 100644 --- a/packages/omi-ie11/dist/omi.esm.js +++ b/packages/omi-ie11/dist/omi.esm.js @@ -1,5 +1,5 @@ /** - * omi v4.0.1 http://omijs.org + * omi v4.0.2 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/Tencent/omi @@ -31,8 +31,6 @@ function getGlobal() { */ var options = { - store: null, - root: getGlobal() //componentChange(component, element) { }, /** If `true`, `prop` changes trigger synchronous component updates. @@ -670,10 +668,17 @@ var WeElement = function (_HTMLElement) { } WeElement.prototype.connectedCallback = function connectedCallback() { - this.store = options.store; - if (this.store) { - this.store.instances.push(this); + if (!this.constructor.pure) { + var p = this.parentNode; + while (p && !this.store) { + this.store = p.store; + p = p.parentNode || p.host; + } + if (this.store) { + this.store.instances.push(this); + } } + this.install(); var shadowRoot = this.attachShadow({ mode: 'open' }); @@ -822,23 +827,30 @@ function type(obj) { return Object.prototype.toString.call(obj); } +var list = []; +var tick = false; + function render(vnode, parent, store) { parent = typeof parent === 'string' ? document.querySelector(parent) : parent; if (store) { store.instances = []; extendStoreUpate(store); - options.store = store; store.originData = JSON.parse(JSON.stringify(store.data)); } + parent.store = store; diff(null, vnode, {}, false, parent, false); + list.push(store); - if (store) { + if (store && !tick) { requestIdleCallback(execTask); + tick = true; } function execTask(deadline) { while (deadline.timeRemaining() > 0) { - store.update(); + list.forEach(function (currentStore) { + currentStore.update(); + }); } setTimeout(function () { requestIdleCallback(execTask); diff --git a/packages/omi-ie11/dist/omi.esm.js.map b/packages/omi-ie11/dist/omi.esm.js.map index 4d14bb22f..9e6e7b7d0 100644 --- a/packages/omi-ie11/dist/omi.esm.js.map +++ b/packages/omi-ie11/dist/omi.esm.js.map @@ -1 +1 @@ -{"version":3,"file":"omi.esm.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/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/tag.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","function getGlobal() {\r\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\r\n\t\tif (typeof self !== 'undefined') {\r\n\t\t\treturn self\r\n\t\t} else if (typeof window !== 'undefined') {\r\n\t\t\treturn window\r\n\t\t} else if (typeof global !== 'undefined') {\r\n\t\t\treturn global\r\n\t\t}\r\n\t\treturn (function(){\r\n\t\t\treturn this\r\n\t\t})()\r\n\t\t\r\n\t}\r\n\treturn 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\r\n\tstore: null,\r\n\t\r\n\troot: getGlobal()\r\n\t//componentChange(component, element) { },\r\n\t/** If `true`, `prop` changes trigger synchronous component updates.\r\n\t *\t@name syncComponentUpdates\r\n\t *\t@type Boolean\r\n\t *\t@default true\r\n\t */\r\n\t//syncComponentUpdates: true,\r\n\r\n\t/** Processes all created VNodes.\r\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n\t */\r\n\t//vnode(vnode) { }\r\n\r\n\t/** Hook invoked after a component is mounted. */\r\n\t//afterMount(component) { },\r\n\r\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\r\n\t//afterUpdate(component) { }\r\n\r\n\t/** Hook invoked immediately before a component is unmounted. */\r\n\t// beforeUnmount(component) { }\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\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\r\n\tfor (i = arguments.length; i-- > 2;) {\r\n\t\tstack.push(arguments[i])\r\n\t}\r\n\tif (attributes && attributes.children != null) {\r\n\t\tif (!stack.length) stack.push(attributes.children)\r\n\t\tdelete attributes.children\r\n\t}\r\n\twhile (stack.length) {\r\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\r\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (typeof child === 'boolean') child = null\r\n\r\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\r\n\t\t\t\tif (child == null) child = ''\r\n\t\t\t\telse if (typeof child === 'number') child = String(child)\r\n\t\t\t\telse if (typeof child !== 'string') simple = false\r\n\t\t\t}\r\n\r\n\t\t\tif (simple && lastSimple) {\r\n\t\t\t\tchildren[children.length - 1] += child\r\n\t\t\t}\r\n\t\t\telse if (children === EMPTY_CHILDREN) {\r\n\t\t\t\tchildren = [child]\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchildren.push(child)\r\n\t\t\t}\r\n\r\n\t\t\tlastSimple = simple\r\n\t\t}\r\n\t}\r\n\r\n\tlet p = new VNode()\r\n\tp.nodeName = nodeName\r\n\tp.children = children\r\n\tp.attributes = attributes == null ? undefined : attributes\r\n\tp.key = attributes == null ? undefined : attributes.key\r\n\r\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\r\n\tif (options.vnode !== undefined) options.vnode(p)\r\n\r\n\treturn p\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\tif (\r\n\t// No Reflect, no classes, no need for shim because native custom elements\r\n\t// require ES2015 classes or Reflect.\r\n\t\twindow.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\t) {\r\n\t\treturn\r\n\t}\r\n\tconst BuiltInHTMLElement = HTMLElement\r\n\twindow.HTMLElement = function HTMLElement() {\r\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n\t}\r\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\r\n\tHTMLElement.prototype.constructor = HTMLElement\r\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\n/*\r\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\r\n */\r\nwindow.requestIdleCallback = window.requestIdleCallback ||\r\n\tfunction (cb) {\r\n\t\treturn setTimeout(function () {\r\n\t\t\tvar start = Date.now();\r\n\t\t\tcb({\r\n\t\t\t\tdidTimeout: false,\r\n\t\t\t\ttimeRemaining: function () {\r\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}, 1);\r\n\t}\r\n\r\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\r\n\tfunction (id) {\r\n\t\tclearTimeout(id);\r\n\t} \r\n\r\nexport function cssToDom(css) {\r\n\tconst node = document.createElement('style')\r\n\tnode.innerText = css\r\n\treturn node\r\n}\r\n\r\n\r\nexport function npn(str) {\r\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\r\n\t\treturn $1.toUpperCase()\r\n\t})\r\n}\r\n\r\nexport function extend(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i]\r\n\treturn 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\tif (ref!=null) {\r\n\t\tif (typeof ref=='function') ref(value)\r\n\t\telse ref.current = value\r\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\r\n\r\nexport function isArray(obj){\r\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props){\r\n\tif (!props || isArray(props)) return {}\r\n\tconst result = {}\r\n\tObject.keys(props).forEach(key =>{\r\n\t\tresult[key] = props[key].value\r\n\t})\r\n\treturn 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\n\r\nexport const ATTR_KEY = '__preactattr_'\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\r\n","import { extend } from '../util'\r\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\t\treturn node.splitText!==undefined\r\n\t}\r\n\tif (typeof vnode.nodeName==='string') {\r\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n\t}\r\n\treturn hydrating || node._componentConstructor===vnode.nodeName\r\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\r\n\tprops.children = vnode.children\r\n\r\n\tlet defaultProps = vnode.nodeName.defaultProps\r\n\tif (defaultProps!==undefined) {\r\n\t\tfor (let i in defaultProps) {\r\n\t\t\tif (props[i]===undefined) {\r\n\t\t\t\tprops[i] = defaultProps[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 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 * A DOM event listener\r\n * @typedef {(e: Event) => void} EventListner\r\n */\r\n\r\n/**\r\n * A mapping of event types to event listeners\r\n * @typedef {Object.} EventListenerMap\r\n */\r\n\r\n/**\r\n * Properties Preact adds to elements it creates\r\n * @typedef PreactElementExtensions\r\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\r\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\r\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\r\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\r\n */\r\n\r\n/**\r\n * A DOM element that has been extended with Preact properties\r\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\r\n */\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 {PreactElement} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\t/** @type {PreactElement} */\r\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\r\n\tnode.normalizedNodeName = nodeName\r\n\treturn node\r\n}\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\tlet parentNode = node.parentNode\r\n\tif (parentNode) parentNode.removeChild(node)\r\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\r\n\r\n\r\n\tif (name==='key') {\r\n\t\t// ignore\r\n\t}\r\n\telse if (name==='ref') {\r\n\t\tapplyRef(old, null)\r\n\t\tapplyRef(value, node)\r\n\t}\r\n\telse if (name==='class' && !isSvg) {\r\n\t\tnode.className = value || ''\r\n\t}\r\n\telse if (name==='style') {\r\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\tnode.style.cssText = value || ''\r\n\t\t}\r\n\t\tif (value && typeof value==='object') {\r\n\t\t\tif (typeof old!=='string') {\r\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\r\n\t\t\t}\r\n\t\t\tfor (let i in value) {\r\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (name==='dangerouslySetInnerHTML') {\r\n\t\tif (value) node.innerHTML = value.__html || ''\r\n\t}\r\n\telse if (name[0]=='o' && name[1]=='n') {\r\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\r\n\t\tname = name.toLowerCase().substring(2)\r\n\t\tif (value) {\r\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\t(node._listeners || (node._listeners = {}))[name] = value\r\n\t}\r\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\r\n\t\t// Attempt to set a DOM property to the given value.\r\n\t\t// IE & FF throw for certain property-value combinations.\r\n\t\ttry {\r\n\t\t\tnode[name] = value==null ? '' : value\r\n\t\t} catch (e) { }\r\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\r\n\t\t// spellcheck is treated differently than all other boolean values and\r\n\t\t// should not be removed when the value is `false`. See:\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n\t\tif (value==null || value===false) {\r\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\r\n\t\t\telse node.removeAttribute(name)\r\n\t\t}\r\n\t\telse if (typeof value === 'string') {\r\n\t\t\tif (ns) {\r\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\r\n\t\t\t} else {\r\n\t\t\t\tnode.setAttribute(name, value)\r\n\t\t\t}\r\n\t\t}\r\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\r\n}","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n\r\n\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n\tif (!diffLevel++) {\r\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\r\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\r\n\r\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\r\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\r\n\t}\r\n\r\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n\r\n\t// append the element if its a new parent\r\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\r\n\r\n\t// diffLevel being reduced to 0 means we're exiting the diff\r\n\tif (!--diffLevel) {\r\n\t\thydrating = false\r\n\t\t// invoke queued componentDidMount lifecycle methods\r\n\t\t\r\n\t}\r\n\r\n\treturn ret\r\n}\r\n\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n\tlet out = dom,\r\n\t\tprevSvgMode = isSvgMode\r\n\r\n\t// empty values (null, undefined, booleans) render as empty Text nodes\r\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\r\n\r\n\r\n\t// Fast case: Strings & Numbers create/update Text nodes.\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\r\n\t\t// update if it's already a Text node:\r\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\r\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n\t\t\tif (dom.nodeValue!=vnode) {\r\n\t\t\t\tdom.nodeValue = vnode\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\r\n\t\t\tout = document.createTextNode(vnode)\r\n\t\t\tif (dom) {\r\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\t\t\t\trecollectNodeTree(dom, true)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tout[ATTR_KEY] = true\r\n\r\n\t\treturn out\r\n\t}\r\n\r\n\r\n\t// If the VNode represents a Component, perform a component diff:\r\n\tlet vnodeName = vnode.nodeName\r\n\t\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\r\n\r\n\r\n\t// If there's no existing element or it's the wrong type, create a new one:\r\n\tvnodeName = String(vnodeName)\r\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\r\n\t\tout = createNode(vnodeName, isSvgMode)\r\n\r\n\t\tif (dom) {\r\n\t\t\t// move children into the replacement node\r\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\r\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n\t\t\t// recycle the old element (skips non-Element node types)\r\n\t\t\trecollectNodeTree(dom, true)\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet fc = out.firstChild,\r\n\t\tprops = out[ATTR_KEY],\r\n\t\tvchildren = vnode.children\r\n\r\n\tif (props==null) {\r\n\t\tprops = out[ATTR_KEY] = {}\r\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\r\n\t}\r\n\r\n\t// Optimization: fast-path for elements containing a single TextNode:\r\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\r\n\t\tif (fc.nodeValue!=vchildren[0]) {\r\n\t\t\tfc.nodeValue = vchildren[0]\r\n\t\t}\r\n\t}\r\n\t// otherwise, if there are existing or new children, diff them:\r\n\telse if (vchildren && vchildren.length || fc!=null) {\r\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\r\n\t}\r\n\r\n\r\n\t// Apply attributes/props from VNode to the DOM Element:\r\n\tdiffAttributes(out, vnode.attributes, props)\r\n\r\n\r\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n\tisSvgMode = prevSvgMode\r\n\r\n\treturn out\r\n}\r\n\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n\tlet originalChildren = dom.childNodes,\r\n\t\tchildren = [],\r\n\t\tkeyed = {},\r\n\t\tkeyedLen = 0,\r\n\t\tmin = 0,\r\n\t\tlen = originalChildren.length,\r\n\t\tchildrenLen = 0,\r\n\t\tvlen = vchildren ? vchildren.length : 0,\r\n\t\tj, c, f, vchild, child\r\n\r\n\t// Build up a map of keyed children and an Array of unkeyed children:\r\n\tif (len!==0) {\r\n\t\tfor (let i=0; i= Object.keys(pre).length){\r\n for (let key in pre) {\r\n const currentValue = current[key]\r\n if (currentValue === undefined) {\r\n current[key] = null\r\n } else {\r\n syncKeys(currentValue, pre[key])\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\r\n if (current.length >= pre.length) {\r\n pre.forEach((item, index) => {\r\n syncKeys(current[index], item)\r\n })\r\n }\r\n }\r\n}\r\n\r\nfunction _diff(current, pre, path, result) {\r\n if (current === pre) return\r\n const rootCurrentType = type(current)\r\n const rootPreType = type(pre)\r\n if (rootCurrentType == OBJECTTYPE) {\r\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\r\n setResult(result, path, current)\r\n } else {\r\n for (let key in current) {\r\n const currentValue = current[key]\r\n const preValue = pre[key]\r\n const currentType = type(currentValue)\r\n const preType = type(preValue)\r\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\r\n if (currentValue != pre[key]) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n }\r\n } else if (currentType == ARRAYTYPE) {\r\n if (preType != ARRAYTYPE) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n if (currentValue.length < preValue.length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n currentValue.forEach((item, index) => {\r\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else if (currentType == OBJECTTYPE) {\r\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n for (let subKey in currentValue) {\r\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE) {\r\n if (rootPreType != ARRAYTYPE) {\r\n setResult(result, path, current)\r\n } else {\r\n if (current.length < pre.length) {\r\n setResult(result, path, current)\r\n } else {\r\n current.forEach((item, index) => {\r\n _diff(item, pre[index], path + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else {\r\n setResult(result, path, current)\r\n }\r\n}\r\n\r\nfunction setResult(result, k, v) {\r\n if (type(v) != FUNCTIONTYPE) {\r\n result[k] = v\r\n }\r\n}\r\n\r\nfunction type(obj) {\r\n return Object.prototype.toString.call(obj)\r\n}","import { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport jsonDiff from './json-diff'\r\n\r\nexport function render(vnode, parent, store) {\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n\tif(store){\r\n\t\tstore.instances = []\r\n\t\textendStoreUpate(store)\r\n\t\toptions.store = store\r\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\r\n\t}\r\n diff(null, vnode, {}, false, parent, false)\r\n \r\n if(store){\r\n requestIdleCallback(execTask)\r\n }\r\n \r\n function execTask(deadline){\r\n while (deadline.timeRemaining() > 0){\r\n store.update()\r\n }\r\n setTimeout(function(){\r\n requestIdleCallback(execTask)\r\n },200)\r\n \r\n }\r\n} \r\n\r\n\r\n\r\nfunction extendStoreUpate(store){\r\n\tstore.update = function(){\r\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\r\n\t\tif (Object.keys(diffResult)[0] == '') {\r\n\t\t\tdiffResult = diffResult['']\r\n\t\t}\r\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\r\n\t\tif (Object.keys(diffResult).length > 0) {\r\n\t\t\tthis.instances.forEach(instance => {\r\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\r\n\t\t\t\t\tinstance.update()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tthis.onChange && this.onChange(diffResult)\r\n\t\t\tfor (let key in diffResult) {\r\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction matchGlobalData(globalData, diffResult) {\r\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\r\nfunction 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\nfunction updateByPath(origin, path, value) {\r\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\r\n let current = origin\r\n for (let i = 0, len = arr.length; i < len; i++) {\r\n if (i === len - 1) {\r\n current[arr[i]] = value\r\n } else {\r\n current = current[arr[i]]\r\n }\r\n }\r\n}","const OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n\tcustomElements.define(name, ctor)\r\n\tif (ctor.data && !ctor.pure) {\r\n\t\tctor.updatePath = getUpdatePath(ctor.data)\r\n\t}\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n\tconst result = {}\r\n\tdataToPath(data, result)\r\n\treturn result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[key] = true\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[path + '.' + key] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], path + '.' + key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n\tdata.forEach((item, index) => {\r\n\t\tresult[path + '[' + index + ']'] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(item)\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\r\n\t\t}\r\n\t})\r\n}","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n\treturn function (target) {\r\n\t\ttarget.pure = pure\r\n\t\tdefine(name, target)\r\n\t}\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\n\r\noptions.root.Omi = {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\noptions.root.Omi.version = '4.0.1'\r\n\r\nexport default {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\nexport {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","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","setPrototypeOf","requestIdleCallback","cb","setTimeout","start","Date","now","max","cancelIdleCallback","id","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","defer","Promise","resolve","then","bind","isArray","obj","Object","toString","call","nProps","props","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","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","firstChild","fc","vchildren","a","nextSibling","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","update","isWeElement","WeElement","data","connectedCallback","store","instances","install","shadowRoot","attachShadow","mode","host","render","pure","installed","disconnectedCallback","uninstall","splice","beforeUpdate","afterUpdate","fire","dispatchEvent","CustomEvent","detail","ARRAYTYPE","OBJECTTYPE","FUNCTIONTYPE","pre","syncKeys","rootCurrentType","rootPreType","currentValue","item","index","_diff","path","preValue","currentType","preType","subKey","setResult","k","v","querySelector","originData","JSON","parse","stringify","execTask","deadline","timeRemaining","extendStoreUpate","diffResult","jsonDiff","updateAll","matchGlobalData","globalData","instance","updatePath","needUpdate","onChange","keyA","indexOf","includePath","keyB","pathA","pathB","substr","updateByPath","origin","arr","split","define","ctor","getUpdatePath","dataToPath","_objToPath","_arrayToPath","tag","target","root","Omi","version"],"mappings":";;;;;;;;AAAA;AACA,SAAgBA,KAAT,GAAiB;;ACDxB,SAASC,SAAT,GAAqB;KAChB,OAAOC,MAAP,KAAkB,QAAlB,IAA8B,CAACA,MAA/B,IAAyCA,OAAOC,IAAP,KAAgBA,IAAzD,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AA;qBAAA;eAAA;KAAA;iBAAA;iBAAA;;CAAnB;;AAUA5N,QAAQ2N,IAAR,CAAaC,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;AAEA,UAAe;SAAA;qBAAA;eAAA;KAAA;iBAAA;iBAAA;;CAAf;;;"} \ No newline at end of file +{"version":3,"file":"omi.esm.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/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/tag.js","../src/omi.js"],"sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","function getGlobal() {\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t} else if (typeof global !== 'undefined') {\n\t\t\treturn global\n\t\t}\n\t\treturn (function(){\n\t\t\treturn this\n\t\t})()\n\t\t\n\t}\n\treturn global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n\t\n\troot: getGlobal()\n\t//componentChange(component, element) { },\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n\t *\t@name syncComponentUpdates\n\t *\t@type Boolean\n\t *\t@default true\n\t */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n\t */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t//afterMount(component) { },\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t//afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i])\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children)\n\t\tdelete attributes.children\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\n\t\t}\n\t\telse {\n\t\t\tif (typeof child === 'boolean') child = null\n\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\n\t\t\t\tif (child == null) child = ''\n\t\t\t\telse if (typeof child === 'number') child = String(child)\n\t\t\t\telse if (typeof child !== 'string') simple = false\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child\n\t\t\t}\n\t\t\telse if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child]\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child)\n\t\t\t}\n\n\t\t\tlastSimple = simple\n\t\t}\n\t}\n\n\tlet p = new VNode()\n\tp.nodeName = nodeName\n\tp.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n\tp.key = attributes == null ? undefined : attributes.key\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p)\n\n\treturn p\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\tif (\n\t// No Reflect, no classes, no need for shim because native custom elements\n\t// require ES2015 classes or Reflect.\n\t\twindow.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\t) {\n\t\treturn\n\t}\n\tconst BuiltInHTMLElement = HTMLElement\n\twindow.HTMLElement = function HTMLElement() {\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n\t}\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\n\tHTMLElement.prototype.constructor = HTMLElement\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/*\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\n */\nwindow.requestIdleCallback = window.requestIdleCallback ||\n\tfunction (cb) {\n\t\treturn setTimeout(function () {\n\t\t\tvar start = Date.now();\n\t\t\tcb({\n\t\t\t\tdidTimeout: false,\n\t\t\t\ttimeRemaining: function () {\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\n\t\t\t\t}\n\t\t\t});\n\t\t}, 1);\n\t}\n\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\n\tfunction (id) {\n\t\tclearTimeout(id);\n\t} \n\nexport function cssToDom(css) {\n\tconst node = document.createElement('style')\n\tnode.innerText = css\n\treturn node\n}\n\n\nexport function npn(str) {\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\n\t\treturn $1.toUpperCase()\n\t})\n}\n\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i]\n\treturn 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\tif (ref!=null) {\n\t\tif (typeof ref=='function') ref(value)\n\t\telse ref.current = value\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\n\nexport function isArray(obj){\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props){\n\tif (!props || isArray(props)) return {}\n\tconst result = {}\n\tObject.keys(props).forEach(key =>{\n\t\tresult[key] = props[key].value\n\t})\n\treturn 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\n\nexport const ATTR_KEY = '__preactattr_'\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\n","import { extend } from '../util'\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\n\tprops.children = vnode.children\n\n\tlet defaultProps = vnode.nodeName.defaultProps\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\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 {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\n\tnode.normalizedNodeName = nodeName\n\treturn node\n}\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\tlet parentNode = node.parentNode\n\tif (parentNode) parentNode.removeChild(node)\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null)\n\t\tapplyRef(value, node)\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || ''\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || ''\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || ''\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\n\t\tname = name.toLowerCase().substring(2)\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\n\t\t\telse node.removeAttribute(name)\n\t\t}\n\t\telse if (typeof value === 'string') {\n\t\t\tif (ns) {\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\n\t\t\t} else {\n\t\t\t\tnode.setAttribute(name, value)\n\t\t\t}\n\t\t}\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\n}","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn } 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\n\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\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\t\n\t}\n\n\treturn ret\n}\n\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode)\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\t\t\t\trecollectNodeTree(dom, true)\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true\n\n\t\treturn out\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName\n\t\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName)\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode)\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true)\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {}\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0]\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props)\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode\n\n\treturn out\n}\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\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i= Object.keys(pre).length){\n for (let key in pre) {\n const currentValue = current[key]\n if (currentValue === undefined) {\n current[key] = null\n } else {\n syncKeys(currentValue, pre[key])\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\n if (current.length >= pre.length) {\n pre.forEach((item, index) => {\n syncKeys(current[index], item)\n })\n }\n }\n}\n\nfunction _diff(current, pre, path, result) {\n if (current === pre) return\n const rootCurrentType = type(current)\n const rootPreType = type(pre)\n if (rootCurrentType == OBJECTTYPE) {\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\n setResult(result, path, current)\n } else {\n for (let key in current) {\n const currentValue = current[key]\n const preValue = pre[key]\n const currentType = type(currentValue)\n const preType = type(preValue)\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\n if (currentValue != pre[key]) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n }\n } else if (currentType == ARRAYTYPE) {\n if (preType != ARRAYTYPE) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n if (currentValue.length < preValue.length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n currentValue.forEach((item, index) => {\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\n })\n }\n }\n } else if (currentType == OBJECTTYPE) {\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n for (let subKey in currentValue) {\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\n }\n }\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE) {\n if (rootPreType != ARRAYTYPE) {\n setResult(result, path, current)\n } else {\n if (current.length < pre.length) {\n setResult(result, path, current)\n } else {\n current.forEach((item, index) => {\n _diff(item, pre[index], path + '[' + index + ']', result)\n })\n }\n }\n } else {\n setResult(result, path, current)\n }\n}\n\nfunction setResult(result, k, v) {\n if (type(v) != FUNCTIONTYPE) {\n result[k] = v\n }\n}\n\nfunction type(obj) {\n return Object.prototype.toString.call(obj)\n}","import { diff } from './vdom/diff'\nimport jsonDiff from './json-diff'\n\nconst list = []\nlet tick = false\n\nexport function render(vnode, parent, store) {\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\n\tif(store){\n\t\tstore.instances = []\n\t\textendStoreUpate(store)\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\n }\n parent.store = store\n diff(null, vnode, {}, false, parent, false)\n list.push(store)\n\n if(store && !tick){\n requestIdleCallback(execTask)\n tick = true\n }\n \n function execTask(deadline){\n while (deadline.timeRemaining() > 0){\n list.forEach(currentStore => {\n currentStore.update()\n })\n }\n setTimeout(function(){\n requestIdleCallback(execTask)\n },200)\n \n }\n} \n\nfunction extendStoreUpate(store){\n\tstore.update = function(){\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\n\t\tif (Object.keys(diffResult)[0] == '') {\n\t\t\tdiffResult = diffResult['']\n\t\t}\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\n\t\tif (Object.keys(diffResult).length > 0) {\n\t\t\tthis.instances.forEach(instance => {\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\n\t\t\t\t\tinstance.update()\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.onChange && this.onChange(diffResult)\n\t\t\tfor (let key in diffResult) {\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction matchGlobalData(globalData, diffResult) {\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\nfunction 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\nfunction updateByPath(origin, path, value) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}","const OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n\tcustomElements.define(name, ctor)\n\tif (ctor.data && !ctor.pure) {\n\t\tctor.updatePath = getUpdatePath(ctor.data)\n\t}\n}\n\nexport function getUpdatePath(data) {\n\tconst result = {}\n\tdataToPath(data, result)\n\treturn result\n}\n\nfunction dataToPath(data, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[key] = true\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], key, result)\n\t\t}\n\t})\n}\n\nfunction _objToPath(data, path, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[path + '.' + key] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], path + '.' + key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\n\t\t}\n\t})\n}\n\nfunction _arrayToPath(data, path, result) {\n\tdata.forEach((item, index) => {\n\t\tresult[path + '[' + index + ']'] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(item)\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\n\t\t}\n\t})\n}","import { define } from './define'\n\nexport function tag(name, pure) {\n\treturn function (target) {\n\t\ttarget.pure = pure\n\t\tdefine(name, target)\n\t}\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'\n\noptions.root.Omi = {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\noptions.root.Omi.version = '4.0.1'\n\nexport default {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\nexport {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","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","setPrototypeOf","requestIdleCallback","cb","setTimeout","start","Date","now","max","cancelIdleCallback","id","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","defer","Promise","resolve","then","bind","isArray","obj","Object","toString","call","nProps","props","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","removeEventListener","_listeners","e","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","type","event","diffLevel","isSvgMode","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","firstChild","fc","vchildren","a","nextSibling","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","c","f","vchild","__key","trim","insertBefore","recollectNodeTree","unmountOnly","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","update","isWeElement","WeElement","data","connectedCallback","pure","store","host","instances","install","shadowRoot","attachShadow","mode","render","installed","disconnectedCallback","uninstall","splice","beforeUpdate","afterUpdate","fire","dispatchEvent","CustomEvent","detail","ARRAYTYPE","OBJECTTYPE","FUNCTIONTYPE","pre","syncKeys","rootCurrentType","rootPreType","currentValue","item","index","_diff","path","preValue","currentType","preType","subKey","setResult","k","v","list","tick","querySelector","originData","JSON","parse","stringify","execTask","deadline","timeRemaining","extendStoreUpate","diffResult","jsonDiff","updateAll","matchGlobalData","globalData","instance","updatePath","needUpdate","onChange","keyA","indexOf","includePath","keyB","pathA","pathB","substr","updateByPath","origin","arr","split","define","ctor","getUpdatePath","dataToPath","_objToPath","_arrayToPath","tag","target","root","Omi","version"],"mappings":";;;;;;;;AAAA;AACA,SAAgBA,KAAT,GAAiB;;ACDxB,SAASC,SAAT,GAAqB;KAChB,OAAOC,MAAP,KAAkB,QAAlB,IAA8B,CAACA,MAA/B,IAAyCA,OAAOC,IAAP,KAAgBA,IAAzD,IAAiED,OAAOE,KAAP,KAAiBA,KAAtF,EAA6F;MACxF,OAAOC,IAAP,KAAgB,WAApB,EAAiC;UACzBA,IAAP;GADD,MAEO,IAAI,OAAOC,MAAP,KAAkB,WAAtB,EAAmC;UAClCA,MAAP;GADM,MAEA,IAAI,OAAOJ,MAAP,KAAkB,WAAtB,EAAmC;UAClCA,MAAP;;SAEO,YAAU;UACV,IAAP;GADM,EAAP;;QAKMA,MAAP;;;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AmB;SAAA;qBAAA;eAAA;KAAA;iBAAA;iBAAA;;CAAnB;;AAUA9N,QAAQ6N,IAAR,CAAaC,GAAb,CAAiBC,OAAjB,GAA2B,OAA3B;;AAEA,UAAe;SAAA;qBAAA;eAAA;KAAA;iBAAA;iBAAA;;CAAf;;;"} \ No newline at end of file diff --git a/packages/omi-ie11/dist/omi.js b/packages/omi-ie11/dist/omi.js index 903e641f4..625776449 100644 --- a/packages/omi-ie11/dist/omi.js +++ b/packages/omi-ie11/dist/omi.js @@ -281,7 +281,9 @@ } function render(vnode, parent, store) { function execTask(deadline) { - while (deadline.timeRemaining() > 0) store.update(); + while (deadline.timeRemaining() > 0) list.forEach(function(currentStore) { + currentStore.update(); + }); setTimeout(function() { requestIdleCallback(execTask); }, 200); @@ -290,11 +292,15 @@ if (store) { store.instances = []; extendStoreUpate(store); - options.store = store; store.originData = JSON.parse(JSON.stringify(store.data)); } + parent.store = store; diff(null, vnode, {}, !1, parent, !1); - if (store) requestIdleCallback(execTask); + list.push(store); + if (store && !tick) { + requestIdleCallback(execTask); + tick = !0; + } } function extendStoreUpate(store) { store.update = function() { @@ -377,7 +383,6 @@ }; } var options = { - store: null, root: function() { if ('object' != typeof global || !global || global.Math !== Math || global.Array !== Array) { if ('undefined' != typeof self) return self; else if ('undefined' != typeof window) return window; else if ('undefined' != typeof global) return global; @@ -430,8 +435,14 @@ } _inherits(WeElement, _HTMLElement); WeElement.prototype.connectedCallback = function() { - this.store = options.store; - if (this.store) this.store.instances.push(this); + if (!this.constructor.pure) { + var p = this.parentNode; + while (p && !this.store) { + this.store = p.store; + p = p.parentNode || p.host; + } + if (this.store) this.store.instances.push(this); + } this.install(); var shadowRoot = this.attachShadow({ mode: 'open' @@ -465,6 +476,8 @@ WeElement.prototype.afterUpdate = function() {}; return WeElement; }(HTMLElement); + var list = []; + var tick = !1; options.root.Omi = { tag: tag, WeElement: WeElement, diff --git a/packages/omi-ie11/dist/omi.js.map b/packages/omi-ie11/dist/omi.js.map index dfba3aede..fa33953ce 100644 --- a/packages/omi-ie11/dist/omi.js.map +++ b/packages/omi-ie11/dist/omi.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/options.js","../src/tag.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","key","options","vnode","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","isArray","obj","Object","prototype","toString","call","nProps","props","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","removeNode","name","isSvg","className","old","style","cssText","IS_NON_DIMENSIONAL","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","e","removeAttribute","ns","removeAttributeNS","toLowerCase","setAttribute","isSvgMode","dom","componentRoot","context","mountAll","ret","idiff","diffLevel","parent","out","splitText","parentNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","createNode","vchildren","firstChild","fc","a","nextSibling","innerDiffNode","dangerouslySetInnerHTML","prevSvgMode","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","__key","trim","isHydrating","c","f","appendChild","unmountOnly","removeChildren","update","attrs","setAccessor","isWeElement","_possibleConstructorReturn","self","ReferenceError","HTMLElement","ARRAYTYPE","type","syncKeys","pre","_diff","rootPreType","currentValue","rootCurrentType","item","index","setResult","path","OBJECTTYPE","preValue","currentType","subKey","k","v","store","originData","deadline","timeRemaining","requestIdleCallback","execTask","querySelector","extendStoreUpate","JSON","parse","stringify","data","render","setTimeout","this","diffResult","diff$1","globalData","instances","instance","jsonDiff","onChange","updateAll","matchGlobalData","updateByPath","indexOf","keyA","needUpdate","includePath","updatePath","keyB","pathA","pathB","next","substr","arr","split","origin","ctor","pure","dataToPath","getUpdatePath","_objToPath","_arrayToPath","target","define","root","global","Math","Array","window","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","construct","constructor","setPrototypeOf","cb","start","Date","now","didTimeout","max","cancelIdleCallback","id","clearTimeout","Promise","resolve","then","bind","_listeners","WeElement","_this","shadowRoot","mode","install","attachShadow","installed","disconnectedCallback","uninstall","splice","beforeUpdate","diff","host","fire","afterUpdate","CustomEvent","detail","Omi","tag","h"],"mappings":";;IACO,SAASA;ICKT,SAAWC,EAAAA,UAAUC;QAC3B,IAA+BC,YAAYC,OAAOC,QAAQC,GAAtDC,WAAWC;QACf,KAAKF,IAAIG,UAAUC,QAAQJ,MAAM,KAChCK,MAAMC,KAAKH,UAAUH;QAEtB,IAAIJ,cAAqC,QAAvBA,WAAWK,UAAkB;YAC9C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEnB,OAAOI,MAAMD,QACZ,KAAKN,QAAQO,MAAME,eAAwBC,MAAdV,MAAMS,KAClC,KAAKP,IAAIF,MAAMM,QAAQJ,OAAMK,MAAMC,KAAKR,MAAME,UAE1C;YACJ,IAAqB,oBAAVF,OAAqBA,QAAQ;YAExC,IAAKC,SAA6B,qBAAbJ,UACpB,IAAa,QAATG,OAAeA,QAAQ,SACtB,IAAqB,mBAAVA,OAAoBA,QAAQW,OAAOX,aAC9C,IAAqB,mBAAVA,OAAoBC,UAAS;YAG9C,IAAIA,UAAUF,YACbI,SAASA,SAASG,SAAS,MAAMN,YAE7B,IAAIG,aAAaC,gBACrBD,aAAYH,cAGZG,SAASK,KAAKR;YAGfD,aAAaE;;QAIf,IAAIW,IAAI,IAAIhB;QACZgB,EAAEf,WAAWA;QACbe,EAAET,WAAWA;QACbS,EAAEd,aAA2B,QAAdA,kBAAqBY,IAAYZ;QAChDc,EAAEC,MAAoB,QAAdf,kBAAqBY,IAAYZ,WAAWe;QAGpD,SAAsBH,MAAlBI,QAAQC,OAAqBD,QAAQC,MAAMH;QAE/C,OAAOA;;ICOD,SAASI,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;YAGAc,KAAKd;YAEJ,IAAA0E,aAAWxD,KAAUpJ;gBAArB6M,MAAA;;YAED7D,KAAK8D,OAALF,WAAAvG,YAAA7F,SAAAwI,KAAAvI;;YAEAmM,WAAMA,YAAkBG,KAAAA;YAExB/D,KAAKvI;;;YAILuI,KAAKgE;YACL,IAAAhE,KAAAd,iGAED+E,OAAAA,MAAAA;gBACCjE,KAAKkE,MAAL9D,UAAA+D,OAAAzN,GAAA;gBACA;;;QAMEgN,UAAA/K,UAAA6E,SAAA;YACDwC,KAAAoE;YACDC,KAAArE,KAAAsE,MAAAtE,KAAAF,OAAAE,KAAAjH,QAAAiH,KAAA0C,YAAAjB,QAAAzB,KAAAd,QAAAc,KAAAd,MAAAW,OAAAG,KAAAH;;;QAIAwE,UAAK1L,UAAW4L,OAAKzE,SAAoBvG,MAAMmJ;YAC/C1C,KAAKwE,cAAL,IAAAC,YAAAlL;gBAAAmL,QAAA7E;;;4BAGD0E,UAAAA;QAECb,UAAA/K,UAAAqL,YAAA;4BAEDF,YAAAA;4BAIAE,eAAAA;4BAIAE,cAAAA;;;IGPE5M,QAAA0K,KAAA2C;QACDC,KATDA;QAUAlB,WAAAA;;;QEjDA9L,eAAOiN;QACN/C,SAAOL;QACPM,QAAOxI;;;ICGRqL,IAAAA;QACAlB,KAAAA;QACA5D,WAAAA;QACA+E,QAJkB/E;QAKlBlI,GAAAA;QACAN,eAAAA;QACAyK,SAAAA;QAPDA,QAAAA","file":"omi.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\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\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\r\n\tfor (i = arguments.length; i-- > 2;) {\r\n\t\tstack.push(arguments[i])\r\n\t}\r\n\tif (attributes && attributes.children != null) {\r\n\t\tif (!stack.length) stack.push(attributes.children)\r\n\t\tdelete attributes.children\r\n\t}\r\n\twhile (stack.length) {\r\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\r\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (typeof child === 'boolean') child = null\r\n\r\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\r\n\t\t\t\tif (child == null) child = ''\r\n\t\t\t\telse if (typeof child === 'number') child = String(child)\r\n\t\t\t\telse if (typeof child !== 'string') simple = false\r\n\t\t\t}\r\n\r\n\t\t\tif (simple && lastSimple) {\r\n\t\t\t\tchildren[children.length - 1] += child\r\n\t\t\t}\r\n\t\t\telse if (children === EMPTY_CHILDREN) {\r\n\t\t\t\tchildren = [child]\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchildren.push(child)\r\n\t\t\t}\r\n\r\n\t\t\tlastSimple = simple\r\n\t\t}\r\n\t}\r\n\r\n\tlet p = new VNode()\r\n\tp.nodeName = nodeName\r\n\tp.children = children\r\n\tp.attributes = attributes == null ? undefined : attributes\r\n\tp.key = attributes == null ? undefined : attributes.key\r\n\r\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\r\n\tif (options.vnode !== undefined) options.vnode(p)\r\n\r\n\treturn p\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\tif (\r\n\t// No Reflect, no classes, no need for shim because native custom elements\r\n\t// require ES2015 classes or Reflect.\r\n\t\twindow.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\t) {\r\n\t\treturn\r\n\t}\r\n\tconst BuiltInHTMLElement = HTMLElement\r\n\twindow.HTMLElement = function HTMLElement() {\r\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n\t}\r\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\r\n\tHTMLElement.prototype.constructor = HTMLElement\r\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\n/*\r\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\r\n */\r\nwindow.requestIdleCallback = window.requestIdleCallback ||\r\n\tfunction (cb) {\r\n\t\treturn setTimeout(function () {\r\n\t\t\tvar start = Date.now();\r\n\t\t\tcb({\r\n\t\t\t\tdidTimeout: false,\r\n\t\t\t\ttimeRemaining: function () {\r\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}, 1);\r\n\t}\r\n\r\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\r\n\tfunction (id) {\r\n\t\tclearTimeout(id);\r\n\t} \r\n\r\nexport function cssToDom(css) {\r\n\tconst node = document.createElement('style')\r\n\tnode.innerText = css\r\n\treturn node\r\n}\r\n\r\n\r\nexport function npn(str) {\r\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\r\n\t\treturn $1.toUpperCase()\r\n\t})\r\n}\r\n\r\nexport function extend(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i]\r\n\treturn 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\tif (ref!=null) {\r\n\t\tif (typeof ref=='function') ref(value)\r\n\t\telse ref.current = value\r\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\r\n\r\nexport function isArray(obj){\r\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props){\r\n\tif (!props || isArray(props)) return {}\r\n\tconst result = {}\r\n\tObject.keys(props).forEach(key =>{\r\n\t\tresult[key] = props[key].value\r\n\t})\r\n\treturn result\r\n}\r\n","import { extend } from '../util'\r\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\t\treturn node.splitText!==undefined\r\n\t}\r\n\tif (typeof vnode.nodeName==='string') {\r\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n\t}\r\n\treturn hydrating || node._componentConstructor===vnode.nodeName\r\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\r\n\tprops.children = vnode.children\r\n\r\n\tlet defaultProps = vnode.nodeName.defaultProps\r\n\tif (defaultProps!==undefined) {\r\n\t\tfor (let i in defaultProps) {\r\n\t\t\tif (props[i]===undefined) {\r\n\t\t\t\tprops[i] = defaultProps[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 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 * A DOM event listener\r\n * @typedef {(e: Event) => void} EventListner\r\n */\r\n\r\n/**\r\n * A mapping of event types to event listeners\r\n * @typedef {Object.} EventListenerMap\r\n */\r\n\r\n/**\r\n * Properties Preact adds to elements it creates\r\n * @typedef PreactElementExtensions\r\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\r\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\r\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\r\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\r\n */\r\n\r\n/**\r\n * A DOM element that has been extended with Preact properties\r\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\r\n */\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 {PreactElement} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\t/** @type {PreactElement} */\r\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\r\n\tnode.normalizedNodeName = nodeName\r\n\treturn node\r\n}\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\tlet parentNode = node.parentNode\r\n\tif (parentNode) parentNode.removeChild(node)\r\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\r\n\r\n\r\n\tif (name==='key') {\r\n\t\t// ignore\r\n\t}\r\n\telse if (name==='ref') {\r\n\t\tapplyRef(old, null)\r\n\t\tapplyRef(value, node)\r\n\t}\r\n\telse if (name==='class' && !isSvg) {\r\n\t\tnode.className = value || ''\r\n\t}\r\n\telse if (name==='style') {\r\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\tnode.style.cssText = value || ''\r\n\t\t}\r\n\t\tif (value && typeof value==='object') {\r\n\t\t\tif (typeof old!=='string') {\r\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\r\n\t\t\t}\r\n\t\t\tfor (let i in value) {\r\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (name==='dangerouslySetInnerHTML') {\r\n\t\tif (value) node.innerHTML = value.__html || ''\r\n\t}\r\n\telse if (name[0]=='o' && name[1]=='n') {\r\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\r\n\t\tname = name.toLowerCase().substring(2)\r\n\t\tif (value) {\r\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\t(node._listeners || (node._listeners = {}))[name] = value\r\n\t}\r\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\r\n\t\t// Attempt to set a DOM property to the given value.\r\n\t\t// IE & FF throw for certain property-value combinations.\r\n\t\ttry {\r\n\t\t\tnode[name] = value==null ? '' : value\r\n\t\t} catch (e) { }\r\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\r\n\t\t// spellcheck is treated differently than all other boolean values and\r\n\t\t// should not be removed when the value is `false`. See:\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n\t\tif (value==null || value===false) {\r\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\r\n\t\t\telse node.removeAttribute(name)\r\n\t\t}\r\n\t\telse if (typeof value === 'string') {\r\n\t\t\tif (ns) {\r\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\r\n\t\t\t} else {\r\n\t\t\t\tnode.setAttribute(name, value)\r\n\t\t\t}\r\n\t\t}\r\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\r\n}","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n\r\n\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n\tif (!diffLevel++) {\r\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\r\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\r\n\r\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\r\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\r\n\t}\r\n\r\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n\r\n\t// append the element if its a new parent\r\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\r\n\r\n\t// diffLevel being reduced to 0 means we're exiting the diff\r\n\tif (!--diffLevel) {\r\n\t\thydrating = false\r\n\t\t// invoke queued componentDidMount lifecycle methods\r\n\t\t\r\n\t}\r\n\r\n\treturn ret\r\n}\r\n\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n\tlet out = dom,\r\n\t\tprevSvgMode = isSvgMode\r\n\r\n\t// empty values (null, undefined, booleans) render as empty Text nodes\r\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\r\n\r\n\r\n\t// Fast case: Strings & Numbers create/update Text nodes.\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\r\n\t\t// update if it's already a Text node:\r\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\r\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n\t\t\tif (dom.nodeValue!=vnode) {\r\n\t\t\t\tdom.nodeValue = vnode\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\r\n\t\t\tout = document.createTextNode(vnode)\r\n\t\t\tif (dom) {\r\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\t\t\t\trecollectNodeTree(dom, true)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tout[ATTR_KEY] = true\r\n\r\n\t\treturn out\r\n\t}\r\n\r\n\r\n\t// If the VNode represents a Component, perform a component diff:\r\n\tlet vnodeName = vnode.nodeName\r\n\t\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\r\n\r\n\r\n\t// If there's no existing element or it's the wrong type, create a new one:\r\n\tvnodeName = String(vnodeName)\r\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\r\n\t\tout = createNode(vnodeName, isSvgMode)\r\n\r\n\t\tif (dom) {\r\n\t\t\t// move children into the replacement node\r\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\r\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n\t\t\t// recycle the old element (skips non-Element node types)\r\n\t\t\trecollectNodeTree(dom, true)\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet fc = out.firstChild,\r\n\t\tprops = out[ATTR_KEY],\r\n\t\tvchildren = vnode.children\r\n\r\n\tif (props==null) {\r\n\t\tprops = out[ATTR_KEY] = {}\r\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\r\n\t}\r\n\r\n\t// Optimization: fast-path for elements containing a single TextNode:\r\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\r\n\t\tif (fc.nodeValue!=vchildren[0]) {\r\n\t\t\tfc.nodeValue = vchildren[0]\r\n\t\t}\r\n\t}\r\n\t// otherwise, if there are existing or new children, diff them:\r\n\telse if (vchildren && vchildren.length || fc!=null) {\r\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\r\n\t}\r\n\r\n\r\n\t// Apply attributes/props from VNode to the DOM Element:\r\n\tdiffAttributes(out, vnode.attributes, props)\r\n\r\n\r\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n\tisSvgMode = prevSvgMode\r\n\r\n\treturn out\r\n}\r\n\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n\tlet originalChildren = dom.childNodes,\r\n\t\tchildren = [],\r\n\t\tkeyed = {},\r\n\t\tkeyedLen = 0,\r\n\t\tmin = 0,\r\n\t\tlen = originalChildren.length,\r\n\t\tchildrenLen = 0,\r\n\t\tvlen = vchildren ? vchildren.length : 0,\r\n\t\tj, c, f, vchild, child\r\n\r\n\t// Build up a map of keyed children and an Array of unkeyed children:\r\n\tif (len!==0) {\r\n\t\tfor (let i=0; i= Object.keys(pre).length){\r\n for (let key in pre) {\r\n const currentValue = current[key]\r\n if (currentValue === undefined) {\r\n current[key] = null\r\n } else {\r\n syncKeys(currentValue, pre[key])\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\r\n if (current.length >= pre.length) {\r\n pre.forEach((item, index) => {\r\n syncKeys(current[index], item)\r\n })\r\n }\r\n }\r\n}\r\n\r\nfunction _diff(current, pre, path, result) {\r\n if (current === pre) return\r\n const rootCurrentType = type(current)\r\n const rootPreType = type(pre)\r\n if (rootCurrentType == OBJECTTYPE) {\r\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\r\n setResult(result, path, current)\r\n } else {\r\n for (let key in current) {\r\n const currentValue = current[key]\r\n const preValue = pre[key]\r\n const currentType = type(currentValue)\r\n const preType = type(preValue)\r\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\r\n if (currentValue != pre[key]) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n }\r\n } else if (currentType == ARRAYTYPE) {\r\n if (preType != ARRAYTYPE) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n if (currentValue.length < preValue.length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n currentValue.forEach((item, index) => {\r\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else if (currentType == OBJECTTYPE) {\r\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n for (let subKey in currentValue) {\r\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE) {\r\n if (rootPreType != ARRAYTYPE) {\r\n setResult(result, path, current)\r\n } else {\r\n if (current.length < pre.length) {\r\n setResult(result, path, current)\r\n } else {\r\n current.forEach((item, index) => {\r\n _diff(item, pre[index], path + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else {\r\n setResult(result, path, current)\r\n }\r\n}\r\n\r\nfunction setResult(result, k, v) {\r\n if (type(v) != FUNCTIONTYPE) {\r\n result[k] = v\r\n }\r\n}\r\n\r\nfunction type(obj) {\r\n return Object.prototype.toString.call(obj)\r\n}","import { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport jsonDiff from './json-diff'\r\n\r\nexport function render(vnode, parent, store) {\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n\tif(store){\r\n\t\tstore.instances = []\r\n\t\textendStoreUpate(store)\r\n\t\toptions.store = store\r\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\r\n\t}\r\n diff(null, vnode, {}, false, parent, false)\r\n \r\n if(store){\r\n requestIdleCallback(execTask)\r\n }\r\n \r\n function execTask(deadline){\r\n while (deadline.timeRemaining() > 0){\r\n store.update()\r\n }\r\n setTimeout(function(){\r\n requestIdleCallback(execTask)\r\n },200)\r\n \r\n }\r\n} \r\n\r\n\r\n\r\nfunction extendStoreUpate(store){\r\n\tstore.update = function(){\r\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\r\n\t\tif (Object.keys(diffResult)[0] == '') {\r\n\t\t\tdiffResult = diffResult['']\r\n\t\t}\r\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\r\n\t\tif (Object.keys(diffResult).length > 0) {\r\n\t\t\tthis.instances.forEach(instance => {\r\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\r\n\t\t\t\t\tinstance.update()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tthis.onChange && this.onChange(diffResult)\r\n\t\t\tfor (let key in diffResult) {\r\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction matchGlobalData(globalData, diffResult) {\r\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\r\nfunction 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\nfunction updateByPath(origin, path, value) {\r\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\r\n let current = origin\r\n for (let i = 0, len = arr.length; i < len; i++) {\r\n if (i === len - 1) {\r\n current[arr[i]] = value\r\n } else {\r\n current = current[arr[i]]\r\n }\r\n }\r\n}","const OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n\tcustomElements.define(name, ctor)\r\n\tif (ctor.data && !ctor.pure) {\r\n\t\tctor.updatePath = getUpdatePath(ctor.data)\r\n\t}\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n\tconst result = {}\r\n\tdataToPath(data, result)\r\n\treturn result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[key] = true\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[path + '.' + key] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], path + '.' + key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n\tdata.forEach((item, index) => {\r\n\t\tresult[path + '[' + index + ']'] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(item)\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\r\n\t\t}\r\n\t})\r\n}","function getGlobal() {\r\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\r\n\t\tif (typeof self !== 'undefined') {\r\n\t\t\treturn self\r\n\t\t} else if (typeof window !== 'undefined') {\r\n\t\t\treturn window\r\n\t\t} else if (typeof global !== 'undefined') {\r\n\t\t\treturn global\r\n\t\t}\r\n\t\treturn (function(){\r\n\t\t\treturn this\r\n\t\t})()\r\n\t\t\r\n\t}\r\n\treturn 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\r\n\tstore: null,\r\n\t\r\n\troot: getGlobal()\r\n\t//componentChange(component, element) { },\r\n\t/** If `true`, `prop` changes trigger synchronous component updates.\r\n\t *\t@name syncComponentUpdates\r\n\t *\t@type Boolean\r\n\t *\t@default true\r\n\t */\r\n\t//syncComponentUpdates: true,\r\n\r\n\t/** Processes all created VNodes.\r\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n\t */\r\n\t//vnode(vnode) { }\r\n\r\n\t/** Hook invoked after a component is mounted. */\r\n\t//afterMount(component) { },\r\n\r\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\r\n\t//afterUpdate(component) { }\r\n\r\n\t/** Hook invoked immediately before a component is unmounted. */\r\n\t// beforeUnmount(component) { }\r\n}\r\n","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n\treturn function (target) {\r\n\t\ttarget.pure = pure\r\n\t\tdefine(name, target)\r\n\t}\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\n\r\noptions.root.Omi = {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\noptions.root.Omi.version = '4.0.1'\r\n\r\nexport default {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\nexport {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/we-element.js","../src/json-diff.js","../src/render.js","../src/define.js","../src/options.js","../src/tag.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","key","options","vnode","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","isArray","obj","Object","prototype","toString","call","nProps","props","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","removeNode","name","isSvg","className","old","style","cssText","IS_NON_DIMENSIONAL","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","e","removeAttribute","ns","removeAttributeNS","toLowerCase","setAttribute","isSvgMode","dom","componentRoot","context","mountAll","ret","idiff","diffLevel","parent","out","splitText","parentNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","createNode","vchildren","firstChild","fc","a","nextSibling","innerDiffNode","dangerouslySetInnerHTML","prevSvgMode","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","__key","trim","isHydrating","c","f","appendChild","unmountOnly","removeChildren","update","attrs","setAccessor","isWeElement","_possibleConstructorReturn","self","ReferenceError","HTMLElement","ARRAYTYPE","type","syncKeys","pre","_diff","rootPreType","currentValue","rootCurrentType","item","index","setResult","path","OBJECTTYPE","preValue","currentType","subKey","k","v","diff","execTask","deadline","list","store","timeRemaining","setTimeout","querySelector","instances","originData","JSON","parse","stringify","data","render","extendStoreUpate","this","diffResult","diff$1","globalData","instance","jsonDiff","onChange","updateAll","matchGlobalData","updateByPath","indexOf","keyA","needUpdate","includePath","updatePath","keyB","pathA","pathB","next","substr","arr","split","origin","ctor","pure","dataToPath","getUpdatePath","_objToPath","_arrayToPath","target","define","root","global","Math","Array","window","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","construct","constructor","setPrototypeOf","requestIdleCallback","cb","start","Date","now","didTimeout","max","cancelIdleCallback","id","clearTimeout","Promise","resolve","then","bind","_listeners","WeElement","_this","install","shadowRoot","attachShadow","mode","installed","disconnectedCallback","uninstall","splice","beforeUpdate","host","fire","afterUpdate","CustomEvent","detail","tick","Omi","tag","h"],"mappings":";;IACO,SAASA;ICKT,SAAWC,EAAAA,UAAUC;QAC3B,IAA+BC,YAAYC,OAAOC,QAAQC,GAAtDC,WAAWC;QACf,KAAKF,IAAIG,UAAUC,QAAQJ,MAAM,KAChCK,MAAMC,KAAKH,UAAUH;QAEtB,IAAIJ,cAAqC,QAAvBA,WAAWK,UAAkB;YAC9C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEnB,OAAOI,MAAMD,QACZ,KAAKN,QAAQO,MAAME,eAAwBC,MAAdV,MAAMS,KAClC,KAAKP,IAAIF,MAAMM,QAAQJ,OAAMK,MAAMC,KAAKR,MAAME,UAE1C;YACJ,IAAqB,oBAAVF,OAAqBA,QAAQ;YAExC,IAAKC,SAA6B,qBAAbJ,UACpB,IAAa,QAATG,OAAeA,QAAQ,S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4BAIAE,cAAAA;;;IC+BOpL,IAAAA;IACH,IAAA4L,QAAA;IE7CFtN,QAAA2K,KAAA4C;QACDC,KATDA;QAUAlB,WAAAA;;;QEjDAhM,eAAOmN;QACNhD,SAAOL;QACPM,QAAOzI;;;ICGRuL,IAAAA;QACAlB,KAAAA;QACA5D,WAAAA;QACA+E,QAJkB/E;QAKlBpI,GAAAA;QACAN,eAAAA;QACA0K,SAAAA;QAPDA,QAAAA","file":"omi.js","sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i])\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children)\n\t\tdelete attributes.children\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\n\t\t}\n\t\telse {\n\t\t\tif (typeof child === 'boolean') child = null\n\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\n\t\t\t\tif (child == null) child = ''\n\t\t\t\telse if (typeof child === 'number') child = String(child)\n\t\t\t\telse if (typeof child !== 'string') simple = false\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child\n\t\t\t}\n\t\t\telse if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child]\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child)\n\t\t\t}\n\n\t\t\tlastSimple = simple\n\t\t}\n\t}\n\n\tlet p = new VNode()\n\tp.nodeName = nodeName\n\tp.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n\tp.key = attributes == null ? undefined : attributes.key\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p)\n\n\treturn p\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\tif (\n\t// No Reflect, no classes, no need for shim because native custom elements\n\t// require ES2015 classes or Reflect.\n\t\twindow.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\t) {\n\t\treturn\n\t}\n\tconst BuiltInHTMLElement = HTMLElement\n\twindow.HTMLElement = function HTMLElement() {\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n\t}\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\n\tHTMLElement.prototype.constructor = HTMLElement\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/*\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\n */\nwindow.requestIdleCallback = window.requestIdleCallback ||\n\tfunction (cb) {\n\t\treturn setTimeout(function () {\n\t\t\tvar start = Date.now();\n\t\t\tcb({\n\t\t\t\tdidTimeout: false,\n\t\t\t\ttimeRemaining: function () {\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\n\t\t\t\t}\n\t\t\t});\n\t\t}, 1);\n\t}\n\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\n\tfunction (id) {\n\t\tclearTimeout(id);\n\t} \n\nexport function cssToDom(css) {\n\tconst node = document.createElement('style')\n\tnode.innerText = css\n\treturn node\n}\n\n\nexport function npn(str) {\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\n\t\treturn $1.toUpperCase()\n\t})\n}\n\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i]\n\treturn 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\tif (ref!=null) {\n\t\tif (typeof ref=='function') ref(value)\n\t\telse ref.current = value\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\n\nexport function isArray(obj){\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props){\n\tif (!props || isArray(props)) return {}\n\tconst result = {}\n\tObject.keys(props).forEach(key =>{\n\t\tresult[key] = props[key].value\n\t})\n\treturn result\n}\n","import { extend } from '../util'\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\n\tprops.children = vnode.children\n\n\tlet defaultProps = vnode.nodeName.defaultProps\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\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 {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\n\tnode.normalizedNodeName = nodeName\n\treturn node\n}\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\tlet parentNode = node.parentNode\n\tif (parentNode) parentNode.removeChild(node)\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null)\n\t\tapplyRef(value, node)\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || ''\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || ''\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || ''\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\n\t\tname = name.toLowerCase().substring(2)\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\n\t\t\telse node.removeAttribute(name)\n\t\t}\n\t\telse if (typeof value === 'string') {\n\t\t\tif (ns) {\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\n\t\t\t} else {\n\t\t\t\tnode.setAttribute(name, value)\n\t\t\t}\n\t\t}\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\n}","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn } 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\n\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\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\t\n\t}\n\n\treturn ret\n}\n\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode)\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\t\t\t\trecollectNodeTree(dom, true)\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true\n\n\t\treturn out\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName\n\t\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName)\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode)\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true)\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {}\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0]\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props)\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode\n\n\treturn out\n}\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\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i= Object.keys(pre).length){\n for (let key in pre) {\n const currentValue = current[key]\n if (currentValue === undefined) {\n current[key] = null\n } else {\n syncKeys(currentValue, pre[key])\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\n if (current.length >= pre.length) {\n pre.forEach((item, index) => {\n syncKeys(current[index], item)\n })\n }\n }\n}\n\nfunction _diff(current, pre, path, result) {\n if (current === pre) return\n const rootCurrentType = type(current)\n const rootPreType = type(pre)\n if (rootCurrentType == OBJECTTYPE) {\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\n setResult(result, path, current)\n } else {\n for (let key in current) {\n const currentValue = current[key]\n const preValue = pre[key]\n const currentType = type(currentValue)\n const preType = type(preValue)\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\n if (currentValue != pre[key]) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n }\n } else if (currentType == ARRAYTYPE) {\n if (preType != ARRAYTYPE) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n if (currentValue.length < preValue.length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n currentValue.forEach((item, index) => {\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\n })\n }\n }\n } else if (currentType == OBJECTTYPE) {\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n for (let subKey in currentValue) {\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\n }\n }\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE) {\n if (rootPreType != ARRAYTYPE) {\n setResult(result, path, current)\n } else {\n if (current.length < pre.length) {\n setResult(result, path, current)\n } else {\n current.forEach((item, index) => {\n _diff(item, pre[index], path + '[' + index + ']', result)\n })\n }\n }\n } else {\n setResult(result, path, current)\n }\n}\n\nfunction setResult(result, k, v) {\n if (type(v) != FUNCTIONTYPE) {\n result[k] = v\n }\n}\n\nfunction type(obj) {\n return Object.prototype.toString.call(obj)\n}","import { diff } from './vdom/diff'\nimport jsonDiff from './json-diff'\n\nconst list = []\nlet tick = false\n\nexport function render(vnode, parent, store) {\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\n\tif(store){\n\t\tstore.instances = []\n\t\textendStoreUpate(store)\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\n }\n parent.store = store\n diff(null, vnode, {}, false, parent, false)\n list.push(store)\n\n if(store && !tick){\n requestIdleCallback(execTask)\n tick = true\n }\n \n function execTask(deadline){\n while (deadline.timeRemaining() > 0){\n list.forEach(currentStore => {\n currentStore.update()\n })\n }\n setTimeout(function(){\n requestIdleCallback(execTask)\n },200)\n \n }\n} \n\nfunction extendStoreUpate(store){\n\tstore.update = function(){\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\n\t\tif (Object.keys(diffResult)[0] == '') {\n\t\t\tdiffResult = diffResult['']\n\t\t}\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\n\t\tif (Object.keys(diffResult).length > 0) {\n\t\t\tthis.instances.forEach(instance => {\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\n\t\t\t\t\tinstance.update()\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.onChange && this.onChange(diffResult)\n\t\t\tfor (let key in diffResult) {\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction matchGlobalData(globalData, diffResult) {\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\nfunction 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\nfunction updateByPath(origin, path, value) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}","const OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n\tcustomElements.define(name, ctor)\n\tif (ctor.data && !ctor.pure) {\n\t\tctor.updatePath = getUpdatePath(ctor.data)\n\t}\n}\n\nexport function getUpdatePath(data) {\n\tconst result = {}\n\tdataToPath(data, result)\n\treturn result\n}\n\nfunction dataToPath(data, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[key] = true\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], key, result)\n\t\t}\n\t})\n}\n\nfunction _objToPath(data, path, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[path + '.' + key] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], path + '.' + key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\n\t\t}\n\t})\n}\n\nfunction _arrayToPath(data, path, result) {\n\tdata.forEach((item, index) => {\n\t\tresult[path + '[' + index + ']'] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(item)\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\n\t\t}\n\t})\n}","function getGlobal() {\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t} else if (typeof global !== 'undefined') {\n\t\t\treturn global\n\t\t}\n\t\treturn (function(){\n\t\t\treturn this\n\t\t})()\n\t\t\n\t}\n\treturn global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n\t\n\troot: getGlobal()\n\t//componentChange(component, element) { },\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n\t *\t@name syncComponentUpdates\n\t *\t@type Boolean\n\t *\t@default true\n\t */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n\t */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t//afterMount(component) { },\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t//afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n\treturn function (target) {\n\t\ttarget.pure = pure\n\t\tdefine(name, target)\n\t}\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'\n\noptions.root.Omi = {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\noptions.root.Omi.version = '4.0.1'\n\nexport default {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\nexport {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n"]} \ No newline at end of file diff --git a/packages/omi-ie11/dist/omi.min.js b/packages/omi-ie11/dist/omi.min.js index 1ecd04337..563e43596 100644 --- a/packages/omi-ie11/dist/omi.min.js +++ b/packages/omi-ie11/dist/omi.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function e(){}function t(t,n){var o,r,i,l,a=U;for(l=arguments.length;l-- >2;)R.push(arguments[l]);n&&null!=n.children&&(R.length||R.push(n.children),delete n.children);while(R.length)if((r=R.pop())&&void 0!==r.pop)for(l=r.length;l--;)R.push(r[l]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof t)&&(null==r?r="":"number"==typeof r?r+="":"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===U?a=[r]:a.push(r),o=i;var c=new e;return c.nodeName=t,c.children=a,c.attributes=null==n?void 0:n,c.key=null==n?void 0:n.key,void 0!==q.vnode&&q.vnode(c),c}function n(e){var t=document.createElement("style");return t.innerText=e,t}function o(e){return e.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})}function r(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}function i(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e){if(!e||i(e))return{};var t={};return Object.keys(e).forEach(function(n){t[n]=e[n].value}),t}function a(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&c(e,t.nodeName):n||e._componentConstructor===t.nodeName}function c(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.__n=e,n}function u(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,t,n,o,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)r(n,null),r(o,e);else if("class"!==t||i)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var l in n)l in o||(e.style[l]="");for(var l in o)e.style[l]="number"==typeof o[l]&&!1===J.test(l)?o[l]+"px":o[l]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var a=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,p,a):e.removeEventListener(t,p,a),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!i&&t in e){try{e[t]=null==o?"":o}catch(e){}null!=o&&!1!==o||"spellcheck"==t||e.removeAttribute(t)}else{var c=i&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?c?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"string"==typeof o&&(c?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function p(e){return this.__l[e.type](q.event&&q.event(e)||e)}function d(e,t,n,o,r,i){W++||(F=null!=r&&void 0!==r.ownerSVGElement,$=null!=e&&!("__preactattr_"in e));var l=h(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--W||($=!1),l}function h(e,t,n,o,r){var i=e,l=F;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0))),i.t=!0,i;var a=t.nodeName;if(F="svg"===a||"foreignObject"!==a&&F,a+="",(!e||!c(e,a))&&(i=s(a,F),e)){while(e.firstChild)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),y(e,!0)}var u=i.firstChild,f=i.t,p=t.children;if(null==f){f=i.t={};for(var d=i.attributes,h=d.length;h--;)f[d[h].name]=d[h].value}return!$&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&b(i,p,n,o,$||null!=f.dangerouslySetInnerHTML),g(i,t.attributes,f),F=l,i}function b(e,t,n,o,r){var i,l,c,s,f,p=e.childNodes,d=[],b={},v=0,g=0,m=p.length,w=0,j=t?t.length:0;if(0!==m)for(var O=0;O=Object.keys(t).length)for(var r in t){var i=e[r];void 0===i?e[r]=null:C(i,t[r])}}else"[object Array]"==n&&"[object Array]"==o&&e.length>=t.length&&t.forEach(function(t,n){C(e[n],t)})}}function k(e,t,n,o){if(e!==t){var r=_(e),i=_(t);if("[object Object]"==r)if("[object Object]"!=i||Object.keys(e).length0)n.update();setTimeout(function(){requestIdleCallback(o)},200)}t="string"==typeof t?document.querySelector(t):t,n&&(n.instances=[],T(n),q.store=n,n.originData=JSON.parse(JSON.stringify(n.data))),d(null,e,{},!1,t,!1),n&&requestIdleCallback(o)}function T(e){e.update=function(){var e=this,t=O(this.data,this.originData);""==Object.keys(t)[0]&&(t=t[""]);var n=S(this.globalData,t);if(Object.keys(t).length>0){this.instances.forEach(function(o){(n||e.updateAll||o.constructor.updatePath&&x(t,o.constructor.updatePath))&&o.update()}),this.onChange&&this.onChange(t);for(var o in t)L(this.originData,o,"object"==typeof t[o]?JSON.parse(JSON.stringify(t[o])):t[o])}}}function S(e,t){if(!e)return!1;for(var n in t){if(e.indexOf(n)>-1)return!0;for(var o=0,r=e.length;o2;)R.push(arguments[l]);n&&null!=n.children&&(R.length||R.push(n.children),delete n.children);while(R.length)if((r=R.pop())&&void 0!==r.pop)for(l=r.length;l--;)R.push(r[l]);else"boolean"==typeof r&&(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r+="":"string"!=typeof r&&(i=!1)),i&&o?a[a.length-1]+=r:a===U?a=[r]:a.push(r),o=i;var c=new t;return c.nodeName=e,c.children=a,c.attributes=null==n?void 0:n,c.key=null==n?void 0:n.key,void 0!==q.vnode&&q.vnode(c),c}function n(t){var e=document.createElement("style");return e.innerText=t,e}function o(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})}function r(t,e){null!=t&&("function"==typeof t?t(e):t.current=e)}function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function l(t){if(!t||i(t))return{};var e={};return Object.keys(t).forEach(function(n){e[n]=t[n].value}),e}function a(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&c(t,e.nodeName):n||t._componentConstructor===e.nodeName}function c(t,e){return t.__n===e||t.nodeName.toLowerCase()===e.toLowerCase()}function s(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.__n=t,n}function u(t){var e=t.parentNode;e&&e.removeChild(t)}function f(t,e,n,o,i){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)r(n,null),r(o,t);else if("class"!==e||i)if("style"===e){if(o&&"string"!=typeof o&&"string"!=typeof n||(t.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var l in n)l in o||(t.style[l]="");for(var l in o)t.style[l]="number"==typeof o[l]&&!1===J.test(l)?o[l]+"px":o[l]}}else if("dangerouslySetInnerHTML"===e)o&&(t.innerHTML=o.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),o?n||t.addEventListener(e,p,a):t.removeEventListener(e,p,a),(t.__l||(t.__l={}))[e]=o}else if("list"!==e&&"type"!==e&&!i&&e in t){try{t[e]=null==o?"":o}catch(t){}null!=o&&!1!==o||"spellcheck"==e||t.removeAttribute(e)}else{var c=i&&e!==(e=e.replace(/^xlink:?/,""));null==o||!1===o?c?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"string"==typeof o&&(c?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),o):t.setAttribute(e,o))}else t.className=o||""}function p(t){return this.__l[t.type](q.event&&q.event(t)||t)}function d(t,e,n,o,r,i){W++||(F=null!=r&&void 0!==r.ownerSVGElement,$=null!=t&&!("__preactattr_"in t));var l=h(t,e,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--W||($=!1),l}function h(t,e,n,o,r){var i=t,l=F;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||r)?t.nodeValue!=e&&(t.nodeValue=e):(i=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(i,t),y(t,!0))),i.t=!0,i;var a=e.nodeName;if(F="svg"===a||"foreignObject"!==a&&F,a+="",(!t||!c(t,a))&&(i=s(a,F),t)){while(t.firstChild)i.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(i,t),y(t,!0)}var u=i.firstChild,f=i.t,p=e.children;if(null==f){f=i.t={};for(var d=i.attributes,h=d.length;h--;)f[d[h].name]=d[h].value}return!$&&p&&1===p.length&&"string"==typeof p[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=p[0]&&(u.nodeValue=p[0]):(p&&p.length||null!=u)&&b(i,p,n,o,$||null!=f.dangerouslySetInnerHTML),g(i,e.attributes,f),F=l,i}function b(t,e,n,o,r){var i,l,c,s,f,p=t.childNodes,d=[],b={},v=0,g=0,m=p.length,w=0,j=e?e.length:0;if(0!==m)for(var O=0;O=Object.keys(e).length)for(var r in e){var i=t[r];void 0===i?t[r]=null:C(i,e[r])}}else"[object Array]"==n&&"[object Array]"==o&&t.length>=e.length&&e.forEach(function(e,n){C(t[n],e)})}}function E(t,e,n,o){if(t!==e){var r=N(t),i=N(e);if("[object Object]"==r)if("[object Object]"!=i||Object.keys(t).length0)B.forEach(function(t){t.update()});setTimeout(function(){requestIdleCallback(o)},200)}e="string"==typeof e?document.querySelector(e):e,n&&(n.instances=[],T(n),n.originData=JSON.parse(JSON.stringify(n.data))),e.store=n,d(null,t,{},!1,e,!1),B.push(n),n&&!G&&(requestIdleCallback(o),G=!0)}function T(t){t.update=function(){var t=this,e=O(this.data,this.originData);""==Object.keys(e)[0]&&(e=e[""]);var n=S(this.globalData,e);if(Object.keys(e).length>0){this.instances.forEach(function(o){(n||t.updateAll||o.constructor.updatePath&&x(e,o.constructor.updatePath))&&o.update()}),this.onChange&&this.onChange(e);for(var o in e)L(this.originData,o,"object"==typeof e[o]?JSON.parse(JSON.stringify(e[o])):e[o])}}}function S(t,e){if(!t)return!1;for(var n in e){if(t.indexOf(n)>-1)return!0;for(var o=0,r=t.length;o 2;) {\r\n\t\tstack.push(arguments[i])\r\n\t}\r\n\tif (attributes && attributes.children != null) {\r\n\t\tif (!stack.length) stack.push(attributes.children)\r\n\t\tdelete attributes.children\r\n\t}\r\n\twhile (stack.length) {\r\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\r\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif (typeof child === 'boolean') child = null\r\n\r\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\r\n\t\t\t\tif (child == null) child = ''\r\n\t\t\t\telse if (typeof child === 'number') child = String(child)\r\n\t\t\t\telse if (typeof child !== 'string') simple = false\r\n\t\t\t}\r\n\r\n\t\t\tif (simple && lastSimple) {\r\n\t\t\t\tchildren[children.length - 1] += child\r\n\t\t\t}\r\n\t\t\telse if (children === EMPTY_CHILDREN) {\r\n\t\t\t\tchildren = [child]\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tchildren.push(child)\r\n\t\t\t}\r\n\r\n\t\t\tlastSimple = simple\r\n\t\t}\r\n\t}\r\n\r\n\tlet p = new VNode()\r\n\tp.nodeName = nodeName\r\n\tp.children = children\r\n\tp.attributes = attributes == null ? undefined : attributes\r\n\tp.key = attributes == null ? undefined : attributes.key\r\n\r\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\r\n\tif (options.vnode !== undefined) options.vnode(p)\r\n\r\n\treturn p\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\tif (\r\n\t// No Reflect, no classes, no need for shim because native custom elements\r\n\t// require ES2015 classes or Reflect.\r\n\t\twindow.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\t) {\r\n\t\treturn\r\n\t}\r\n\tconst BuiltInHTMLElement = HTMLElement\r\n\twindow.HTMLElement = function HTMLElement() {\r\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\r\n\t}\r\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\r\n\tHTMLElement.prototype.constructor = HTMLElement\r\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\r\n})()\r\n\r\n/*\r\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\r\n */\r\nwindow.requestIdleCallback = window.requestIdleCallback ||\r\n\tfunction (cb) {\r\n\t\treturn setTimeout(function () {\r\n\t\t\tvar start = Date.now();\r\n\t\t\tcb({\r\n\t\t\t\tdidTimeout: false,\r\n\t\t\t\ttimeRemaining: function () {\r\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}, 1);\r\n\t}\r\n\r\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\r\n\tfunction (id) {\r\n\t\tclearTimeout(id);\r\n\t} \r\n\r\nexport function cssToDom(css) {\r\n\tconst node = document.createElement('style')\r\n\tnode.innerText = css\r\n\treturn node\r\n}\r\n\r\n\r\nexport function npn(str) {\r\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\r\n\t\treturn $1.toUpperCase()\r\n\t})\r\n}\r\n\r\nexport function extend(obj, props) {\r\n\tfor (let i in props) obj[i] = props[i]\r\n\treturn 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\tif (ref!=null) {\r\n\t\tif (typeof ref=='function') ref(value)\r\n\t\telse ref.current = value\r\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\r\n\r\nexport function isArray(obj){\r\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\r\n}\r\n\r\nexport function nProps(props){\r\n\tif (!props || isArray(props)) return {}\r\n\tconst result = {}\r\n\tObject.keys(props).forEach(key =>{\r\n\t\tresult[key] = props[key].value\r\n\t})\r\n\treturn result\r\n}\r\n","import { extend } from '../util'\r\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\t\treturn node.splitText!==undefined\r\n\t}\r\n\tif (typeof vnode.nodeName==='string') {\r\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\r\n\t}\r\n\treturn hydrating || node._componentConstructor===vnode.nodeName\r\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\r\n\tprops.children = vnode.children\r\n\r\n\tlet defaultProps = vnode.nodeName.defaultProps\r\n\tif (defaultProps!==undefined) {\r\n\t\tfor (let i in defaultProps) {\r\n\t\t\tif (props[i]===undefined) {\r\n\t\t\t\tprops[i] = defaultProps[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 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 * A DOM event listener\r\n * @typedef {(e: Event) => void} EventListner\r\n */\r\n\r\n/**\r\n * A mapping of event types to event listeners\r\n * @typedef {Object.} EventListenerMap\r\n */\r\n\r\n/**\r\n * Properties Preact adds to elements it creates\r\n * @typedef PreactElementExtensions\r\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\r\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\r\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\r\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\r\n */\r\n\r\n/**\r\n * A DOM element that has been extended with Preact properties\r\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\r\n */\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 {PreactElement} The created DOM node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\t/** @type {PreactElement} */\r\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\r\n\tnode.normalizedNodeName = nodeName\r\n\treturn node\r\n}\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\tlet parentNode = node.parentNode\r\n\tif (parentNode) parentNode.removeChild(node)\r\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\r\n\r\n\r\n\tif (name==='key') {\r\n\t\t// ignore\r\n\t}\r\n\telse if (name==='ref') {\r\n\t\tapplyRef(old, null)\r\n\t\tapplyRef(value, node)\r\n\t}\r\n\telse if (name==='class' && !isSvg) {\r\n\t\tnode.className = value || ''\r\n\t}\r\n\telse if (name==='style') {\r\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\tnode.style.cssText = value || ''\r\n\t\t}\r\n\t\tif (value && typeof value==='object') {\r\n\t\t\tif (typeof old!=='string') {\r\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\r\n\t\t\t}\r\n\t\t\tfor (let i in value) {\r\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\telse if (name==='dangerouslySetInnerHTML') {\r\n\t\tif (value) node.innerHTML = value.__html || ''\r\n\t}\r\n\telse if (name[0]=='o' && name[1]=='n') {\r\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\r\n\t\tname = name.toLowerCase().substring(2)\r\n\t\tif (value) {\r\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\r\n\t\t}\r\n\t\t(node._listeners || (node._listeners = {}))[name] = value\r\n\t}\r\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\r\n\t\t// Attempt to set a DOM property to the given value.\r\n\t\t// IE & FF throw for certain property-value combinations.\r\n\t\ttry {\r\n\t\t\tnode[name] = value==null ? '' : value\r\n\t\t} catch (e) { }\r\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\r\n\t\t// spellcheck is treated differently than all other boolean values and\r\n\t\t// should not be removed when the value is `false`. See:\r\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\r\n\t\tif (value==null || value===false) {\r\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\r\n\t\t\telse node.removeAttribute(name)\r\n\t\t}\r\n\t\telse if (typeof value === 'string') {\r\n\t\t\tif (ns) {\r\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\r\n\t\t\t} else {\r\n\t\t\t\tnode.setAttribute(name, value)\r\n\t\t\t}\r\n\t\t}\r\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\r\n}","import { ATTR_KEY } from '../constants'\r\nimport { isSameNodeType, isNamedNode } from './index'\r\nimport { createNode, setAccessor } from '../dom/index'\r\nimport { npn } from '../util'\r\nimport { removeNode } from '../dom/index'\r\n\r\n/** Queue of components that have been mounted and are awaiting componentDidMount */\r\nexport const mounts = []\r\n\r\n/** Diff recursion count, used to track the end of the diff cycle. */\r\nexport let diffLevel = 0\r\n\r\n/** Global flag indicating if the diff is currently within an SVG */\r\nlet isSvgMode = false\r\n\r\n/** Global flag indicating if the diff is performing hydration */\r\nlet hydrating = false\r\n\r\n\r\n\r\n\r\n/** Apply differences in a given vnode (and it's deep children) to a real DOM Node.\r\n *\t@param {Element} [dom=null]\t\tA DOM node to mutate into the shape of the `vnode`\r\n *\t@param {VNode} vnode\t\t\tA VNode (with descendants forming a tree) representing the desired DOM structure\r\n *\t@returns {Element} dom\t\t\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\r\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\r\n\tif (!diffLevel++) {\r\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\r\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\r\n\r\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\r\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\r\n\t}\r\n\r\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\r\n\r\n\t// append the element if its a new parent\r\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\r\n\r\n\t// diffLevel being reduced to 0 means we're exiting the diff\r\n\tif (!--diffLevel) {\r\n\t\thydrating = false\r\n\t\t// invoke queued componentDidMount lifecycle methods\r\n\t\t\r\n\t}\r\n\r\n\treturn ret\r\n}\r\n\r\n\r\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\r\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\r\n\tlet out = dom,\r\n\t\tprevSvgMode = isSvgMode\r\n\r\n\t// empty values (null, undefined, booleans) render as empty Text nodes\r\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\r\n\r\n\r\n\t// Fast case: Strings & Numbers create/update Text nodes.\r\n\tif (typeof vnode==='string' || typeof vnode==='number') {\r\n\r\n\t\t// update if it's already a Text node:\r\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\r\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\r\n\t\t\tif (dom.nodeValue!=vnode) {\r\n\t\t\t\tdom.nodeValue = vnode\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\r\n\t\t\tout = document.createTextNode(vnode)\r\n\t\t\tif (dom) {\r\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\t\t\t\trecollectNodeTree(dom, true)\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tout[ATTR_KEY] = true\r\n\r\n\t\treturn out\r\n\t}\r\n\r\n\r\n\t// If the VNode represents a Component, perform a component diff:\r\n\tlet vnodeName = vnode.nodeName\r\n\t\r\n\r\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\r\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\r\n\r\n\r\n\t// If there's no existing element or it's the wrong type, create a new one:\r\n\tvnodeName = String(vnodeName)\r\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\r\n\t\tout = createNode(vnodeName, isSvgMode)\r\n\r\n\t\tif (dom) {\r\n\t\t\t// move children into the replacement node\r\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\r\n\r\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\r\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\r\n\r\n\t\t\t// recycle the old element (skips non-Element node types)\r\n\t\t\trecollectNodeTree(dom, true)\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet fc = out.firstChild,\r\n\t\tprops = out[ATTR_KEY],\r\n\t\tvchildren = vnode.children\r\n\r\n\tif (props==null) {\r\n\t\tprops = out[ATTR_KEY] = {}\r\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\r\n\t}\r\n\r\n\t// Optimization: fast-path for elements containing a single TextNode:\r\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\r\n\t\tif (fc.nodeValue!=vchildren[0]) {\r\n\t\t\tfc.nodeValue = vchildren[0]\r\n\t\t}\r\n\t}\r\n\t// otherwise, if there are existing or new children, diff them:\r\n\telse if (vchildren && vchildren.length || fc!=null) {\r\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\r\n\t}\r\n\r\n\r\n\t// Apply attributes/props from VNode to the DOM Element:\r\n\tdiffAttributes(out, vnode.attributes, props)\r\n\r\n\r\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\r\n\tisSvgMode = prevSvgMode\r\n\r\n\treturn out\r\n}\r\n\r\n\r\n/** Apply child and attribute changes between a VNode and a DOM Node to the DOM.\r\n *\t@param {Element} dom\t\t\tElement whose children should be compared & mutated\r\n *\t@param {Array} vchildren\t\tArray of VNodes to compare to `dom.childNodes`\r\n *\t@param {Object} context\t\t\tImplicitly descendant context object (from most recent `getChildContext()`)\r\n *\t@param {Boolean} mountAll\r\n *\t@param {Boolean} isHydrating\tIf `true`, consumes externally created elements similar to hydration\r\n */\r\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\r\n\tlet originalChildren = dom.childNodes,\r\n\t\tchildren = [],\r\n\t\tkeyed = {},\r\n\t\tkeyedLen = 0,\r\n\t\tmin = 0,\r\n\t\tlen = originalChildren.length,\r\n\t\tchildrenLen = 0,\r\n\t\tvlen = vchildren ? vchildren.length : 0,\r\n\t\tj, c, f, vchild, child\r\n\r\n\t// Build up a map of keyed children and an Array of unkeyed children:\r\n\tif (len!==0) {\r\n\t\tfor (let i=0; i= Object.keys(pre).length){\r\n for (let key in pre) {\r\n const currentValue = current[key]\r\n if (currentValue === undefined) {\r\n current[key] = null\r\n } else {\r\n syncKeys(currentValue, pre[key])\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\r\n if (current.length >= pre.length) {\r\n pre.forEach((item, index) => {\r\n syncKeys(current[index], item)\r\n })\r\n }\r\n }\r\n}\r\n\r\nfunction _diff(current, pre, path, result) {\r\n if (current === pre) return\r\n const rootCurrentType = type(current)\r\n const rootPreType = type(pre)\r\n if (rootCurrentType == OBJECTTYPE) {\r\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\r\n setResult(result, path, current)\r\n } else {\r\n for (let key in current) {\r\n const currentValue = current[key]\r\n const preValue = pre[key]\r\n const currentType = type(currentValue)\r\n const preType = type(preValue)\r\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\r\n if (currentValue != pre[key]) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n }\r\n } else if (currentType == ARRAYTYPE) {\r\n if (preType != ARRAYTYPE) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n if (currentValue.length < preValue.length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n currentValue.forEach((item, index) => {\r\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else if (currentType == OBJECTTYPE) {\r\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\r\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\r\n } else {\r\n for (let subKey in currentValue) {\r\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\r\n }\r\n }\r\n }\r\n }\r\n }\r\n } else if (rootCurrentType == ARRAYTYPE) {\r\n if (rootPreType != ARRAYTYPE) {\r\n setResult(result, path, current)\r\n } else {\r\n if (current.length < pre.length) {\r\n setResult(result, path, current)\r\n } else {\r\n current.forEach((item, index) => {\r\n _diff(item, pre[index], path + '[' + index + ']', result)\r\n })\r\n }\r\n }\r\n } else {\r\n setResult(result, path, current)\r\n }\r\n}\r\n\r\nfunction setResult(result, k, v) {\r\n if (type(v) != FUNCTIONTYPE) {\r\n result[k] = v\r\n }\r\n}\r\n\r\nfunction type(obj) {\r\n return Object.prototype.toString.call(obj)\r\n}","import { cssToDom, nProps } from './util'\r\nimport { diff } from './vdom/diff'\r\nimport options from './options'\r\n\r\nexport default class WeElement extends HTMLElement {\r\n\tconstructor() {\r\n\t\tsuper()\r\n\t\tthis.props = nProps(this.constructor.props)\r\n\t\tthis.data = this.constructor.data || {}\r\n\t}\r\n\r\n\tconnectedCallback() {\r\n\t\tthis.store = options.store\r\n\t\tif (this.store){\r\n\t\t\tthis.store.instances.push(this)\r\n\t\t}\r\n\t\tthis.install()\r\n \r\n\t\tconst shadowRoot = this.attachShadow({ mode: 'open' })\r\n\r\n\t\tthis.css && shadowRoot.appendChild(cssToDom(this.css()))\r\n\t\tthis.host = diff(null, this.render(this.props, (!this.constructor.pure && this.store) ? this.store.data : this.data), {}, false, null, false)\r\n\t\tshadowRoot.appendChild(this.host)\r\n\r\n\t\tthis.installed()\r\n\t}\r\n\r\n\tdisconnectedCallback() {\r\n\t\tthis.uninstall()\r\n\t\tif (this.store) {\r\n\t\t\tfor (let i = 0, len = this.store.instances.length; i < len; i++) {\r\n\t\t\t\tif (this.store.instances[i] === this) {\r\n\t\t\t\t\tthis.store.instances.splice(i, 1)\r\n\t\t\t\t\tbreak\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tupdate() {\r\n\t\tthis.beforeUpdate()\r\n\t\tdiff(this.host, this.render(this.props, (!this.constructor.pure && this.store) ? this.store.data : this.data))\r\n\t\tthis.afterUpdate()\r\n\t}\r\n\r\n\tfire(name, data){\r\n\t\tthis.dispatchEvent(new CustomEvent(name, { detail : data }))\r\n\t}\r\n\r\n\tinstall() {\r\n\r\n\t}\r\n\r\n\tinstalled() {\r\n\r\n\t}\r\n\r\n\tuninstall() {\r\n\r\n\t}\r\n\r\n\tbeforeUpdate() {\r\n\r\n\t}\r\n\r\n\tafterUpdate() {\r\n\r\n\t}\r\n}\r\n","import { diff } from './vdom/diff'\r\nimport options from './options'\r\nimport jsonDiff from './json-diff'\r\n\r\nexport function render(vnode, parent, store) {\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\r\n\tif(store){\r\n\t\tstore.instances = []\r\n\t\textendStoreUpate(store)\r\n\t\toptions.store = store\r\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\r\n\t}\r\n diff(null, vnode, {}, false, parent, false)\r\n \r\n if(store){\r\n requestIdleCallback(execTask)\r\n }\r\n \r\n function execTask(deadline){\r\n while (deadline.timeRemaining() > 0){\r\n store.update()\r\n }\r\n setTimeout(function(){\r\n requestIdleCallback(execTask)\r\n },200)\r\n \r\n }\r\n} \r\n\r\n\r\n\r\nfunction extendStoreUpate(store){\r\n\tstore.update = function(){\r\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\r\n\t\tif (Object.keys(diffResult)[0] == '') {\r\n\t\t\tdiffResult = diffResult['']\r\n\t\t}\r\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\r\n\t\tif (Object.keys(diffResult).length > 0) {\r\n\t\t\tthis.instances.forEach(instance => {\r\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\r\n\t\t\t\t\tinstance.update()\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\tthis.onChange && this.onChange(diffResult)\r\n\t\t\tfor (let key in diffResult) {\r\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction matchGlobalData(globalData, diffResult) {\r\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\r\nfunction 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\nfunction updateByPath(origin, path, value) {\r\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\r\n let current = origin\r\n for (let i = 0, len = arr.length; i < len; i++) {\r\n if (i === len - 1) {\r\n current[arr[i]] = value\r\n } else {\r\n current = current[arr[i]]\r\n }\r\n }\r\n}","const OBJECTTYPE = '[object Object]'\r\nconst ARRAYTYPE = '[object Array]'\r\n\r\nexport function define(name, ctor) {\r\n\tcustomElements.define(name, ctor)\r\n\tif (ctor.data && !ctor.pure) {\r\n\t\tctor.updatePath = getUpdatePath(ctor.data)\r\n\t}\r\n}\r\n\r\nexport function getUpdatePath(data) {\r\n\tconst result = {}\r\n\tdataToPath(data, result)\r\n\treturn result\r\n}\r\n\r\nfunction dataToPath(data, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[key] = true\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _objToPath(data, path, result) {\r\n\tObject.keys(data).forEach(key => {\r\n\t\tresult[path + '.' + key] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(data[key])\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(data[key], path + '.' + key, result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\r\n\t\t}\r\n\t})\r\n}\r\n\r\nfunction _arrayToPath(data, path, result) {\r\n\tdata.forEach((item, index) => {\r\n\t\tresult[path + '[' + index + ']'] = true\r\n\t\tdelete result[path]\r\n\t\tconst type = Object.prototype.toString.call(item)\r\n\t\tif (type === OBJECTTYPE) {\r\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\r\n\t\t} else if (type === ARRAYTYPE) {\r\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\r\n\t\t}\r\n\t})\r\n}","function getGlobal() {\r\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\r\n\t\tif (typeof self !== 'undefined') {\r\n\t\t\treturn self\r\n\t\t} else if (typeof window !== 'undefined') {\r\n\t\t\treturn window\r\n\t\t} else if (typeof global !== 'undefined') {\r\n\t\t\treturn global\r\n\t\t}\r\n\t\treturn (function(){\r\n\t\t\treturn this\r\n\t\t})()\r\n\t\t\r\n\t}\r\n\treturn 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\r\n\tstore: null,\r\n\t\r\n\troot: getGlobal()\r\n\t//componentChange(component, element) { },\r\n\t/** If `true`, `prop` changes trigger synchronous component updates.\r\n\t *\t@name syncComponentUpdates\r\n\t *\t@type Boolean\r\n\t *\t@default true\r\n\t */\r\n\t//syncComponentUpdates: true,\r\n\r\n\t/** Processes all created VNodes.\r\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\r\n\t */\r\n\t//vnode(vnode) { }\r\n\r\n\t/** Hook invoked after a component is mounted. */\r\n\t//afterMount(component) { },\r\n\r\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\r\n\t//afterUpdate(component) { }\r\n\r\n\t/** Hook invoked immediately before a component is unmounted. */\r\n\t// beforeUnmount(component) { }\r\n}\r\n","import { define } from './define'\r\n\r\nexport function tag(name, pure) {\r\n\treturn function (target) {\r\n\t\ttarget.pure = pure\r\n\t\tdefine(name, target)\r\n\t}\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\n\r\noptions.root.Omi = {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\noptions.root.Omi.version = '4.0.1'\r\n\r\nexport default {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n\r\nexport {\r\n\ttag,\r\n\tWeElement,\r\n\trender,\r\n\th,\r\n\tcreateElement,\r\n\toptions,\r\n\tdefine\r\n}\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/json-diff.js","../src/we-element.js","../src/render.js","../src/define.js","../src/options.js","../src/tag.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","String","p","key","options","vnode","cssToDom","css","node","document","createElement","innerText","npn","str","replace","$","$1","toUpperCase","applyRef","ref","value","current","isArray","obj","Object","prototype","toString","call","nProps","props","result","keys","forEach","isSameNodeType","hydrating","_componentConstructor","removeNode","name","isSvg","old","style","cssText","IS_NON_DIMENSIONAL","test","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","e","removeAttribute","ns","removeAttributeNS","toLowerCase","setAttribute","className","isSvgMode","dom","context","mountAll","ret","idiff","componentRoot","diffLevel","out","splitText","parentNode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","createNode","t","vchildren","firstChild","fc","a","nextSibling","innerDiffNode","dangerouslySetInnerHTML","prevSvgMode","min","len","childrenLen","vlen","j","keyedLen","originalChildren","keyed","vchild","_child","__key","trim","isHydrating","c","f","appendChild","unmountOnly","removeChildren","update","attrs","setAccessor","isWeElement","_possibleConstructorReturn","self","ReferenceError","ARRAYTYPE","HTMLElement","type","syncKeys","pre","_diff","rootPreType","currentValue","rootCurrentType","item","index","setResult","path","OBJECTTYPE","preValue","currentType","subKey","k","v","diff","execTask","deadline","list","store","timeRemaining","currentStore","setTimeout","parent","querySelector","instances","originData","JSON","parse","stringify","data","render","extendStoreUpate","this","diffResult","diff$1","globalData","instance","jsonDiff","onChange","updateAll","matchGlobalData","updateByPath","indexOf","keyA","needUpdate","includePath","updatePath","keyB","pathA","pathB","next","substr","arr","split","origin","ctor","pure","dataToPath","getUpdatePath","_objToPath","_arrayToPath","target","define","root","global","Math","Array","window","Reflect","customElements","hasOwnProperty","BuiltInHTMLElement","construct","constructor","setPrototypeOf","requestIdleCallback","cb","start","Date","now","didTimeout","max","cancelIdleCallback","id","clearTimeout","Promise","resolve","then","bind","_listeners","WeElement","_this","install","shadowRoot","attachShadow","mode","installed","disconnectedCallback","uninstall","splice","beforeUpdate","host","fire","afterUpdate","CustomEvent","detail","tick","Omi","tag","h"],"mappings":"wBACO,SAASA,MCKT,QAAWC,GAAAA,EAAUC,GAC3B,GAA+BC,GAAYC,EAAOC,EAAQC,EAAtDC,EAAWC,CACf,KAAKF,EAAIG,UAAUC,OAAQJ,KAAM,GAChCK,EAAMC,KAAKH,UAAUH,GAElBJ,IAAqC,MAAvBA,EAAWK,WACvBI,EAAMD,QAAQC,EAAMC,KAAKV,EAAWK,gBAClCL,GAAWK,SAEnB,OAAOI,EAAMD,OACZ,IAAKN,EAAQO,EAAME,YAAAA,KAAUT,EAAMS,IAClC,IAAKP,EAAIF,EAAMM,OAAQJ,KAAMK,EAAMC,KAAKR,EAAME,QAGzB,iBAAVF,KAAqBA,EAAQ,OAEnCC,EAA6B,kBAAbJ,MACP,MAATG,EAAeA,EAAQ,GACD,gBAAVA,GAAoBA,GAAQU,GAClB,gBAAVV,KAAoBC,GAAAA,IAGjCA,GAAUF,EACbI,EAASA,EAASG,OAAS,IAAMN,EAEzBG,IAAaC,EACrBD,GAAYH,GAGZG,EAASK,KAAKR,GAGfD,EAAaE,CAIf,IAAIU,GAAI,GAAIf,EASZ,OARAe,GAAEd,SAAWA,EACbc,EAAER,SAAWA,EACbQ,EAAEb,WAA2B,MAAdA,MAAAA,GAAiCA,EAChDa,EAAEC,IAAoB,MAAdd,MAAAA,GAAiCA,EAAWc,QAGpD,KAAIC,EAAQC,OAAqBD,EAAQC,MAAMH,GAExCA,ECOD,QAASI,GAATC,GACN,GAAMC,GAAOC,SAASC,cAAc,QAEpC,OADAF,GAAKG,UAAYJ,EACVC,EAID,QAAAI,GAAAC,GACN,MAAOA,GAAIC,QAAQ,SAAU,SAACC,EAAGC,GAChC,MAAOA,GAAGC,gBAaL,QAASC,GAATC,EAAuBC,GACpB,MAALD,IACa,kBAALA,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sL,OAAA5E,kBAGDyE,QAAAA,aAECZ,EAAAnL,UAAAyL,UAAA,yBAEDJ,UAAAA,yBAIAI,aAAAA,yBAIAE,YAAAA,6BD+BOtL,KACH8L,GAAAA,CG7CFxN,GAAA6K,KAAA4C,KACDC,IATDA,EAUAlB,UAAAA,eEjDAlM,cAAOqN,EACNhD,QAAOL,EACPM,OAAO3I,6BCGRyL,IAAAA,IACAlB,IAAAA,EACA5D,UAAAA,EACA+E,OAJkB/E,EAKlBtI,EAAAA,EACAN,cAAAA,EACA4K,QAAAA,EAPDA,OAAAA","file":"omi.min.js","sourcesContent":["/** Virtual DOM Node */\nexport function VNode() {}\n","import { VNode } from './vnode'\nimport options from './options'\n\nconst stack = []\nconst EMPTY_CHILDREN = []\n\nexport function h(nodeName, attributes) {\n\tlet children = EMPTY_CHILDREN, lastSimple, child, simple, i\n\tfor (i = arguments.length; i-- > 2;) {\n\t\tstack.push(arguments[i])\n\t}\n\tif (attributes && attributes.children != null) {\n\t\tif (!stack.length) stack.push(attributes.children)\n\t\tdelete attributes.children\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop !== undefined) {\n\t\t\tfor (i = child.length; i--;) stack.push(child[i])\n\t\t}\n\t\telse {\n\t\t\tif (typeof child === 'boolean') child = null\n\n\t\t\tif ((simple = typeof nodeName !== 'function')) {\n\t\t\t\tif (child == null) child = ''\n\t\t\t\telse if (typeof child === 'number') child = String(child)\n\t\t\t\telse if (typeof child !== 'string') simple = false\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length - 1] += child\n\t\t\t}\n\t\t\telse if (children === EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child]\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child)\n\t\t\t}\n\n\t\t\tlastSimple = simple\n\t\t}\n\t}\n\n\tlet p = new VNode()\n\tp.nodeName = nodeName\n\tp.children = children\n\tp.attributes = attributes == null ? undefined : attributes\n\tp.key = attributes == null ? undefined : attributes.key\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode !== undefined) options.vnode(p)\n\n\treturn p\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\tif (\n\t// No Reflect, no classes, no need for shim because native custom elements\n\t// require ES2015 classes or Reflect.\n\t\twindow.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\t) {\n\t\treturn\n\t}\n\tconst BuiltInHTMLElement = HTMLElement\n\twindow.HTMLElement = function HTMLElement() {\n\t\treturn Reflect.construct(BuiltInHTMLElement, [], this.constructor)\n\t}\n\tHTMLElement.prototype = BuiltInHTMLElement.prototype\n\tHTMLElement.prototype.constructor = HTMLElement\n\tObject.setPrototypeOf(HTMLElement, BuiltInHTMLElement)\n})()\n\n/*\n * @see https://developers.google.com/web/updates/2015/08/using-requestidlecallback\n */\nwindow.requestIdleCallback = window.requestIdleCallback ||\n\tfunction (cb) {\n\t\treturn setTimeout(function () {\n\t\t\tvar start = Date.now();\n\t\t\tcb({\n\t\t\t\tdidTimeout: false,\n\t\t\t\ttimeRemaining: function () {\n\t\t\t\t\treturn Math.max(0, 50 - (Date.now() - start));\n\t\t\t\t}\n\t\t\t});\n\t\t}, 1);\n\t}\n\nwindow.cancelIdleCallback = window.cancelIdleCallback ||\n\tfunction (id) {\n\t\tclearTimeout(id);\n\t} \n\nexport function cssToDom(css) {\n\tconst node = document.createElement('style')\n\tnode.innerText = css\n\treturn node\n}\n\n\nexport function npn(str) {\n\treturn str.replace(/-(\\w)/g, ($, $1) => {\n\t\treturn $1.toUpperCase()\n\t})\n}\n\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i]\n\treturn 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\tif (ref!=null) {\n\t\tif (typeof ref=='function') ref(value)\n\t\telse ref.current = value\n\t}\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 = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout\n\nexport function isArray(obj){\n\treturn Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nexport function nProps(props){\n\tif (!props || isArray(props)) return {}\n\tconst result = {}\n\tObject.keys(props).forEach(key =>{\n\t\tresult[key] = props[key].value\n\t})\n\treturn result\n}\n","import { extend } from '../util'\n\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\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName)\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName\n}\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\treturn node.normalizedNodeName===nodeName || 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\tlet props = extend({}, vnode.attributes)\n\tprops.children = vnode.children\n\n\tlet defaultProps = vnode.nodeName.defaultProps\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props\n}\n","import { IS_NON_DIMENSIONAL } from '../constants'\nimport { applyRef } from '../util'\nimport options from '../options'\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\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 {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName)\n\tnode.normalizedNodeName = nodeName\n\treturn node\n}\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\tlet parentNode = node.parentNode\n\tif (parentNode) parentNode.removeChild(node)\n}\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 {PreactElement} 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\tif (name==='className') name = 'class'\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null)\n\t\tapplyRef(value, node)\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || ''\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || ''\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = ''\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i]\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || ''\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''))\n\t\tname = name.toLowerCase().substring(2)\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture)\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name)\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')))\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase())\n\t\t\telse node.removeAttribute(name)\n\t\t}\n\t\telse if (typeof value === 'string') {\n\t\t\tif (ns) {\n\t\t\t\tnode.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value)\n\t\t\t} else {\n\t\t\t\tnode.setAttribute(name, value)\n\t\t\t}\n\t\t}\n\t}\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\treturn this._listeners[e.type](options.event && options.event(e) || e)\n}","import { ATTR_KEY } from '../constants'\nimport { isSameNodeType, isNamedNode } from './index'\nimport { createNode, setAccessor } from '../dom/index'\nimport { npn } 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\n\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\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom)\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot)\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret)\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\t\n\t}\n\n\treturn ret\n}\n\n\n/** Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing. */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = ''\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode)\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\t\t\t\trecollectNodeTree(dom, true)\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true\n\n\t\treturn out\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName\n\t\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName)\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode)\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild)\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom)\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true)\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {}\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0]\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null)\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props)\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode\n\n\treturn out\n}\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\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i= Object.keys(pre).length){\n for (let key in pre) {\n const currentValue = current[key]\n if (currentValue === undefined) {\n current[key] = null\n } else {\n syncKeys(currentValue, pre[key])\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE && rootPreType == ARRAYTYPE) {\n if (current.length >= pre.length) {\n pre.forEach((item, index) => {\n syncKeys(current[index], item)\n })\n }\n }\n}\n\nfunction _diff(current, pre, path, result) {\n if (current === pre) return\n const rootCurrentType = type(current)\n const rootPreType = type(pre)\n if (rootCurrentType == OBJECTTYPE) {\n if (rootPreType != OBJECTTYPE || Object.keys(current).length < Object.keys(pre).length) {\n setResult(result, path, current)\n } else {\n for (let key in current) {\n const currentValue = current[key]\n const preValue = pre[key]\n const currentType = type(currentValue)\n const preType = type(preValue)\n if (currentType != ARRAYTYPE && currentType != OBJECTTYPE) {\n if (currentValue != pre[key]) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n }\n } else if (currentType == ARRAYTYPE) {\n if (preType != ARRAYTYPE) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n if (currentValue.length < preValue.length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n currentValue.forEach((item, index) => {\n _diff(item, preValue[index], (path == '' ? '' : path + \".\") + key + '[' + index + ']', result)\n })\n }\n }\n } else if (currentType == OBJECTTYPE) {\n if (preType != OBJECTTYPE || Object.keys(currentValue).length < Object.keys(preValue).length) {\n setResult(result, (path == '' ? '' : path + \".\") + key, currentValue)\n } else {\n for (let subKey in currentValue) {\n _diff(currentValue[subKey], preValue[subKey], (path == '' ? '' : path + \".\") + key + '.' + subKey, result)\n }\n }\n }\n }\n }\n } else if (rootCurrentType == ARRAYTYPE) {\n if (rootPreType != ARRAYTYPE) {\n setResult(result, path, current)\n } else {\n if (current.length < pre.length) {\n setResult(result, path, current)\n } else {\n current.forEach((item, index) => {\n _diff(item, pre[index], path + '[' + index + ']', result)\n })\n }\n }\n } else {\n setResult(result, path, current)\n }\n}\n\nfunction setResult(result, k, v) {\n if (type(v) != FUNCTIONTYPE) {\n result[k] = v\n }\n}\n\nfunction type(obj) {\n return Object.prototype.toString.call(obj)\n}","import { cssToDom, nProps } from './util'\nimport { diff } from './vdom/diff'\n\nexport default class WeElement extends HTMLElement {\n\tconstructor() {\n\t\tsuper()\n\t\tthis.props = nProps(this.constructor.props)\n\t\tthis.data = this.constructor.data || {}\n\t}\n\n\tconnectedCallback() {\n\t\tif (!this.constructor.pure) {\n\t\t\tlet p = this.parentNode\n\t\t\twhile (p && !this.store) {\n\t\t\t\tthis.store = p.store\n\t\t\t\tp = p.parentNode || p.host\n\t\t\t}\n\t\t\tif (this.store) {\n\t\t\t\tthis.store.instances.push(this)\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.install()\n \n\t\tconst shadowRoot = this.attachShadow({ mode: 'open' })\n\n\t\tthis.css && shadowRoot.appendChild(cssToDom(this.css()))\n\t\tthis.host = diff(null, this.render(this.props, (!this.constructor.pure && this.store) ? this.store.data : this.data), {}, false, null, false)\n\t\tshadowRoot.appendChild(this.host)\n\n\t\tthis.installed()\n\t}\n\n\tdisconnectedCallback() {\n\t\tthis.uninstall()\n\t\tif (this.store) {\n\t\t\tfor (let i = 0, len = this.store.instances.length; i < len; i++) {\n\t\t\t\tif (this.store.instances[i] === this) {\n\t\t\t\t\tthis.store.instances.splice(i, 1)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tupdate() {\n\t\tthis.beforeUpdate()\n\t\tdiff(this.host, this.render(this.props, (!this.constructor.pure && this.store) ? this.store.data : this.data))\n\t\tthis.afterUpdate()\n\t}\n\n\tfire(name, data){\n\t\tthis.dispatchEvent(new CustomEvent(name, { detail : data }))\n\t}\n\n\tinstall() {\n\n\t}\n\n\tinstalled() {\n\n\t}\n\n\tuninstall() {\n\n\t}\n\n\tbeforeUpdate() {\n\n\t}\n\n\tafterUpdate() {\n\n\t}\n}","import { diff } from './vdom/diff'\nimport jsonDiff from './json-diff'\n\nconst list = []\nlet tick = false\n\nexport function render(vnode, parent, store) {\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent\n\tif(store){\n\t\tstore.instances = []\n\t\textendStoreUpate(store)\n\t\tstore.originData = JSON.parse(JSON.stringify(store.data))\t\n }\n parent.store = store\n diff(null, vnode, {}, false, parent, false)\n list.push(store)\n\n if(store && !tick){\n requestIdleCallback(execTask)\n tick = true\n }\n \n function execTask(deadline){\n while (deadline.timeRemaining() > 0){\n list.forEach(currentStore => {\n currentStore.update()\n })\n }\n setTimeout(function(){\n requestIdleCallback(execTask)\n },200)\n \n }\n} \n\nfunction extendStoreUpate(store){\n\tstore.update = function(){\n\t\tlet diffResult = jsonDiff(this.data, this.originData)\n\t\tif (Object.keys(diffResult)[0] == '') {\n\t\t\tdiffResult = diffResult['']\n\t\t}\n\t\tconst updateAll = matchGlobalData(this.globalData, diffResult)\n\t\tif (Object.keys(diffResult).length > 0) {\n\t\t\tthis.instances.forEach(instance => {\n\t\t\t\tif(updateAll || this.updateAll || instance.constructor.updatePath && needUpdate(diffResult, instance.constructor.updatePath)){\n\t\t\t\t\tinstance.update()\n\t\t\t\t}\n\t\t\t})\n\t\t\tthis.onChange && this.onChange(diffResult)\n\t\t\tfor (let key in diffResult) {\n\t\t\t\tupdateByPath(this.originData, key, typeof diffResult[key] === 'object' ? JSON.parse(JSON.stringify(diffResult[key])) : diffResult[key])\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction matchGlobalData(globalData, diffResult) {\n\tif(!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//todo path级别检测包括Array,如果array为空数组,默认值在install里加\nfunction 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\nfunction updateByPath(origin, path, value) {\n const arr = path.replace(/]/g, '').replace(/\\[/g, '.').split('.')\n let current = origin\n for (let i = 0, len = arr.length; i < len; i++) {\n if (i === len - 1) {\n current[arr[i]] = value\n } else {\n current = current[arr[i]]\n }\n }\n}","const OBJECTTYPE = '[object Object]'\nconst ARRAYTYPE = '[object Array]'\n\nexport function define(name, ctor) {\n\tcustomElements.define(name, ctor)\n\tif (ctor.data && !ctor.pure) {\n\t\tctor.updatePath = getUpdatePath(ctor.data)\n\t}\n}\n\nexport function getUpdatePath(data) {\n\tconst result = {}\n\tdataToPath(data, result)\n\treturn result\n}\n\nfunction dataToPath(data, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[key] = true\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], key, result)\n\t\t}\n\t})\n}\n\nfunction _objToPath(data, path, result) {\n\tObject.keys(data).forEach(key => {\n\t\tresult[path + '.' + key] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(data[key])\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(data[key], path + '.' + key, result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(data[key], path + '.' + key, result)\n\t\t}\n\t})\n}\n\nfunction _arrayToPath(data, path, result) {\n\tdata.forEach((item, index) => {\n\t\tresult[path + '[' + index + ']'] = true\n\t\tdelete result[path]\n\t\tconst type = Object.prototype.toString.call(item)\n\t\tif (type === OBJECTTYPE) {\n\t\t\t_objToPath(item, path + '[' + index + ']', result)\n\t\t} else if (type === ARRAYTYPE) {\n\t\t\t_arrayToPath(item, path + '[' + index + ']', result)\n\t\t}\n\t})\n}","function getGlobal() {\n\tif (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) {\n\t\tif (typeof self !== 'undefined') {\n\t\t\treturn self\n\t\t} else if (typeof window !== 'undefined') {\n\t\t\treturn window\n\t\t} else if (typeof global !== 'undefined') {\n\t\t\treturn global\n\t\t}\n\t\treturn (function(){\n\t\t\treturn this\n\t\t})()\n\t\t\n\t}\n\treturn global\n}\n\n/** Global options\n *\t@public\n *\t@namespace options {Object}\n */\nexport default {\n\t\n\troot: getGlobal()\n\t//componentChange(component, element) { },\n\t/** If `true`, `prop` changes trigger synchronous component updates.\n\t *\t@name syncComponentUpdates\n\t *\t@type Boolean\n\t *\t@default true\n\t */\n\t//syncComponentUpdates: true,\n\n\t/** Processes all created VNodes.\n\t *\t@param {VNode} vnode\tA newly-created VNode to normalize/process\n\t */\n\t//vnode(vnode) { }\n\n\t/** Hook invoked after a component is mounted. */\n\t//afterMount(component) { },\n\n\t/** Hook invoked after the DOM is updated with a component's latest render. */\n\t//afterUpdate(component) { }\n\n\t/** Hook invoked immediately before a component is unmounted. */\n\t// beforeUnmount(component) { }\n}\n","import { define } from './define'\n\nexport function tag(name, pure) {\n\treturn function (target) {\n\t\ttarget.pure = pure\n\t\tdefine(name, target)\n\t}\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'\n\noptions.root.Omi = {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\noptions.root.Omi.version = '4.0.1'\n\nexport default {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n\nexport {\n\ttag,\n\tWeElement,\n\trender,\n\th,\n\tcreateElement,\n\toptions,\n\tdefine\n}\n"]} \ No newline at end of file diff --git a/packages/omi-ie11/package.json b/packages/omi-ie11/package.json index 1a5d39e15..95274bf50 100644 --- a/packages/omi-ie11/package.json +++ b/packages/omi-ie11/package.json @@ -1,6 +1,6 @@ { "name": "omi", - "version": "4.0.1", + "version": "4.0.2", "description": "Next generation web framework.", "main": "dist/omi.js", "jsnext:main": "dist/omi.esm.js",