1 line
68 KiB
Plaintext
1 line
68 KiB
Plaintext
{"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","getCtorName","ctor","len","styleCache","item","doRender","attrName","styleId","prefix","css","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","addScopedAttrStatic","staticStyle","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","install","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","instances","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,IAAK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OAAU,SACVC,cAAe,cACfC,OAAU,SACVC,OAAU,SACVC,UAAa,YAEbC,MAAS,QACTC,iBAAkB,iBAClBC,MAAS,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,KCzQDkG,EAAA,EEiPA3B,GAAAA,CCvPD/H,GAAKkJ,EAAaA,+JAuBlBsC,EAAAxG,OAQCsR,YAAA,SAAoB9I,GACpBhC,IAAcxG,KAAdwI,IAAAxI,KAAAwI,SAAAlO,KAAAiX,GArB0BxV,EAAAiE,KAAA,yDAyB3BwR,OAAA,SAAAD,6CCHC7W,IAAAA,MAEAA,GAAA+O,KAAA3F,SAEDpH,cAAa+D,EACb/F,aAAQyL,EACRxC,UAAOzE,EACPwE,OAAAA,qBErEK+N,gBAIL/U,EAAAA,KAAAA,IAFkBgV,QAAA,OAIlB/N,IAAAA,KACAD,EAAAA,EACA/H,cAAAA,EACAjB,aAAAA,EACA+W,UAAAA,EARD/N,OAAAA,aAWAhJ,QAAQ+O,eAEO,oBAEd/M,QAFciV,OAAAC,QAAA9N,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 * `<div id=\"foo\" name=\"bar\">Hello!</div>`\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<len; i++) {\r\n\t\t\tlet child = originalChildren[i],\r\n\t\t\t\tprops = child[ATTR_KEY],\r\n\t\t\t\tkey = vlen && props ? child._component ? child._component.__key : props.key : null;\r\n\t\t\tif (key!=null) {\r\n\t\t\t\tkeyedLen++;\r\n\t\t\t\tkeyed[key] = child;\r\n\t\t\t}\r\n\t\t\telse if (props || (child.splitText!==undefined ? (isHydrating ? child.nodeValue.trim() : true) : isHydrating)) {\r\n\t\t\t\tchildren[childrenLen++] = child;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif (vlen!==0) {\r\n\t\tfor (let i=0; i<vlen; i++) {\r\n\t\t\tvchild = vchildren[i];\r\n\t\t\tchild = null;\r\n\r\n\t\t\t// attempt to find a node based on key matching\r\n\t\t\tlet key = vchild.key;\r\n\t\t\tif (key!=null) {\r\n\t\t\t\tif (keyedLen && keyed[key]!==undefined) {\r\n\t\t\t\t\tchild = keyed[key];\r\n\t\t\t\t\tkeyed[key] = undefined;\r\n\t\t\t\t\tkeyedLen--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// attempt to pluck a node of the same type from the existing children\r\n\t\t\telse if (!child && min<childrenLen) {\r\n\t\t\t\tfor (j=min; j<childrenLen; j++) {\r\n\t\t\t\t\tif (children[j]!==undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\r\n\t\t\t\t\t\tchild = c;\r\n\t\t\t\t\t\tchildren[j] = undefined;\r\n\t\t\t\t\t\tif (j===childrenLen-1) childrenLen--;\r\n\t\t\t\t\t\tif (j===min) min++;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\r\n\t\t\tchild = idiff(child, vchild, context, mountAll);\r\n\r\n\t\t\tf = originalChildren[i];\r\n\t\t\tif (child && child!==dom && child!==f) {\r\n\t\t\t\tif (f==null) {\r\n\t\t\t\t\tdom.appendChild(child);\r\n\t\t\t\t}\r\n\t\t\t\telse if (child===f.nextSibling) {\r\n\t\t\t\t\tremoveNode(f);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdom.insertBefore(child, f);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t// remove unused keyed children:\r\n\tif (keyedLen) {\r\n\t\tfor (let i in keyed) if (keyed[i]!==undefined) recollectNodeTree(keyed[i], false);\r\n\t}\r\n\r\n\t// remove orphaned unkeyed children:\r\n\twhile (min<=childrenLen) {\r\n\t\tif ((child = children[childrenLen--])!==undefined) recollectNodeTree(child, false);\r\n\t}\r\n}\r\n\r\n\r\n\r\n/** Recursively recycle (or just unmount) a node and its descendants.\r\n *\t@param {Node} node\t\t\t\t\t\tDOM node to start unmount/removal from\r\n *\t@param {Boolean} [unmountOnly=false]\tIf `true`, only triggers unmount lifecycle, skips removal\r\n */\r\nexport function recollectNodeTree(node, unmountOnly) {\r\n\tlet component = node._component;\r\n\tif (component) {\r\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\r\n\t\tunmountComponent(component);\r\n\t}\r\n\telse {\r\n\t\t// If the node's VNode had a ref function, invoke it with null here.\r\n\t\t// (this is part of the React spec, and smart for unsetting references)\r\n\t\tif (node[ATTR_KEY]!=null && node[ATTR_KEY].ref) node[ATTR_KEY].ref(null);\r\n\r\n\t\tif (unmountOnly===false || node[ATTR_KEY]==null) {\r\n\t\t\tremoveNode(node);\r\n\t\t}\r\n\r\n\t\tremoveChildren(node);\r\n\t}\r\n}\r\n\r\n\r\n/** Recollect/unmount all children.\r\n *\t- we use .lastChild here because it causes less reflow than .firstChild\r\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\r\n */\r\nexport function removeChildren(node) {\r\n\tnode = node.lastChild;\r\n\twhile (node) {\r\n\t\tlet next = node.previousSibling;\r\n\t\trecollectNodeTree(node, true);\r\n\t\tnode = next;\r\n\t}\r\n}\r\n\r\n\r\n/** Apply differences in attributes from a VNode to the given DOM Element.\r\n *\t@param {Element} dom\t\tElement with attributes to diff `attrs` against\r\n *\t@param {Object} attrs\t\tThe desired end-state key-value attribute pairs\r\n *\t@param {Object} old\t\t\tCurrent/previous attributes (from previous VNode or element's prop cache)\r\n */\r\nfunction diffAttributes(dom, attrs, old) {\r\n\tlet name;\r\n\r\n\t// remove attributes no longer present on the vnode by setting them to undefined\r\n\tfor (name in old) {\r\n\t\tif (!(attrs && attrs[name]!=null) && old[name]!=null) {\r\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\r\n\t\t}\r\n\t}\r\n\r\n\t// add new & update changed attributes\r\n\tfor (name in attrs) {\r\n\t\tif (name!=='children' && name!=='innerHTML' && (!(name in old) || attrs[name]!==(name==='value' || name==='checked' ? dom[name] : old[name]))) {\r\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\r\n\t\t}\r\n\t}\r\n}\r\n","import { Component } from '../component';\r\nimport options from '../options';\r\n/** Retains a pool of Components for re-use, keyed on component name.\r\n *\tNote: since component names are not unique or even necessarily available, these are primarily a form of sharding.\r\n *\t@private\r\n */\r\nconst components = {};\r\n\r\n\r\n/** Reclaim a component for later re-use by the recycler. */\r\nexport function collectComponent(component) {\r\n\tlet name = component.constructor.name;\r\n\t(components[name] || (components[name] = [])).push(component);\r\n}\r\n\r\n/** Create a component. Normalizes differences between PFC's and classful Components. */\r\nexport function createComponent(Ctor, props, context) {\r\n\tlet list = components[Ctor.name],\r\n\t\tinst;\r\n\r\n\tif (Ctor.prototype && Ctor.prototype.render) {\r\n\t\tinst = new Ctor(props, context);\r\n\t\tComponent.call(inst, props, context);\r\n\t}\r\n\telse {\r\n\t\tinst = new Component(props, context);\r\n\t\tinst.constructor = Ctor;\r\n\t\tinst.render = doRender;\r\n\t}\r\n\tinst.$store = options.$store;\r\n\tif (window && window.Omi){\r\n\t\twindow.Omi.instances.push(inst);\r\n\t}\r\n\r\n\tif (list) {\r\n\t\tfor (let i=list.length; i--; ) {\r\n\t\t\tif (list[i].constructor===Ctor) {\r\n\t\t\t\tinst.nextBase = list[i].nextBase;\r\n\t\t\t\tlist.splice(i, 1);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn inst;\r\n}\r\n\r\n\r\n/** The `.render()` method for a PFC backing instance. */\r\nfunction doRender(props, state, context) {\r\n\treturn this.constructor(props, context);\r\n}\r\n","import options from './options';\r\n\r\nlet styleId = 0;\r\n\r\nexport function 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\tlet attrName = 'static_' + styleId;\r\n\toptions.styleCache.push({ ctor, attrName });\r\n\tstyleId++;\r\n\r\n\treturn attrName;\r\n}\r\n\r\n// many thanks to https://github.com/thomaspark/scoper/\r\nexport function scoper(css, prefix) {\r\n\tprefix = '['+prefix.toLowerCase()+']';\r\n\t// https://www.w3.org/TR/css-syntax-3/#lexical\r\n\tcss = css.replace(/\\/\\*[^*]*\\*+([^/][^*]*\\*+)*\\//g, '');\r\n\t// eslint-disable-next-line\r\n let re = new RegExp('([^\\r\\n,{}:]+)(:[^\\r\\n,{}]+)?(,(?=[^{}]*{)|\\s*{)', 'g')\r\n\t/**\r\n * Example:\r\n *\r\n * .classname::pesudo { color:red }\r\n *\r\n * g1 is normal selector `.classname`\r\n * g2 is pesudo class or pesudo element\r\n * g3 is the suffix\r\n */\r\n\tcss = css.replace(re, (g0, g1, g2, g3) => {\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, getCtorName} 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\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 <div />;\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, getCtorName} 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 <body>:\r\n *\trender(<div id=\"hello\">hello!</div>, document.body);\r\n *\r\n *\t@example\r\n *\t// render a \"Thing\" component into #foo:\r\n *\tconst Thing = ({ name }) => <span>{ name }</span>;\r\n *\trender(<Thing name=\"one\" />, 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\r\n\t\t//don't rerender\r\n\t\tif (vnode.staticStyle){\r\n\t\t\taddScopedAttrStatic(rendered,vnode.staticStyle(),'_style_'+getCtorName(vnode.constructor));\r\n\t\t}\r\n\r\n\t\tif (vnode.style){\r\n\t\t\taddScopedAttr(rendered,vnode.style(),'_style_'+vnode._id,vnode);\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.6';\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"]} |