From 66bab76c536829f912189a890e16c4020de45648 Mon Sep 17 00:00:00 2001 From: dntzhang Date: Sun, 20 May 2018 13:29:19 +0800 Subject: [PATCH] omi 3.0.5 --- README.CN.md | 4 ++-- README.md | 4 ++-- change-log.md | 4 ++++ dist/omi.dev.js | 41 ++++++++++++++++++++++++++++---------- dist/omi.dev.js.map | 2 +- dist/omi.esm.js | 41 ++++++++++++++++++++++++++++---------- dist/omi.esm.js.map | 2 +- dist/omi.js | 23 +++++++++++++++++---- dist/omi.js.map | 2 +- dist/omi.min.js | 2 +- dist/omi.min.js.map | 2 +- package.json | 2 +- src/omi.js | 2 +- src/options.js | 4 +++- src/vdom/component.js | 32 ++++++++++++++++++++++++----- test/browser/components.js | 4 ++-- 16 files changed, 128 insertions(+), 43 deletions(-) diff --git a/README.CN.md b/README.CN.md index 11351d903..a8eae3e39 100644 --- a/README.CN.md +++ b/README.CN.md @@ -264,8 +264,8 @@ npm i omi ๆˆ–ไปŽ CDN ่Žทๅ–: -* [https://unpkg.com/omi@3.0.4/dist/omi.min.js](https://unpkg.com/omi@3.0.4/dist/omi.min.js) -* [https://unpkg.com/omi@3.0.4/dist/omi.js](https://unpkg.com/omi@3.0.4/dist/omi.js) +* [https://unpkg.com/omi@3.0.5/dist/omi.min.js](https://unpkg.com/omi@3.0.5/dist/omi.min.js) +* [https://unpkg.com/omi@3.0.5/dist/omi.js](https://unpkg.com/omi@3.0.5/dist/omi.js) ## Official Plugins diff --git a/README.md b/README.md index d6772c17f..255d355e0 100644 --- a/README.md +++ b/README.md @@ -261,8 +261,8 @@ npm i omi or get it from CDN: -* [https://unpkg.com/omi@3.0.4/dist/omi.min.js](https://unpkg.com/omi@3.0.4/dist/omi.min.js) -* [https://unpkg.com/omi@3.0.4/dist/omi.js](https://unpkg.com/omi@3.0.4/dist/omi.js) +* [https://unpkg.com/omi@3.0.5/dist/omi.min.js](https://unpkg.com/omi@3.0.5/dist/omi.min.js) +* [https://unpkg.com/omi@3.0.5/dist/omi.js](https://unpkg.com/omi@3.0.5/dist/omi.js) ## Official Plugins diff --git a/change-log.md b/change-log.md index 748548849..1e6b29380 100644 --- a/change-log.md +++ b/change-log.md @@ -1,3 +1,7 @@ +# omi 3.0.5 + +Solving the component constructor name conflict of static style rendering. + # omi 3.0.4 * modify the render method args: diff --git a/dist/omi.dev.js b/dist/omi.dev.js index 7476432ee..d6ee0f737 100644 --- a/dist/omi.dev.js +++ b/dist/omi.dev.js @@ -1,5 +1,5 @@ /** - * omi v3.0.4 http://omijs.org + * omi v3.0.5 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/AlloyTeam/omi @@ -39,7 +39,9 @@ isWeb: true, staticStyleRendered: false, doc: typeof document === 'object' ? document : null, - root: getGlobal() + root: getGlobal(), + //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}] + styleCache: [] //componentChange(component, element) { }, /** If `true`, `prop` changes trigger synchronous component updates. * @name syncComponentUpdates @@ -1020,6 +1022,25 @@ } } + var id = 0; + + function getCtorName(ctor) { + + for (var i = 0, len = options.styleCache.length; i < len; i++) { + var item = options.styleCache[i]; + + if (item.ctor === ctor) { + return item.attrName; + } + } + + var attrName = 'static_' + id; + options.styleCache.push({ ctor: ctor, attrName: attrName }); + id++; + + return attrName; + } + /** Set a component's `props` (generally derived from JSX attributes). * @param {Object} props * @param {Object} [opts] @@ -1107,13 +1128,13 @@ if (!skip) { rendered = component.render(props, state, context); - if (component.style) { - addScopedAttr(rendered, component.style(), '_style_' + component._id, component); - } - //don't rerender if (component.staticStyle) { - addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + component.constructor.name); + addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + getCtorName(component.constructor)); + } + + if (component.style) { + addScopedAttr(rendered, component.style(), '_style_' + component._id, component); } // context to pass to the child, can be updated via (grand-)parent component @@ -1291,9 +1312,9 @@ if (component.__ref) component.__ref(null); } - var id = 0; + var id$1 = 0; function getId() { - return id++; + return id$1++; } /** Base Component class. * Provides `setState()` and `forceUpdate()`, which trigger rendering. @@ -1463,7 +1484,7 @@ instances: instances }; - options.root.Omi.version = '3.0.4'; + options.root.Omi.version = '3.0.5'; var Omi = { h: h, diff --git a/dist/omi.dev.js.map b/dist/omi.dev.js.map index d57582a07..58b18ae65 100644 --- a/dist/omi.dev.js.map +++ b/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/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\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\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_'+component.constructor.name);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\r\n","import { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.4';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\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","scopedStyle","$store","isWeb","staticStyleRendered","doc","document","root","stack","EMPTY_CHILDREN","map","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","options","value","key","vnode","extend","obj","props","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","cloneElement","slice","call","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","list","element","base","renderComponent","componentChange","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","createElementNS","createElement","parseCSSText","cssText","cssTxt","replace","match","a","b","rule","cssToJs","s","toUpperCase","properties","o","x","trim","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","result","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","removeEventListener","_listeners","setProperty","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","e","type","event","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","componentDidMount","installed","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","f","vchild","__key","insertBefore","unmountOnly","unmountComponent","ref","removeChildren","lastChild","next","previousSibling","attrs","components","collectComponent","constructor","createComponent","Ctor","inst","prototype","render","Component","doRender","Omi","instances","nextBase","splice","state","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttr","vdom","attr","scopeVdom","_preStyle","addScopedAttrStatic","forEach","setComponentProps","opts","_disable","__ref","componentWillMount","install","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","shouldComponentUpdate","componentWillUpdate","beforeUpdate","_id","staticStyle","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","componentWillUnmount","uninstall","inner","getId","setState","callback","forceUpdate","update","merge","Object","assign","store","querySelector","empty","ssrData","__omiSsrData","version","module","exports"],"mappings":";;;;;;;;;;;CAAA;AACA,CAAO,SAASA,KAAT,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dev.js","sources":["../src/vnode.js","../src/options.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\r\n\troot: getGlobal(),\r\n\t//styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n\tstyleCache: []\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\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\nlet id = 0;\r\n\r\nfunction getCtorName(ctor) {\r\n\r\n\tfor (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n\t\tlet item = options.styleCache[i];\r\n\r\n\t\tif (item.ctor === ctor) {\r\n\t\t\treturn item.attrName\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet attrName = 'static_' + id;\r\n\toptions.styleCache.push({ ctor: ctor, attrName: attrName });\r\n\tid++\r\n\r\n\r\n\treturn attrName;\r\n}\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor));\r\n\r\n\t\t}\r\n\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\r\n","import { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.5';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\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","scopedStyle","$store","isWeb","staticStyleRendered","doc","document","root","styleCache","stack","EMPTY_CHILDREN","map","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","options","value","key","vnode","extend","obj","props","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","cloneElement","slice","call","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","list","element","base","renderComponent","componentChange","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","createElementNS","createElement","parseCSSText","cssText","cssTxt","replace","match","a","b","rule","cssToJs","s","toUpperCase","properties","o","x","trim","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","result","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","removeEventListener","_listeners","setProperty","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","e","type","event","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","componentDidMount","installed","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","recollectNodeTree","vnodeName","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","innerDiffNode","dangerouslySetInnerHTML","diffAttributes","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","f","vchild","__key","insertBefore","unmountOnly","unmountComponent","ref","removeChildren","lastChild","next","previousSibling","attrs","components","collectComponent","constructor","createComponent","Ctor","inst","prototype","render","Component","doRender","Omi","instances","nextBase","splice","state","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttr","vdom","attr","scopeVdom","_preStyle","addScopedAttrStatic","forEach","getCtorName","ctor","item","attrName","setComponentProps","opts","_disable","__ref","componentWillMount","install","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","shouldComponentUpdate","componentWillUpdate","beforeUpdate","staticStyle","_id","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","beforeUnmount","componentWillUnmount","uninstall","inner","getId","setState","callback","forceUpdate","update","merge","Object","assign","store","querySelector","empty","ssrData","__omiSsrData","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,cAAa,IAFC;CAGdC,SAAQ,IAHM;CAIdC,QAAO,IAJO;CAKdC,sBAAqB,KALP;CAMdC,MAAK,OAAOC,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,IANjC;CAOdC,OAAMZ,WAPQ;CAQd;CACAa,aAAY;CACZ;CACA;;;;;CAKA;;CAEA;;;CAGA;;CAEA;CACA;;CAEA;CACA;;CAEA;CACA;CA9Bc,CAAf;;KCjBMC,QAAQ,EAAd;;CAEA,IAAMC,iBAAiB,EAAvB;;CAEA,IAAMC,MAAM;CACX,OAAM,MADK;CAEX,OAAM,MAFK;;CAIX,MAAK,MAJM;CAKX,OAAM,MALK;CAMX,OAAM,MANK;CAOX,OAAM,MAPK;CAQX,OAAM,MARK;CASX,OAAM,MATK;CAUX,OAAM,MAVK;CAWX,SAAQ,MAXG;CAYX,YAAW,MAZA;CAaX,MAAK,MAbM;CAcX,QAAO,MAdI;CAeX,QAAO,MAfI;CAgBX,eAAc,M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4G,MAApC,EAA4C,KAA5C,CAAb;CACA/G,SAAQvB,mBAAR,GAA8B,IAA9B;CACA,QAAOqG,MAAP;CACA;;KCpEKwF,YAAY,EAAlB;;CAEAtK,QAAQpB,IAAR,CAAayL,GAAb,GAAmB;CAClBpL,KADkB;CAElBiE,iBAFkB;CAGlBhC,2BAHkB;CAIlBiJ,qBAJkB;CAKlBD,eALkB;CAMlBnI,mBANkB;CAOlB/B,iBAPkB;CAQlBsK;CARkB,CAAnB;;CAWAtK,QAAQpB,IAAR,CAAayL,GAAb,CAAiBgG,OAAjB,GAA2B,OAA3B;;AAEA,WAAe;CACdpR,KADc;CAEdiE,iBAFc;CAGdhC,2BAHc;CAIdiJ,qBAJc;CAKdD,eALc;CAMdnI,mBANc;CAOd/B,iBAPc;CAQdsK;CARc,CAAf;;CCpBI,IAAI,OAAOgG,MAAP,IAAe,WAAnB,EAAgCA,OAAOC,OAAP,GAAiBlG,GAAjB,CAAhC,KACKjM,KAAKiM,GAAL,GAAWA,GAAX;;"} \ No newline at end of file diff --git a/dist/omi.esm.js b/dist/omi.esm.js index 3206fbb09..e28eb5563 100644 --- a/dist/omi.esm.js +++ b/dist/omi.esm.js @@ -1,5 +1,5 @@ /** - * omi v3.0.4 http://omijs.org + * omi v3.0.5 http://omijs.org * Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript. * By dntzhang https://github.com/dntzhang * Github: https://github.com/AlloyTeam/omi @@ -36,7 +36,9 @@ var options = { isWeb: true, staticStyleRendered: false, doc: typeof document === 'object' ? document : null, - root: getGlobal() + root: getGlobal(), + //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}] + styleCache: [] //componentChange(component, element) { }, /** If `true`, `prop` changes trigger synchronous component updates. * @name syncComponentUpdates @@ -1017,6 +1019,25 @@ function scopeVdom(attr, vdom) { } } +var id = 0; + +function getCtorName(ctor) { + + for (var i = 0, len = options.styleCache.length; i < len; i++) { + var item = options.styleCache[i]; + + if (item.ctor === ctor) { + return item.attrName; + } + } + + var attrName = 'static_' + id; + options.styleCache.push({ ctor: ctor, attrName: attrName }); + id++; + + return attrName; +} + /** Set a component's `props` (generally derived from JSX attributes). * @param {Object} props * @param {Object} [opts] @@ -1104,13 +1125,13 @@ function renderComponent(component, opts, mountAll, isChild) { if (!skip) { rendered = component.render(props, state, context); - if (component.style) { - addScopedAttr(rendered, component.style(), '_style_' + component._id, component); - } - //don't rerender if (component.staticStyle) { - addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + component.constructor.name); + addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + getCtorName(component.constructor)); + } + + if (component.style) { + addScopedAttr(rendered, component.style(), '_style_' + component._id, component); } // context to pass to the child, can be updated via (grand-)parent component @@ -1288,9 +1309,9 @@ function unmountComponent(component) { if (component.__ref) component.__ref(null); } -var id = 0; +var id$1 = 0; function getId() { - return id++; + return id$1++; } /** Base Component class. * Provides `setState()` and `forceUpdate()`, which trigger rendering. @@ -1460,7 +1481,7 @@ options.root.Omi = { instances: instances }; -options.root.Omi.version = '3.0.4'; +options.root.Omi.version = '3.0.5'; var omi = { h: h, diff --git a/dist/omi.esm.js.map b/dist/omi.esm.js.map index 263854ac8..0ce31dcf7 100644 --- a/dist/omi.esm.js.map +++ b/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/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\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\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_'+component.constructor.name);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\r\n","import { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.4';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","document","stack","EMPTY_CHILDREN","map","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","options","isWeb","value","key","vnode","extend","obj","props","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","cloneElement","slice","call","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","list","element","base","componentChange","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","doc","createElementNS","createElement","parseCSSText","cssText","cssTxt","replace","match","a","b","rule","cssToJs","s","toUpperCase","properties","o","x","trim","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","result","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","removeEventListener","_listeners","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","setProperty","e","type","event","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","componentDidMount","installed","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","f","vchild","__key","insertBefore","recollectNodeTree","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","components","collectComponent","constructor","createComponent","Ctor","inst","prototype","render","Component","doRender","$store","Omi","instances","nextBase","splice","state","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttr","vdom","attr","scopedStyle","_preStyle","addScopedAttrStatic","staticStyleRendered","scopeVdom","forEach","setComponentProps","opts","_disable","__ref","componentWillMount","install","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","renderComponent","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","shouldComponentUpdate","componentWillUpdate","beforeUpdate","_id","staticStyle","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","uninstall","inner","getId","callback","forceUpdate","merge","Object","assign","store","querySelector","empty","ssrData","root","__omiSsrData","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;;;;;;;AAOD,cAAe;;cAED,IAFC;SAGN,IAHM;QAIP,IAJO;sBAKO,KALP;MAMT,OAAOK,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,IANjC;OAORN;;;;;;;;;;;;;;;;;;;;;;CAPP;;ICjBMO,QAAQ,EAAd;;AAEA,IAAMC,iBAAiB,EAAvB;;AAEA,IAAMC,MAAM;OACL,MADK;OAEL,MAFK;;MAIN,MAJM;OAKL,MALK;OAML,MANK;OAOL,MAPK;OAQL,MARK;OASL,MATK;OAUL,MAVK;SAWH,MAXG;YAYA,MAZA;MAaN,MAbM;QAcJ,MAdI;QAeJ,MAfI;eAgBG,MAhBH;SA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EAAoC4G,MAApC,EAA4C,KAA5C,CAAb;SACQsF,mBAAR,GAA8B,IAA9B;QACOvH,MAAP;;;ICnEKwF,YAAY,EAAlB;;AAEAvK,QAAQmQ,IAAR,CAAa7F,GAAb,GAAmB;KAAA;iBAAA;2BAAA;qBAAA;eAAA;mBAAA;iBAAA;;CAAnB;;AAWAtK,QAAQmQ,IAAR,CAAa7F,GAAb,CAAiB+F,OAAjB,GAA2B,OAA3B;;AAEA,UAAe;KAAA;iBAAA;2BAAA;qBAAA;eAAA;mBAAA;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/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\r\n\troot: getGlobal(),\r\n\t//styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n\tstyleCache: []\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\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\nlet id = 0;\r\n\r\nfunction getCtorName(ctor) {\r\n\r\n\tfor (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n\t\tlet item = options.styleCache[i];\r\n\r\n\t\tif (item.ctor === ctor) {\r\n\t\t\treturn item.attrName\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet attrName = 'static_' + id;\r\n\toptions.styleCache.push({ ctor: ctor, attrName: attrName });\r\n\tid++\r\n\r\n\r\n\treturn attrName;\r\n}\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor));\r\n\r\n\t\t}\r\n\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\r\n","import { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.5';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"],"names":["VNode","getGlobal","global","Math","Array","self","window","document","stack","EMPTY_CHILDREN","map","h","nodeName","attributes","children","lastSimple","child","simple","i","arguments","length","push","pop","undefined","String","p","options","isWeb","value","key","vnode","extend","obj","props","usePromise","Promise","__config__","platform","systemVersion","split","defer","resolve","then","bind","setTimeout","cloneElement","slice","call","NO_RENDER","SYNC_RENDER","FORCE_RENDER","ASYNC_RENDER","ATTR_KEY","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","list","element","base","componentChange","isSameNodeType","node","hydrating","splitText","_componentConstructor","isNamedNode","normalizedNodeName","toLowerCase","getNodeProps","defaultProps","createNode","isSvg","doc","createElementNS","createElement","parseCSSText","cssText","cssTxt","replace","match","a","b","rule","cssToJs","s","toUpperCase","properties","o","x","trim","property","style","removeNode","parentNode","removeChild","setAccessor","name","old","className","test","oldJson","currentJson","result","changed","ckey","setStyles","innerHTML","__html","useCapture","substring","addEventListener","eventProxy","removeEventListener","_listeners","removeAttribute","ns","removeAttributeNS","setAttributeNS","setAttribute","setProperty","e","type","event","mounts","diffLevel","isSvgMode","flushMounts","c","afterMount","componentDidMount","installed","diff","dom","context","mountAll","parent","componentRoot","ownerSVGElement","ret","idiff","appendChild","out","prevSvgMode","_component","nodeValue","createTextNode","replaceChild","vnodeName","buildComponentFromVNode","firstChild","fc","vchildren","nextSibling","dangerouslySetInnerHTML","innerDiffNode","isHydrating","originalChildren","childNodes","keyed","keyedLen","min","len","childrenLen","vlen","j","f","vchild","__key","insertBefore","recollectNodeTree","unmountOnly","ref","removeChildren","lastChild","next","previousSibling","diffAttributes","attrs","components","collectComponent","constructor","createComponent","Ctor","inst","prototype","render","Component","doRender","$store","Omi","instances","nextBase","splice","state","scoper","css","prefix","re","RegExp","g0","g1","g2","g3","appendClass","addStyle","id","ele","getElementById","head","getElementsByTagName","someThingStyles","ActiveXObject","styleSheet","textContent","addStyleWithoutId","addScopedAttr","vdom","attr","scopedStyle","_preStyle","addScopedAttrStatic","staticStyleRendered","scopeVdom","forEach","getCtorName","ctor","styleCache","item","attrName","setComponentProps","opts","_disable","__ref","componentWillMount","install","componentWillReceiveProps","prevContext","prevProps","syncComponentUpdates","renderComponent","isChild","previousProps","previousState","prevState","previousContext","isUpdate","initialBase","initialChildComponent","skip","rendered","cbase","shouldComponentUpdate","componentWillUpdate","beforeUpdate","staticStyle","_id","getChildContext","childComponent","toUnmount","childProps","_parentComponent","baseParent","componentRef","t","unshift","componentDidUpdate","afterUpdate","_renderCallbacks","originalComponent","oldDom","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","uninstall","inner","getId","callback","forceUpdate","merge","Object","assign","store","querySelector","empty","ssrData","root","__omiSsrData","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;;;;;;;AAOD,cAAe;;cAED,IAFC;SAGN,IAHM;QAIP,IAJO;sBAKO,KALP;MAMT,OAAOK,QAAP,KAAoB,QAApB,GAA+BA,QAA/B,GAA0C,IANjC;OAORN,WAPQ;;aASF;;;;;;;;;;;;;;;;;;;;;;CATb;;ICjBMO,QAAQ,EAAd;;AAEA,IAAMC,iBAAiB,EAAvB;;AAEA,IAAMC,MAAM;OACL,MADK;OAEL,MAFK;;MAIN,MAJM;OAKL,MALK;OAML,MANK;OAOL,MAPK;OAQL,MARK;OASL,MATK;OAUL,MAVK;SAWH,MAXG;YAYA,MAZA;MAaN,MAbM;QAcJ,MAdI;QAeJ,MAfI;eAgBG,MAhBH;SAiBH,MAjBG;SAkBH,MAlBG;QAm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,WAAN,CAAkBpF,IAA7E,EAAmF,CAACrE,MAAM+B,IAA1F;;;QAGKA,IAAN,GAAayE,KAAKqJ,MAAMA,KAAX,EAAkB/B,QAAlB,EAA4B,EAA5B,EAAgC,KAAhC,EAAuClH,MAAvC,EAA+C,KAA/C,CAAb;;MAEI5G,MAAMsG,iBAAV,EAA6BtG,MAAMsG,iBAAN;MACzBtG,MAAMuG,SAAV,EAAqBvG,MAAMuG,SAAN;UACb2F,mBAAR,GAA8B,IAA9B;SACOlM,MAAM+B,IAAb;;;KAGG4C,SAAS6B,KAAKqJ,MAAMA,KAAX,EAAkB7P,KAAlB,EAAyB,EAAzB,EAA6B,KAA7B,EAAoC4G,MAApC,EAA4C,KAA5C,CAAb;SACQsF,mBAAR,GAA8B,IAA9B;QACOvH,MAAP;;;ICnEKwF,YAAY,EAAlB;;AAEAvK,QAAQwQ,IAAR,CAAalG,GAAb,GAAmB;KAAA;iBAAA;2BAAA;qBAAA;eAAA;mBAAA;iBAAA;;CAAnB;;AAWAtK,QAAQwQ,IAAR,CAAalG,GAAb,CAAiBoG,OAAjB,GAA2B,OAA3B;;AAEA,UAAe;KAAA;iBAAA;2BAAA;qBAAA;eAAA;mBAAA;iBAAA;;CAAf;;;"} \ No newline at end of file diff --git a/dist/omi.js b/dist/omi.js index c82449515..bcf650343 100644 --- a/dist/omi.js +++ b/dist/omi.js @@ -342,6 +342,19 @@ }); } } + function getCtorName(ctor) { + for (var i = 0, len = options.styleCache.length; i < len; i++) { + var item = options.styleCache[i]; + if (item.ctor === ctor) return item.attrName; + } + var attrName = 'static_' + id; + options.styleCache.push({ + ctor: ctor, + attrName: attrName + }); + id++; + return attrName; + } function setComponentProps(component, props, opts, context, mountAll) { if (!component.__x) { component.__x = !0; @@ -377,8 +390,8 @@ component.__p = component.__s = component.__c = component.__b = null; if (!skip) { rendered = component.render(props, state, context); + if (component.staticStyle) addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + getCtorName(component.constructor)); if (component.style) addScopedAttr(rendered, component.style(), '_style_' + component.s, component); - if (component.staticStyle) addScopedAttrStatic(rendered, component.staticStyle(), '_style_' + component.constructor.name); if (component.getChildContext) context = extend(extend({}, context), component.getChildContext()); var toUnmount, base, childComponent = rendered && rendered.nodeName; if ('function' == typeof childComponent) { @@ -473,7 +486,7 @@ if (component.__r) component.__r(null); } function getId() { - return id++; + return id$1++; } function Component(props, context) { this.context = context; @@ -527,7 +540,8 @@ }(); } return global; - }() + }(), + styleCache: [] }; var stack = []; var EMPTY_CHILDREN = []; @@ -666,6 +680,7 @@ var hydrating = !1; var components = {}; var id = 0; + var id$1 = 0; extend(Component.prototype, { setState: function(state, callback) { var s = this.state; @@ -695,7 +710,7 @@ options: options, instances: instances }; - options.root.Omi.version = '3.0.4'; + options.root.Omi.version = '3.0.5'; var Omi = { h: h, createElement: h, diff --git a/dist/omi.js.map b/dist/omi.js.map index 103e21541..6d2b2e550 100644 --- a/dist/omi.js.map +++ b/dist/omi.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.js","../src/options.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","options","isWeb","map","value","key","vnode","extend","obj","props","cloneElement","h","slice","call","ATTR_KEY","component","debounceRendering","defer","rerender","items","element","base","renderComponent","list","componentChange","hydrating","node","_componentConstructor","normalizedNodeName","toLowerCase","defaultProps","doc","createElementNS","createElement","_ref","createNode","match","a","b","cssTxt","isSvg","rule","properties","o","split","x","trim","s","replace","Array","isArray","Symbol","iterator","_ref3","next","done","_ref2","property","style","parseCSSText","cssText","parentNode","removeChild","setAccessor","name","old","className","IS_NON_DIMENSIONAL","test","oldJson","currentJson","changed","ckey","result","substring","setStyles","addEventListener","eventProxy","useCapture","removeEventListener","innerHTML","_listeners","setProperty","removeAttribute","ns","setAttribute","e","this","type","event","diffLevel","c","mounts","isSvgMode","afterMount","installed","diff","dom","context","mountAll","parent","componentRoot","ret","idiff","ownerSVGElement","out","prevSvgMode","_component","nodeValue","splitText","recollectNodeTree","document","vnodeName","buildComponentFromVNode","replaceChild","appendChild","vchildren","fc","innerDiffNode","isHydrating","j","originalChildren","keyed","keyedLen","childrenLen","vlen","_child","f","__key","vchild","min","nextSibling","removeNode","insertBefore","unmountOnly","removeChildren","previousSibling","attrs","collectComponent","components","Ctor","inst","constructor","render","Component","createComponent","prototype","Omi","nextBase","$store","splice","state","scoper","css","prefix","re","g0","g1","g2","g3","appendClass","addStyle","id","ele","head","getElementsByTagName","someThingStyles","getElementById","textContent","window","ActiveXObject","styleSheet","addStyleWithoutId","attr","scopeVdom","_preStyle","scopedStyle","vdom","staticStyleRendered","setComponentProps","opts","_disable","componentWillReceiveProps","enqueueRender","prevProps","isChild","previousProps","previousState","isUpdate","initialBase","initialChildComponent","previousContext","rendered","shouldComponentUpdate","skip","cbase","componentWillUpdate","beforeUpdate","FORCE_RENDER","prevContext","_id","addScopedAttrStatic","staticStyle","addScopedAttr","getChildContext","childComponent","childProps","getNodeProps","toUnmount","baseParent","SYNC_RENDER","componentRef","t","unshift","_parentComponent","afterUpdate","componentDidUpdate","_renderCallbacks","flushMounts","oldDom","originalComponent","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","ref","merge","Object","querySelector","empty","firstChild","store","componentWillMount","instances","componentDidMount","root","global","Math","self","br","hr","h1","h2","h3","h4","h5","h6","abbr","address","bdi","bdo","blockquote","cite","code","del","ins","dfn","em","strong","samp","kbd","var","mark","pre","q","ruby","rp","rt","small","sub","sup","time","u","wbr","form","input","textarea","button","select","option","optgroup","label","fieldset","datalist","legend","output","iframe","img","canvas","figure","figcaption","audio","source","video","track","nav","link","ul","ol","li","dl","dt","dd","menu","command","table","caption","th","td","tr","thead","tbody","tfoot","col","colgroup","div","main","span","header","footer","section","article","aside","details","dialog","summary","progress","meter","meta","area","script","noscript","embed","object","param","view","scroll-view","swiper","icon","text","checkbox","radio","picker","picker-view","slider","switch","navigator","image","contact-button","block","usePromise","Promise","__config__","platform","systemVersion","resolve","then","bind","setTimeout","ASYNC_RENDER","forceUpdate","callback","update","version","module","exports"],"mappings":";;IACO,SAASA;ICmLT,SAAWC,EAAAA,UAAUC;QAC3B,IAA6BC,YAAYC,OAAOC,QAAQC,GAApDC,WAASC;QACb,KAAKF,IAAEG,UAAUC,QAAQJ,MAAM,KAC9BK,MAAMC,KAAKH,UAAUH;QAEtB,IAAIJ,cAAmC,QAArBA,WAAWK,UAAgB;YAC5C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEnB,OAAOI,MAAMD,QACZ,KAAKN,QAAQO,MAAME,eAAsBC,MAAZV,MAAMS,KAClC,KAAKP,IAAEF,MAAMM,QAAQJ,OAAOK,MAAMC,KAAKR,MAAME,UAEzC;YACJ,IAAmB,oBAARF,OAAmBA,QAAQ;YAEtC,IAAKC,SAA2B,qBAAXJ,UACpB,IAAW,QAAPG,OAAaA,QAAQ,SACpB,IAAmB,mBAARA,OAAkBA,QAAQW,OAAOX,aAC5C,IAAmB,mBAARA,OAAkBC,UAAS;YAG5C,IAAIA,UAAUF,YACbI,SAASA,SAASG,SAAO,MAAMN,YAE3B,IAAIG,aAAWC,gBACnBD,aAAYH,cAGZG,SAASK,KAAKR;YAGfD,aAAaE;;QAIf,IAAIW,IAAI,IAAIhB;QACZgB,EAAEf,WAAWgB,QAAQC,QAAMjB,WAASkB,IAAIlB;QACxCe,EAAEd,aAA2B,QAAdA,kBAAqBY,IAAYZ;QAChD,IAAIK,YAAmC,mBAAhBA,SAAS,OAAmBU,QAAQC,OAC1D,IAAIF,EAAEd,YACLc,EAAEd,WAAWkB,QAAQb,SAAS,SAE9BS,EAAEd;YAAekB,OAAOb,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KAAKN,QAAQI,aAAaG;;IE7B5E,IAAMC;;;IGoJZ,IAAA3Q,aAAA;IChJM,IAAMD,aAAN;IA0SJ7B,IAAAA;IGzBDqE,IAAAA,KAAAA;ICtPD7H,OAAKgJ,UAAaA;;;;;;YAuBlBgC,cAAAhG;;QAQCkR,aAAA,SAAoBhJ;YACpBlC,IAAAA,WAAchG,KAAdkI,MAAAlI,KAAAkI,WAAA7N,KAAA8W;YArB0BpV,gBAAAiE,MAAA;;;QAyB3BoR,QAAA,SAAAD;;;;;ICJCzW,IAAAA;IAEAA,QAAA2O,KAAAzF;;QAEDlH,eAAa+D;QACb/F,cAAQiL;QACRlC,WAAOvE;QACPsE,QAAAA;;iBEpEK2F;;;IAILzM,QAAAA,KAAAA,IAFkB2U,UAAA;IAIlB5N,IAAAA;QACAD,GAAAA;QACA7H,eAAAA;QACAjB,cAAAA;QACAyO,WAAAA;QARD3F,QAAAA;;QAWA9I,SAAQ2O;;;IAIP3M,IAFc,sBAEdA,QAFc4U,OAAAC,UAAA3N,UAAA4F,KAAA5F,MAAAA","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\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_'+component.constructor.name);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\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 { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.4';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.js","../src/options.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","undefined","String","p","options","isWeb","map","value","key","vnode","extend","obj","props","cloneElement","h","slice","call","ATTR_KEY","component","debounceRendering","defer","rerender","items","element","base","renderComponent","list","componentChange","hydrating","node","_componentConstructor","normalizedNodeName","toLowerCase","defaultProps","doc","createElementNS","createElement","_ref","createNode","match","a","b","cssTxt","isSvg","rule","properties","o","split","x","trim","s","replace","Array","isArray","Symbol","iterator","_ref3","next","done","_ref2","property","style","parseCSSText","cssText","parentNode","removeChild","setAccessor","name","old","className","IS_NON_DIMENSIONAL","test","oldJson","currentJson","changed","ckey","result","substring","setStyles","addEventListener","eventProxy","useCapture","removeEventListener","innerHTML","_listeners","setProperty","removeAttribute","ns","setAttribute","e","this","type","event","diffLevel","c","mounts","isSvgMode","afterMount","installed","diff","dom","context","mountAll","parent","componentRoot","ret","idiff","ownerSVGElement","out","prevSvgMode","_component","nodeValue","splitText","recollectNodeTree","document","vnodeName","buildComponentFromVNode","replaceChild","appendChild","vchildren","fc","innerDiffNode","isHydrating","j","originalChildren","keyed","keyedLen","childrenLen","vlen","_child","f","__key","vchild","min","nextSibling","removeNode","insertBefore","unmountOnly","removeChildren","previousSibling","attrs","collectComponent","components","Ctor","inst","constructor","render","Component","createComponent","prototype","Omi","nextBase","$store","splice","state","scoper","css","prefix","re","g0","g1","g2","g3","appendClass","addStyle","id","ele","head","getElementsByTagName","someThingStyles","getElementById","textContent","window","ActiveXObject","styleSheet","addStyleWithoutId","attr","scopeVdom","_preStyle","scopedStyle","vdom","staticStyleRendered","ctor","styleCache","len","item","attrName","opts","_disable","setComponentProps","componentWillReceiveProps","enqueueRender","prevProps","isChild","previousProps","previousState","isUpdate","initialBase","initialChildComponent","previousContext","rendered","shouldComponentUpdate","skip","cbase","componentWillUpdate","beforeUpdate","FORCE_RENDER","prevContext","addScopedAttrStatic","staticStyle","getCtorName","addScopedAttr","_id","childComponent","childProps","getNodeProps","toUnmount","baseParent","SYNC_RENDER","componentRef","t","unshift","_parentComponent","afterUpdate","componentDidUpdate","_renderCallbacks","flushMounts","oldDom","originalComponent","isDirectOwner","isOwner","unmountComponent","beforeUnmount","componentWillUnmount","ref","merge","Object","querySelector","empty","firstChild","store","componentWillMount","instances","componentDidMount","root","global","Math","self","br","hr","h1","h2","h3","h4","h5","h6","abbr","address","bdi","bdo","blockquote","cite","code","del","ins","dfn","em","strong","samp","kbd","var","mark","pre","q","ruby","rp","rt","small","sub","sup","time","u","wbr","form","input","textarea","button","select","option","optgroup","label","fieldset","datalist","legend","output","iframe","img","canvas","figure","figcaption","audio","source","video","track","nav","link","ul","ol","li","dl","dt","dd","menu","command","table","caption","th","td","tr","thead","tbody","tfoot","col","colgroup","div","main","span","header","footer","section","article","aside","details","dialog","summary","progress","meter","meta","area","script","noscript","embed","object","param","view","scroll-view","swiper","icon","text","checkbox","radio","picker","picker-view","slider","switch","navigator","image","contact-button","block","usePromise","Promise","__config__","platform","systemVersion","resolve","then","bind","setTimeout","ASYNC_RENDER","forceUpdate","callback","update","version","module","exports"],"mappings":";;IACO,SAASA;ICmLT,SAAWC,EAAAA,UAAUC;QAC3B,IAA6BC,YAAYC,OAAOC,QAAQC,GAApDC,WAASC;QACb,KAAKF,IAAEG,UAAUC,QAAQJ,MAAM,KAC9BK,MAAMC,KAAKH,UAAUH;QAEtB,IAAIJ,cAAmC,QAArBA,WAAWK,UAAgB;YAC5C,KAAKI,MAAMD,QAAQC,MAAMC,KAAKV,WAAWK;mBAClCL,WAAWK;;QAEnB,OAAOI,MAAMD,QACZ,KAAKN,QAAQO,MAAME,eAAsBC,MAAZV,MAAMS,KAClC,KAAKP,IAAEF,MAAMM,QAAQJ,OAAOK,MAAMC,KAAKR,MAAME,UAEzC;YACJ,IAAmB,oBAARF,OAAmBA,QAAQ;YAEtC,IAAKC,SAA2B,qBAAXJ,UACpB,IAAW,QAAPG,OAAaA,QAAQ,SACpB,IAAmB,mBAARA,OAAkBA,QAAQW,OAAOX,aAC5C,IAAmB,mBAARA,OAAkBC,UAAS;YAG5C,IAAIA,UAAUF,YACbI,SAASA,SAASG,SAAO,MAAMN,YAE3B,IAAIG,aAAWC,gBACnBD,aAAYH,cAGZG,SAASK,KAAKR;YAGfD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":"omi.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","import { VNode } from './vnode';\r\nimport options from './options';\r\n\r\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\nlet id = 0;\r\n\r\nfunction getCtorName(ctor) {\r\n\r\n\tfor (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n\t\tlet item = options.styleCache[i];\r\n\r\n\t\tif (item.ctor === ctor) {\r\n\t\t\treturn item.attrName\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet attrName = 'static_' + id;\r\n\toptions.styleCache.push({ ctor: ctor, attrName: attrName });\r\n\tid++\r\n\r\n\r\n\treturn attrName;\r\n}\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor));\r\n\r\n\t\t}\r\n\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\r\n\troot: getGlobal(),\r\n\t//styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n\tstyleCache: []\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 { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.5';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"]} \ No newline at end of file diff --git a/dist/omi.min.js b/dist/omi.min.js index 50c5a2123..015cf744d 100644 --- a/dist/omi.min.js +++ b/dist/omi.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";function e(){}function t(t,n){var o,i,r,l,a=P;for(l=arguments.length;l-- >2;)D.push(arguments[l]);n&&null!=n.children&&(D.length||D.push(n.children),delete n.children);while(D.length)if((i=D.pop())&&void 0!==i.pop)for(l=i.length;l--;)D.push(i[l]);else"boolean"==typeof i&&(i=null),(r="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i+="":"string"!=typeof i&&(r=!1)),r&&o?a[a.length-1]+=i:a===P?a=[i]:a.push(i),o=r;var s=new e;return s.nodeName=V.isWeb?t:q[t],s.attributes=null==n?void 0:n,a&&"string"==typeof a[0]&&!V.isWeb?s.attributes?s.attributes.value=a[0]:s.attributes={value:a[0]}:s.children=a,s.key=null==n?void 0:n.key,void 0!==V.vnode&&V.vnode(s),s}function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e,o){return t(e.nodeName,n(n({},e.attributes),o),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){1==z.push(e)&&(V.debounceRendering||I)(r)}function r(){var e,t=z;z=[];var n;while(e=t.pop())n=e.base,A(e);t.length||V.componentChange&&V.componentChange(e,n)}function l(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=n({},e.attributes);t.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var i in o)void 0===t[i]&&(t[i]=o[i]);return t}function c(e,t){var n=t?V.doc.createElementNS("http://www.w3.org/2000/svg",e):V.doc.createElement(e);return n.__n=e,n}function u(e){for(var t=e.replace(/\/\*(.|\s)*?\*\//g," ").replace(/\s+/g," "),n={},o=t.match(/ ?(.*?) ?{([^}]*)}/)||[i,r,t],i=o[0],r=o[1],l=o[2],a=l.split(";").map(function(e){return e.split(":").map(function(e){return e&&e.trim()})}),s=a,s=Array.isArray(s),s=0,s=s||s[Symbol.iterator]();;){var c;if(s){if(s>=s.length)break;c=s[s++]}else{if(s=s.next(),s.done)break;c=s.value}var u=c,p=u[0],d=u[1];n[function(e){return e.replace(/\W+\w/g,function(e){return e.slice(-1).toUpperCase()})}(p)]=d}return n}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n,o,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||i)if("style"===t)if(V.isWeb){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var r in n)r in o||(e.style[r]="");for(var r in o)e.style[r]="number"==typeof o[r]&&!1===X.test(r)?o[r]+"px":o[r]}}else{var l=n,a=o;"string"==typeof n&&(l=u(n)),"string"==typeof o&&(a=u(o));var s={},c=!1;if(l){for(var p in l)"object"!=typeof a||p in a||(s[p]="",c=!0);for(var d in a)a[d]!==l[d]&&(s[d]=a[d],c=!0);c&&e.setStyles(s)}else e.setStyles(a)}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var m=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,f,m):e.removeEventListener(t,f,m),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!i&&t in e)v(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var w=i&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?w?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(w?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function v(e,t,n){try{e[t]=n}catch(e){}}function f(e){return this.__l[e.type](V.event&&V.event(e)||e)}function m(){var e;while(e=G.pop())V.afterMount&&V.afterMount(e),e.componentDidMount&&e.componentDidMount(),e.installed&&e.installed()}function w(e,t,n,o,i,r){F++||(J=null!=i&&void 0!==i.ownerSVGElement,K=null!=e&&!("__preactattr_"in e));var l=h(e,t,n,o,r);return i&&l.parentNode!==i&&i.appendChild(l),--F||(K=!1,r||m()),l}function h(e,t,n,o,i){var r=e,l=J;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(r=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(r,e),b(e,!0))),r.t=!0,r;var s=t.nodeName;if("function"==typeof s)return L(e,t,n,o);if(J="svg"===s||"foreignObject"!==s&&J,s+="",(!e||!a(e,s))&&(r=c(s,J),e)){while(e.firstChild)r.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(r,e),b(e,!0)}var u=r.firstChild,p=r.t,d=t.children;if(null==p){p=r.t={};for(var v=r.attributes,f=v.length;f--;)p[v[f].name]=v[f].value}return!K&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&_(r,d,n,o,K||null!=p.dangerouslySetInnerHTML),g(r,t.attributes,p),J=l,r}function _(e,t,n,o,i){var r,a,s,c,u,d=e.childNodes,v=[],f={},m=0,w=0,_=d.length,y=0,g=t?t.length:0;if(0!==_)for(var x=0;x<_;x++){var C=d[x],k=C.t,N=g&&k?C._component?C._component.__k:k.key:null;null!=N?(m++,f[N]=C):(k||(void 0!==C.splitText?!i||C.nodeValue.trim():i))&&(v[y++]=C)}if(0!==g)for(var x=0;x8&&(B=!0)}var I=B?Promise.resolve().then.bind(Promise.resolve()):setTimeout,X=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,z=[],G=[],F=0,J=!1,K=!1,Q={},Y=0;n(R.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),i(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),A(this,2),V.componentChange&&V.componentChange(this,this.base)},update:function(e){this.forceUpdate(e)},render:function(){}});var Z=[];V.root.Omi={h:t,createElement:t,cloneElement:o,Component:R,render:$,rerender:r,options:V,instances:Z},V.root.Omi.version="3.0.4";var ee={h:t,createElement:t,cloneElement:o,Component:R,render:$,rerender:r,options:V,instances:Z};"undefined"!=typeof module?module.exports=ee:self.Omi=ee}(); +!function(){"use strict";function e(){}function t(t,n){var o,i,r,l,a=q;for(l=arguments.length;l-- >2;)P.push(arguments[l]);n&&null!=n.children&&(P.length||P.push(n.children),delete n.children);while(P.length)if((i=P.pop())&&void 0!==i.pop)for(l=i.length;l--;)P.push(i[l]);else"boolean"==typeof i&&(i=null),(r="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i+="":"string"!=typeof i&&(r=!1)),r&&o?a[a.length-1]+=i:a===q?a=[i]:a.push(i),o=r;var s=new e;return s.nodeName=D.isWeb?t:B[t],s.attributes=null==n?void 0:n,a&&"string"==typeof a[0]&&!D.isWeb?s.attributes?s.attributes.value=a[0]:s.attributes={value:a[0]}:s.children=a,s.key=null==n?void 0:n.key,void 0!==D.vnode&&D.vnode(s),s}function n(e,t){for(var n in t)e[n]=t[n];return e}function o(e,o){return t(e.nodeName,n(n({},e.attributes),o),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){1==G.push(e)&&(D.debounceRendering||X)(r)}function r(){var e,t=G;G=[];var n;while(e=t.pop())n=e.base,L(e);t.length||D.componentChange&&D.componentChange(e,n)}function l(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&a(e,t.nodeName):n||e._componentConstructor===t.nodeName}function a(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function s(e){var t=n({},e.attributes);t.children=e.children;var o=e.nodeName.defaultProps;if(void 0!==o)for(var i in o)void 0===t[i]&&(t[i]=o[i]);return t}function c(e,t){var n=t?D.doc.createElementNS("http://www.w3.org/2000/svg",e):D.doc.createElement(e);return n.__n=e,n}function u(e){for(var t=e.replace(/\/\*(.|\s)*?\*\//g," ").replace(/\s+/g," "),n={},o=t.match(/ ?(.*?) ?{([^}]*)}/)||[i,r,t],i=o[0],r=o[1],l=o[2],a=l.split(";").map(function(e){return e.split(":").map(function(e){return e&&e.trim()})}),s=a,s=Array.isArray(s),s=0,s=s||s[Symbol.iterator]();;){var c;if(s){if(s>=s.length)break;c=s[s++]}else{if(s=s.next(),s.done)break;c=s.value}var u=c,p=u[0],d=u[1];n[function(e){return e.replace(/\W+\w/g,function(e){return e.slice(-1).toUpperCase()})}(p)]=d}return n}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function d(e,t,n,o,i){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||i)if("style"===t)if(D.isWeb){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var r in n)r in o||(e.style[r]="");for(var r in o)e.style[r]="number"==typeof o[r]&&!1===z.test(r)?o[r]+"px":o[r]}}else{var l=n,a=o;"string"==typeof n&&(l=u(n)),"string"==typeof o&&(a=u(o));var s={},c=!1;if(l){for(var p in l)"object"!=typeof a||p in a||(s[p]="",c=!0);for(var d in a)a[d]!==l[d]&&(s[d]=a[d],c=!0);c&&e.setStyles(s)}else e.setStyles(a)}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var m=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,f,m):e.removeEventListener(t,f,m),(e.__l||(e.__l={}))[t]=o}else if("list"!==t&&"type"!==t&&!i&&t in e)v(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var w=i&&t!==(t=t.replace(/^xlink:?/,""));null==o||!1===o?w?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(w?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function v(e,t,n){try{e[t]=n}catch(e){}}function f(e){return this.__l[e.type](D.event&&D.event(e)||e)}function m(){var e;while(e=F.pop())D.afterMount&&D.afterMount(e),e.componentDidMount&&e.componentDidMount(),e.installed&&e.installed()}function w(e,t,n,o,i,r){J++||(K=null!=i&&void 0!==i.ownerSVGElement,Q=null!=e&&!("__preactattr_"in e));var l=h(e,t,n,o,r);return i&&l.parentNode!==i&&i.appendChild(l),--J||(Q=!1,r||m()),l}function h(e,t,n,o,i){var r=e,l=K;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||i)?e.nodeValue!=t&&(e.nodeValue=t):(r=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(r,e),b(e,!0))),r.t=!0,r;var s=t.nodeName;if("function"==typeof s)return O(e,t,n,o);if(K="svg"===s||"foreignObject"!==s&&K,s+="",(!e||!a(e,s))&&(r=c(s,K),e)){while(e.firstChild)r.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(r,e),b(e,!0)}var u=r.firstChild,p=r.t,d=t.children;if(null==p){p=r.t={};for(var v=r.attributes,f=v.length;f--;)p[v[f].name]=v[f].value}return!Q&&d&&1===d.length&&"string"==typeof d[0]&&null!=u&&void 0!==u.splitText&&null==u.nextSibling?u.nodeValue!=d[0]&&(u.nodeValue=d[0]):(d&&d.length||null!=u)&&_(r,d,n,o,Q||null!=p.dangerouslySetInnerHTML),g(r,t.attributes,p),K=l,r}function _(e,t,n,o,i){var r,a,s,c,u,d=e.childNodes,v=[],f={},m=0,w=0,_=d.length,y=0,g=t?t.length:0;if(0!==_)for(var C=0;C<_;C++){var x=d[C],k=x.t,N=g&&k?x._component?x._component.__k:k.key:null;null!=N?(m++,f[N]=x):(k||(void 0!==x.splitText?!i||x.nodeValue.trim():i))&&(v[y++]=x)}if(0!==g)for(var C=0;C8&&(H=!0)}var X=H?Promise.resolve().then.bind(Promise.resolve()):setTimeout,z=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,G=[],F=[],J=0,K=!1,Q=!1,Y={},Z=0,ee=0;n($.prototype,{setState:function(e,t){var o=this.state;this.__s||(this.__s=n({},o)),n(o,"function"==typeof e?e(o,this.props):e),t&&(this.__h=this.__h||[]).push(t),i(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),L(this,2),D.componentChange&&D.componentChange(this,this.base)},update:function(e){this.forceUpdate(e)},render:function(){}});var te=[];D.root.Omi={h:t,createElement:t,cloneElement:o,Component:$,render:V,rerender:r,options:D,instances:te},D.root.Omi.version="3.0.5";var ne={h:t,createElement:t,cloneElement:o,Component:$,render:V,rerender:r,options:D,instances:te};"undefined"!=typeof module?module.exports=ne:self.Omi=ne}(); //# sourceMappingURL=omi.min.js.map \ No newline at end of file diff --git a/dist/omi.min.js.map b/dist/omi.min.js.map index 9d5736fb4..b1bfebca2 100644 --- a/dist/omi.min.js.map +++ b/dist/omi.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.js","../src/options.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","String","p","options","isWeb","map","value","key","vnode","extend","obj","props","cloneElement","h","slice","call","ATTR_KEY","component","debounceRendering","defer","rerender","items","element","base","renderComponent","list","componentChange","hydrating","node","_componentConstructor","normalizedNodeName","toLowerCase","defaultProps","doc","createElementNS","createElement","_ref","createNode","match","a","b","cssTxt","isSvg","rule","properties","o","split","x","trim","s","replace","Array","isArray","Symbol","iterator","_ref3","next","done","_ref2","property","style","parseCSSText","cssText","parentNode","removeChild","setAccessor","name","old","className","IS_NON_DIMENSIONAL","test","oldJson","currentJson","changed","ckey","result","substring","setStyles","addEventListener","eventProxy","useCapture","removeEventListener","innerHTML","_listeners","setProperty","removeAttribute","ns","setAttribute","e","this","type","event","diffLevel","c","mounts","isSvgMode","afterMount","installed","diff","dom","context","mountAll","parent","componentRoot","ret","idiff","ownerSVGElement","undefined","out","prevSvgMode","_component","nodeValue","splitText","recollectNodeTree","t","document","vnodeName","buildComponentFromVNode","replaceChild","appendChild","vchildren","innerDiffNode","fc","isHydrating","j","originalChildren","keyed","keyedLen","childrenLen","vlen","_child","f","__key","vchild","min","nextSibling","removeNode","insertBefore","unmountOnly","removeChildren","previousSibling","attrs","collectComponent","components","Ctor","inst","constructor","render","Component","createComponent","prototype","Omi","nextBase","$store","splice","state","scoper","css","prefix","g0","g1","g2","g3","addStyle","id","ele","appendClass","head","getElementsByTagName","someThingStyles","getElementById","textContent","window","ActiveXObject","styleSheet","addStyleWithoutId","attr","scopeVdom","_preStyle","scopedStyle","vdom","staticStyleRendered","setComponentProps","opts","_disable","componentWillReceiveProps","enqueueRender","prevProps","isChild","previousProps","previousState","isUpdate","initialBase","initialChildComponent","previousContext","rendered","shouldComponentUpdate","skip","cbase","componentWillUpdate","beforeUpdate","FORCE_RENDER","prevContext","_id","addScopedAttrStatic","staticStyle","addScopedAttr","getChildContext","childComponent","childProps","getNodeProps","toUnmount","baseParent","SYNC_RENDER","componentRef","unshift","_parentComponent","afterUpdate","componentDidUpdate","_renderCallbacks","flushMounts","oldDom","originalComponent","isDirectOwner","unmountComponent","isOwner","beforeUnmount","ref","merge","Object","querySelector","empty","firstChild","store","componentWillMount","instances","componentDidMount","root","global","Math","self","br","hr","h1","h2","h3","h4","h5","h6","abbr","address","bdi","bdo","blockquote","cite","code","del","ins","dfn","em","strong","samp","kbd","var","mark","pre","q","ruby","rp","rt","small","sub","sup","time","u","wbr","form","input","textarea","button","select","option","optgroup","label","fieldset","datalist","legend","output","iframe","img","canvas","figure","figcaption","audio","source","video","track","nav","link","ul","ol","li","dl","dt","dd","menu","command","table","caption","th","td","tr","thead","tbody","tfoot","col","colgroup","div","main","span","header","footer","section","article","aside","details","dialog","summary","progress","meter","meta","area","script","noscript","embed","object","param","view","scroll-view","swiper","icon","text","checkbox","radio","picker","picker-view","slider","switch","navigator","image","contact-button","block","usePromise","Promise","__config__","platform","systemVersion","resolve","then","bind","setTimeout","ASYNC_RENDER","forceUpdate","callback","update","version","module","exports"],"mappings":"wBACO,SAASA,MCmLT,QAAWC,GAAAA,EAAUC,GAC3B,GAA6BC,GAAYC,EAAOC,EAAQC,EAApDC,EAASC,CACb,KAAKF,EAAEG,UAAUC,OAAQJ,KAA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AAS,QACTC,iBAAkB,iBAClBC,MAAS,SChINC,EAA+B,kBAAXC,QAGxB,IAAwB,gBAAb9O,WAA2C,mBAAX2H,SAA0BA,OAAOoH,EAC3E,GAAmC,YAA/BpH,OAAOoH,EAAWC,SACrBH,GAAAA,MACM,CACN,GAAII,GAAgBtH,OAAOoH,EAAWE,eAAiBtH,OAAOoH,EAAWE,cAActT,MAAM,KAAK,IAAM,CACpGsT,GAAgB,IACnBJ,GAAAA,GAKI,GAAM7U,GAAQ6U,EAAaC,QAAQI,UAAUC,KAAKC,KAAKN,QAAQI,WAAaG,sEE7BtEC,cGoJZ1Q,GAAAA,EChJYD,GAAAA,EA0SV7B,KGzBDuE,EAAAA,CCtPD/H,GAAKkJ,EAAaA,+JAuBlB+B,EAAAjG,OAQCiR,YAAA,SAAoB/I,GACpBjC,IAAcjG,KAAdkI,IAAAlI,KAAAkI,SAAA5N,KAAA4W,GArB0BnV,EAAAiE,KAAA,yDAyB3BmR,OAAA,SAAAD,6CCJCxW,IAAAA,KAEAA,GAAA0O,KAAAtF,SAEDpH,cAAa+D,EACb/F,aAAQkL,EACRjC,UAAOzE,EACPwE,OAAAA,qBEpEKwF,eAILxM,EAAAA,KAAAA,IAFkB0U,QAAA,OAIlBzN,IAAAA,KACAD,EAAAA,EACA/H,cAAAA,EACAjB,aAAAA,EACAwO,UAAAA,EARDxF,OAAAA,aAWAhJ,QAAQ0O,cAEO,oBAEd1M,QAFc2U,OAAAC,QAAAxN,GAAAyF,KAAAzF,IAAAA","file":"omi.min.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","import { VNode } from './vnode';\r\nimport options from './options';\r\n\r\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_'+component.constructor.name);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\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 { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.4';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"]} \ No newline at end of file +{"version":3,"sources":["../src/vnode.js","../src/h.js","../src/util.js","../src/clone-element.js","../src/constants.js","../src/render-queue.js","../src/vdom/index.js","../src/dom/index.js","../src/vdom/diff.js","../src/vdom/component-recycler.js","../src/style.js","../src/vdom/component.js","../src/component.js","../src/render.js","../src/options.js","../src/omi.js"],"names":["VNode","nodeName","attributes","lastSimple","child","simple","i","children","EMPTY_CHILDREN","arguments","length","stack","push","pop","String","p","options","isWeb","map","value","key","vnode","extend","obj","props","cloneElement","h","slice","call","ATTR_KEY","component","debounceRendering","defer","rerender","items","element","base","renderComponent","list","componentChange","hydrating","node","_componentConstructor","normalizedNodeName","toLowerCase","defaultProps","doc","createElementNS","createElement","_ref","createNode","match","a","b","cssTxt","isSvg","rule","properties","o","split","x","trim","s","replace","Array","isArray","Symbol","iterator","_ref3","next","done","_ref2","property","style","parseCSSText","cssText","parentNode","removeChild","setAccessor","name","old","className","IS_NON_DIMENSIONAL","test","oldJson","currentJson","changed","ckey","result","substring","setStyles","addEventListener","eventProxy","useCapture","removeEventListener","innerHTML","_listeners","setProperty","removeAttribute","ns","setAttribute","e","this","type","event","diffLevel","c","mounts","isSvgMode","afterMount","installed","diff","dom","context","mountAll","parent","componentRoot","ret","idiff","ownerSVGElement","undefined","out","prevSvgMode","_component","nodeValue","splitText","recollectNodeTree","t","document","vnodeName","buildComponentFromVNode","replaceChild","appendChild","vchildren","innerDiffNode","fc","isHydrating","j","originalChildren","keyed","keyedLen","childrenLen","vlen","_child","f","__key","vchild","min","nextSibling","removeNode","insertBefore","unmountOnly","removeChildren","previousSibling","attrs","collectComponent","components","Ctor","inst","constructor","render","Component","createComponent","prototype","Omi","nextBase","$store","splice","state","scoper","css","prefix","g0","g1","g2","g3","addStyle","id","ele","appendClass","head","getElementsByTagName","someThingStyles","getElementById","textContent","window","ActiveXObject","styleSheet","addStyleWithoutId","attr","scopeVdom","_preStyle","scopedStyle","vdom","staticStyleRendered","ctor","styleCache","len","item","attrName","opts","_disable","setComponentProps","componentWillReceiveProps","enqueueRender","prevProps","isChild","previousProps","previousState","isUpdate","initialBase","initialChildComponent","previousContext","rendered","shouldComponentUpdate","skip","cbase","componentWillUpdate","beforeUpdate","FORCE_RENDER","prevContext","addScopedAttrStatic","staticStyle","getCtorName","addScopedAttr","_id","childComponent","childProps","getNodeProps","toUnmount","baseParent","SYNC_RENDER","componentRef","unshift","_parentComponent","afterUpdate","componentDidUpdate","_renderCallbacks","flushMounts","oldDom","originalComponent","isDirectOwner","unmountComponent","isOwner","beforeUnmount","ref","merge","Object","querySelector","empty","firstChild","store","componentWillMount","instances","componentDidMount","root","global","Math","self","br","hr","h1","h2","h3","h4","h5","h6","abbr","address","bdi","bdo","blockquote","cite","code","del","ins","dfn","em","strong","samp","kbd","var","mark","pre","q","ruby","rp","rt","small","sub","sup","time","u","wbr","form","input","textarea","button","select","option","optgroup","label","fieldset","datalist","legend","output","iframe","img","canvas","figure","figcaption","audio","source","video","track","nav","link","ul","ol","li","dl","dt","dd","menu","command","table","caption","th","td","tr","thead","tbody","tfoot","col","colgroup","div","main","span","header","footer","section","article","aside","details","dialog","summary","progress","meter","meta","area","script","noscript","embed","object","param","view","scroll-view","swiper","icon","text","checkbox","radio","picker","picker-view","slider","switch","navigator","image","contact-button","block","usePromise","Promise","__config__","platform","systemVersion","resolve","then","bind","setTimeout","ASYNC_RENDER","forceUpdate","callback","update","version","module","exports"],"mappings":"wBACO,SAASA,MCmLT,QAAWC,GAAAA,EAAUC,GAC3B,GAA6BC,GAAYC,EAAOC,EAAQC,EAApDC,EAASC,CACb,KAAKF,EAAEG,UAAUC,OAAQJ,KAAM,GAC9BK,EAAMC,KAAKH,UAAUH,GAElBJ,IAAmC,MAArBA,EAAWK,WACvBI,EAAMD,QAAQC,EAAMC,KAAKV,EAAWK,gBAClCL,GAAWK,SAEnB,OAAOI,EAAMD,OACZ,IAAKN,EAAQO,EAAME,YAAAA,KAAUT,EAAMS,IAClC,IAAKP,EAAEF,EAAMM,OAAQJ,KAAOK,EAAMC,KAAKR,EAAME,QAG1B,iBAARF,KAAmBA,EAAQ,OAEjCC,EAA2B,kBAAXJ,MACT,MAAP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S,SChINC,EAA+B,kBAAXC,QAGxB,IAAwB,gBAAbnP,WAA2C,mBAAXgI,SAA0BA,OAAOoH,EAC3E,GAAmC,YAA/BpH,OAAOoH,EAAWC,SACrBH,GAAAA,MACM,CACN,GAAII,GAAgBtH,OAAOoH,EAAWE,eAAiBtH,OAAOoH,EAAWE,cAAc3T,MAAM,KAAK,IAAM,CACpG2T,GAAgB,IACnBJ,GAAAA,GAKI,GAAMlV,GAAQkV,EAAaC,QAAQI,UAAUC,KAAKC,KAAKN,QAAQI,WAAaG,sEE7BtEC,cGoJZ/Q,GAAAA,EChJYD,GAAAA,EA0SV7B,KEnNEmG,EAAOgB,ECgNV5C,GAAWjH,CC5QZd,GAAKkJ,EAAaA,+JAuBlBoC,EAAAtG,OAQCsR,YAAA,SAAoB/I,GACpBjC,IAActG,KAAduI,IAAAvI,KAAAuI,SAAAjO,KAAAiX,GArB0BxV,EAAAiE,KAAA,yDAyB3BwR,OAAA,SAAAD,6CCJC7W,IAAAA,MAEAA,GAAA+O,KAAA3F,SAEDpH,cAAa+D,EACb/F,aAAQkL,EACRjC,UAAOzE,EACPwE,OAAAA,qBEpEK6F,gBAIL7M,EAAAA,KAAAA,IAFkB+U,QAAA,OAIlB9N,IAAAA,KACAD,EAAAA,EACA/H,cAAAA,EACAjB,aAAAA,EACA6O,UAAAA,EARD7F,OAAAA,aAWAhJ,QAAQ+O,eAEO,oBAEd/M,QAFcgV,OAAAC,QAAA7N,GAAA8F,KAAA9F,IAAAA","file":"omi.min.js","sourcesContent":["/** Virtual DOM Node */\r\nexport function VNode() {}\r\n","import { VNode } from './vnode';\r\nimport options from './options';\r\n\r\n\r\nconst stack = [];\r\n\r\nconst EMPTY_CHILDREN = [];\r\n\r\nconst map = {\r\n\t'br': 'view',\r\n\t'hr': 'view',\r\n\r\n\t'p': 'view',\r\n\t'h1': 'view',\r\n\t'h2': 'view',\r\n\t'h3': 'view',\r\n\t'h4': 'view',\r\n\t'h5': 'view',\r\n\t'h6': 'view',\r\n\t'abbr': 'view',\r\n\t'address': 'view',\r\n\t'b': 'view',\r\n\t'bdi': 'view',\r\n\t'bdo': 'view',\r\n\t'blockquote': 'view',\r\n\t'cite': 'view',\r\n\t'code': 'view',\r\n\t'del': 'view',\r\n\t'ins': 'view',\r\n\t'dfn': 'view',\r\n\t'em': 'view',\r\n\t'strong': 'view',\r\n\t'samp': 'view',\r\n\t'kbd': 'view',\r\n\t'var': 'view',\r\n\t'i': 'view',\r\n\t'mark': 'view',\r\n\t'pre': 'view',\r\n\t'q': 'view',\r\n\t'ruby': 'view',\r\n\t'rp': 'view',\r\n\t'rt': 'view',\r\n\t's': 'view',\r\n\t'small': 'view',\r\n\t'sub': 'view',\r\n\t'sup': 'view',\r\n\t'time': 'view',\r\n\t'u': 'view',\r\n\t'wbr': 'view',\r\n\r\n\t'form': 'form',\r\n\t'input': 'input',\r\n\t'textarea': 'textarea',\r\n\t'button': 'button',\r\n\t'select': 'picker',\r\n\t'option': 'view',\r\n\t'optgroup': 'view',\r\n\t'label': 'label',\r\n\t'fieldset': 'view',\r\n\t'datalist': 'picker',\r\n\t'legend': 'view',\r\n\t'output': 'view',\r\n\r\n\t'iframe': 'view',\r\n \r\n\t'img': 'image',\r\n\t'canvas': 'canvas',\r\n\t'figure': 'view',\r\n\t'figcaption': 'view',\r\n\r\n \r\n\t'audio': 'audio',\r\n\t'source': 'audio',\r\n\t'video': 'video',\r\n\t'track': 'video',\r\n \r\n\t'a': 'navigator',\r\n\t'nav': 'view',\r\n\t'link': 'navigator',\r\n\r\n\t'ul': 'view',\r\n\t'ol': 'view',\r\n\t'li': 'view',\r\n\t'dl': 'view',\r\n\t'dt': 'view',\r\n\t'dd': 'view',\r\n\t'menu': 'view',\r\n\t'command': 'view',\r\n\r\n\r\n\t'table': 'view',\r\n\t'caption': 'view',\r\n\t'th': 'view',\r\n\t'td': 'view',\r\n\t'tr': 'view',\r\n\t'thead': 'view',\r\n\t'tbody': 'view',\r\n\t'tfoot': 'view',\r\n\t'col': 'view',\r\n\t'colgroup': 'view',\r\n\r\n\r\n\t'div': 'view',\r\n\t'main': 'view',\r\n\t//'span': 'label',\r\n\t'span': 'text',\r\n\t'header': 'view',\r\n\t'footer': 'view',\r\n\t'section': 'view',\r\n\t'article': 'view',\r\n\t'aside': 'view',\r\n\t'details': 'view',\r\n\t'dialog': 'view',\r\n\t'summary': 'view',\r\n\r\n\t'progress': 'progress',\r\n\t'meter': 'progress',\r\n\t'head': 'view',\r\n\t'meta': 'view',\r\n\t'base': 'text',\r\n\t'map': 'map',\r\n\t'area': 'navigator',\r\n\r\n\t'script': 'view',\r\n\t'noscript': 'view',\r\n\t'embed': 'view',\r\n\t'object': 'view',\r\n\t'param': 'view',\r\n\r\n\t'view': 'view',\r\n\t'scroll-view': 'scroll-view',\r\n\t'swiper': 'swiper',\r\n\t'icon': 'icon',\r\n\t'text': 'text',\r\n\r\n\t\r\n\r\n\r\n\t'checkbox': 'checkbox',\r\n\t'radio': 'radio',\r\n\t'picker': 'picker',\r\n\t'picker-view': 'picker-view',\r\n\t'slider': 'slider',\r\n\t'switch': 'switch',\r\n\t'navigator': 'navigator',\r\n\t\r\n\t'image': 'image',\r\n\t'contact-button': 'contact-button',\r\n\t'block': 'block'\r\n};\r\n\r\n\r\n/**\r\n * JSX/hyperscript reviver.\r\n * @see http://jasonformat.com/wtf-is-jsx\r\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\r\n *\r\n * Note: this is exported as both `h()` and `createElement()` for compatibility reasons.\r\n *\r\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a lightweight representation\r\n * of the structure of a DOM tree. This structure can be realized by recursively comparing it against\r\n * the current _actual_ DOM structure, and applying only the differences.\r\n *\r\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\r\n * and optionally children to append to the element.\r\n *\r\n * @example The following DOM tree\r\n *\r\n * `
Hello!
`\r\n *\r\n * can be constructed using this function as:\r\n *\r\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\r\n *\r\n * @param {string} nodeName\tAn element name. Ex: `div`, `a`, `span`, etc.\r\n * @param {Object} attributes\tAny attributes/props to set on the created element.\r\n * @param rest\t\t\tAdditional arguments are taken to be children to append. Can be infinitely nested Arrays.\r\n *\r\n * @public\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 = options.isWeb?nodeName:map[nodeName];\r\n\tp.attributes = attributes == null ? undefined : attributes;\r\n\tif (children && typeof children[0] === 'string'&& !options.isWeb) {\r\n\t\tif (p.attributes) {\r\n\t\t\tp.attributes.value = children[0];\r\n\t\t} else {\r\n\t\t\tp.attributes = { value: children[0] };\r\n\t\t}\r\n\t} else {\r\n\t\tp.children = children;\r\n\t}\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","/**\r\n * Copy all properties from `props` onto `obj`.\r\n * @param {Object} obj\t\tObject onto which properties should be copied.\r\n * @param {Object} props\tObject from which to copy properties.\r\n * @returns obj\r\n * @private\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/**\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 *\r\n * @param {Function} callback\r\n */\r\n\r\nlet usePromise = typeof Promise == 'function';\r\n\r\n// for native\r\nif (typeof document !== 'object' && typeof global !== 'undefined' && global.__config__) {\r\n\tif (global.__config__.platform === 'android') {\r\n\t\tusePromise = true;\r\n\t} else {\r\n\t\tlet systemVersion = global.__config__.systemVersion && global.__config__.systemVersion.split('.')[0] || 0;\r\n\t\tif (systemVersion > 8) {\r\n\t\t\tusePromise = true;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport const defer = usePromise ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\r\n","import { extend } from './util';\r\nimport { h } from './h';\r\n\r\n/**\r\n * Clones the given VNode, optionally adding attributes/props and replacing its children.\r\n * @param {VNode} vnode\t\tThe virtual DOM element to clone\r\n * @param {Object} props\tAttributes/props to add when cloning\r\n * @param {VNode} rest\t\tAny additional arguments will be used as replacement children.\r\n */\r\nexport function cloneElement(vnode, props) {\r\n\treturn h(\r\n\t\tvnode.nodeName,\r\n\t\textend(extend({}, vnode.attributes), props),\r\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\r\n\t);\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 options from './options';\r\nimport { defer } from './util';\r\nimport { renderComponent } from './vdom/component';\r\n\r\n/** Managed queue of dirty components to be re-rendered */\r\n\r\nlet items = [];\r\n\r\nexport function enqueueRender(component) {\r\n\tif (items.push(component)==1) {\r\n\t\t(options.debounceRendering || defer)(rerender);\r\n\t}\r\n}\r\n\r\nexport function rerender() {\r\n\tlet p, list = items;\r\n\titems = [];\r\n\tlet element;\r\n\twhile ( (p = list.pop()) ) {\r\n\t\telement = p.base;\r\n\t\trenderComponent(p);\r\n\t}\r\n\tif (!list.length) {\r\n\t\tif (options.componentChange) options.componentChange(p, element);\r\n\t}\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 options from '../options';\r\n\r\n\r\n/** Create an element with the given nodeName.\r\n *\t@param {String} nodeName\r\n *\t@param {Boolean} [isSvg=false]\tIf `true`, creates an element within the SVG namespace.\r\n *\t@returns {Element} node\r\n */\r\nexport function createNode(nodeName, isSvg) {\r\n\tlet node = isSvg ? options.doc.createElementNS('http://www.w3.org/2000/svg', nodeName) : options.doc.createElement(nodeName);\r\n\tnode.normalizedNodeName = nodeName;\r\n\treturn node;\r\n}\r\n\r\nfunction parseCSSText(cssText) {\r\n\tlet cssTxt = cssText.replace(/\\/\\*(.|\\s)*?\\*\\//g, \" \").replace(/\\s+/g, \" \");\r\n\tlet style = {}, [a,b,rule] = cssTxt.match(/ ?(.*?) ?{([^}]*)}/)||[a,b,cssTxt];\r\n\tlet cssToJs = s => s.replace(/\\W+\\w/g, match => match.slice(-1).toUpperCase());\r\n\tlet properties = rule.split(\";\").map(o => o.split(\":\").map(x => x && x.trim()));\r\n\tfor (let [property, value] of properties) style[cssToJs(property)] = value;\r\n\treturn style;\r\n}\r\n\r\n/** Remove a child node from its parent if attached.\r\n *\t@param {Element} node\t\tThe 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/** Set a named attribute on the given Node, with special behavior for some names and event handlers.\r\n *\tIf `value` is `null`, the attribute/handler will be removed.\r\n *\t@param {Element} node\tAn element to mutate\r\n *\t@param {string} name\tThe name/key to set, such as an event or attribute name\r\n *\t@param {any} old\tThe last value that was set for this name/node pair\r\n *\t@param {any} value\tAn attribute value, such as a function to be used as an event handler\r\n *\t@param {Boolean} isSvg\tAre we currently diffing inside an svg?\r\n *\t@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\tif (old) old(null);\r\n\t\tif (value) 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 (options.isWeb) {\r\n\t\t\tif (!value || typeof value==='string' || typeof old==='string') {\r\n\t\t\t\tnode.style.cssText = value || '';\r\n\t\t\t}\r\n\t\t\tif (value && typeof value==='object') {\r\n\t\t\t\tif (typeof old!=='string') {\r\n\t\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\r\n\t\t\t\t}\r\n\t\t\t\tfor (let i in value) {\r\n\t\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\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tlet oldJson = old,\r\n\t\t\t\tcurrentJson = value;\r\n\t\t\tif (typeof old === 'string') {\r\n\t\t\t\toldJson = parseCSSText(old);\r\n\t\t\t}\r\n\t\t\tif (typeof value == 'string') {\r\n\t\t\t\tcurrentJson = parseCSSText(value);\r\n\t\t\t}\r\n\t\t\r\n\t\t\tlet result = {},\r\n\t\t\t\tchanged = false;\r\n\t\t\r\n\t\t\tif (oldJson) {\r\n\t\t\t\tfor (let key in oldJson) {\r\n\t\t\t\t\tif (typeof currentJson == 'object' && !(key in currentJson)) {\r\n\t\t\t\t\t\tresult[key] = '';\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tfor (let ckey in currentJson) {\r\n\t\t\t\t\tif (currentJson[ckey] !== oldJson[ckey]) {\r\n\t\t\t\t\t\tresult[ckey] = currentJson[ckey];\r\n\t\t\t\t\t\tchanged = true;\r\n\t\t\t\t\t}\r\n\t\t\r\n\t\t\t\t}\r\n\t\t\r\n\t\t\t\tif (changed) {\r\n\t\t\t\t\tnode.setStyles(result);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tnode.setStyles(currentJson);\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\tsetProperty(node, name, value==null ? '' : value);\r\n\t\tif (value==null || value===false) node.removeAttribute(name);\r\n\t}\r\n\telse {\r\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\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!=='function') {\r\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\r\n\t\t\telse node.setAttribute(name, value);\r\n\t\t}\r\n\t}\r\n}\r\n\r\n\r\n/** Attempt to set a DOM property to the given value.\r\n *\tIE & FF throw for certain property-value combinations.\r\n */\r\nfunction setProperty(node, name, value) {\r\n\ttry {\r\n\t\tnode[name] = value;\r\n\t} catch (e) { }\r\n}\r\n\r\n\r\n/** Proxy an event to hooked event handlers\r\n *\t@private\r\n */\r\nfunction eventProxy(e) {\r\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\r\n}\r\n","import { ATTR_KEY } from '../constants';\r\nimport { isSameNodeType, isNamedNode } from './index';\r\nimport { buildComponentFromVNode } from './component';\r\nimport { createNode, setAccessor } from '../dom/index';\r\nimport { unmountComponent } from './component';\r\nimport options from '../options';\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/** Invoke queued componentDidMount lifecycle methods */\r\nexport function flushMounts() {\r\n\tlet c;\r\n\twhile ((c=mounts.pop())) {\r\n\t\tif (options.afterMount) options.afterMount(c);\r\n\t\tif (c.componentDidMount) c.componentDidMount();\r\n\t\tif (c.installed) c.installed();\r\n\t}\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\tif (!componentRoot) flushMounts();\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\tif (typeof vnodeName==='function') {\r\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\r\n\t}\r\n\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 {\r\n\t\tif (typeof g2 === 'undefined') {\r\n\t\t\tg2 = '';\r\n\t\t}\r\n\r\n\t\t/* eslint-ignore-next-line */\r\n\t\tif (g1.match(/^\\s*(@media|\\d+%?|@-webkit-keyframes|@keyframes|to|from|@font-face)/)) {\r\n\t\t\treturn g1 + g2 + g3;\r\n\t\t}\r\n\r\n\t\tlet appendClass = g1.replace(/(\\s*)$/, '') + prefix + g2;\r\n\t\t//let prependClass = prefix + ' ' + g1.trim() + g2;\r\n\r\n\t\treturn appendClass + g3;\r\n\t\t//return appendClass + ',' + prependClass + g3;\r\n\t});\r\n\r\n\treturn css;\r\n}\r\n\r\nexport function addStyle(cssText, id) {\r\n\tid = id.toLowerCase();\r\n\tlet ele = document.getElementById(id);\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tif (ele && ele.parentNode === head) {\r\n\t\thead.removeChild(ele);\r\n\t}\r\n\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\tsomeThingStyles.setAttribute('id', id);\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\nexport function addStyleWithoutId(cssText) {\r\n\tlet head = document.getElementsByTagName('head')[0];\r\n\tlet someThingStyles = document.createElement('style');\r\n\thead.appendChild(someThingStyles);\r\n\tsomeThingStyles.setAttribute('type', 'text/css');\r\n\r\n\tif (window.ActiveXObject) {\r\n\t\tsomeThingStyles.styleSheet.cssText = cssText;\r\n\t} else {\r\n\t\tsomeThingStyles.textContent = cssText;\r\n\t}\r\n}\r\n\r\n\r\nexport function addScopedAttr(vdom, style, attr, component) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tstyle = scoper(style, attr);\r\n\t\tif (style !== component._preStyle) {\r\n\t\t\taddStyle(style, attr);\r\n\t\t}\r\n\t} else if (style !== component._preStyle) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n\tcomponent._preStyle = style;\r\n}\r\n\r\nexport function addScopedAttrStatic(vdom, style, attr) {\r\n\tif (options.scopedStyle) {\r\n\t\tscopeVdom(attr, vdom);\r\n\t\tif (!options.staticStyleRendered) {\r\n\t\t\taddStyle(scoper(style, attr), attr);\r\n\t\t}\r\n\t} else if (!options.staticStyleRendered) {\r\n\t\taddStyleWithoutId(style);\r\n\t}\r\n}\r\n\r\nexport function scopeVdom(attr,vdom){\r\n\tif (typeof vdom!== 'string'){\r\n\t\tvdom.attributes = vdom.attributes||{};\r\n\t\tvdom.attributes[attr] = '';\r\n\t\tvdom.children.forEach(child=>scopeVdom(attr,child));\r\n\t}\r\n}","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\r\nimport options from '../options';\r\nimport { extend } from '../util';\r\nimport { enqueueRender } from '../render-queue';\r\nimport { getNodeProps } from './index';\r\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\r\nimport { createComponent, collectComponent } from './component-recycler';\r\nimport { removeNode } from '../dom/index';\r\nimport {addScopedAttr, addScopedAttrStatic} from '../style';\r\n\r\nlet id = 0;\r\n\r\nfunction getCtorName(ctor) {\r\n\r\n\tfor (let i = 0, len = options.styleCache.length; i < len; i++) {\r\n\t\tlet item = options.styleCache[i];\r\n\r\n\t\tif (item.ctor === ctor) {\r\n\t\t\treturn item.attrName\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tlet attrName = 'static_' + id;\r\n\toptions.styleCache.push({ ctor: ctor, attrName: attrName });\r\n\tid++\r\n\r\n\r\n\treturn attrName;\r\n}\r\n\r\n/** Set a component's `props` (generally derived from JSX attributes).\r\n *\t@param {Object} props\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.renderSync=false]\tIf `true` and {@link options.syncComponentUpdates} is `true`, triggers synchronous rendering.\r\n *\t@param {boolean} [opts.render=true]\t\t\tIf `false`, no render will be triggered.\r\n */\r\nexport function setComponentProps(component, props, opts, context, mountAll) {\r\n\tif (component._disable) return;\r\n\tcomponent._disable = true;\r\n\r\n\tif ((component.__ref = props.ref)) delete props.ref;\r\n\tif ((component.__key = props.key)) delete props.key;\r\n\r\n\tif (!component.base || mountAll) {\r\n\t\tif (component.componentWillMount) component.componentWillMount();\r\n\t\tif (component.install) component.install();\r\n\t}\r\n\telse if (component.componentWillReceiveProps) {\r\n\t\tcomponent.componentWillReceiveProps(props, context);\r\n\t}\r\n\r\n\tif (context && context!==component.context) {\r\n\t\tif (!component.prevContext) component.prevContext = component.context;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tif (!component.prevProps) component.prevProps = component.props;\r\n\tcomponent.props = props;\r\n\r\n\tcomponent._disable = false;\r\n\r\n\tif (opts!==NO_RENDER) {\r\n\t\tif (opts===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\r\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\r\n\t\t}\r\n\t\telse {\r\n\t\t\tenqueueRender(component);\r\n\t\t}\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(component);\r\n}\r\n\r\n/** Render a Component, triggering necessary lifecycle events and taking High-Order Components into account.\r\n *\t@param {Component} component\r\n *\t@param {Object} [opts]\r\n *\t@param {boolean} [opts.build=false]\t\tIf `true`, component will build and store a DOM node if not already associated with one.\r\n *\t@private\r\n */\r\nexport function renderComponent(component, opts, mountAll, isChild) {\r\n\tif (component._disable) return;\r\n\r\n\tlet props = component.props,\r\n\t\tstate = component.state,\r\n\t\tcontext = component.context,\r\n\t\tpreviousProps = component.prevProps || props,\r\n\t\tpreviousState = component.prevState || state,\r\n\t\tpreviousContext = component.prevContext || context,\r\n\t\tisUpdate = component.base,\r\n\t\tnextBase = component.nextBase,\r\n\t\tinitialBase = isUpdate || nextBase,\r\n\t\tinitialChildComponent = component._component,\r\n\t\tskip = false,\r\n\t\trendered, inst, cbase;\r\n\r\n\t// if updating\r\n\tif (isUpdate) {\r\n\t\tcomponent.props = previousProps;\r\n\t\tcomponent.state = previousState;\r\n\t\tcomponent.context = previousContext;\r\n\t\tif (opts!==FORCE_RENDER\r\n\t\t\t&& component.shouldComponentUpdate\r\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\r\n\t\t\tskip = true;\r\n\t\t}\r\n\t\telse if (component.componentWillUpdate) {\r\n\t\t\tcomponent.componentWillUpdate(props, state, context);\r\n\t\t}\r\n\t\telse if (component.beforeUpdate) {\r\n\t\t\tcomponent.beforeUpdate(props, state, context);\r\n\t\t}\r\n\t\tcomponent.props = props;\r\n\t\tcomponent.state = state;\r\n\t\tcomponent.context = context;\r\n\t}\r\n\r\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\r\n\r\n\tif (!skip) {\r\n\t\trendered = component.render(props, state, context);\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (component.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor));\r\n\r\n\t\t}\r\n\r\n\t\tif (component.style){\r\n\t\t\taddScopedAttr(rendered,component.style(),'_style_'+component._id,component);\r\n\t\t}\r\n\r\n\t\t// context to pass to the child, can be updated via (grand-)parent component\r\n\t\tif (component.getChildContext) {\r\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\r\n\t\t}\r\n\r\n\t\tlet childComponent = rendered && rendered.nodeName,\r\n\t\t\ttoUnmount, base;\r\n\r\n\t\tif (typeof childComponent==='function') {\r\n\t\t\t// set up high order component link\r\n\r\n\t\t\tlet childProps = getNodeProps(rendered);\r\n\t\t\tinst = initialChildComponent;\r\n\r\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\r\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\ttoUnmount = inst;\r\n\r\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\r\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\r\n\t\t\t\tinst._parentComponent = component;\r\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\r\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\r\n\t\t\t}\r\n\r\n\t\t\tbase = inst.base;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tcbase = initialBase;\r\n\r\n\t\t\t// destroy high order component link\r\n\t\t\ttoUnmount = initialChildComponent;\r\n\t\t\tif (toUnmount) {\r\n\t\t\t\tcbase = component._component = null;\r\n\t\t\t}\r\n\r\n\t\t\tif (initialBase || opts===SYNC_RENDER) {\r\n\t\t\t\tif (cbase) cbase._component = null;\r\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\r\n\t\t\tlet baseParent = initialBase.parentNode;\r\n\t\t\tif (baseParent && base!==baseParent) {\r\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\r\n\r\n\t\t\t\tif (!toUnmount) {\r\n\t\t\t\t\tinitialBase._component = null;\r\n\t\t\t\t\trecollectNodeTree(initialBase, false);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (toUnmount) {\r\n\t\t\tunmountComponent(toUnmount);\r\n\t\t}\r\n\r\n\t\tcomponent.base = base;\r\n\t\tif (base && !isChild) {\r\n\t\t\tlet componentRef = component,\r\n\t\t\t\tt = component;\r\n\t\t\twhile ((t=t._parentComponent)) {\r\n\t\t\t\t(componentRef = t).base = base;\r\n\t\t\t}\r\n\t\t\tbase._component = componentRef;\r\n\t\t\tbase._componentConstructor = componentRef.constructor;\r\n\t\t}\r\n\t}\r\n\r\n\tif (!isUpdate || mountAll) {\r\n\t\tmounts.unshift(component);\r\n\t}\r\n\telse if (!skip) {\r\n\t\t// Ensure that pending componentDidMount() hooks of child components\r\n\t\t// are called before the componentDidUpdate() hook in the parent.\r\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\r\n\t\t// flushMounts();\r\n\r\n\t\tif (component.componentDidUpdate) {\r\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (component.afterUpdate) {\r\n\t\t\tcomponent.afterUpdate(previousProps, previousState, previousContext);\r\n\t\t}\r\n\t\tif (options.afterUpdate) options.afterUpdate(component);\r\n\t}\r\n\r\n\tif (component._renderCallbacks!=null) {\r\n\t\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\r\n\t}\r\n\r\n\tif (!diffLevel && !isChild) flushMounts();\r\n}\r\n\r\n\r\n\r\n/** Apply the Component referenced by a VNode to the DOM.\r\n *\t@param {Element} dom\tThe DOM node to mutate\r\n *\t@param {VNode} vnode\tA Component-referencing VNode\r\n *\t@returns {Element} dom\tThe created/mutated element\r\n *\t@private\r\n */\r\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\r\n\tlet c = dom && dom._component,\r\n\t\toriginalComponent = c,\r\n\t\toldDom = dom,\r\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\r\n\t\tisOwner = isDirectOwner,\r\n\t\tprops = getNodeProps(vnode);\r\n\twhile (c && !isOwner && (c=c._parentComponent)) {\r\n\t\tisOwner = c.constructor===vnode.nodeName;\r\n\t}\r\n\r\n\tif (c && isOwner && (!mountAll || c._component)) {\r\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\t}\r\n\telse {\r\n\t\tif (originalComponent && !isDirectOwner) {\r\n\t\t\tunmountComponent(originalComponent);\r\n\t\t\tdom = oldDom = null;\r\n\t\t}\r\n\r\n\t\tc = createComponent(vnode.nodeName, props, context);\r\n\t\tif (dom && !c.nextBase) {\r\n\t\t\tc.nextBase = dom;\r\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\r\n\t\t\toldDom = null;\r\n\t\t}\r\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\r\n\t\tdom = c.base;\r\n\r\n\t\tif (oldDom && dom!==oldDom) {\r\n\t\t\toldDom._component = null;\r\n\t\t\trecollectNodeTree(oldDom, false);\r\n\t\t}\r\n\t}\r\n\r\n\treturn dom;\r\n}\r\n\r\n\r\n\r\n/** Remove a component from the DOM and recycle it.\r\n *\t@param {Component} component\tThe Component instance to unmount\r\n *\t@private\r\n */\r\nexport function unmountComponent(component) {\r\n\tif (options.beforeUnmount) options.beforeUnmount(component);\r\n\r\n\tlet base = component.base;\r\n\r\n\tcomponent._disable = true;\r\n\r\n\tif (component.componentWillUnmount) component.componentWillUnmount();\r\n\tif (component.uninstall) component.uninstall();\r\n\t\r\n\tcomponent.base = null;\r\n\r\n\t// recursively tear down & recollect high-order component children:\r\n\tlet inner = component._component;\r\n\tif (inner) {\r\n\t\tunmountComponent(inner);\r\n\t}\r\n\telse if (base) {\r\n\t\tif (base[ATTR_KEY] && base[ATTR_KEY].ref) base[ATTR_KEY].ref(null);\r\n\r\n\t\tcomponent.nextBase = base;\r\n\r\n\t\tremoveNode(base);\r\n\t\tcollectComponent(component);\r\n\r\n\t\tremoveChildren(base);\r\n\t}\r\n\r\n\tif (component.__ref) component.__ref(null);\r\n}\r\n","import { FORCE_RENDER } from './constants';\r\nimport { extend } from './util';\r\nimport { renderComponent } from './vdom/component';\r\nimport { enqueueRender } from './render-queue';\r\nimport options from './options';\r\n\r\nlet id = 0;\r\nfunction getId(){\r\n\treturn id++;\r\n}\r\n/** Base Component class.\r\n *\tProvides `setState()` and `forceUpdate()`, which trigger rendering.\r\n *\t@public\r\n *\r\n *\t@example\r\n *\tclass MyFoo extends Component {\r\n *\t\trender(props, state) {\r\n *\t\t\treturn
;\r\n *\t\t}\r\n *\t}\r\n */\r\nexport function Component(props, context) {\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.context = context;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.props = props;\r\n\r\n\t/** @public\r\n\t *\t@type {object}\r\n\t */\r\n\tthis.state = this.state || {};\r\n\r\n\tthis._id = getId();\r\n\r\n\tthis._preStyle = null;\r\n\r\n\tthis.$store = null;\r\n\r\n}\r\n\r\n\r\nextend(Component.prototype, {\r\n\r\n\t/** Returns a `boolean` indicating if the component should re-render when receiving the given `props` and `state`.\r\n\t *\t@param {object} nextProps\r\n\t *\t@param {object} nextState\r\n\t *\t@param {object} nextContext\r\n\t *\t@returns {Boolean} should the component re-render\r\n\t *\t@name shouldComponentUpdate\r\n\t *\t@function\r\n\t */\r\n\r\n\r\n\t/** Update component state by copying properties from `state` to `this.state`.\r\n\t *\t@param {object} state\t\tA hash of state properties to update with new values\r\n\t *\t@param {function} callback\tA function to be called once component state is updated\r\n\t */\r\n\tsetState(state, callback) {\r\n\t\tlet s = this.state;\r\n\t\tif (!this.prevState) this.prevState = extend({}, s);\r\n\t\textend(s, typeof state==='function' ? state(s, this.props) : state);\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\tenqueueRender(this);\r\n\t},\r\n\r\n\r\n\t/** Immediately perform a synchronous re-render of the component.\r\n\t *\t@param {function} callback\t\tA function to be called after component is re-rendered.\r\n\t *\t@private\r\n\t */\r\n\tforceUpdate(callback) {\r\n\t\tif (callback) (this._renderCallbacks = (this._renderCallbacks || [])).push(callback);\r\n\t\trenderComponent(this, FORCE_RENDER);\r\n\t\tif (options.componentChange) options.componentChange(this, this.base);\r\n\t},\r\n\r\n\tupdate(callback){\r\n\t\tthis.forceUpdate(callback);\r\n\t},\r\n\r\n\t/** Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\r\n\t *\tVirtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\r\n\t *\t@param {object} props\t\tProps (eg: JSX attributes) received from parent element/component\r\n\t *\t@param {object} state\t\tThe component's current state\r\n\t *\t@param {object} context\t\tContext object (if a parent component has provided context)\r\n\t *\t@returns VNode\r\n\t */\r\n\trender() {}\r\n\r\n});\r\n","import { diff } from './vdom/diff';\r\nimport { Component } from './component';\r\nimport options from './options';\r\nimport {addScopedAttr, addScopedAttrStatic} from './style';\r\n\r\n/** Render JSX into a `parent` Element.\r\n *\t@param {VNode} vnode\t\tA (JSX) VNode to render\r\n *\t@param {Element} parent\t\tDOM element to render into\r\n *\t@param {Element} [merge]\tAttempt to re-use an existing DOM tree rooted at `merge`\r\n *\t@public\r\n *\r\n *\t@example\r\n *\t// render a div into :\r\n *\trender(
hello!
, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => { name };\r\n *\trender(, document.querySelector('#foo'));\r\n */\r\nexport function render(vnode, parent, merge) {\r\n\tmerge = Object.assign({\r\n\t\tstore: {}\r\n\t}, merge);\r\n\tif (typeof window === 'undefined') {\r\n\t\tif (vnode instanceof Component&&merge){\r\n\t\t\tvnode.$store = merge.store;\r\n\t\t}\r\n\t\treturn;\r\n\t}\r\n\toptions.staticStyleRendered = false;\r\n\r\n\tparent = typeof parent === 'string' ? document.querySelector(parent) : parent;\r\n\t\r\n\tif (merge.merge){\r\n\t\tmerge.merge = typeof merge.merge === 'string' ? document.querySelector(merge.merge) : merge.merge;\r\n\t}\r\n\tif (merge.empty){\r\n\t\twhile (parent.firstChild){\r\n\t\t\tparent.removeChild(parent.firstChild);\r\n\t\t}\r\n\t}\r\n\tmerge.store.ssrData = options.root.__omiSsrData;\r\n\toptions.$store = merge.store;\r\n\r\n\tif (vnode instanceof Component) {\r\n\t\tif (window && window.Omi){\r\n\t\t\twindow.Omi.instances.push(vnode);\r\n\t\t}\r\n\t\t\r\n\t\tvnode.$store = merge.store;\r\n\t\t\r\n\t\tif (vnode.componentWillMount) vnode.componentWillMount();\r\n\t\tif (vnode.install) vnode.install();\r\n\t\tconst rendered = vnode.render(vnode.props, vnode.state, vnode.context);\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\r\n\t\t}\r\n\t\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+vnode.constructor.name, !vnode.base);\r\n\t\t}\r\n\r\n\t\tvnode.base = diff(merge.merge, rendered, {}, false, parent, false);\r\n\t\t\r\n\t\tif (vnode.componentDidMount) vnode.componentDidMount();\r\n\t\tif (vnode.installed) vnode.installed();\r\n\t\toptions.staticStyleRendered = true;\r\n\t\treturn vnode.base;\r\n\t}\r\n\r\n\tlet result = diff(merge.merge, vnode, {}, false, parent, false);\r\n\toptions.staticStyleRendered = true;\r\n\treturn result;\r\n}\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\tscopedStyle: true,\r\n\t$store: null,\r\n\tisWeb: true,\r\n\tstaticStyleRendered: false,\r\n\tdoc: typeof document === 'object' ? document : null,\r\n\troot: getGlobal(),\r\n\t//styleCache :[{ctor:ctor,ctorName:ctorName,style:style}]\r\n\tstyleCache: []\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 { h, h as createElement } from './h';\r\nimport { cloneElement } from './clone-element';\r\nimport { Component } from './component';\r\nimport { render } from './render';\r\nimport { rerender } from './render-queue';\r\nimport options from './options';\r\n\r\nconst instances = [];\r\n\r\noptions.root.Omi = {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\noptions.root.Omi.version = '3.0.5';\r\n\r\nexport default {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n\r\nexport {\r\n\th,\r\n\tcreateElement,\r\n\tcloneElement,\r\n\tComponent,\r\n\trender,\r\n\trerender,\r\n\toptions,\r\n\tinstances\r\n};\r\n"]} \ No newline at end of file diff --git a/package.json b/package.json index cf71121b4..7b058d349 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "omi", - "version": "3.0.4", + "version": "3.0.5", "description": "Omi === Preact + Scoped CSS + Store System + Native Support in 3kb javascript.", "main": "dist/omi.js", "jsnext:main": "dist/omi.esm.js", diff --git a/src/omi.js b/src/omi.js index a04002150..a643de806 100644 --- a/src/omi.js +++ b/src/omi.js @@ -18,7 +18,7 @@ options.root.Omi = { instances }; -options.root.Omi.version = '3.0.4'; +options.root.Omi.version = '3.0.5'; export default { h, diff --git a/src/options.js b/src/options.js index f31f9f213..b02825e53 100644 --- a/src/options.js +++ b/src/options.js @@ -26,7 +26,9 @@ export default { isWeb: true, staticStyleRendered: false, doc: typeof document === 'object' ? document : null, - root: getGlobal() + root: getGlobal(), + //styleCache :[{ctor:ctor,ctorName:ctorName,style:style}] + styleCache: [] //componentChange(component, element) { }, /** If `true`, `prop` changes trigger synchronous component updates. * @name syncComponentUpdates diff --git a/src/vdom/component.js b/src/vdom/component.js index 63538503b..8e29de3d7 100644 --- a/src/vdom/component.js +++ b/src/vdom/component.js @@ -8,6 +8,27 @@ import { createComponent, collectComponent } from './component-recycler'; import { removeNode } from '../dom/index'; import {addScopedAttr, addScopedAttrStatic} from '../style'; +let id = 0; + +function getCtorName(ctor) { + + for (let i = 0, len = options.styleCache.length; i < len; i++) { + let item = options.styleCache[i]; + + if (item.ctor === ctor) { + return item.attrName; + } + } + + + let attrName = 'static_' + id; + options.styleCache.push({ ctor, attrName }); + id++; + + + return attrName; +} + /** Set a component's `props` (generally derived from JSX attributes). * @param {Object} props * @param {Object} [opts] @@ -99,13 +120,14 @@ export function renderComponent(component, opts, mountAll, isChild) { if (!skip) { rendered = component.render(props, state, context); - if (component.style){ - addScopedAttr(rendered,component.style(),'_style_'+component._id,component); - } - //don't rerender if (component.staticStyle){ - addScopedAttrStatic(rendered,component.staticStyle(),'_style_'+component.constructor.name); + addScopedAttrStatic(rendered,component.staticStyle(),'_style_' + getCtorName(component.constructor)); + + } + + if (component.style){ + addScopedAttr(rendered,component.style(),'_style_'+component._id,component); } // context to pass to the child, can be updated via (grand-)parent component diff --git a/test/browser/components.js b/test/browser/components.js index 2e405fcd5..a8d012248 100644 --- a/test/browser/components.js +++ b/test/browser/components.js @@ -144,7 +144,7 @@ describe('Components', () => { render(, scratch); - expect(scratch.innerHTML).to.equal('
'); + expect(scratch.innerHTML).to.equal('
'); }); it('should render components with scoped attr', () => { @@ -166,7 +166,7 @@ describe('Components', () => { render(, scratch); - expect(scratch.innerHTML).to.equal('
'); + expect(scratch.innerHTML).to.equal('
'); }); it('should render components with store', () => {